diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-30 09:01:07 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-07-30 09:01:07 +0000 |
commit | 5aed697e92869d264219d2980bf89821d9717c87 (patch) | |
tree | cb8b6d17bf8cffaa97992365025babf50f746749 | |
parent | 8b74ed4c18edcd94f8232a9c563ac402ed70f209 (diff) | |
download | edk2-5aed697e92869d264219d2980bf89821d9717c87.tar.gz |
Sync patch r9413 from main trunk.
r9413 - Update EFI_IP4_MODE_DATA: add MaxPacketSize to this structure to comply with UEFI 2.3 specification.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UDK2008@10750 6f19259b-4bc3-4df7-8a09-765794883524
4 files changed, 10 insertions, 7 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c index 7a0f18af28..5a342cf3b1 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c @@ -1,7 +1,7 @@ /** @file
The driver binding and service binding protocol for IP4 driver.
-Copyright (c) 2005 - 2006, Intel Corporation.<BR>
+Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -290,6 +290,7 @@ Ip4CreateService ( InsertHeadList (&IpSb->Interfaces, &IpSb->DefaultInterface->Link);
+ IpSb->MaxPacketSize = IpSb->SnpMode.MaxPacketSize - sizeof (IP4_HEAD);
IpSb->MacString = NULL;
*Service = IpSb;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index 714f3d9b82..6b7d3048fe 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -403,7 +403,8 @@ EfiIp4GetModeData ( Ip4ModeData->RouteTable = NULL;
Ip4ModeData->RouteCount = 0;
-
+ Ip4ModeData->MaxPacketSize = IpSb->MaxPacketSize;
+
//
// return the current station address for this IP child. So,
// the user can get the default address through this. Some
@@ -1947,12 +1948,12 @@ EfiIp4Transmit ( }
Head.Fragment = IP4_HEAD_FRAGMENT_FIELD (DontFragment, FALSE, 0);
- HeadLen = sizeof (IP4_HEAD) + ((TxData->OptionsLength + 3) &~0x03);
+ HeadLen = (TxData->OptionsLength + 3) & (~0x03);
//
// If don't fragment and fragment needed, return error
//
- if (DontFragment && (TxData->TotalDataLength + HeadLen > IpSb->SnpMode.MaxPacketSize)) {
+ if (DontFragment && (TxData->TotalDataLength + HeadLen > IpSb->MaxPacketSize)) {
Status = EFI_BAD_BUFFER_SIZE;
goto ON_EXIT;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h index 615e5ae2a8..8bd9a1da9a 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h @@ -197,6 +197,7 @@ struct _IP4_SERVICE { // NIC this IP4_SERVICE works on.
//
CHAR16 *MacString;
+ UINT32 MaxPacketSize;
};
#define IP4_INSTANCE_FROM_PROTOCOL(Ip4) \
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c index 1f478290bb..f5638cd990 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c @@ -471,7 +471,7 @@ TcpGetRcvMss ( IN SOCKET *Sock
)
{
- EFI_SIMPLE_NETWORK_MODE SnpMode;
+ EFI_IP4_MODE_DATA Ip4Mode;
TCP4_PROTO_DATA *TcpProto;
EFI_IP4_PROTOCOL *Ip;
@@ -481,9 +481,9 @@ TcpGetRcvMss ( Ip = TcpProto->TcpService->IpIo->Ip;
ASSERT (Ip != NULL);
- Ip->GetModeData (Ip, NULL, NULL, &SnpMode);
+ Ip->GetModeData (Ip, &Ip4Mode, NULL, NULL);
- return (UINT16) (SnpMode.MaxPacketSize - 40);
+ return (UINT16) (Ip4Mode.MaxPacketSize - sizeof (TCP_HEAD));
}
|