\r
\r
#include "ArpImpl.h"\r
-#include "ArpDebug.h"\r
\r
EFI_ARP_PROTOCOL mEfiArpProtocolTemplate = {\r
ArpConfigure,\r
Instance->Configured = FALSE;\r
Instance->Destroyed = FALSE;\r
\r
- NetListInit (&Instance->List);\r
+ InitializeListHead (&Instance->List);\r
}\r
\r
\r
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
// 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
}\r
\r
if (!IsListEmpty (&CacheEntry->List)) {\r
- NetListRemoveEntry (&CacheEntry->List);\r
+ RemoveEntryList (&CacheEntry->List);\r
}\r
\r
//\r
//\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
\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
\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
)\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
// 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
//\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
//\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
//\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
//\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
}\r
\r
if ((AddressOne->AddressPtr != NULL) &&\r
- (NetCompareMem (\r
+ (CompareMem (\r
AddressOne->AddressPtr,\r
AddressTwo->AddressPtr,\r
AddressOne->Length\r
**/\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
//\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
//\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
//\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
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
//\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
//\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
//\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
//\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
//\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
//\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
//\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
//\r
// Save the StationAddress.\r
//\r
- NetCopyMem (\r
+ CopyMem (\r
OldConfigData->StationAddress,\r
ConfigData->StationAddress,\r
OldConfigData->SwAddressLength\r
//\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
//\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
//\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
//\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
// 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
//\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
//\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
//\r
// The target protocol address.\r
//\r
- NetCopyMem (\r
+ CopyMem (\r
TmpPtr,\r
CacheEntry->Addresses[Protocol].AddressPtr,\r
ConfigData->SwAddressLength\r
//\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
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
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
// 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
}\r
} else {\r
if ((AddressBuffer == NULL) ||\r
- (NetCompareMem (\r
+ (CompareMem (\r
AddressBuffer,\r
CacheEntry->Addresses[Hardware].AddressPtr,\r
CacheEntry->Addresses[Hardware].Length\r
//\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
)\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
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
//\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
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
//\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
//\r
// Copy the software address.\r
//\r
- NetCopyMem (\r
+ CopyMem (\r
FindData + 1,\r
CacheEntry->Addresses[Protocol].AddressPtr,\r
FindData->SwAddressLength\r
//\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