Lines Matching defs:pSG
262 * PINTNETSG pSG manipulation functions
268 static NDIS_STATUS vboxNetFltWinNdisBufferMoveToSG0(PNDIS_BUFFER pBuffer, PINTNETSG pSG)
277 Assert(pSG->cSegsAlloc == 1);
279 paSeg = pSG->aSegs;
283 pSG->cbTotal = 0;
297 pSG->cbTotal += cbCurrentLength;
307 pSG->cSegsUsed = 1;
308 Assert(pSG->cbTotal == paSeg->cb);
315 static NDIS_STATUS vboxNetFltWinNdisBuffersToSG(PNDIS_BUFFER pBuffer, PINTNETSG pSG)
332 pSG->cbTotal += cbCurrentLength;
333 pSG->aSegs[cSegs].cb = cbCurrentLength;
334 pSG->aSegs[cSegs].pv = pVirtualAddress;
335 pSG->aSegs[cSegs].Phys = NIL_RTHCPHYS;
341 AssertFatal(cSegs <= pSG->cSegsAlloc);
345 pSG->cSegsUsed = cSegs;
351 static void vboxNetFltWinDeleteSG(PINTNETSG pSG)
353 vboxNetFltWinMemFree(pSG);
358 PINTNETSG pSG;
359 NTSTATUS Status = vboxNetFltWinMemAlloc((PVOID*)&pSG, RT_OFFSETOF(INTNETSG, aSegs[cSegs]));
362 IntNetSgInitTempSegs(pSG, 0 /*cbTotal*/, cSegs, 0 /*cSegsUsed*/);
363 return pSG;
374 static NDIS_STATUS vboxNetFltWinQuPostPacket(PVBOXNETFLTINS pNetFlt, PNDIS_PACKET pPacket, PINTNETSG pSG, uint32_t fFlags
390 pSG, /* PINTNETSG */
391 pSG, /* PVOID pBufToFree */
399 DBG_CHECK_PACKET_AND_SG(pMyPacket, pSG);
404 DBG_CHECK_PACKET_AND_SG(pTmpPacket, pSG);
414 DBG_CHECK_PACKET_AND_SG(pPacket, pSG);
503 PINTNETSG pSG = NULL;
551 LogFlow(("preparing pSG"));
556 pSG = vboxNetFltWinCreateSG(cBufferCount);
563 pSG = pWorker->pSG;
565 if (cBufferCount > pSG->cSegsAlloc)
567 pSG = vboxNetFltWinCreateSG(cBufferCount + 2);
568 if (pSG)
570 vboxNetFltWinDeleteSG(pWorker->pSG);
571 pWorker->pSG = pSG;
575 LogRel(("Failed to reallocate the pSG\n"));
580 if (pSG)
586 IntNetSgInitTempSegs(pSG, 0 /*cbTotal*/, pSG->cSegsAlloc, 0 /*cSegsUsed*/);
589 Status = vboxNetFltWinNdisBuffersToSG(pCurrentBuffer, pSG);
592 pSG = NULL;
596 DBG_CHECK_PACKET_AND_SG(pPacket, pSG);
610 pSG = (PINTNETSG)pvPacket;
612 LogFlow(("not ndis packet info, pSG (%p)\n", pSG));
620 pSG, /* PINTNETSG */
621 pSG, /* PVOID pBufToFree */
627 DBG_CHECK_PACKET_AND_SG(pTmpPacket, pSG);
635 /* the pSG was successfully initialized, post it to the netFlt*/
636 bDropIt = pSG ? pNetFltIf->pSwitchPort->pfnRecv(pNetFltIf->pSwitchPort, NULL /* pvIf */, pSG,
641 if (pSG)
643 pNetFltIf->pSwitchPort->pfnRecv(pNetFltIf->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_HOST);
657 Status = vboxNetFltWinQuPostPacket(pNetFltIf, pPacket, pSG, fFlags
708 Assert(pSG);
709 vboxNetFltWinMemFree(pSG);
732 vboxNetFltWinMemFree(pSG);
1018 AssertFatal(!pWorker->pSG);
1034 pWorker->pSG = vboxNetFltWinCreateSG(PACKET_QUEUE_SG_SEGS_ALLOC);
1035 if (!pWorker->pSG)
1045 vboxNetFltWinMemFree(pWorker->pSG);
1046 pWorker->pSG = NULL;
1061 PINTNETSG pSG;
1067 if (pWorker->pSG)
1069 pSG = pWorker->pSG;
1070 pWorker->pSG = NULL;
1079 vboxNetFltWinDeleteSG(pSG);
1098 PINTNETSG pSG;
1104 Status = vboxNetFltWinMemAlloc((PVOID*)&pSG, cbPacket + sizeof(INTNETSG));
1107 IntNetSgInitTemp(pSG, pSG + 1, cbPacket);
1108 LogFlow(("pSG created (%p)\n", pSG));
1109 *ppSG = pSG;
1148 PINTNETSG pSG;
1163 fStatus = vboxNetFltWinAllocSG(cbPacketLength, &pSG);
1177 vboxNetFltWinMemFree(pSG);
1185 SET_PACKET_TO_INFO(pInfo, pSG);
1187 fStatus = vboxNetFltWinNdisBufferMoveToSG0(pBuffer, pSG);
1192 vboxNetFltWinMemFree(pSG);
1196 DBG_CHECK_PACKET_AND_SG((PNDIS_PACKET)pPacket, pSG);
1499 DECLHIDDEN(PNDIS_PACKET) vboxNetFltWinNdisPacketFromSG(PVBOXNETFLTINS pNetFlt, PINTNETSG pSG, PVOID pBufToFree, bool bToWire, bool bCopyMemory)
1504 Assert(pSG->aSegs[0].pv);
1505 Assert(pSG->cbTotal >= sizeof(VBOXNETFLT_PACKET_ETHEADER_SIZE));
1509 AssertReturn(pSG->cSegsUsed == 1 || bCopyMemory, NULL);
1528 fStatus = vboxNetFltWinMemAlloc(&pvMemBuf, pSG->cbTotal);
1531 IntNetSgRead(pSG, pvMemBuf);
1535 pvMemBuf = pSG->aSegs[0].pv;
1543 pSG->cbTotal);
1548 pSG->cbTotal);
1604 DBG_CHECK_PACKET_AND_SG(pPacket, pSG);
2073 DECLHIDDEN(PRTNETETHERHDR) vboxNetFltWinGetEthHdrSG(PINTNETSG pSG)
2075 Assert(pSG->cSegsUsed);
2076 Assert(pSG->cSegsAlloc >= pSG->cSegsUsed);
2077 Assert(pSG->aSegs[0].cb >= VBOXNETFLT_PACKET_ETHEADER_SIZE);
2079 if (!pSG->cSegsUsed)
2082 if (pSG->aSegs[0].cb < VBOXNETFLT_PACKET_ETHEADER_SIZE)
2085 return (PRTNETETHERHDR)pSG->aSegs[0].pv;
2105 DECLHIDDEN(bool) vboxNetFltWinCheckMACsSG(PINTNETSG pSG, PRTMAC pDst, PRTMAC pSrc)
2107 PRTNETETHERHDR pHdr = vboxNetFltWinGetEthHdrSG(pSG);
2233 DECLHIDDEN(bool) vboxNetFltWinMatchPacketAndSG(PNDIS_PACKET pPacket, PINTNETSG pSG, const INT cbMatch)
2240 UINT uTotalPacketLength2 = pSG->cbTotal;
2250 Assert(pSG->cSegsUsed);
2251 Assert(pSG->cSegsAlloc >= pSG->cSegsUsed);
2290 Assert(i < pSG->cSegsUsed);
2291 pMemBuf2 = (uint8_t*)pSG->aSegs[i].pv;
2292 cbLength2 = pSG->aSegs[i].cb;
2324 DBG_CHECK_PACKET_AND_SG(pPacket, pSG);
2624 Assert(!pThis->u.s.PacketQueueWorker.pSG);
3049 int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst)
3080 pPacket = vboxNetFltWinNdisPacketFromSG(pThis, pSG, NULL /*pBufToFree*/,
3134 PNDIS_PACKET pPacket = vboxNetFltWinNdisPacketFromSG(pThis, pSG, NULL /*pBufToFree*/,