]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / Tcp4Misc.c
index ce66231e226cd3e215f128705586be8320dcfec4..f36a5bd1bf1a7da4cd20bb08c0a34c469812d998 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Misc support routines for tcp.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php<BR>\r
@@ -432,7 +432,7 @@ TcpCloneTcb (
   Clone->Sk = SockClone (Tcb->Sk);\r
   if (Clone->Sk == NULL) {\r
     DEBUG ((EFI_D_ERROR, "TcpCloneTcb: failed to clone a sock\n"));\r
-    gBS->FreePool (Clone);\r
+    FreePool (Clone);\r
     return NULL;\r
   }\r
 \r
@@ -471,7 +471,7 @@ TcpGetRcvMss (
   IN SOCKET  *Sock\r
   )\r
 {\r
-  EFI_SIMPLE_NETWORK_MODE SnpMode;\r
+  EFI_IP4_MODE_DATA       Ip4Mode;\r
   TCP4_PROTO_DATA         *TcpProto;\r
   EFI_IP4_PROTOCOL        *Ip;\r
 \r
@@ -481,9 +481,9 @@ TcpGetRcvMss (
   Ip       = (EFI_IP4_PROTOCOL *) (TcpProto->TcpService->IpIo->Ip);\r
   ASSERT (Ip != NULL);\r
 \r
-  Ip->GetModeData (Ip, NULL, NULL, &SnpMode);\r
+  Ip->GetModeData (Ip, &Ip4Mode, NULL, NULL);\r
 \r
-  return (UINT16) (SnpMode.MaxPacketSize - 40);\r
+  return (UINT16) (Ip4Mode.MaxPacketSize - sizeof (TCP_HEAD));\r
 }\r
 \r
 \r
@@ -1025,7 +1025,7 @@ TcpSetVariableData (
              );\r
     }\r
 \r
-    gBS->FreePool (Tcp4Service->MacString);\r
+    FreePool (Tcp4Service->MacString);\r
   }\r
 \r
   Tcp4Service->MacString = NewMacString;\r
@@ -1040,7 +1040,7 @@ TcpSetVariableData (
 \r
 ON_ERROR:\r
 \r
-  gBS->FreePool (Tcp4VariableData);\r
+  FreePool (Tcp4VariableData);\r
 \r
   return Status;\r
 }\r
@@ -1067,7 +1067,7 @@ TcpClearVariableData (
          NULL\r
          );\r
 \r
-  gBS->FreePool (Tcp4Service->MacString);\r
+  FreePool (Tcp4Service->MacString);\r
   Tcp4Service->MacString = NULL;\r
 }\r
 \r
@@ -1090,18 +1090,22 @@ TcpInstallDevicePath (
   TCP_CB             *Tcb;\r
   IPv4_DEVICE_PATH   Ip4DPathNode;\r
   EFI_STATUS         Status;\r
+  TCP_PORTNO         LocalPort;\r
+  TCP_PORTNO         RemotePort;\r
 \r
   TcpProto   = (TCP4_PROTO_DATA *) Sock->ProtoReserved;\r
   TcpService = TcpProto->TcpService;\r
   Tcb        = TcpProto->TcpPcb;\r
 \r
+  LocalPort = NTOHS (Tcb->LocalEnd.Port);\r
+  RemotePort = NTOHS (Tcb->RemoteEnd.Port);\r
   NetLibCreateIPv4DPathNode (\r
     &Ip4DPathNode,\r
     TcpService->ControllerHandle,\r
     Tcb->LocalEnd.Ip,\r
-    NTOHS (Tcb->LocalEnd.Port),\r
+    LocalPort,\r
     Tcb->RemoteEnd.Ip,\r
-    NTOHS (Tcb->RemoteEnd.Port),\r
+    RemotePort,\r
     EFI_IP_PROTO_TCP,\r
     Tcb->UseDefaultAddr\r
     );\r
@@ -1121,7 +1125,7 @@ TcpInstallDevicePath (
                   Sock->DevicePath\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (Sock->DevicePath);\r
+    FreePool (Sock->DevicePath);\r
   }\r
 \r
   return Status;\r