]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c
Use Mde library and definition instead of some native definitions in NetLib, to simpl...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / ArpDxe / ArpImpl.c
index 404e6cc9d68ef30582f4d8470ee9a4ad3cf4b6cf..797ebd0ba08528805d3c6225c2e0b3715b6d86a3 100644 (file)
@@ -20,7 +20,6 @@ Abstract:
 \r
 \r
 #include "ArpImpl.h"\r
-#include "ArpDebug.h"\r
 \r
 EFI_ARP_PROTOCOL  mEfiArpProtocolTemplate = {\r
   ArpConfigure,\r
@@ -59,7 +58,7 @@ ArpInitInstance (
   Instance->Configured = FALSE;\r
   Instance->Destroyed  = FALSE;\r
 \r
-  NetListInit (&Instance->List);\r
+  InitializeListHead (&Instance->List);\r
 }\r
 \r
 \r
@@ -85,7 +84,7 @@ ArpOnFrameRcvdDpc (
   ARP_HEAD                              *Head;\r
   ARP_ADDRESS                           ArpAddress;\r
   ARP_CACHE_ENTRY                       *CacheEntry;\r
-  NET_LIST_ENTRY                        *Entry;\r
+  LIST_ENTRY                            *Entry;\r
   ARP_INSTANCE_DATA                     *Instance;\r
   EFI_ARP_CONFIG_DATA                   *ConfigData;\r
   NET_ARP_ADDRESS                       SenderAddress[2];\r
@@ -186,7 +185,7 @@ ArpOnFrameRcvdDpc (
       // The protocol type is matched for the received arp packet.\r
       //\r
       ProtoMatched = TRUE;\r
-      if (0 == NetCompareMem (\r
+      if (0 == CompareMem (\r
                  (VOID *)ArpAddress.TargetProtoAddr,\r
                  ConfigData->StationAddress,\r
                  ConfigData->SwAddressLength\r
@@ -257,7 +256,7 @@ ArpOnFrameRcvdDpc (
     }\r
 \r
     if (!IsListEmpty (&CacheEntry->List)) {\r
-      NetListRemoveEntry (&CacheEntry->List);\r
+      RemoveEntryList (&CacheEntry->List);\r
     }\r
 \r
     //\r
@@ -277,7 +276,7 @@ ArpOnFrameRcvdDpc (
     //\r
     // Add this entry into the ResolvedCacheTable\r
     //\r
-    NetListInsertHead (&ArpService->ResolvedCacheTable, &CacheEntry->List);\r
+    InsertHeadList (&ArpService->ResolvedCacheTable, &CacheEntry->List);\r
   }\r
 \r
   if (Head->OpCode == ARP_OPCODE_REQUEST) {\r
@@ -304,7 +303,7 @@ RESTART_RECEIVE:
 \r
   DEBUG_CODE (\r
     if (EFI_ERROR (Status)) {\r
-      ARP_DEBUG_ERROR (("ArpOnFrameRcvd: ArpService->Mnp->Receive "\r
+      DEBUG ((EFI_D_ERROR, "ArpOnFrameRcvd: ArpService->Mnp->Receive "\r
         "failed, %r\n.", Status));\r
     }\r
   );\r
@@ -358,17 +357,17 @@ ArpOnFrameSentDpc (
 \r
   DEBUG_CODE (\r
     if (EFI_ERROR (TxToken->Status)) {\r
-      ARP_DEBUG_ERROR (("ArpOnFrameSent: TxToken->Status, %r.\n", TxToken->Status));\r
+      DEBUG ((EFI_D_ERROR, "ArpOnFrameSent: TxToken->Status, %r.\n", TxToken->Status));\r
     }\r
   );\r
 \r
   //\r
   // Free the allocated memory and close the event.\r
   //\r
-  NetFreePool (TxData->FragmentTable[0].FragmentBuffer);\r
-  NetFreePool (TxData);\r
+  gBS->FreePool (TxData->FragmentTable[0].FragmentBuffer);\r
+  gBS->FreePool (TxData);\r
   gBS->CloseEvent (TxToken->Event);\r
-  NetFreePool (TxToken);\r
+  gBS->FreePool (TxToken);\r
 }\r
 \r
 /**\r
@@ -413,9 +412,9 @@ ArpTimerHandler (
   )\r
 {\r
   ARP_SERVICE_DATA      *ArpService;\r
-  NET_LIST_ENTRY        *Entry;\r
-  NET_LIST_ENTRY        *NextEntry;\r
-  NET_LIST_ENTRY        *ContextEntry;\r
+  LIST_ENTRY            *Entry;\r
+  LIST_ENTRY            *NextEntry;\r
+  LIST_ENTRY            *ContextEntry;\r
   ARP_CACHE_ENTRY       *CacheEntry;\r
   USER_REQUEST_CONTEXT  *RequestContext;\r
 \r
@@ -439,15 +438,15 @@ ArpTimerHandler (
         // Abort this request.\r
         //\r
         ArpAddressResolved (CacheEntry, NULL, NULL);\r
-        ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));\r
+        ASSERT (IsListEmpty (&CacheEntry->UserRequestList));\r
 \r
-        NetListRemoveEntry (&CacheEntry->List);\r
-        NetFreePool (CacheEntry);\r
+        RemoveEntryList (&CacheEntry->List);\r
+        gBS->FreePool (CacheEntry);\r
       } else {\r
         //\r
         // resend the ARP request.\r
         //\r
-        ASSERT (!NetListIsEmpty(&CacheEntry->UserRequestList));\r
+        ASSERT (!IsListEmpty(&CacheEntry->UserRequestList));\r
 \r
         ContextEntry   = CacheEntry->UserRequestList.ForwardLink;\r
         RequestContext = NET_LIST_USER_STRUCT (ContextEntry, USER_REQUEST_CONTEXT, List);\r
@@ -470,7 +469,7 @@ ArpTimerHandler (
   //\r
   NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &ArpService->DeniedCacheTable) {\r
     CacheEntry = NET_LIST_USER_STRUCT (Entry, ARP_CACHE_ENTRY, List);\r
-    ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));\r
+    ASSERT (IsListEmpty (&CacheEntry->UserRequestList));\r
 \r
     if (CacheEntry->DefaultDecayTime == 0) {\r
       //\r
@@ -483,8 +482,8 @@ ArpTimerHandler (
       //\r
       // Time out, remove it.\r
       //\r
-      NetListRemoveEntry (&CacheEntry->List);\r
-      NetFreePool (CacheEntry);\r
+      RemoveEntryList (&CacheEntry->List);\r
+      gBS->FreePool (CacheEntry);\r
     } else {\r
       //\r
       // Update the DecayTime.\r
@@ -498,7 +497,7 @@ ArpTimerHandler (
   //\r
   NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &ArpService->ResolvedCacheTable) {\r
     CacheEntry = NET_LIST_USER_STRUCT (Entry, ARP_CACHE_ENTRY, List);\r
-    ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));\r
+    ASSERT (IsListEmpty (&CacheEntry->UserRequestList));\r
 \r
     if (CacheEntry->DefaultDecayTime == 0) {\r
       //\r
@@ -511,8 +510,8 @@ ArpTimerHandler (
       //\r
       // Time out, remove it.\r
       //\r
-      NetListRemoveEntry (&CacheEntry->List);\r
-      NetFreePool (CacheEntry);\r
+      RemoveEntryList (&CacheEntry->List);\r
+      gBS->FreePool (CacheEntry);\r
     } else {\r
       //\r
       // Update the DecayTime.\r
@@ -548,7 +547,7 @@ ArpMatchAddress (
   }\r
 \r
   if ((AddressOne->AddressPtr != NULL) &&\r
-    (NetCompareMem (\r
+    (CompareMem (\r
       AddressOne->AddressPtr,\r
       AddressTwo->AddressPtr,\r
       AddressOne->Length\r
@@ -578,14 +577,14 @@ ArpMatchAddress (
 **/\r
 ARP_CACHE_ENTRY *\r
 ArpFindNextCacheEntryInTable (\r
-  IN NET_LIST_ENTRY    *CacheTable,\r
-  IN NET_LIST_ENTRY    *StartEntry,\r
+  IN LIST_ENTRY        *CacheTable,\r
+  IN LIST_ENTRY        *StartEntry,\r
   IN FIND_OPTYPE       FindOpType,\r
   IN NET_ARP_ADDRESS   *ProtocolAddress OPTIONAL,\r
   IN NET_ARP_ADDRESS   *HardwareAddress OPTIONAL\r
   )\r
 {\r
-  NET_LIST_ENTRY   *Entry;\r
+  LIST_ENTRY       *Entry;\r
   ARP_CACHE_ENTRY  *CacheEntry;\r
 \r
   if (StartEntry == NULL) {\r
@@ -716,7 +715,7 @@ ArpAllocCacheEntry (
   //\r
   // Allocate memory for the cache entry.\r
   //\r
-  CacheEntry = NetAllocatePool (sizeof (ARP_CACHE_ENTRY));\r
+  CacheEntry = AllocatePool (sizeof (ARP_CACHE_ENTRY));\r
   if (CacheEntry == NULL) {\r
     return NULL;\r
   }\r
@@ -724,8 +723,8 @@ ArpAllocCacheEntry (
   //\r
   // Init the lists.\r
   //\r
-  NetListInit (&CacheEntry->List);\r
-  NetListInit (&CacheEntry->UserRequestList);\r
+  InitializeListHead (&CacheEntry->List);\r
+  InitializeListHead (&CacheEntry->UserRequestList);\r
 \r
   for (Index = 0; Index < 2; Index++) {\r
     //\r
@@ -738,7 +737,7 @@ ArpAllocCacheEntry (
   //\r
   // Zero the hardware address first.\r
   //\r
-  NetZeroMem (CacheEntry->Addresses[Hardware].AddressPtr, ARP_MAX_HARDWARE_ADDRESS_LEN);\r
+  ZeroMem (CacheEntry->Addresses[Hardware].AddressPtr, ARP_MAX_HARDWARE_ADDRESS_LEN);\r
 \r
   if (Instance != NULL) {\r
     //\r
@@ -780,8 +779,8 @@ ArpAddressResolved (
   IN EFI_EVENT          UserEvent OPTIONAL\r
   )\r
 {\r
-  NET_LIST_ENTRY        *Entry;\r
-  NET_LIST_ENTRY        *NextEntry;\r
+  LIST_ENTRY            *Entry;\r
+  LIST_ENTRY            *NextEntry;\r
   USER_REQUEST_CONTEXT  *Context;\r
   UINTN                 Count;\r
 \r
@@ -798,7 +797,7 @@ ArpAddressResolved (
       //\r
       // Copy the address to the user-provided buffer and notify the user.\r
       //\r
-      NetCopyMem (\r
+      CopyMem (\r
         Context->UserHwAddrBuffer,\r
         CacheEntry->Addresses[Hardware].AddressPtr,\r
         CacheEntry->Addresses[Hardware].Length\r
@@ -808,8 +807,8 @@ ArpAddressResolved (
       //\r
       // Remove this user request and free the context data.\r
       //\r
-      NetListRemoveEntry (&Context->List);\r
-      NetFreePool (Context);\r
+      RemoveEntryList (&Context->List);\r
+      gBS->FreePool (Context);\r
 \r
       Count++;\r
     }\r
@@ -863,7 +862,7 @@ ArpFillAddressInCacheEntry (
         //\r
         // Copy it if the AddressPtr points to some buffer.\r
         //\r
-        NetCopyMem (\r
+        CopyMem (\r
           CacheAddress->AddressPtr,\r
           Address[Index]->AddressPtr,\r
           CacheAddress->Length\r
@@ -872,7 +871,7 @@ ArpFillAddressInCacheEntry (
         //\r
         // Zero the corresponding address buffer in the CacheEntry.\r
         //\r
-        NetZeroMem (CacheAddress->AddressPtr, CacheAddress->Length);\r
+        ZeroMem (CacheAddress->AddressPtr, CacheAddress->Length);\r
       }\r
     }\r
   }\r
@@ -916,7 +915,7 @@ ArpConfigureInstance (
       //\r
       if ((OldConfigData->SwAddressType != ConfigData->SwAddressType) ||\r
         (OldConfigData->SwAddressLength != ConfigData->SwAddressLength) ||\r
-        (NetCompareMem (\r
+        (CompareMem (\r
            OldConfigData->StationAddress,\r
            ConfigData->StationAddress,\r
            OldConfigData->SwAddressLength\r
@@ -932,7 +931,7 @@ ArpConfigureInstance (
       //\r
 \r
       if (ConfigData->SwAddressType == IPv4_ETHER_PROTO_TYPE) {\r
-        NetCopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));\r
+        CopyMem (&Ip, ConfigData->StationAddress, sizeof (IP4_ADDR));\r
 \r
         if (!Ip4IsUnicast (NTOHL (Ip), 0)) {\r
           //\r
@@ -947,9 +946,9 @@ ArpConfigureInstance (
       //\r
       CopyMem (OldConfigData, ConfigData, sizeof (*OldConfigData));\r
 \r
-      OldConfigData->StationAddress = NetAllocatePool (OldConfigData->SwAddressLength);\r
+      OldConfigData->StationAddress = AllocatePool (OldConfigData->SwAddressLength);\r
       if (OldConfigData->StationAddress == NULL) {\r
-        ARP_DEBUG_ERROR (("ArpConfigInstance: NetAllocatePool for the StationAddress "\r
+        DEBUG ((EFI_D_ERROR, "ArpConfigInstance: AllocatePool for the StationAddress "\r
           "failed.\n"));\r
         return EFI_OUT_OF_RESOURCES;\r
       }\r
@@ -957,7 +956,7 @@ ArpConfigureInstance (
       //\r
       // Save the StationAddress.\r
       //\r
-      NetCopyMem (\r
+      CopyMem (\r
         OldConfigData->StationAddress,\r
         ConfigData->StationAddress,\r
         OldConfigData->SwAddressLength\r
@@ -994,7 +993,7 @@ ArpConfigureInstance (
       //\r
       // Free the buffer previously allocated to hold the station address.\r
       //\r
-      NetFreePool (OldConfigData->StationAddress);\r
+      gBS->FreePool (OldConfigData->StationAddress);\r
     }\r
 \r
     Instance->Configured = FALSE;\r
@@ -1039,9 +1038,9 @@ ArpSendFrame (
   //\r
   // Allocate memory for the TxToken.\r
   //\r
-  TxToken = NetAllocatePool (sizeof(EFI_MANAGED_NETWORK_COMPLETION_TOKEN));\r
+  TxToken = AllocatePool (sizeof(EFI_MANAGED_NETWORK_COMPLETION_TOKEN));\r
   if (TxToken == NULL) {\r
-    ARP_DEBUG_ERROR (("ArpSendFrame: Allocate memory for TxToken failed.\n"));\r
+    DEBUG ((EFI_D_ERROR, "ArpSendFrame: Allocate memory for TxToken failed.\n"));\r
     return;\r
   }\r
 \r
@@ -1054,22 +1053,22 @@ ArpSendFrame (
   //\r
   Status = gBS->CreateEvent (\r
                   EVT_NOTIFY_SIGNAL,\r
-                  NET_TPL_EVENT,\r
+                  TPL_NOTIFY,\r
                   ArpOnFrameSent,\r
                   (VOID *)TxToken,\r
                   &TxToken->Event\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    ARP_DEBUG_ERROR (("ArpSendFrame: CreateEvent failed for TxToken->Event.\n"));\r
+    DEBUG ((EFI_D_ERROR, "ArpSendFrame: CreateEvent failed for TxToken->Event.\n"));\r
     goto CLEAN_EXIT;\r
   }\r
 \r
   //\r
   // Allocate memory for the TxData used in the TxToken.\r
   //\r
-  TxData = NetAllocatePool (sizeof(EFI_MANAGED_NETWORK_TRANSMIT_DATA));\r
+  TxData = AllocatePool (sizeof(EFI_MANAGED_NETWORK_TRANSMIT_DATA));\r
   if (TxData == NULL) {\r
-    ARP_DEBUG_ERROR (("ArpSendFrame: Allocate memory for TxData failed.\n"));\r
+    DEBUG ((EFI_D_ERROR, "ArpSendFrame: Allocate memory for TxData failed.\n"));\r
     goto CLEAN_EXIT;\r
   }\r
 \r
@@ -1086,9 +1085,9 @@ ArpSendFrame (
   //\r
   // Allocate buffer for the arp frame.\r
   //\r
-  Packet = NetAllocatePool (TotalLength);\r
+  Packet = AllocatePool (TotalLength);\r
   if (Packet == NULL) {\r
-    ARP_DEBUG_ERROR (("ArpSendFrame: Allocate memory for Packet failed.\n"));\r
+    DEBUG ((EFI_D_ERROR, "ArpSendFrame: Allocate memory for Packet failed.\n"));\r
   }\r
 \r
   TmpPtr = Packet;\r
@@ -1097,9 +1096,9 @@ ArpSendFrame (
   // The destination MAC address.\r
   //\r
   if (ArpOpCode == ARP_OPCODE_REQUEST) {\r
-    NetCopyMem (TmpPtr, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);\r
+    CopyMem (TmpPtr, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);\r
   } else {\r
-    NetCopyMem (\r
+    CopyMem (\r
       TmpPtr,\r
       CacheEntry->Addresses[Hardware].AddressPtr,\r
       SnpMode->HwAddressSize\r
@@ -1110,7 +1109,7 @@ ArpSendFrame (
   //\r
   // The source MAC address.\r
   //\r
-  NetCopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);\r
+  CopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);\r
   TmpPtr += SnpMode->HwAddressSize;\r
 \r
   //\r
@@ -1133,19 +1132,19 @@ ArpSendFrame (
   //\r
   // The sender hardware address.\r
   //\r
-  NetCopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);\r
+  CopyMem (TmpPtr, &SnpMode->CurrentAddress, SnpMode->HwAddressSize);\r
   TmpPtr += SnpMode->HwAddressSize;\r
 \r
   //\r
   // The sender protocol address.\r
   //\r
-  NetCopyMem (TmpPtr, ConfigData->StationAddress, ConfigData->SwAddressLength);\r
+  CopyMem (TmpPtr, ConfigData->StationAddress, ConfigData->SwAddressLength);\r
   TmpPtr += ConfigData->SwAddressLength;\r
 \r
   //\r
   // The target hardware address.\r
   //\r
-  NetCopyMem (\r
+  CopyMem (\r
     TmpPtr,\r
     CacheEntry->Addresses[Hardware].AddressPtr,\r
     SnpMode->HwAddressSize\r
@@ -1155,7 +1154,7 @@ ArpSendFrame (
   //\r
   // The target protocol address.\r
   //\r
-  NetCopyMem (\r
+  CopyMem (\r
     TmpPtr,\r
     CacheEntry->Addresses[Protocol].AddressPtr,\r
     ConfigData->SwAddressLength\r
@@ -1185,7 +1184,7 @@ ArpSendFrame (
   //\r
   Status = ArpService->Mnp->Transmit (ArpService->Mnp, TxToken);\r
   if (EFI_ERROR (Status)) {\r
-    ARP_DEBUG_ERROR (("Mnp->Transmit failed, %r.\n", Status));\r
+    DEBUG ((EFI_D_ERROR, "Mnp->Transmit failed, %r.\n", Status));\r
     goto CLEAN_EXIT;\r
   }\r
 \r
@@ -1194,18 +1193,18 @@ ArpSendFrame (
 CLEAN_EXIT:\r
 \r
   if (Packet != NULL) {\r
-    NetFreePool (Packet);\r
+    gBS->FreePool (Packet);\r
   }\r
 \r
   if (TxData != NULL) {\r
-    NetFreePool (TxData);\r
+    gBS->FreePool (TxData);\r
   }\r
 \r
   if (TxToken->Event != NULL) {\r
     gBS->CloseEvent (TxToken->Event);\r
   }\r
 \r
-  NetFreePool (TxToken);\r
+  gBS->FreePool (TxToken);\r
 }\r
 \r
 \r
@@ -1228,15 +1227,15 @@ CLEAN_EXIT:
 STATIC\r
 UINTN\r
 ArpDeleteCacheEntryInTable (\r
-  IN NET_LIST_ENTRY  *CacheTable,\r
+  IN LIST_ENTRY      *CacheTable,\r
   IN BOOLEAN         BySwAddress,\r
   IN UINT16          SwAddressType,\r
   IN UINT8           *AddressBuffer OPTIONAL,\r
   IN BOOLEAN         Force\r
   )\r
 {\r
-  NET_LIST_ENTRY   *Entry;\r
-  NET_LIST_ENTRY   *NextEntry;\r
+  LIST_ENTRY       *Entry;\r
+  LIST_ENTRY       *NextEntry;\r
   ARP_CACHE_ENTRY  *CacheEntry;\r
   UINTN            Count;\r
 \r
@@ -1258,7 +1257,7 @@ ArpDeleteCacheEntryInTable (
         // Protocol address type matched. Check the address.\r
         //\r
         if ((AddressBuffer == NULL) ||\r
-          (NetCompareMem (\r
+          (CompareMem (\r
              AddressBuffer,\r
              CacheEntry->Addresses[Protocol].AddressPtr,\r
              CacheEntry->Addresses[Protocol].Length\r
@@ -1271,7 +1270,7 @@ ArpDeleteCacheEntryInTable (
       }\r
     } else {\r
       if ((AddressBuffer == NULL) ||\r
-        (NetCompareMem (\r
+        (CompareMem (\r
            AddressBuffer,\r
            CacheEntry->Addresses[Hardware].AddressPtr,\r
            CacheEntry->Addresses[Hardware].Length\r
@@ -1290,9 +1289,9 @@ MATCHED:
     //\r
     // Delete this entry.\r
     //\r
-    NetListRemoveEntry (&CacheEntry->List);\r
-    ASSERT (NetListIsEmpty (&CacheEntry->UserRequestList));\r
-    NetFreePool (CacheEntry);\r
+    RemoveEntryList (&CacheEntry->List);\r
+    ASSERT (IsListEmpty (&CacheEntry->UserRequestList));\r
+    gBS->FreePool (CacheEntry);\r
 \r
     Count++;\r
   }\r
@@ -1375,8 +1374,8 @@ ArpCancelRequest (
   )\r
 {\r
   ARP_SERVICE_DATA  *ArpService;\r
-  NET_LIST_ENTRY    *Entry;\r
-  NET_LIST_ENTRY    *NextEntry;\r
+  LIST_ENTRY        *Entry;\r
+  LIST_ENTRY        *NextEntry;\r
   ARP_CACHE_ENTRY   *CacheEntry;\r
   UINTN             Count;\r
 \r
@@ -1389,7 +1388,7 @@ ArpCancelRequest (
     CacheEntry = NET_LIST_USER_STRUCT (Entry, ARP_CACHE_ENTRY, List);\r
 \r
     if ((TargetSwAddress == NULL) ||\r
-      (NetCompareMem (\r
+      (CompareMem (\r
          TargetSwAddress,\r
          CacheEntry->Addresses[Protocol].AddressPtr,\r
          CacheEntry->Addresses[Protocol].Length\r
@@ -1400,12 +1399,12 @@ ArpCancelRequest (
       //\r
       Count += ArpAddressResolved (CacheEntry, Instance, UserEvent);\r
 \r
-      if (NetListIsEmpty (&CacheEntry->UserRequestList)) {\r
+      if (IsListEmpty (&CacheEntry->UserRequestList)) {\r
         //\r
         // No user requests any more, remove this request cache entry.\r
         //\r
-        NetListRemoveEntry (&CacheEntry->List);\r
-        NetFreePool (CacheEntry);\r
+        RemoveEntryList (&CacheEntry->List);\r
+        gBS->FreePool (CacheEntry);\r
       }\r
     }\r
   }\r
@@ -1452,12 +1451,12 @@ ArpFindCacheEntry (
   ARP_SERVICE_DATA   *ArpService;\r
   NET_ARP_ADDRESS    MatchAddress;\r
   FIND_OPTYPE        FindOpType;\r
-  NET_LIST_ENTRY     *StartEntry;\r
+  LIST_ENTRY         *StartEntry;\r
   ARP_CACHE_ENTRY    *CacheEntry;\r
   NET_MAP            FoundEntries;\r
   UINT32             FoundCount;\r
   EFI_ARP_FIND_DATA  *FindData;\r
-  NET_LIST_ENTRY     *CacheTable;\r
+  LIST_ENTRY         *CacheTable;\r
 \r
   ArpService = Instance->ArpService;\r
 \r
@@ -1596,9 +1595,9 @@ ArpFindCacheEntry (
   //\r
   // Allocate buffer to copy the found entries.\r
   //\r
-  FindData = NetAllocatePool (FoundCount * (*EntryLength));\r
+  FindData = AllocatePool (FoundCount * (*EntryLength));\r
   if (FindData == NULL) {\r
-    ARP_DEBUG_ERROR (("ArpFindCacheEntry: Failed to allocate memory.\n"));\r
+    DEBUG ((EFI_D_ERROR, "ArpFindCacheEntry: Failed to allocate memory.\n"));\r
     Status = EFI_OUT_OF_RESOURCES;\r
     goto CLEAN_EXIT;\r
   }\r
@@ -1631,7 +1630,7 @@ ArpFindCacheEntry (
     //\r
     // Copy the software address.\r
     //\r
-    NetCopyMem (\r
+    CopyMem (\r
       FindData + 1,\r
       CacheEntry->Addresses[Protocol].AddressPtr,\r
       FindData->SwAddressLength\r
@@ -1640,7 +1639,7 @@ ArpFindCacheEntry (
     //\r
     // Copy the hardware address.\r
     //\r
-    NetCopyMem (\r
+    CopyMem (\r
       (UINT8 *)(FindData + 1) + FindData->SwAddressLength,\r
       CacheEntry->Addresses[Hardware].AddressPtr,\r
       FindData->HwAddressLength\r