]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c
Use Mde library and definition instead of some native definitions in NetLib, to simpl...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / ArpDxe / ArpMain.c
index d760f7c0181bb460003df0c82e07169f770d1ffa..46aa19226b3914c1e8abb9099d7a21c3e88e5938 100644 (file)
@@ -66,14 +66,14 @@ ArpConfigure (
 \r
   Instance = ARP_INSTANCE_DATA_FROM_THIS (This);\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Configure this instance, the ConfigData has already passed the basic checks.\r
   //\r
   Status = ArpConfigureInstance (Instance, ConfigData);\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -166,7 +166,7 @@ ArpAdd (
   MatchAddress[Protocol].Length     = Instance->ConfigData.SwAddressLength;\r
   MatchAddress[Protocol].AddressPtr = TargetSwAddress;\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // See whether the entry to add exists. Check the DeinedCacheTable first.\r
@@ -215,7 +215,7 @@ ArpAdd (
     //\r
     // Remove it from the Table.\r
     //\r
-    NetListRemoveEntry (&CacheEntry->List);\r
+    RemoveEntryList (&CacheEntry->List);\r
   } else {\r
     //\r
     // It's a new entry, allocate memory for the entry.\r
@@ -223,7 +223,7 @@ ArpAdd (
     CacheEntry = ArpAllocCacheEntry (Instance);\r
 \r
     if (CacheEntry == NULL) {\r
-      ARP_DEBUG_ERROR (("ArpAdd: Failed to allocate pool for CacheEntry.\n"));\r
+      DEBUG ((EFI_D_ERROR, "ArpAdd: Failed to allocate pool for CacheEntry.\n"));\r
       Status = EFI_OUT_OF_RESOURCES;\r
       goto UNLOCK_EXIT;\r
     }\r
@@ -253,14 +253,14 @@ ArpAdd (
   // Add this CacheEntry to the corresponding CacheTable.\r
   //\r
   if (DenyFlag) {\r
-    NetListInsertHead (&ArpService->DeniedCacheTable, &CacheEntry->List);\r
+    InsertHeadList (&ArpService->DeniedCacheTable, &CacheEntry->List);\r
   } else {\r
-    NetListInsertHead (&ArpService->ResolvedCacheTable, &CacheEntry->List);\r
+    InsertHeadList (&ArpService->ResolvedCacheTable, &CacheEntry->List);\r
   }\r
 \r
 UNLOCK_EXIT:\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -321,7 +321,7 @@ ArpFind (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // All the check passed, find the cache entries now.\r
@@ -336,7 +336,7 @@ ArpFind (
              Refresh\r
              );\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -381,14 +381,14 @@ ArpDelete (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Delete the specified cache entries.\r
   //\r
   Count = ArpDeleteCacheEntry (Instance, BySwAddress, AddressBuffer, TRUE);\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS;\r
 }\r
@@ -426,14 +426,14 @@ ArpFlush (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Delete the dynamic entries from the cache table.\r
   //\r
   Count = ArpDeleteCacheEntry (Instance, FALSE, NULL, FALSE);\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS;\r
 }\r
@@ -500,7 +500,7 @@ ArpRequest (
     //\r
     // Return the hardware broadcast address.\r
     //\r
-    NetCopyMem (TargetHwAddress, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);\r
+    CopyMem (TargetHwAddress, &SnpMode->BroadcastAddress, SnpMode->HwAddressSize);\r
 \r
     goto SIGNAL_USER;\r
   }\r
@@ -531,9 +531,9 @@ ArpRequest (
   //\r
   // Initialize the TargetHwAddrss to a zero address.\r
   //\r
-  NetZeroMem (TargetHwAddress, SnpMode->HwAddressSize);\r
+  ZeroMem (TargetHwAddress, SnpMode->HwAddressSize);\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Check whether the software address is in the denied table.\r
@@ -558,7 +558,7 @@ ArpRequest (
     //\r
     // Resolved, copy the address into the user buffer.\r
     //\r
-    NetCopyMem (\r
+    CopyMem (\r
       TargetHwAddress,\r
       CacheEntry->Addresses[Hardware].AddressPtr,\r
       CacheEntry->Addresses[Hardware].Length\r
@@ -575,9 +575,9 @@ ArpRequest (
   //\r
   // Create a request context for this arp request.\r
   //\r
-  RequestContext = NetAllocatePool (sizeof(USER_REQUEST_CONTEXT));\r
+  RequestContext = AllocatePool (sizeof(USER_REQUEST_CONTEXT));\r
   if (RequestContext == NULL) {\r
-    ARP_DEBUG_ERROR (("ArpRequest: Allocate memory for RequestContext failed.\n"));\r
+    DEBUG ((EFI_D_ERROR, "ArpRequest: Allocate memory for RequestContext failed.\n"));\r
 \r
     Status = EFI_OUT_OF_RESOURCES;\r
     goto UNLOCK_EXIT;\r
@@ -586,7 +586,7 @@ ArpRequest (
   RequestContext->Instance         = Instance;\r
   RequestContext->UserRequestEvent = ResolvedEvent;\r
   RequestContext->UserHwAddrBuffer = TargetHwAddress;\r
-  NetListInit (&RequestContext->List);\r
+  InitializeListHead (&RequestContext->List);\r
 \r
   //\r
   // Check whether there is a same request.\r
@@ -608,8 +608,8 @@ ArpRequest (
     //\r
     CacheEntry = ArpAllocCacheEntry (Instance);\r
     if (CacheEntry == NULL) {\r
-      ARP_DEBUG_ERROR (("ArpRequest: Allocate memory for CacheEntry failed.\n"));\r
-      NetFreePool (RequestContext);\r
+      DEBUG ((EFI_D_ERROR, "ArpRequest: Allocate memory for CacheEntry failed.\n"));\r
+      gBS->FreePool (RequestContext);\r
 \r
       Status = EFI_OUT_OF_RESOURCES;\r
       goto UNLOCK_EXIT;\r
@@ -623,13 +623,13 @@ ArpRequest (
     //\r
     // Add this entry into the PendingRequestTable.\r
     //\r
-    NetListInsertTail (&ArpService->PendingRequestTable, &CacheEntry->List);\r
+    InsertTailList (&ArpService->PendingRequestTable, &CacheEntry->List);\r
   }\r
 \r
   //\r
   // Link this request context into the cache entry.\r
   //\r
-  NetListInsertHead (&CacheEntry->UserRequestList, &RequestContext->List);\r
+  InsertHeadList (&CacheEntry->UserRequestList, &RequestContext->List);\r
 \r
   //\r
   // Send out the ARP Request frame.\r
@@ -639,7 +639,7 @@ ArpRequest (
 \r
 UNLOCK_EXIT:\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
 SIGNAL_USER:\r
 \r
@@ -701,7 +701,7 @@ ArpCancel (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Cancel the specified request.\r
@@ -714,7 +714,7 @@ ArpCancel (
   //\r
   NetLibDispatchDpc ();\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return (Count == 0) ? EFI_NOT_FOUND : EFI_SUCCESS;\r
 }\r