Lines Matching refs:Nbuf
44 NET_BUF *Nbuf; in NetbufAllocStruct() local
52 Nbuf = AllocateZeroPool (NET_BUF_SIZE (BlockOpNum)); in NetbufAllocStruct()
54 if (Nbuf == NULL) { in NetbufAllocStruct()
58 Nbuf->Signature = NET_BUF_SIGNATURE; in NetbufAllocStruct()
59 Nbuf->RefCnt = 1; in NetbufAllocStruct()
60 Nbuf->BlockOpNum = BlockOpNum; in NetbufAllocStruct()
61 InitializeListHead (&Nbuf->List); in NetbufAllocStruct()
73 Nbuf->Vector = Vector; in NetbufAllocStruct()
76 return Nbuf; in NetbufAllocStruct()
80 FreePool (Nbuf); in NetbufAllocStruct()
101 NET_BUF *Nbuf; in NetbufAlloc() local
107 Nbuf = NetbufAllocStruct (1, 1); in NetbufAlloc()
109 if (Nbuf == NULL) { in NetbufAlloc()
119 Vector = Nbuf->Vector; in NetbufAlloc()
125 Nbuf->BlockOp[0].BlockHead = Bulk; in NetbufAlloc()
126 Nbuf->BlockOp[0].BlockTail = Bulk + Len; in NetbufAlloc()
128 Nbuf->BlockOp[0].Head = Bulk; in NetbufAlloc()
129 Nbuf->BlockOp[0].Tail = Bulk; in NetbufAlloc()
130 Nbuf->BlockOp[0].Size = 0; in NetbufAlloc()
132 return Nbuf; in NetbufAlloc()
135 FreePool (Nbuf); in NetbufAlloc()
206 IN NET_BUF *Nbuf in NetbufFree() argument
209 ASSERT (Nbuf != NULL); in NetbufFree()
210 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufFree()
211 ASSERT (Nbuf->RefCnt > 0); in NetbufFree()
213 Nbuf->RefCnt--; in NetbufFree()
215 if (Nbuf->RefCnt == 0) { in NetbufFree()
220 NetbufFreeVector (Nbuf->Vector); in NetbufFree()
221 FreePool (Nbuf); in NetbufFree()
241 IN NET_BUF *Nbuf in NetbufClone() argument
246 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufClone()
248 Clone = AllocatePool (NET_BUF_SIZE (Nbuf->BlockOpNum)); in NetbufClone()
258 Clone->Ip = Nbuf->Ip; in NetbufClone()
259 Clone->Tcp = Nbuf->Tcp; in NetbufClone()
261 CopyMem (Clone->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA); in NetbufClone()
263 NET_GET_REF (Nbuf->Vector); in NetbufClone()
265 Clone->Vector = Nbuf->Vector; in NetbufClone()
266 Clone->BlockOpNum = Nbuf->BlockOpNum; in NetbufClone()
267 Clone->TotalSize = Nbuf->TotalSize; in NetbufClone()
268 CopyMem (Clone->BlockOp, Nbuf->BlockOp, sizeof (NET_BLOCK_OP) * Nbuf->BlockOpNum); in NetbufClone()
293 IN NET_BUF *Nbuf, in NetbufDuplicate() argument
300 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufDuplicate()
303 Duplicate = NetbufAlloc (Nbuf->TotalSize + HeadSpace); in NetbufDuplicate()
314 CopyMem (Duplicate->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA); in NetbufDuplicate()
317 Dst = NetbufAllocSpace (Duplicate, Nbuf->TotalSize, NET_BUF_TAIL); in NetbufDuplicate()
318 NetbufCopy (Nbuf, 0, Nbuf->TotalSize, Dst); in NetbufDuplicate()
338 NET_BUF *Nbuf; in NetbufFreeList() local
343 Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); in NetbufFreeList()
344 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufFreeList()
347 NetbufFree (Nbuf); in NetbufFreeList()
374 IN NET_BUF *Nbuf, in NetbufGetByte() argument
383 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufGetByte()
385 if (Offset >= Nbuf->TotalSize) { in NetbufGetByte()
389 BlockOp = Nbuf->BlockOp; in NetbufGetByte()
392 for (Loop = 0; Loop < Nbuf->BlockOpNum; Loop++) { in NetbufGetByte()
428 IN OUT NET_BUF *Nbuf, in NetbufSetBlock() argument
437 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufSetBlock()
438 NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); in NetbufSetBlock()
439 ASSERT (Index < Nbuf->BlockOpNum); in NetbufSetBlock()
441 Block = &(Nbuf->Vector->Block[Index]); in NetbufSetBlock()
442 BlockOp = &(Nbuf->BlockOp[Index]); in NetbufSetBlock()
470 IN OUT NET_BUF *Nbuf, in NetbufSetBlockOp() argument
478 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufSetBlockOp()
479 ASSERT (Index < Nbuf->BlockOpNum); in NetbufSetBlockOp()
481 BlockOp = &(Nbuf->BlockOp[Index]); in NetbufSetBlockOp()
532 IN NET_BUF *Nbuf, in NetbufGetFragment() argument
552 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufGetFragment()
554 if ((Len == 0) || (Offset + Len > Nbuf->TotalSize)) { in NetbufGetFragment()
563 BlockOp = Nbuf->BlockOp; in NetbufGetFragment()
566 for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { in NetbufGetFragment()
589 for (; Index < Nbuf->BlockOpNum; Index++) { in NetbufGetFragment()
629 Vector->Arg = Nbuf->Vector; in NetbufGetFragment()
648 Child->Vector = Nbuf->Vector; in NetbufGetFragment()
651 NET_GET_REF (Nbuf->Vector); in NetbufGetFragment()
660 Nbuf->BlockOp[First].Head + FirstSkip, in NetbufGetFragment()
683 CopyMem (Child->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA); in NetbufGetFragment()
727 NET_BUF *Nbuf; in NetbufFromExt() local
829 Nbuf = NetbufAllocStruct (BlockNum, BlockNum); in NetbufFromExt()
831 if (Nbuf == NULL) { in NetbufFromExt()
835 Vector = Nbuf->Vector; in NetbufFromExt()
847 NetbufSetBlock (Nbuf, FirstBlock, HeadSpace + Copied, 0); in NetbufFromExt()
848 Nbuf->BlockOp[0].Head += HeadSpace; in NetbufFromExt()
849 Nbuf->BlockOp[0].Size = Copied; in NetbufFromExt()
855 NetbufSetBlock (Nbuf, ExtFragment[Index].Bulk, ExtFragment[Index].Len, CurBlock); in NetbufFromExt()
861 Nbuf->TotalSize = TotalLen; in NetbufFromExt()
867 return Nbuf; in NetbufFromExt()
893 IN NET_BUF *Nbuf, in NetbufBuildExt() argument
903 for (Index = 0; (Index < Nbuf->BlockOpNum); Index++) { in NetbufBuildExt()
904 if (Nbuf->BlockOp[Index].Size == 0) { in NetbufBuildExt()
909 ExtFragment[Current].Bulk = Nbuf->BlockOp[Index].Head; in NetbufBuildExt()
910 ExtFragment[Current].Len = Nbuf->BlockOp[Index].Size; in NetbufBuildExt()
952 NET_BUF *Nbuf; in NetbufFromBufList() local
962 Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); in NetbufFromBufList()
963 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufFromBufList()
964 FragmentNum += Nbuf->BlockOpNum; in NetbufFromBufList()
979 Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); in NetbufFromBufList()
980 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufFromBufList()
982 for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { in NetbufFromBufList()
983 if (Nbuf->BlockOp[Index].Size != 0) { in NetbufFromBufList()
984 Fragment[Current].Bulk = Nbuf->BlockOp[Index].Head; in NetbufFromBufList()
985 Fragment[Current].Len = Nbuf->BlockOp[Index].Size; in NetbufFromBufList()
991 Nbuf = NetbufFromExt (Fragment, Current, HeadSpace, HeaderLen, ExtFree, Arg); in NetbufFromBufList()
994 return Nbuf; in NetbufFromBufList()
1013 IN OUT NET_BUF *Nbuf, in NetbufReserve() argument
1017 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufReserve()
1018 NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); in NetbufReserve()
1020 ASSERT ((Nbuf->BlockOpNum == 1) && (Nbuf->TotalSize == 0)); in NetbufReserve()
1021 ASSERT ((Nbuf->Vector->Free == NULL) && (Nbuf->Vector->Len >= Len)); in NetbufReserve()
1023 Nbuf->BlockOp[0].Head += Len; in NetbufReserve()
1024 Nbuf->BlockOp[0].Tail += Len; in NetbufReserve()
1026 ASSERT (Nbuf->BlockOp[0].Tail <= Nbuf->BlockOp[0].BlockTail); in NetbufReserve()
1045 IN OUT NET_BUF *Nbuf, in NetbufAllocSpace() argument
1056 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufAllocSpace()
1057 NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); in NetbufAllocSpace()
1067 if (Nbuf->TotalSize == 0) { in NetbufAllocSpace()
1070 NetbufGetByte (Nbuf, 0, &Index); in NetbufAllocSpace()
1072 if ((NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len) && (Index > 0)) { in NetbufAllocSpace()
1077 BlockOp = &(Nbuf->BlockOp[Index]); in NetbufAllocSpace()
1085 Nbuf->TotalSize += Len; in NetbufAllocSpace()
1095 if (Nbuf->TotalSize == 0) { in NetbufAllocSpace()
1098 NetbufGetByte (Nbuf, Nbuf->TotalSize - 1, &Index); in NetbufAllocSpace()
1100 if ((NET_TAILSPACE(&(Nbuf->BlockOp[Index])) < Len) && in NetbufAllocSpace()
1101 (Index < Nbuf->BlockOpNum - 1)) { in NetbufAllocSpace()
1107 BlockOp = &(Nbuf->BlockOp[Index]); in NetbufAllocSpace()
1117 Nbuf->TotalSize += Len; in NetbufAllocSpace()
1167 IN OUT NET_BUF *Nbuf, in NetbufTrim() argument
1176 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufTrim()
1178 if (Len > Nbuf->TotalSize) { in NetbufTrim()
1179 Len = Nbuf->TotalSize; in NetbufTrim()
1190 Nbuf->TotalSize -= Len; in NetbufTrim()
1192 Index = (FromHead ? 0 : Nbuf->BlockOpNum - 1); in NetbufTrim()
1193 BlockOp = Nbuf->BlockOp; in NetbufTrim()
1236 IN NET_BUF *Nbuf, in NetbufCopy() argument
1249 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufCopy()
1252 if ((Len == 0) || (Nbuf->TotalSize <= Offset)) { in NetbufCopy()
1256 if (Nbuf->TotalSize - Offset < Len) { in NetbufCopy()
1257 Len = Nbuf->TotalSize - Offset; in NetbufCopy()
1260 BlockOp = Nbuf->BlockOp; in NetbufCopy()
1271 for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { in NetbufCopy()
1304 for (; Index < Nbuf->BlockOpNum; Index++) { in NetbufCopy()
1409 IN OUT NET_BUF *Nbuf in NetbufQueAppend() argument
1413 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufQueAppend()
1415 InsertTailList (&NbufQue->BufList, &Nbuf->List); in NetbufQueAppend()
1417 NbufQue->BufSize += Nbuf->TotalSize; in NetbufQueAppend()
1481 NET_BUF *Nbuf; in NetbufQueCopy() local
1502 Nbuf = NULL; in NetbufQueCopy()
1505 Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); in NetbufQueCopy()
1507 if (Offset < Cur + Nbuf->TotalSize) { in NetbufQueCopy()
1511 Cur += Nbuf->TotalSize; in NetbufQueCopy()
1514 ASSERT (Nbuf != NULL); in NetbufQueCopy()
1520 Left = Nbuf->TotalSize - Skip; in NetbufQueCopy()
1523 return NetbufCopy (Nbuf, Skip, Len, Dest); in NetbufQueCopy()
1526 NetbufCopy (Nbuf, Skip, Left, Dest); in NetbufQueCopy()
1537 Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); in NetbufQueCopy()
1539 if (Len > Nbuf->TotalSize) { in NetbufQueCopy()
1540 Len -= Nbuf->TotalSize; in NetbufQueCopy()
1541 Copied += Nbuf->TotalSize; in NetbufQueCopy()
1543 NetbufCopy (Nbuf, 0, Nbuf->TotalSize, Dest); in NetbufQueCopy()
1544 Dest += Nbuf->TotalSize; in NetbufQueCopy()
1547 NetbufCopy (Nbuf, 0, Len, Dest); in NetbufQueCopy()
1581 NET_BUF *Nbuf; in NetbufQueTrim() local
1598 Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); in NetbufQueTrim()
1600 if (Len >= Nbuf->TotalSize) { in NetbufQueTrim()
1601 Trimmed += Nbuf->TotalSize; in NetbufQueTrim()
1602 Len -= Nbuf->TotalSize; in NetbufQueTrim()
1605 NetbufFree (Nbuf); in NetbufQueTrim()
1614 Trimmed += NetbufTrim (Nbuf, Len, NET_BUF_HEAD); in NetbufQueTrim()
1732 IN NET_BUF *Nbuf in NetbufChecksum() argument
1741 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetbufChecksum()
1745 BlockOp = Nbuf->BlockOp; in NetbufChecksum()
1747 for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { in NetbufChecksum()
1858 NET_BUF *Nbuf in NetIpSecNetbufFree() argument
1861 NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); in NetIpSecNetbufFree()
1862 ASSERT (Nbuf->RefCnt > 0); in NetIpSecNetbufFree()
1864 Nbuf->RefCnt--; in NetIpSecNetbufFree()
1866 if (Nbuf->RefCnt == 0) { in NetIpSecNetbufFree()
1872 NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); in NetIpSecNetbufFree()
1873 ASSERT (Nbuf->Vector->RefCnt > 0); in NetIpSecNetbufFree()
1875 Nbuf->Vector->RefCnt--; in NetIpSecNetbufFree()
1877 if (Nbuf->Vector->RefCnt > 0) { in NetIpSecNetbufFree()
1885 if ((Nbuf->Vector->Flag & NET_VECTOR_OWN_FIRST) != 0) { in NetIpSecNetbufFree()
1886 FreePool (Nbuf->Vector->Block[0].Bulk); in NetIpSecNetbufFree()
1888 FreePool (Nbuf->Vector); in NetIpSecNetbufFree()
1889 FreePool (Nbuf); in NetIpSecNetbufFree()