]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
Fix ping command issue in IP4 driver.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4If.c
index 9cb71473128e835d16ba63f4206b72b03b1dc66e..e4ab17a37ea555a9c10206f8e474d0c47fc41bed 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Implement IP4 pesudo interface.\r
   \r
-Copyright (c) 2005 - 2007, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2013, 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\r
@@ -188,7 +188,7 @@ Ip4WrapLinkTxToken (
                   );\r
 \r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (Token);\r
+    FreePool (Token);\r
     return NULL;\r
   }\r
 \r
@@ -225,7 +225,7 @@ Ip4FreeLinkTxToken (
   NET_CHECK_SIGNATURE (Token, IP4_FRAME_TX_SIGNATURE);\r
 \r
   gBS->CloseEvent (Token->MnpToken.Event);\r
-  gBS->FreePool (Token);\r
+  FreePool (Token);\r
 }\r
 \r
 \r
@@ -269,7 +269,7 @@ Ip4CreateArpQue (
                   );\r
 \r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (ArpQue);\r
+    FreePool (ArpQue);\r
     return NULL;\r
   }\r
 \r
@@ -302,7 +302,7 @@ Ip4FreeArpQue (
   Ip4CancelFrameArp (ArpQue, IoStatus, NULL, NULL);\r
 \r
   gBS->CloseEvent (ArpQue->OnResolved);\r
-  gBS->FreePool (ArpQue);\r
+  FreePool (ArpQue);\r
 }\r
 \r
 \r
@@ -353,7 +353,7 @@ Ip4CreateLinkRxToken (
                   );\r
 \r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (Token);\r
+    FreePool (Token);\r
     return NULL;\r
   }\r
 \r
@@ -378,7 +378,7 @@ Ip4FreeFrameRxToken (
   NET_CHECK_SIGNATURE (Token, IP4_FRAME_RX_SIGNATURE);\r
 \r
   gBS->CloseEvent (Token->MnpToken.Event);\r
-  gBS->FreePool (Token);\r
+  FreePool (Token);\r
 }\r
 \r
 \r
@@ -523,7 +523,7 @@ Ip4CreateInterface (
   // Get the interface's Mac address and broadcast mac address from SNP\r
   //\r
   if (EFI_ERROR (Mnp->GetModeData (Mnp, NULL, &SnpMode))) {\r
-    gBS->FreePool (Interface);\r
+    FreePool (Interface);\r
     return NULL;\r
   }\r
 \r
@@ -582,7 +582,7 @@ Ip4SetAddress (
 \r
   Type                      = NetGetIpClass (IpAddr);\r
   Len                       = NetGetMaskLength (SubnetMask);\r
-  Netmask                   = gIp4AllMasks[MIN (Len, Type << 3)];\r
+  Netmask                   = gIp4AllMasks[MIN ((Len - 1), Type << 3)];\r
   Interface->NetBrdcast     = (IpAddr | ~Netmask);\r
 \r
   //\r
@@ -745,10 +745,10 @@ Ip4FreeInterface (
   }\r
 \r
   //\r
-  // Destory the interface if this is the last IP instance that\r
+  // Destroy the interface if this is the last IP instance that\r
   // has the address. Remove all the system transmitted packets\r
   // from this interface, cancel the receive request if there is\r
-  // one, and destory the ARP requests.\r
+  // one, and destroy the ARP requests.\r
   //\r
   Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL);\r
   Ip4CancelReceive (Interface);\r
@@ -774,7 +774,7 @@ Ip4FreeInterface (
   }\r
 \r
   RemoveEntryList (&Interface->Link);\r
-  gBS->FreePool (Interface);\r
+  FreePool (Interface);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -871,7 +871,7 @@ Ip4OnArpResolved (
   //\r
   // Request Ip4OnArpResolvedDpc as a DPC at TPL_CALLBACK\r
   //\r
-  NetLibQueueDpc (TPL_CALLBACK, Ip4OnArpResolvedDpc, Context);\r
+  QueueDpc (TPL_CALLBACK, Ip4OnArpResolvedDpc, Context);\r
 }\r
 \r
 \r
@@ -924,7 +924,7 @@ Ip4OnFrameSent (
   //\r
   // Request Ip4OnFrameSentDpc as a DPC at TPL_CALLBACK\r
   //\r
-  NetLibQueueDpc (TPL_CALLBACK, Ip4OnFrameSentDpc, Context);\r
+  QueueDpc (TPL_CALLBACK, Ip4OnFrameSentDpc, Context);\r
 }\r
 \r
 \r
@@ -1088,6 +1088,7 @@ ON_ERROR:
 \r
 **/\r
 VOID\r
+EFIAPI\r
 Ip4RecycleFrame (\r
   IN VOID                   *Context\r
   )\r
@@ -1187,7 +1188,7 @@ Ip4OnFrameReceived (
   //\r
   // Request Ip4OnFrameReceivedDpc as a DPC at TPL_CALLBACK\r
   //\r
-  NetLibQueueDpc (TPL_CALLBACK, Ip4OnFrameReceivedDpc, Context);\r
+  QueueDpc (TPL_CALLBACK, Ip4OnFrameReceivedDpc, Context);\r
 }\r
 \r
 \r