Import ArpDxe, Dhcp4Dxe, Ip4Dxe, Mtftp4Dxe, PxeBcDxe and PxeDhcp4Dxe.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3492 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2007-07-30 02:37:10 +00:00
parent eca7eaf49b
commit 772db4bb33
113 changed files with 42735 additions and 302 deletions

View File

@@ -139,7 +139,7 @@ MnpAddFreeNbuf (
for (Index = 0; Index < Count; Index++) {
Nbuf = NetbufAlloc (MnpServiceData->BufferLength);
Nbuf = NetbufAlloc (MnpServiceData->BufferLength + MnpServiceData->PaddingSize);
if (Nbuf == NULL) {
MNP_DEBUG_ERROR (("MnpAddFreeNbuf: NetBufAlloc failed.\n"));
@@ -147,6 +147,14 @@ MnpAddFreeNbuf (
break;
}
if (MnpServiceData->PaddingSize > 0) {
//
// Pad padding bytes before the media header
//
NetbufAllocSpace (Nbuf, MnpServiceData->PaddingSize, NET_BUF_TAIL);
NetbufTrim (Nbuf, MnpServiceData->PaddingSize, NET_BUF_HEAD);
}
NetbufQueAppend (&MnpServiceData->FreeNbufQue, Nbuf);
}
@@ -328,6 +336,12 @@ MnpInitializeServiceData (
//
MnpServiceData->BufferLength = MnpServiceData->Mtu + SnpMode->MediaHeaderSize + NET_ETHER_FCS_SIZE;
//
// Make sure the protocol headers immediately following the media header
// 4-byte aligned
//
MnpServiceData->PaddingSize = (4 - SnpMode->MediaHeaderSize) & 0x3;
//
// Initialize the FreeNetBufQue and pre-allocate some NET_BUFs.
//

View File

@@ -521,7 +521,6 @@ MnpServiceBindingDestroyChild (
return Status;
}
//@MT: EFI_DRIVER_ENTRY_POINT (MnpDriverEntryPoint)
EFI_STATUS
EFIAPI

View File

@@ -82,6 +82,7 @@ typedef struct _MNP_SERVICE_DATA {
// store a packet.
//
UINT32 BufferLength;
UINT32 PaddingSize;
NET_BUF *RxNbufCache;
UINT8 *TxBuf;
} MNP_SERVICE_DATA;

View File

@@ -974,7 +974,10 @@ MnpReceivePacket (
//
// No receiver for this packet.
//
NetbufAllocSpace (Nbuf, Trimmed, NET_BUF_TAIL);
if (Trimmed > 0) {
NetbufAllocSpace (Nbuf, Trimmed, NET_BUF_TAIL);
}
goto EXIT;
}
//