Lines Matching refs:pSG

63  * @param   pSG         Pointer to the scatter / gather structure.
68 DECLINLINE(void) IntNetSgInitTempSegs(PINTNETSG pSG, uint32_t cbTotal, unsigned cSegs, unsigned cSegsUsed)
70 pSG->pvOwnerData = NULL;
71 pSG->pvUserData = NULL;
72 pSG->pvUserData2 = NULL;
73 pSG->cbTotal = cbTotal;
74 pSG->cUsers = 1;
75 pSG->fFlags = INTNETSG_FLAGS_TEMP;
76 pSG->GsoCtx.u8Type = (uint8_t)PDMNETWORKGSOTYPE_INVALID;
77 pSG->GsoCtx.cbHdrsTotal = 0;
78 pSG->GsoCtx.cbHdrsSeg = 0;
79 pSG->GsoCtx.cbMaxSeg= 0;
80 pSG->GsoCtx.offHdr1 = 0;
81 pSG->GsoCtx.offHdr2 = 0;
82 pSG->GsoCtx.u8Unused= 0;
84 pSG->uPadding = 0;
86 pSG->cSegsAlloc = (uint16_t)cSegs;
87 Assert(pSG->cSegsAlloc == cSegs);
88 pSG->cSegsUsed = (uint16_t)cSegsUsed;
89 Assert(pSG->cSegsUsed == cSegsUsed);
99 * @param pSG Pointer to the scatter / gather structure.
105 DECLINLINE(void) IntNetSgInitTempSegsGso(PINTNETSG pSG, uint32_t cbTotal, unsigned cSegs,
108 pSG->pvOwnerData = NULL;
109 pSG->pvUserData = NULL;
110 pSG->pvUserData2 = NULL;
111 pSG->cbTotal = cbTotal;
112 pSG->cUsers = 1;
113 pSG->fFlags = INTNETSG_FLAGS_TEMP;
114 pSG->GsoCtx.u8Type = pGso->u8Type;
115 pSG->GsoCtx.cbHdrsTotal = pGso->cbHdrsTotal;
116 pSG->GsoCtx.cbHdrsSeg = pGso->cbHdrsSeg;
117 pSG->GsoCtx.cbMaxSeg= pGso->cbMaxSeg;
118 pSG->GsoCtx.offHdr1 = pGso->offHdr1;
119 pSG->GsoCtx.offHdr2 = pGso->offHdr2;
120 pSG->GsoCtx.u8Unused= 0;
122 pSG->uPadding = 0;
124 pSG->cSegsAlloc = (uint16_t)cSegs;
125 Assert(pSG->cSegsAlloc == cSegs);
126 pSG->cSegsUsed = (uint16_t)cSegsUsed;
127 Assert(pSG->cSegsUsed == cSegsUsed);
137 * @param pSG Pointer to the scatter / gather structure.
141 DECLINLINE(void) IntNetSgInitTemp(PINTNETSG pSG, void *pvFrame, uint32_t cbFrame)
143 IntNetSgInitTempSegs(pSG, cbFrame, 1, 1);
144 pSG->aSegs[0].Phys = NIL_RTHCPHYS;
145 pSG->aSegs[0].pv = pvFrame;
146 pSG->aSegs[0].cb = cbFrame;
153 * @param pSG Pointer to the scatter / gather structure.
158 DECLINLINE(void) IntNetSgInitTempGso(PINTNETSG pSG, void *pvFrame, uint32_t cbFrame, PCPDMNETWORKGSO pGso)
160 IntNetSgInitTempSegsGso(pSG, cbFrame, 1, 1, pGso);
161 pSG->aSegs[0].Phys = NIL_RTHCPHYS;
162 pSG->aSegs[0].pv = pvFrame;
163 pSG->aSegs[0].cb = cbFrame;
170 * @param pSG The SG list to read.
171 * @param pvBuf The buffer to read into (at least pSG->cbTotal in size).
173 DECLINLINE(void) IntNetSgRead(PCINTNETSG pSG, void *pvBuf)
175 memcpy(pvBuf, pSG->aSegs[0].pv, pSG->aSegs[0].cb);
176 if (pSG->cSegsUsed == 1)
177 Assert(pSG->cbTotal == pSG->aSegs[0].cb);
180 uint8_t *pbDst = (uint8_t *)pvBuf + pSG->aSegs[0].cb;
182 unsigned const cSegs = pSG->cSegsUsed;
185 uint32_t cbSeg = pSG->aSegs[iSeg].cb;
186 Assert((uintptr_t)pbDst - (uintptr_t)pvBuf + cbSeg <= pSG->cbTotal);
187 memcpy(pbDst, pSG->aSegs[iSeg].pv, cbSeg);
197 * @param pSG The SG list to read.
202 DECLINLINE(void) IntNetSgReadEx(PCINTNETSG pSG, uint32_t offSrc, uint32_t cbToRead, void *pvBuf)
208 Assert(cbToRead <= pSG->cbTotal);
209 Assert(offSrc <= pSG->cbTotal);
210 Assert(offSrc + cbToRead <= pSG->cbTotal);
215 uint32_t cbSeg = pSG->aSegs[iSeg].cb;
221 memcpy(pbDst, (uint8_t const *)pSG->aSegs[iSeg].pv + offSrc, cbToRead);
225 memcpy(pbDst, (uint8_t const *)pSG->aSegs[iSeg].pv + offSrc, cbChunk);
239 uint32_t cbSeg = pSG->aSegs[iSeg].cb;
242 memcpy(pbDst, pSG->aSegs[iSeg].pv, cbToRead);
246 memcpy(pbDst, pSG->aSegs[iSeg].pv, cbSeg);
250 Assert(iSeg < pSG->cSegsUsed);