]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c
1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / ArpDxe / ArpImpl.c
index a3923d95bd8e006d161abb9363370f7887247d9e..633c3e7d387e62b7f55b14f083cbbc7fb853cddd 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   The implementation of the ARP protocol.\r
   \r
-Copyright (c) 2006 - 2009, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2012, 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<BR>\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -52,7 +52,7 @@ ArpInitInstance (
   CopyMem (&Instance->ArpProto, &mEfiArpProtocolTemplate, sizeof (Instance->ArpProto));\r
 \r
   Instance->Configured = FALSE;\r
-  Instance->Destroyed  = FALSE;\r
+  Instance->InDestroy  = FALSE;\r
 \r
   InitializeListHead (&Instance->List);\r
 }\r
@@ -325,7 +325,7 @@ ArpOnFrameRcvd (
   //\r
   // Request ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK\r
   //\r
-  NetLibQueueDpc (TPL_CALLBACK, ArpOnFrameRcvdDpc, Context);\r
+  QueueDpc (TPL_CALLBACK, ArpOnFrameRcvdDpc, Context);\r
 }\r
 \r
 /**\r
@@ -360,10 +360,10 @@ ArpOnFrameSentDpc (
   //\r
   // Free the allocated memory and close the event.\r
   //\r
-  gBS->FreePool (TxData->FragmentTable[0].FragmentBuffer);\r
-  gBS->FreePool (TxData);\r
+  FreePool (TxData->FragmentTable[0].FragmentBuffer);\r
+  FreePool (TxData);\r
   gBS->CloseEvent (TxToken->Event);\r
-  gBS->FreePool (TxToken);\r
+  FreePool (TxToken);\r
 }\r
 \r
 /**\r
@@ -386,7 +386,7 @@ ArpOnFrameSent (
   //\r
   // Request ArpOnFrameSentDpc as a DPC at TPL_CALLBACK\r
   //\r
-  NetLibQueueDpc (TPL_CALLBACK, ArpOnFrameSentDpc, Context);\r
+  QueueDpc (TPL_CALLBACK, ArpOnFrameSentDpc, Context);\r
 }\r
 \r
 \r
@@ -437,7 +437,7 @@ ArpTimerHandler (
         ASSERT (IsListEmpty (&CacheEntry->UserRequestList));\r
 \r
         RemoveEntryList (&CacheEntry->List);\r
-        gBS->FreePool (CacheEntry);\r
+        FreePool (CacheEntry);\r
       } else {\r
         //\r
         // resend the ARP request.\r
@@ -479,7 +479,7 @@ ArpTimerHandler (
       // Time out, remove it.\r
       //\r
       RemoveEntryList (&CacheEntry->List);\r
-      gBS->FreePool (CacheEntry);\r
+      FreePool (CacheEntry);\r
     } else {\r
       //\r
       // Update the DecayTime.\r
@@ -507,7 +507,7 @@ ArpTimerHandler (
       // Time out, remove it.\r
       //\r
       RemoveEntryList (&CacheEntry->List);\r
-      gBS->FreePool (CacheEntry);\r
+      FreePool (CacheEntry);\r
     } else {\r
       //\r
       // Update the DecayTime.\r
@@ -533,6 +533,8 @@ ArpMatchAddress (
   IN NET_ARP_ADDRESS  *AddressTwo\r
   )\r
 {\r
+  ASSERT (AddressOne != NULL && AddressTwo != NULL);\r
+\r
   if ((AddressOne->Type != AddressTwo->Type) ||\r
     (AddressOne->Length != AddressTwo->Length)) {\r
     //\r
@@ -803,7 +805,7 @@ ArpAddressResolved (
       // Remove this user request and free the context data.\r
       //\r
       RemoveEntryList (&Context->List);\r
-      gBS->FreePool (Context);\r
+      FreePool (Context);\r
 \r
       Count++;\r
     }\r
@@ -812,7 +814,7 @@ ArpAddressResolved (
   //\r
   // Dispatch the DPCs queued by the NotifyFunction of the Context->UserRequestEvent.\r
   //\r
-  NetLibDispatchDpc ();\r
+  DispatchDpc ();\r
 \r
   return Count;\r
 }\r
@@ -928,7 +930,7 @@ ArpConfigureInstance (
       if (ConfigData->SwAddressType == IPV4_ETHER_PROTO_TYPE) {\r
         CopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));\r
 \r
-        if (!Ip4IsUnicast (NTOHL (Ip), 0)) {\r
+        if (!NetIp4IsUnicast (NTOHL (Ip), 0)) {\r
           //\r
           // The station address is not a valid IPv4 unicast address.\r
           //\r
@@ -988,7 +990,7 @@ ArpConfigureInstance (
       //\r
       // Free the buffer previously allocated to hold the station address.\r
       //\r
-      gBS->FreePool (OldConfigData->StationAddress);\r
+      FreePool (OldConfigData->StationAddress);\r
     }\r
 \r
     Instance->Configured = FALSE;\r
@@ -1189,18 +1191,18 @@ ArpSendFrame (
 CLEAN_EXIT:\r
 \r
   if (Packet != NULL) {\r
-    gBS->FreePool (Packet);\r
+    FreePool (Packet);\r
   }\r
 \r
   if (TxData != NULL) {\r
-    gBS->FreePool (TxData);\r
+    FreePool (TxData);\r
   }\r
 \r
   if (TxToken->Event != NULL) {\r
     gBS->CloseEvent (TxToken->Event);\r
   }\r
 \r
-  gBS->FreePool (TxToken);\r
+  FreePool (TxToken);\r
 }\r
 \r
 \r
@@ -1286,7 +1288,7 @@ MATCHED:
     //\r
     RemoveEntryList (&CacheEntry->List);\r
     ASSERT (IsListEmpty (&CacheEntry->UserRequestList));\r
-    gBS->FreePool (CacheEntry);\r
+    FreePool (CacheEntry);\r
 \r
     Count++;\r
   }\r
@@ -1399,7 +1401,7 @@ ArpCancelRequest (
         // No user requests any more, remove this request cache entry.\r
         //\r
         RemoveEntryList (&CacheEntry->List);\r
-        gBS->FreePool (CacheEntry);\r
+        FreePool (CacheEntry);\r
       }\r
     }\r
   }\r