diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-02-14 09:40:22 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-02-14 09:40:22 +0000 |
commit | e48e37fce2611df7a52aff271835ff72ee396d9b (patch) | |
tree | f6427ba11251479c615da9b5a3e38aa8c7b0f943 /MdeModulePkg/Universal/Network/Ip4Dxe | |
parent | bb8ffffd1c0ff0ee697c26d377fd9767097cc02b (diff) | |
download | edk2-platforms-e48e37fce2611df7a52aff271835ff72ee396d9b.tar.xz |
Use Mde library and definition instead of some native definitions in NetLib, to simply network library.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4693 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4Dxe')
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c | 18 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c | 60 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c | 94 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h | 14 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c | 28 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h | 4 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c | 124 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h | 14 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c | 88 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h | 6 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c | 6 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c | 2 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c | 76 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h | 8 |
15 files changed, 266 insertions, 278 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c index ac339bee52..561be165d8 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c @@ -80,7 +80,7 @@ Ip4GetHostCast ( IN IP4_ADDR Src
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
INTN Type;
INTN Class;
@@ -146,7 +146,7 @@ Ip4FindInterface ( IN IP4_ADDR Ip
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
@@ -176,7 +176,7 @@ Ip4FindNet ( IN IP4_ADDR Ip
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
@@ -208,7 +208,7 @@ Ip4FindStationAddress ( IN IP4_ADDR Netmask
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {
@@ -290,7 +290,7 @@ Ip4SetVariableData ( )
{
UINT32 NumConfiguredInstance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UINTN VariableDataSize;
EFI_IP4_VARIABLE_DATA *Ip4VariableData;
EFI_IP4_ADDRESS_PAIR *Ip4AddressPair;
@@ -322,7 +322,7 @@ Ip4SetVariableData ( VariableDataSize += sizeof (EFI_IP4_ADDRESS_PAIR) * (NumConfiguredInstance - 1);
}
- Ip4VariableData = NetAllocatePool (VariableDataSize);
+ Ip4VariableData = AllocatePool (VariableDataSize);
if (Ip4VariableData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -372,7 +372,7 @@ Ip4SetVariableData ( );
}
- NetFreePool (IpSb->MacString);
+ gBS->FreePool (IpSb->MacString);
}
IpSb->MacString = NewMacString;
@@ -387,7 +387,7 @@ Ip4SetVariableData ( ON_ERROR:
- NetFreePool (Ip4VariableData);
+ gBS->FreePool (Ip4VariableData);
return Status;
}
@@ -416,6 +416,6 @@ Ip4ClearVariableData ( NULL
);
- NetFreePool (IpSb->MacString);
+ gBS->FreePool (IpSb->MacString);
IpSb->MacString = NULL;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c index 589eca5208..85cc6afb50 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c @@ -161,7 +161,7 @@ Ip4CreateService ( // empty resources, so if any thing goes wrong when allocating
// resources, Ip4CleanService can be called to clean it up.
//
- IpSb = NetAllocatePool (sizeof (IP4_SERVICE));
+ IpSb = AllocatePool (sizeof (IP4_SERVICE));
if (IpSb == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -174,16 +174,16 @@ Ip4CreateService ( IpSb->InDestory = FALSE;
IpSb->NumChildren = 0;
- NetListInit (&IpSb->Children);
+ InitializeListHead (&IpSb->Children);
- NetListInit (&IpSb->Interfaces);
+ InitializeListHead (&IpSb->Interfaces);
IpSb->DefaultInterface = NULL;
IpSb->DefaultRouteTable = NULL;
Ip4InitAssembleTable (&IpSb->Assemble);
IpSb->IgmpCtrl.Igmpv1QuerySeen = 0;
- NetListInit (&IpSb->IgmpCtrl.Groups);
+ InitializeListHead (&IpSb->IgmpCtrl.Groups);
IpSb->Image = ImageHandle;
IpSb->Controller = Controller;
@@ -202,7 +202,7 @@ Ip4CreateService ( IpSb->MnpConfigData.EnableReceiveTimestamps = FALSE;
IpSb->MnpConfigData.DisableBackgroundPolling = FALSE;
- NetZeroMem (&IpSb->SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
+ ZeroMem (&IpSb->SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
IpSb->Timer = NULL;
IpSb->Ip4Config = NULL;
@@ -224,7 +224,7 @@ Ip4CreateService ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
Ip4TimerTicking,
IpSb,
&IpSb->Timer
@@ -283,7 +283,7 @@ Ip4CreateService ( goto ON_ERROR;
}
- NetListInsertHead (&IpSb->Interfaces, &IpSb->DefaultInterface->Link);
+ InsertHeadList (&IpSb->Interfaces, &IpSb->DefaultInterface->Link);
IpSb->MacString = NULL;
@@ -292,7 +292,7 @@ Ip4CreateService ( ON_ERROR:
Ip4CleanService (IpSb);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
return Status;
}
@@ -477,7 +477,7 @@ UNINSTALL_PROTOCOL: FREE_SERVICE:
Ip4CleanService (IpSb);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
return Status;
}
@@ -555,7 +555,7 @@ Ip4DriverBindingStop ( IpSb = IP4_SERVICE_FROM_PROTOCOL (ServiceBinding);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpSb->Ip4Config && (IpSb->State != IP4_SERVICE_DESTORY)) {
@@ -569,7 +569,7 @@ Ip4DriverBindingStop ( );
if (EFI_ERROR (Status)) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -585,7 +585,7 @@ Ip4DriverBindingStop ( gBS->CloseEvent (IpSb->ReconfigEvent);
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -625,15 +625,15 @@ Ip4DriverBindingStop ( IpSb = IP4_SERVICE_FROM_PROTOCOL (ServiceBinding);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpSb->InDestory) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
if (IsArp) {
- while (!NetListIsEmpty (&IpSb->Children)) {
+ while (!IsListEmpty (&IpSb->Children)) {
IpInstance = NET_LIST_HEAD (&IpSb->Children, IP4_PROTOCOL, Link);
ServiceBinding->DestroyChild (ServiceBinding, IpInstance->Handle);
@@ -670,7 +670,7 @@ Ip4DriverBindingStop ( ServiceBinding
);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
} else if (NumberOfChildren == 0) {
IpSb->InDestory = TRUE;
@@ -698,10 +698,10 @@ Ip4DriverBindingStop ( ServiceBinding
);
- NetFreePool (IpSb);
+ gBS->FreePool (IpSb);
} else {
- while (!NetListIsEmpty (&IpSb->Children)) {
+ while (!IsListEmpty (&IpSb->Children)) {
IpInstance = NET_LIST_HEAD (&IpSb->Children, IP4_PROTOCOL, Link);
ServiceBinding->DestroyChild (ServiceBinding, IpInstance->Handle);
@@ -714,7 +714,7 @@ Ip4DriverBindingStop ( ON_ERROR:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -752,7 +752,7 @@ Ip4ServiceBindingCreateChild ( }
IpSb = IP4_SERVICE_FROM_PROTOCOL (This);
- IpInstance = NetAllocatePool (sizeof (IP4_PROTOCOL));
+ IpInstance = AllocatePool (sizeof (IP4_PROTOCOL));
if (IpInstance == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -801,12 +801,12 @@ Ip4ServiceBindingCreateChild ( //
// Insert it into the service binding instance.
//
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
- NetListInsertTail (&IpSb->Children, &IpInstance->Link);
+ InsertTailList (&IpSb->Children, &IpInstance->Link);
IpSb->NumChildren++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
ON_ERROR:
@@ -814,7 +814,7 @@ ON_ERROR: Ip4CleanProtocol (IpInstance);
- NetFreePool (IpInstance);
+ gBS->FreePool (IpInstance);
}
return Status;
@@ -879,7 +879,7 @@ Ip4ServiceBindingDestroyChild ( return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// A child can be destoried more than once. For example,
@@ -888,7 +888,7 @@ Ip4ServiceBindingDestroyChild ( // the IP child it opens.
//
if (IpInstance->State == IP4_STATE_DESTORY) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -944,17 +944,17 @@ Ip4ServiceBindingDestroyChild ( goto ON_ERROR;
}
- NetListRemoveEntry (&IpInstance->Link);
+ RemoveEntryList (&IpInstance->Link);
IpSb->NumChildren--;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (IpInstance);
+ gBS->FreePool (IpInstance);
return EFI_SUCCESS;
ON_ERROR:
IpInstance->State = State;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c index 14188851b4..473449cbcf 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Icmp.c @@ -108,7 +108,7 @@ Ip4ProcessIcmpRedirect ( IN IP4_ICMP_ERROR_HEAD *Icmp
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_PROTOCOL *Ip4Instance;
IP4_ROUTE_CACHE_ENTRY *CacheEntry;
IP4_INTERFACE *IpIf;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c index a7a230d6fb..d8f88e14b1 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c @@ -114,7 +114,7 @@ Ip4WrapLinkTxToken ( EFI_STATUS Status;
UINT32 Count;
- Token = NetAllocatePool (sizeof (IP4_LINK_TX_TOKEN) + \
+ Token = AllocatePool (sizeof (IP4_LINK_TX_TOKEN) + \
(Packet->BlockOpNum - 1) * sizeof (EFI_MANAGED_NETWORK_FRAGMENT_DATA));
if (Token == NULL) {
@@ -122,7 +122,7 @@ Ip4WrapLinkTxToken ( }
Token->Signature = IP4_FRAME_TX_SIGNATURE;
- NetListInit (&Token->Link);
+ InitializeListHead (&Token->Link);
Token->Interface = Interface;
Token->IpInstance = IpInstance;
@@ -137,14 +137,14 @@ Ip4WrapLinkTxToken ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4OnFrameSent,
Token,
&MnpToken->Event
);
if (EFI_ERROR (Status)) {
- NetFreePool (Token);
+ gBS->FreePool (Token);
return NULL;
}
@@ -184,7 +184,7 @@ Ip4FreeLinkTxToken ( NET_CHECK_SIGNATURE (Token, IP4_FRAME_TX_SIGNATURE);
gBS->CloseEvent (Token->MnpToken.Event);
- NetFreePool (Token);
+ gBS->FreePool (Token);
}
@@ -208,28 +208,28 @@ Ip4CreateArpQue ( IP4_ARP_QUE *ArpQue;
EFI_STATUS Status;
- ArpQue = NetAllocatePool (sizeof (IP4_ARP_QUE));
+ ArpQue = AllocatePool (sizeof (IP4_ARP_QUE));
if (ArpQue == NULL) {
return NULL;
}
ArpQue->Signature = IP4_FRAME_ARP_SIGNATURE;
- NetListInit (&ArpQue->Link);
+ InitializeListHead (&ArpQue->Link);
- NetListInit (&ArpQue->Frames);
+ InitializeListHead (&ArpQue->Frames);
ArpQue->Interface = Interface;
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4OnArpResolved,
ArpQue,
&ArpQue->OnResolved
);
if (EFI_ERROR (Status)) {
- NetFreePool (ArpQue);
+ gBS->FreePool (ArpQue);
return NULL;
}
@@ -265,7 +265,7 @@ Ip4FreeArpQue ( Ip4CancelFrameArp (ArpQue, IoStatus, NULL, NULL);
gBS->CloseEvent (ArpQue->OnResolved);
- NetFreePool (ArpQue);
+ gBS->FreePool (ArpQue);
}
@@ -294,7 +294,7 @@ Ip4CreateLinkRxToken ( IP4_LINK_RX_TOKEN *Token;
EFI_STATUS Status;
- Token = NetAllocatePool (sizeof (IP4_LINK_RX_TOKEN));
+ Token = AllocatePool (sizeof (IP4_LINK_RX_TOKEN));
if (Token == NULL) {
return NULL;
}
@@ -310,14 +310,14 @@ Ip4CreateLinkRxToken ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4OnFrameReceived,
Token,
&MnpToken->Event
);
if (EFI_ERROR (Status)) {
- NetFreePool (Token);
+ gBS->FreePool (Token);
return NULL;
}
@@ -345,7 +345,7 @@ Ip4FreeFrameRxToken ( NET_CHECK_SIGNATURE (Token, IP4_FRAME_RX_SIGNATURE);
gBS->CloseEvent (Token->MnpToken.Event);
- NetFreePool (Token);
+ gBS->FreePool (Token);
}
@@ -371,15 +371,15 @@ Ip4CancelFrameArp ( IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_LINK_TX_TOKEN *Token;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &ArpQue->Frames) {
Token = NET_LIST_USER_STRUCT (Entry, IP4_LINK_TX_TOKEN, Link);
if ((FrameToCancel == NULL) || FrameToCancel (Token, Context)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Token->CallBack (Token->IpInstance, Token->Packet, IoStatus, 0, Token->Context);
Ip4FreeLinkTxToken (Token);
@@ -411,8 +411,8 @@ Ip4CancelFrames ( IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ARP_QUE *ArpQue;
IP4_LINK_TX_TOKEN *Token;
@@ -424,7 +424,7 @@ Ip4CancelFrames ( Ip4CancelFrameArp (ArpQue, IoStatus, FrameToCancel, Context);
- if (NetListIsEmpty (&ArpQue->Frames)) {
+ if (IsListEmpty (&ArpQue->Frames)) {
Interface->Arp->Cancel (Interface->Arp, &ArpQue->Ip, ArpQue->OnResolved);
}
}
@@ -466,14 +466,14 @@ Ip4CreateInterface ( IP4_INTERFACE *Interface;
EFI_SIMPLE_NETWORK_MODE SnpMode;
- Interface = NetAllocatePool (sizeof (IP4_INTERFACE));
+ Interface = AllocatePool (sizeof (IP4_INTERFACE));
if ((Interface == NULL) || (Mnp == NULL)) {
return NULL;
}
Interface->Signature = IP4_INTERFACE_SIGNATURE;
- NetListInit (&Interface->Link);
+ InitializeListHead (&Interface->Link);
Interface->RefCnt = 1;
Interface->Ip = IP4_ALLZERO_ADDRESS;
@@ -486,8 +486,8 @@ Ip4CreateInterface ( Interface->Arp = NULL;
Interface->ArpHandle = NULL;
- NetListInit (&Interface->ArpQues);
- NetListInit (&Interface->SentFrames);
+ InitializeListHead (&Interface->ArpQues);
+ InitializeListHead (&Interface->SentFrames);
Interface->RecvRequest = NULL;
@@ -495,7 +495,7 @@ Ip4CreateInterface ( // Get the interface's Mac address and broadcast mac address from SNP
//
if (EFI_ERROR (Mnp->GetModeData (Mnp, NULL, &SnpMode))) {
- NetFreePool (Interface);
+ gBS->FreePool (Interface);
return NULL;
}
@@ -503,7 +503,7 @@ Ip4CreateInterface ( CopyMem (&Interface->BroadcastMac, &SnpMode.BroadcastAddress, sizeof (Interface->BroadcastMac));
Interface->HwaddrLen = SnpMode.HwAddressSize;
- NetListInit (&Interface->IpInstances);
+ InitializeListHead (&Interface->IpInstances);
Interface->PromiscRecv = FALSE;
return Interface;
@@ -677,12 +677,12 @@ Ip4CancelReceive ( IP4_LINK_RX_TOKEN *Token;
if ((Token = Interface->RecvRequest) != NULL) {
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
Interface->RecvRequest = NULL;
Interface->Mnp->Cancel (Interface->Mnp, &Token->MnpToken);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
}
}
@@ -728,9 +728,9 @@ Ip4FreeInterface ( Ip4CancelFrames (Interface, EFI_ABORTED, Ip4CancelInstanceFrame, NULL);
Ip4CancelReceive (Interface);
- ASSERT (NetListIsEmpty (&Interface->IpInstances));
- ASSERT (NetListIsEmpty (&Interface->ArpQues));
- ASSERT (NetListIsEmpty (&Interface->SentFrames));
+ ASSERT (IsListEmpty (&Interface->IpInstances));
+ ASSERT (IsListEmpty (&Interface->ArpQues));
+ ASSERT (IsListEmpty (&Interface->SentFrames));
if (Interface->Arp != NULL) {
gBS->CloseProtocol (
@@ -748,8 +748,8 @@ Ip4FreeInterface ( );
}
- NetListRemoveEntry (&Interface->Link);
- NetFreePool (Interface);
+ RemoveEntryList (&Interface->Link);
+ gBS->FreePool (Interface);
return EFI_SUCCESS;
}
@@ -773,8 +773,8 @@ Ip4OnArpResolvedDpc ( IN VOID *Context
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ARP_QUE *ArpQue;
IP4_INTERFACE *Interface;
IP4_LINK_TX_TOKEN *Token;
@@ -783,7 +783,7 @@ Ip4OnArpResolvedDpc ( ArpQue = (IP4_ARP_QUE *) Context;
NET_CHECK_SIGNATURE (ArpQue, IP4_FRAME_ARP_SIGNATURE);
- NetListRemoveEntry (&ArpQue->Link);
+ RemoveEntryList (&ArpQue->Link);
//
// ARP resolve failed for some reason. Release all the frame
@@ -804,7 +804,7 @@ Ip4OnArpResolvedDpc ( Interface = ArpQue->Interface;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &ArpQue->Frames) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Token = NET_LIST_USER_STRUCT (Entry, IP4_LINK_TX_TOKEN, Link);
CopyMem (&Token->DstMac, &ArpQue->Mac, sizeof (Token->DstMac));
@@ -816,11 +816,11 @@ Ip4OnArpResolvedDpc ( // Status of Mnp->Transmit is not EFI_SUCCESS as in this case the
// FrameSentDpc won't be queued.
//
- NetListInsertTail (&Interface->SentFrames, &Token->Link);
+ InsertTailList (&Interface->SentFrames, &Token->Link);
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
if (EFI_ERROR (Status)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Token->CallBack (Token->IpInstance, Token->Packet, Status, 0, Token->Context);
Ip4FreeLinkTxToken (Token);
@@ -884,7 +884,7 @@ Ip4OnFrameSentDpc ( Token = (IP4_LINK_TX_TOKEN *) Context;
NET_CHECK_SIGNATURE (Token, IP4_FRAME_TX_SIGNATURE);
- NetListRemoveEntry (&Token->Link);
+ RemoveEntryList (&Token->Link);
Token->CallBack (
Token->IpInstance,
@@ -961,7 +961,7 @@ Ip4SendFrame ( )
{
IP4_LINK_TX_TOKEN *Token;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ARP_QUE *ArpQue;
EFI_ARP_PROTOCOL *Arp;
EFI_STATUS Status;
@@ -1034,7 +1034,7 @@ Ip4SendFrame ( // Found a pending ARP request, enqueue the frame then return
//
if (Entry != &Interface->ArpQues) {
- NetListInsertTail (&ArpQue->Frames, &Token->Link);
+ InsertTailList (&ArpQue->Frames, &Token->Link);
return EFI_SUCCESS;
}
@@ -1055,8 +1055,8 @@ Ip4SendFrame ( goto ON_ERROR;
}
- NetListInsertHead (&ArpQue->Frames, &Token->Link);
- NetListInsertHead (&Interface->ArpQues, &ArpQue->Link);
+ InsertHeadList (&ArpQue->Frames, &Token->Link);
+ InsertHeadList (&Interface->ArpQues, &ArpQue->Link);
return EFI_SUCCESS;
SEND_NOW:
@@ -1064,10 +1064,10 @@ SEND_NOW: // Insert the tx token into the SentFrames list before calling Mnp->Transmit.
// Remove it if the returned status is not EFI_SUCCESS.
//
- NetListInsertTail (&Interface->SentFrames, &Token->Link);
+ InsertTailList (&Interface->SentFrames, &Token->Link);
Status = Interface->Mnp->Transmit (Interface->Mnp, &Token->MnpToken);
if (EFI_ERROR (Status)) {
- NetListRemoveEntry (&Interface->SentFrames);
+ RemoveEntryList (&Interface->SentFrames);
goto ON_ERROR;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h index 22db034a0a..e807516408 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.h @@ -79,7 +79,7 @@ typedef struct { //
typedef struct {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
IP4_INTERFACE *Interface;
@@ -103,9 +103,9 @@ typedef struct { //
typedef struct {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
- NET_LIST_ENTRY Frames;
+ LIST_ENTRY Frames;
IP4_INTERFACE *Interface;
//
@@ -136,7 +136,7 @@ BOOLEAN //
struct _IP4_INTERFACE {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
//
@@ -164,8 +164,8 @@ struct _IP4_INTERFACE { //
// Queues to keep the frames sent and waiting ARP request.
//
- NET_LIST_ENTRY ArpQues;
- NET_LIST_ENTRY SentFrames;
+ LIST_ENTRY ArpQues;
+ LIST_ENTRY SentFrames;
IP4_LINK_RX_TOKEN *RecvRequest;
//
@@ -180,7 +180,7 @@ struct _IP4_INTERFACE { // together through IpInstances. If any of the instance enables
// promiscuous receive, PromiscRecv is true.
//
- NET_LIST_ENTRY IpInstances;
+ LIST_ENTRY IpInstances;
BOOLEAN PromiscRecv;
};
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c index 70fbebdc44..4fbabe2f36 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c @@ -56,7 +56,7 @@ Ip4InitIgmp ( //
// Configure MNP to receive ALL_SYSTEM multicast
//
- Group = NetAllocatePool (sizeof (IGMP_GROUP));
+ Group = AllocatePool (sizeof (IGMP_GROUP));
if (Group == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -81,11 +81,11 @@ Ip4InitIgmp ( goto ON_ERROR;
}
- NetListInsertHead (&IgmpCtrl->Groups, &Group->Link);
+ InsertHeadList (&IgmpCtrl->Groups, &Group->Link);
return EFI_SUCCESS;
ON_ERROR:
- NetFreePool (Group);
+ gBS->FreePool (Group);
return Status;
}
@@ -108,7 +108,7 @@ Ip4FindGroup ( IN IP4_ADDR Address
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IGMP_GROUP *Group;
NET_LIST_FOR_EACH (Entry, &IgmpCtrl->Groups) {
@@ -141,7 +141,7 @@ Ip4FindMac ( IN EFI_MAC_ADDRESS *Mac
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IGMP_GROUP *Group;
INTN Count;
@@ -298,7 +298,7 @@ Ip4JoinGroup ( // Otherwise, create a new IGMP_GROUP, Get the multicast's MAC address,
// send a report, then direct MNP to receive the multicast.
//
- Group = NetAllocatePool (sizeof (IGMP_GROUP));
+ Group = AllocatePool (sizeof (IGMP_GROUP));
if (Group == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -327,11 +327,11 @@ Ip4JoinGroup ( goto ON_ERROR;
}
- NetListInsertHead (&IgmpCtrl->Groups, &Group->Link);
+ InsertHeadList (&IgmpCtrl->Groups, &Group->Link);
return EFI_SUCCESS;
ON_ERROR:
- NetFreePool (Group);
+ gBS->FreePool (Group);
return Status;
}
@@ -399,8 +399,8 @@ Ip4LeaveGroup ( Ip4SendIgmpMessage (IpSb, IP4_ALLROUTER_ADDRESS, IGMP_LEAVE_GROUP, Group->Address);
}
- NetListRemoveEntry (&Group->Link);
- NetFreePool (Group);
+ RemoveEntryList (&Group->Link);
+ gBS->FreePool (Group);
return EFI_SUCCESS;
}
@@ -428,7 +428,7 @@ Ip4IgmpHandle ( IGMP_HEAD Igmp;
IGMP_GROUP *Group;
IP4_ADDR Address;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IgmpCtrl = &IpSb->IgmpCtrl;
@@ -526,7 +526,7 @@ Ip4IgmpTicking ( )
{
IGMP_SERVICE_DATA *IgmpCtrl;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IGMP_GROUP *Group;
IgmpCtrl = &IpSb->IgmpCtrl;
@@ -578,13 +578,13 @@ Ip4CombineGroups ( {
IP4_ADDR *Groups;
- Groups = NetAllocatePool (sizeof (IP4_ADDR) * (Count + 1));
+ Groups = AllocatePool (sizeof (IP4_ADDR) * (Count + 1));
if (Groups == NULL) {
return NULL;
}
- NetCopyMem (Groups, Source, Count * sizeof (IP4_ADDR));
+ CopyMem (Groups, Source, Count * sizeof (IP4_ADDR));
Groups[Count] = Addr;
return Groups;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h index 0b61874632..8c01d1f629 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.h @@ -38,7 +38,7 @@ typedef struct { // "idle member" state.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
IP4_ADDR Address;
INTN DelayTime;
@@ -53,7 +53,7 @@ typedef struct { //
typedef struct {
INTN Igmpv1QuerySeen;
- NET_LIST_ENTRY Groups;
+ LIST_ENTRY Groups;
} IGMP_SERVICE_DATA;
enum {
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c index 04ca79578f..d1302acaa3 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c @@ -57,7 +57,7 @@ EfiIp4GetModeData ( return EFI_INVALID_PARAMETER;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
IpSb = IpInstance->Service;
@@ -89,10 +89,10 @@ EfiIp4GetModeData ( Config = &Ip4ModeData->ConfigData;
Ip = HTONL (IpInstance->Interface->Ip);
- NetCopyMem (&Config->StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Config->StationAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip = HTONL (IpInstance->Interface->SubnetMask);
- NetCopyMem (&Config->SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Config->SubnetMask, &Ip, sizeof (EFI_IPv4_ADDRESS));
Ip4ModeData->IsConfigured = IpInstance->Interface->Configured;
@@ -102,7 +102,7 @@ EfiIp4GetModeData ( Status = Ip4BuildEfiRouteTable (IpInstance);
if (EFI_ERROR (Status)) {
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -119,7 +119,7 @@ EfiIp4GetModeData ( CopyMem (SnpModeData, &IpSb->SnpMode, sizeof (*SnpModeData));
}
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
}
@@ -148,8 +148,8 @@ Ip4ServiceConfigMnp ( IN BOOLEAN Force
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *ProtoEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *ProtoEntry;
IP4_INTERFACE *IpIf;
IP4_PROTOCOL *IpInstance;
BOOLEAN Reconfig;
@@ -271,7 +271,7 @@ Ip4AutoConfigCallBackDpc ( Ip4FreeRouteTable (IpSb->DefaultRouteTable);
IpSb->DefaultInterface = IpIf;
- NetListInsertHead (&IpSb->Interfaces, &IpIf->Link);
+ InsertHeadList (&IpSb->Interfaces, &IpIf->Link);
IpSb->DefaultRouteTable = RouteTable;
Ip4ReceiveFrame (IpIf, NULL, Ip4AccpetFrame, IpSb);
@@ -291,7 +291,7 @@ Ip4AutoConfigCallBackDpc ( return ;
}
- Data = NetAllocatePool (Len);
+ Data = AllocatePool (Len);
if (Data == NULL) {
return ;
@@ -355,7 +355,7 @@ Ip4AutoConfigCallBackDpc ( Ip4SetVariableData (IpSb);
ON_EXIT:
- NetFreePool (Data);
+ gBS->FreePool (Data);
}
VOID
@@ -421,7 +421,7 @@ Ip4StartAutoConfig ( //
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_LOCK,
+ TPL_CALLBACK,
Ip4AutoConfigCallBack,
IpSb,
&IpSb->DoneEvent
@@ -433,7 +433,7 @@ Ip4StartAutoConfig ( Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_EVENT,
+ TPL_NOTIFY,
Ip4AutoConfigCallBack,
IpSb,
&IpSb->ReconfigEvent
@@ -506,21 +506,21 @@ Ip4InitProtocol ( {
ASSERT ((IpSb != NULL) && (IpInstance != NULL));
- NetZeroMem (IpInstance, sizeof (IP4_PROTOCOL));
+ ZeroMem (IpInstance, sizeof (IP4_PROTOCOL));
IpInstance->Signature = IP4_PROTOCOL_SIGNATURE;
CopyMem (&IpInstance->Ip4Proto, &mEfiIp4ProtocolTemplete, sizeof (IpInstance->Ip4Proto));
IpInstance->State = IP4_STATE_UNCONFIGED;
IpInstance->Service = IpSb;
- NetListInit (&IpInstance->Link);
+ InitializeListHead (&IpInstance->Link);
NetMapInit (&IpInstance->RxTokens);
NetMapInit (&IpInstance->TxTokens);
- NetListInit (&IpInstance->Received);
- NetListInit (&IpInstance->Delivered);
- NetListInit (&IpInstance->AddrLink);
+ InitializeListHead (&IpInstance->Received);
+ InitializeListHead (&IpInstance->Delivered);
+ InitializeListHead (&IpInstance->AddrLink);
- NET_RECYCLE_LOCK_INIT (&IpInstance->RecycleLock);
+ EfiInitializeLock (&IpInstance->RecycleLock, TPL_NOTIFY);
}
@@ -589,8 +589,8 @@ Ip4ConfigProtocol ( //
// Set up the interface.
//
- NetCopyMem (&Ip, &Config->StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Netmask, &Config->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Ip, &Config->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Netmask, &Config->SubnetMask, sizeof (IP4_ADDR));
Ip = NTOHL (Ip);
Netmask = NTOHL (Netmask);
@@ -621,7 +621,7 @@ Ip4ConfigProtocol ( goto ON_ERROR;
}
- NetListInsertTail (&IpSb->Interfaces, &IpIf->Link);
+ InsertTailList (&IpSb->Interfaces, &IpIf->Link);
}
//
@@ -657,7 +657,7 @@ Ip4ConfigProtocol ( }
IpInstance->Interface = IpIf;
- NetListInsertTail (&IpIf->IpInstances, &IpInstance->AddrLink);
+ InsertTailList (&IpIf->IpInstances, &IpInstance->AddrLink);
CopyMem (&IpInstance->ConfigData, Config, sizeof (IpInstance->ConfigData));
IpInstance->State = IP4_STATE_CONFIGED;
@@ -707,12 +707,12 @@ Ip4CleanProtocol ( // user forgets to recycle the packets, or because the callback
// hasn't been called. Just leave it alone.
//
- if (!NetListIsEmpty (&IpInstance->Delivered)) {
+ if (!IsListEmpty (&IpInstance->Delivered)) {
;
}
if (IpInstance->Interface != NULL) {
- NetListRemoveEntry (&IpInstance->AddrLink);
+ RemoveEntryList (&IpInstance->AddrLink);
Ip4FreeInterface (IpInstance->Interface, IpInstance);
IpInstance->Interface = NULL;
}
@@ -727,13 +727,13 @@ Ip4CleanProtocol ( }
if (IpInstance->EfiRouteTable != NULL) {
- NetFreePool (IpInstance->EfiRouteTable);
+ gBS->FreePool (IpInstance->EfiRouteTable);
IpInstance->EfiRouteTable = NULL;
IpInstance->EfiRouteCount = 0;
}
if (IpInstance->Groups != NULL) {
- NetFreePool (IpInstance->Groups);
+ gBS->FreePool (IpInstance->Groups);
IpInstance->Groups = NULL;
IpInstance->GroupCount = 0;
}
@@ -845,7 +845,7 @@ EfiIp4Configure ( }
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Validate the configuration first.
@@ -860,8 +860,8 @@ EfiIp4Configure ( }
- NetCopyMem (&IpAddress, &IpConfigData->StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&SubnetMask, &IpConfigData->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&IpAddress, &IpConfigData->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&SubnetMask, &IpConfigData->SubnetMask, sizeof (IP4_ADDR));
IpAddress = NTOHL (IpAddress);
SubnetMask = NTOHL (SubnetMask);
@@ -935,7 +935,7 @@ EfiIp4Configure ( Ip4SetVariableData (IpInstance->Service);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -973,7 +973,7 @@ Ip4Groups ( // host byte order
//
if (JoinFlag) {
- NetCopyMem (&Group, GroupAddress, sizeof (IP4_ADDR));
+ CopyMem (&Group, GroupAddress, sizeof (IP4_ADDR));
for (Index = 0; Index < IpInstance->GroupCount; Index++) {
if (IpInstance->Groups[Index] == Group) {
@@ -988,12 +988,12 @@ Ip4Groups ( }
if (EFI_ERROR (Ip4JoinGroup (IpInstance, NTOHL (Group)))) {
- NetFreePool (Members);
+ gBS->FreePool (Members);
return EFI_DEVICE_ERROR;
}
if (IpInstance->Groups != NULL) {
- NetFreePool (IpInstance->Groups);
+ gBS->FreePool (IpInstance->Groups);
}
IpInstance->Groups = Members;
@@ -1021,7 +1021,7 @@ Ip4Groups ( if (IpInstance->GroupCount == 0) {
ASSERT (Index == 1);
- NetFreePool (IpInstance->Groups);
+ gBS->FreePool (IpInstance->Groups);
IpInstance->Groups = NULL;
}
@@ -1069,7 +1069,7 @@ EfiIp4Groups ( }
if (GroupAddress != NULL) {
- NetCopyMem (&McastIp, GroupAddress, sizeof (IP4_ADDR));
+ CopyMem (&McastIp, GroupAddress, sizeof (IP4_ADDR));
if (!IP4_IS_MULTICAST (NTOHL (McastIp))) {
return EFI_INVALID_PARAMETER;
@@ -1077,7 +1077,7 @@ EfiIp4Groups ( }
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1092,7 +1092,7 @@ EfiIp4Groups ( Status = Ip4Groups (IpInstance, JoinFlag, GroupAddress);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1140,7 +1140,7 @@ EfiIp4Routes ( }
IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1152,9 +1152,9 @@ EfiIp4Routes ( goto ON_EXIT;
}
- NetCopyMem (&Dest, SubnetAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Netmask, SubnetMask, sizeof (IP4_ADDR));
- NetCopyMem (&Nexthop, GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&Dest, SubnetAddress, sizeof (IP4_ADDR));
+ CopyMem (&Netmask, SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&Nexthop, GatewayAddress, sizeof (IP4_ADDR));
Dest = NTOHL (Dest);
Netmask = NTOHL (Netmask);
@@ -1185,7 +1185,7 @@ EfiIp4Routes ( }
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1301,8 +1301,8 @@ Ip4TxTokenValid ( if (TxData->OverrideData) {
Override = TxData->OverrideData;
- NetCopyMem (&Src, &Override->SourceAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Gateway, &Override->GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&Src, &Override->SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&Gateway, &Override->GatewayAddress, sizeof (IP4_ADDR));
Src = NTOHL (Src);
Gateway = NTOHL (Gateway);
@@ -1395,7 +1395,7 @@ Ip4FreeTxToken ( NetLibDispatchDpc ();
}
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
}
@@ -1490,7 +1490,7 @@ EfiIp4Transmit ( return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
IpSb = IpInstance->Service;
IpIf = IpInstance->Interface;
@@ -1524,7 +1524,7 @@ EfiIp4Transmit ( //
TxData = Token->Packet.TxData;
- NetCopyMem (&Head.Dst, &TxData->DestinationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Head.Dst, &TxData->DestinationAddress, sizeof (IP4_ADDR));
Head.Dst = NTOHL (Head.Dst);
if (TxData->OverrideData) {
@@ -1534,8 +1534,8 @@ EfiIp4Transmit ( Head.Ttl = Override->TimeToLive;
DontFragment = Override->DoNotFragment;
- NetCopyMem (&Head.Src, &Override->SourceAddress, sizeof (IP4_ADDR));
- NetCopyMem (&GateWay, &Override->GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&Head.Src, &Override->SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&GateWay, &Override->GatewayAddress, sizeof (IP4_ADDR));
Head.Src = NTOHL (Head.Src);
GateWay = NTOHL (GateWay);
@@ -1564,7 +1564,7 @@ EfiIp4Transmit ( // a IP4_TXTOKEN_WRAP and the data in a netbuf
//
Status = EFI_OUT_OF_RESOURCES;
- Wrap = NetAllocatePool (sizeof (IP4_TXTOKEN_WRAP));
+ Wrap = AllocatePool (sizeof (IP4_TXTOKEN_WRAP));
if (Wrap == NULL) {
goto ON_EXIT;
}
@@ -1583,7 +1583,7 @@ EfiIp4Transmit ( );
if (Wrap->Packet == NULL) {
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
goto ON_EXIT;
}
@@ -1623,7 +1623,7 @@ EfiIp4Transmit ( }
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1665,7 +1665,7 @@ EfiIp4Receive ( IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1673,18 +1673,6 @@ EfiIp4Receive ( }
//
- // Current Udp implementation creates an IP child for each Udp child.
- // It initates a asynchronous receive immediately no matter whether
- // there is no mapping or not. Disable this for now.
- //
-#if 0
- if (Config->UseDefaultAddress && IP4_NO_MAPPING (IpInstance)) {
- Status = EFI_NO_MAPPING;
- goto ON_EXIT;
- }
-#endif
-
- //
// Check whether the toke is already on the receive queue.
//
Status = NetMapIterate (&IpInstance->RxTokens, Ip4TokenExist, Token);
@@ -1712,7 +1700,7 @@ EfiIp4Receive ( NetLibDispatchDpc ();
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -1931,7 +1919,7 @@ EfiIp4Cancel ( IpInstance = IP4_INSTANCE_FROM_PROTOCOL (This);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (IpInstance->State != IP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
@@ -1946,7 +1934,7 @@ EfiIp4Cancel ( Status = Ip4Cancel (IpInstance, Token);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h index 94b4534de2..fa7eff97f9 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.h @@ -103,7 +103,7 @@ typedef struct { // fragments will be freed at last.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
IP4_PROTOCOL *IpInstance;
NET_BUF *Packet;
EFI_IP4_RECEIVE_DATA RxData;
@@ -117,15 +117,15 @@ struct _IP4_PROTOCOL { INTN State;
IP4_SERVICE *Service;
- NET_LIST_ENTRY Link; // Link to all the IP protocol from the service
+ LIST_ENTRY Link; // Link to all the IP protocol from the service
//
// User's transmit/receive tokens, and received/deliverd packets
//
NET_MAP RxTokens;
NET_MAP TxTokens; // map between (User's Token, IP4_TXTOKE_WRAP)
- NET_LIST_ENTRY Received; // Received but not delivered packet
- NET_LIST_ENTRY Delivered; // Delivered and to be recycled packets
+ LIST_ENTRY Received; // Received but not delivered packet
+ LIST_ENTRY Delivered; // Delivered and to be recycled packets
EFI_LOCK RecycleLock;
//
@@ -134,7 +134,7 @@ struct _IP4_PROTOCOL { // is used to communicate the current route info to the upper layer.
//
IP4_INTERFACE *Interface;
- NET_LIST_ENTRY AddrLink; // Ip instances with the same IP address.
+ LIST_ENTRY AddrLink; // Ip instances with the same IP address.
IP4_ROUTE_TABLE *RouteTable;
EFI_IP4_ROUTE_TABLE *EfiRouteTable;
@@ -161,9 +161,9 @@ struct _IP4_SERVICE { // interface and route table and caches.
//
UINTN NumChildren;
- NET_LIST_ENTRY Children;
+ LIST_ENTRY Children;
- NET_LIST_ENTRY Interfaces;
+ LIST_ENTRY Interfaces;
IP4_INTERFACE *DefaultInterface;
IP4_ROUTE_TABLE *DefaultRouteTable;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c index 06a0110315..9498d056e1 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2005 - 2007, Intel Corporation
+Copyright (c) 2005 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -49,14 +49,14 @@ Ip4CreateAssembleEntry ( IP4_ASSEMBLE_ENTRY *Assemble;
- Assemble = NetAllocatePool (sizeof (IP4_ASSEMBLE_ENTRY));
+ Assemble = AllocatePool (sizeof (IP4_ASSEMBLE_ENTRY));
if (Assemble == NULL) {
return NULL;
}
- NetListInit (&Assemble->Link);
- NetListInit (&Assemble->Fragments);
+ InitializeListHead (&Assemble->Link);
+ InitializeListHead (&Assemble->Fragments);
Assemble->Dst = Dst;
Assemble->Src = Src;
@@ -86,18 +86,18 @@ Ip4FreeAssembleEntry ( IN IP4_ASSEMBLE_ENTRY *Assemble
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
NET_BUF *Fragment;
NET_LIST_FOR_EACH_SAFE (Entry, Next, &Assemble->Fragments) {
Fragment = NET_LIST_USER_STRUCT (Entry, NET_BUF, List);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
NetbufFree (Fragment);
}
- NetFreePool (Assemble);
+ gBS->FreePool (Assemble);
}
@@ -118,7 +118,7 @@ Ip4InitAssembleTable ( UINT32 Index;
for (Index = 0; Index < IP4_ASSEMLE_HASH_SIZE; Index++) {
- NetListInit (&Table->Bucket[Index]);
+ InitializeListHead (&Table->Bucket[Index]);
}
}
@@ -137,8 +137,8 @@ Ip4CleanAssembleTable ( IN IP4_ASSEMBLE_TABLE *Table
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ASSEMBLE_ENTRY *Assemble;
UINT32 Index;
@@ -146,7 +146,7 @@ Ip4CleanAssembleTable ( NET_LIST_FOR_EACH_SAFE (Entry, Next, &Table->Bucket[Index]) {
Assemble = NET_LIST_USER_STRUCT (Entry, IP4_ASSEMBLE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeAssembleEntry (Assemble);
}
}
@@ -242,9 +242,9 @@ Ip4Reassemble ( IP4_CLIP_INFO *This;
IP4_CLIP_INFO *Node;
IP4_ASSEMBLE_ENTRY *Assemble;
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Prev;
- NET_LIST_ENTRY *Cur;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Prev;
+ LIST_ENTRY *Cur;
NET_BUF *Fragment;
NET_BUF *NewPacket;
INTN Index;
@@ -284,7 +284,7 @@ Ip4Reassemble ( goto DROP;
}
- NetListInsertHead (&Table->Bucket[Index], &Assemble->Link);
+ InsertHeadList (&Table->Bucket[Index], &Assemble->Link);
}
//
@@ -344,7 +344,7 @@ Ip4Reassemble ( if (Node->End <= This->End) {
Cur = Cur->ForwardLink;
- NetListRemoveEntry (&Fragment->List);
+ RemoveEntryList (&Fragment->List);
Assemble->CurLen -= Node->Length;
NetbufFree (Fragment);
@@ -359,7 +359,7 @@ Ip4Reassemble ( //
if (Node->Start < This->End) {
if (This->Start == Node->Start) {
- NetListRemoveEntry (&Packet->List);
+ RemoveEntryList (&Packet->List);
goto DROP;
}
@@ -404,7 +404,7 @@ Ip4Reassemble ( //
if ((Assemble->TotalLen != 0) && (Assemble->CurLen >= Assemble->TotalLen)) {
- NetListRemoveEntry (&Assemble->Link);
+ RemoveEntryList (&Assemble->Link);
//
// If the packet is properly formated, the last fragment's End
@@ -779,7 +779,7 @@ Ip4InstanceEnquePacket ( Info = IP4_GET_CLIP_INFO (Clone);
Info->Life = IP4_US_TO_SEC (IpInstance->ConfigData.ReceiveTimeout);
- NetListInsertTail (&IpInstance->Received, &Clone->List);
+ InsertTailList (&IpInstance->Received, &Clone->List);
return EFI_SUCCESS;
}
@@ -807,15 +807,15 @@ Ip4OnRecyclePacket ( Wrap = (IP4_RXDATA_WRAP *) Context;
- NET_TRYLOCK (&Wrap->IpInstance->RecycleLock);
- NetListRemoveEntry (&Wrap->Link);
- NET_UNLOCK (&Wrap->IpInstance->RecycleLock);
+ EfiAcquireLockOrFail (&Wrap->IpInstance->RecycleLock);
+ RemoveEntryList (&Wrap->Link);
+ EfiReleaseLock (&Wrap->IpInstance->RecycleLock);
ASSERT (!NET_BUF_SHARED (Wrap->Packet));
NetbufFree (Wrap->Packet);
gBS->CloseEvent (Wrap->RxData.RecycleSignal);
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
}
@@ -843,30 +843,30 @@ Ip4WrapRxData ( EFI_IP4_RECEIVE_DATA *RxData;
EFI_STATUS Status;
- Wrap = NetAllocatePool (IP4_RXDATA_WRAP_SIZE (Packet->BlockOpNum));
+ Wrap = AllocatePool (IP4_RXDATA_WRAP_SIZE (Packet->BlockOpNum));
if (Wrap == NULL) {
return NULL;
}
- NetListInit (&Wrap->Link);
+ InitializeListHead (&Wrap->Link);
Wrap->IpInstance = IpInstance;
Wrap->Packet = Packet;
RxData = &Wrap->RxData;
- NetZeroMem (&RxData->TimeStamp, sizeof (EFI_TIME));
+ ZeroMem (&RxData->TimeStamp, sizeof (EFI_TIME));
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_RECYCLE,
+ TPL_NOTIFY,
Ip4OnRecyclePacket,
Wrap,
&RxData->RecycleSignal
);
if (EFI_ERROR (Status)) {
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
return NULL;
}
@@ -925,7 +925,7 @@ Ip4InstanceDeliverPacket ( //
// Deliver a packet if there are both a packet and a receive token.
//
- while (!NetListIsEmpty (&IpInstance->Received) &&
+ while (!IsListEmpty (&IpInstance->Received) &&
!NetMapIsEmpty (&IpInstance->RxTokens)) {
Packet = NET_LIST_HEAD (&IpInstance->Received, NET_BUF, List);
@@ -940,7 +940,7 @@ Ip4InstanceDeliverPacket ( return EFI_OUT_OF_RESOURCES;
}
- NetListRemoveEntry (&Packet->List);
+ RemoveEntryList (&Packet->List);
} else {
//
@@ -960,7 +960,7 @@ Ip4InstanceDeliverPacket ( Head = NetbufAllocSpace (Dup, IP4_MAX_HEADLEN, NET_BUF_HEAD);
Dup->Ip = (IP4_HEAD *) Head;
- NetCopyMem (Head, Packet->Ip, Packet->Ip->HeadLen << 2);
+ CopyMem (Head, Packet->Ip, Packet->Ip->HeadLen << 2);
NetbufTrim (Dup, IP4_MAX_HEADLEN, TRUE);
Wrap = Ip4WrapRxData (IpInstance, Dup);
@@ -970,7 +970,7 @@ Ip4InstanceDeliverPacket ( return EFI_OUT_OF_RESOURCES;
}
- NetListRemoveEntry (&Packet->List);
+ RemoveEntryList (&Packet->List);
NetbufFree (Packet);
Packet = Dup;
@@ -980,9 +980,9 @@ Ip4InstanceDeliverPacket ( // Insert it into the delivered packet, then get a user's
// receive token, pass the wrapped packet up.
//
- NET_TRYLOCK (&IpInstance->RecycleLock);
- NetListInsertHead (&IpInstance->Delivered, &Wrap->Link);
- NET_UNLOCK (&IpInstance->RecycleLock);
+ EfiAcquireLockOrFail (&IpInstance->RecycleLock);
+ InsertHeadList (&IpInstance->Delivered, &Wrap->Link);
+ EfiReleaseLock (&IpInstance->RecycleLock);
Token = NetMapRemoveHead (&IpInstance->RxTokens, NULL);
Token->Status = IP4_GET_CLIP_INFO (Packet)->Status;
@@ -1017,7 +1017,7 @@ Ip4InterfaceEnquePacket ( {
IP4_PROTOCOL *IpInstance;
IP4_CLIP_INFO *Info;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
INTN Enqueued;
INTN LocalType;
INTN SavedType;
@@ -1103,7 +1103,7 @@ Ip4InterfaceDeliverPacket ( )
{
IP4_PROTOCOL *Ip4Instance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
NET_LIST_FOR_EACH (Entry, &IpIf->IpInstances) {
Ip4Instance = NET_LIST_USER_STRUCT (Entry, IP4_PROTOCOL, AddrLink);
@@ -1139,7 +1139,7 @@ Ip4Demultiplex ( IN NET_BUF *Packet
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_INTERFACE *IpIf;
INTN Enqueued;
@@ -1193,9 +1193,9 @@ Ip4PacketTimerTicking ( IN IP4_SERVICE *IpSb
)
{
- NET_LIST_ENTRY *InstanceEntry;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *InstanceEntry;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_PROTOCOL *IpInstance;
IP4_ASSEMBLE_ENTRY *Assemble;
NET_BUF *Packet;
@@ -1211,7 +1211,7 @@ Ip4PacketTimerTicking ( Assemble = NET_LIST_USER_STRUCT (Entry, IP4_ASSEMBLE_ENTRY, Link);
if ((Assemble->Life > 0) && (--Assemble->Life == 0)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeAssembleEntry (Assemble);
}
}
@@ -1228,7 +1228,7 @@ Ip4PacketTimerTicking ( Info = IP4_GET_CLIP_INFO (Packet);
if ((Info->Life > 0) && (--Info->Life == 0)) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
NetbufFree (Packet);
}
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h index af8ed1adf3..d44029d085 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.h @@ -54,7 +54,7 @@ typedef struct { // Structure used to assemble IP packets.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
//
// Identity of one IP4 packet. Each fragment of a packet has
@@ -67,7 +67,7 @@ typedef struct { INTN TotalLen;
INTN CurLen;
- NET_LIST_ENTRY Fragments; // List of all the fragments of this packet
+ LIST_ENTRY Fragments; // List of all the fragments of this packet
IP4_HEAD *Head; // IP head of the first fragment
IP4_CLIP_INFO *Info; // Per packet info of the first fragment
@@ -80,7 +80,7 @@ typedef struct { // as hash table.
//
typedef struct {
- NET_LIST_ENTRY Bucket[IP4_ASSEMLE_HASH_SIZE];
+ LIST_ENTRY Bucket[IP4_ASSEMLE_HASH_SIZE];
} IP4_ASSEMBLE_TABLE;
#define IP4_GET_CLIP_INFO(Packet) ((IP4_CLIP_INFO *) ((Packet)->ProtoData))
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c index 322166f657..f3caf6e03d 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Option.c @@ -181,7 +181,7 @@ Ip4CopyOption ( // don't copy options that is only valid for the first fragment
//
if (FirstFragment || (Type & IP4_OPTION_COPY_MASK)) {
- NetCopyMem (OptBuf + Next, Option + Cur, Len);
+ CopyMem (OptBuf + Next, Option + Cur, Len);
Next += Len;
}
@@ -224,8 +224,8 @@ Ip4CopyOption ( // Copy the option to the Buf, zero the buffer first to pad
// the options with NOP to align to 4 bytes.
//
- NetZeroMem (Buf, Len);
- NetCopyMem (Buf, OptBuf, Next);
+ ZeroMem (Buf, Len);
+ CopyMem (Buf, OptBuf, Next);
*BufLen = Len;
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c index 8aec74ddce..1a925cf936 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Output.c @@ -118,7 +118,7 @@ Ip4SelectInterface ( {
IP4_INTERFACE *IpIf;
IP4_INTERFACE *Selected;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
//
// Select the interface the Dst is on if one of the connected
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c index 54d934250f..fed1983515 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c @@ -44,13 +44,13 @@ Ip4CreateRouteEntry ( {
IP4_ROUTE_ENTRY *RtEntry;
- RtEntry = NetAllocatePool (sizeof (IP4_ROUTE_ENTRY));
+ RtEntry = AllocatePool (sizeof (IP4_ROUTE_ENTRY));
if (RtEntry == NULL) {
return NULL;
}
- NetListInit (&RtEntry->Link);
+ InitializeListHead (&RtEntry->Link);
RtEntry->RefCnt = 1;
RtEntry->Dest = Dest;
@@ -79,7 +79,7 @@ Ip4FreeRouteEntry ( ASSERT (RtEntry->RefCnt > 0);
if (--RtEntry->RefCnt == 0) {
- NetFreePool (RtEntry);
+ gBS->FreePool (RtEntry);
}
}
@@ -108,13 +108,13 @@ Ip4CreateRouteCacheEntry ( {
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
- RtCacheEntry = NetAllocatePool (sizeof (IP4_ROUTE_CACHE_ENTRY));
+ RtCacheEntry = AllocatePool (sizeof (IP4_ROUTE_CACHE_ENTRY));
if (RtCacheEntry == NULL) {
return NULL;
}
- NetListInit (&RtCacheEntry->Link);
+ InitializeListHead (&RtCacheEntry->Link);
RtCacheEntry->RefCnt = 1;
RtCacheEntry->Dest = Dst;
@@ -142,7 +142,7 @@ Ip4FreeRouteCacheEntry ( ASSERT (RtCacheEntry->RefCnt > 0);
if (--RtCacheEntry->RefCnt == 0) {
- NetFreePool (RtCacheEntry);
+ gBS->FreePool (RtCacheEntry);
}
}
@@ -163,7 +163,7 @@ Ip4InitRouteCache ( UINT32 Index;
for (Index = 0; Index < IP4_ROUTE_CACHE_HASH; Index++) {
- NetListInit (&(RtCache->CacheBucket[Index]));
+ InitializeListHead (&(RtCache->CacheBucket[Index]));
}
}
@@ -182,8 +182,8 @@ Ip4CleanRouteCache ( IN IP4_ROUTE_CACHE *RtCache
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
@@ -191,7 +191,7 @@ Ip4CleanRouteCache ( NET_LIST_FOR_EACH_SAFE (Entry, Next, &(RtCache->CacheBucket[Index])) {
RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteCacheEntry (RtCacheEntry);
}
}
@@ -216,7 +216,7 @@ Ip4CreateRouteTable ( IP4_ROUTE_TABLE *RtTable;
UINT32 Index;
- RtTable = NetAllocatePool (sizeof (IP4_ROUTE_TABLE));
+ RtTable = AllocatePool (sizeof (IP4_ROUTE_TABLE));
if (RtTable == NULL) {
return NULL;
@@ -226,7 +226,7 @@ Ip4CreateRouteTable ( RtTable->TotalNum = 0;
for (Index = 0; Index < IP4_MASK_NUM; Index++) {
- NetListInit (&(RtTable->RouteArea[Index]));
+ InitializeListHead (&(RtTable->RouteArea[Index]));
}
RtTable->Next = NULL;
@@ -250,8 +250,8 @@ Ip4FreeRouteTable ( IN IP4_ROUTE_TABLE *RtTable
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_ENTRY *RtEntry;
UINT32 Index;
@@ -268,14 +268,14 @@ Ip4FreeRouteTable ( NET_LIST_FOR_EACH_SAFE (Entry, Next, &(RtTable->RouteArea[Index])) {
RtEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteEntry (RtEntry);
}
}
Ip4CleanRouteCache (&RtTable->Cache);
- NetFreePool (RtTable);
+ gBS->FreePool (RtTable);
}
@@ -299,8 +299,8 @@ Ip4PurgeRouteCache ( IN UINTN Tag
)
{
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
@@ -310,7 +310,7 @@ Ip4PurgeRouteCache ( RtCacheEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
if (RtCacheEntry->Tag == Tag) {
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteCacheEntry (RtCacheEntry);
}
}
@@ -340,8 +340,8 @@ Ip4AddRoute ( IN IP4_ADDR Gateway
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
IP4_ROUTE_ENTRY *RtEntry;
//
@@ -374,7 +374,7 @@ Ip4AddRoute ( RtEntry->Flag = IP4_DIRECT_ROUTE;
}
- NetListInsertHead (Head, &RtEntry->Link);
+ InsertHeadList (Head, &RtEntry->Link);
RtTable->TotalNum++;
return EFI_SUCCESS;
@@ -402,9 +402,9 @@ Ip4DelRoute ( IN IP4_ADDR Gateway
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_ENTRY *RtEntry;
Head = &(RtTable->RouteArea[NetGetMaskLength (Netmask)]);
@@ -414,7 +414,7 @@ Ip4DelRoute ( if (IP4_NET_EQUAL (RtEntry->Dest, Dest, Netmask) && (RtEntry->NextHop == Gateway)) {
Ip4PurgeRouteCache (&RtTable->Cache, (UINTN) RtEntry);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteEntry (RtEntry);
RtTable->TotalNum--;
@@ -447,7 +447,7 @@ Ip4FindRouteCache ( IN IP4_ADDR Src
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
UINT32 Index;
@@ -489,7 +489,7 @@ Ip4FindRouteEntry ( IN IP4_ADDR Dst
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ROUTE_ENTRY *RtEntry;
IP4_ROUTE_TABLE *Table;
INTN Index;
@@ -533,9 +533,9 @@ Ip4Route ( IN IP4_ADDR Src
)
{
- NET_LIST_ENTRY *Head;
- NET_LIST_ENTRY *Entry;
- NET_LIST_ENTRY *Next;
+ LIST_ENTRY *Head;
+ LIST_ENTRY *Entry;
+ LIST_ENTRY *Next;
IP4_ROUTE_CACHE_ENTRY *RtCacheEntry;
IP4_ROUTE_CACHE_ENTRY *Cache;
IP4_ROUTE_ENTRY *RtEntry;
@@ -551,8 +551,8 @@ Ip4Route ( // If found, promote the cache entry to the head of the hash bucket. LRU
//
if (RtCacheEntry != NULL) {
- NetListRemoveEntry (&RtCacheEntry->Link);
- NetListInsertHead (Head, &RtCacheEntry->Link);
+ RemoveEntryList (&RtCacheEntry->Link);
+ InsertHeadList (Head, &RtCacheEntry->Link);
return RtCacheEntry;
}
@@ -588,7 +588,7 @@ Ip4Route ( return NULL;
}
- NetListInsertHead (Head, &RtCacheEntry->Link);
+ InsertHeadList (Head, &RtCacheEntry->Link);
NET_GET_REF (RtCacheEntry);
//
@@ -604,7 +604,7 @@ Ip4Route ( Cache = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_CACHE_ENTRY, Link);
- NetListRemoveEntry (Entry);
+ RemoveEntryList (Entry);
Ip4FreeRouteCacheEntry (Cache);
}
@@ -628,7 +628,7 @@ Ip4BuildEfiRouteTable ( IN IP4_PROTOCOL *IpInstance
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
IP4_ROUTE_TABLE *RtTable;
IP4_ROUTE_ENTRY *RtEntry;
EFI_IP4_ROUTE_TABLE *Table;
@@ -638,7 +638,7 @@ Ip4BuildEfiRouteTable ( RtTable = IpInstance->RouteTable;
if (IpInstance->EfiRouteTable != NULL) {
- NetFreePool (IpInstance->EfiRouteTable);
+ gBS->FreePool (IpInstance->EfiRouteTable);
IpInstance->EfiRouteTable = NULL;
IpInstance->EfiRouteCount = 0;
@@ -654,7 +654,7 @@ Ip4BuildEfiRouteTable ( return EFI_SUCCESS;
}
- Table = NetAllocatePool (sizeof (EFI_IP4_ROUTE_TABLE) * Count);
+ Table = AllocatePool (sizeof (EFI_IP4_ROUTE_TABLE) * Count);
if (Table == NULL) {
return EFI_OUT_OF_RESOURCES;
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h index fdf40ca5bf..44024a2839 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.h @@ -43,7 +43,7 @@ enum { // enties of the connected network have the flag on.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
IP4_ADDR Dest;
IP4_ADDR Netmask;
@@ -62,7 +62,7 @@ typedef struct { // to-be-deleted route entry.
//
typedef struct {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
INTN RefCnt;
IP4_ADDR Dest;
IP4_ADDR Src;
@@ -78,7 +78,7 @@ typedef struct { // detach them later.
//
typedef struct {
- NET_LIST_ENTRY CacheBucket[IP4_ROUTE_CACHE_HASH];
+ LIST_ENTRY CacheBucket[IP4_ROUTE_CACHE_HASH];
} IP4_ROUTE_CACHE;
//
@@ -94,7 +94,7 @@ typedef struct _IP4_ROUTE_TABLE IP4_ROUTE_TABLE; struct _IP4_ROUTE_TABLE {
INTN RefCnt;
UINT32 TotalNum;
- NET_LIST_ENTRY RouteArea[IP4_MASK_NUM];
+ LIST_ENTRY RouteArea[IP4_MASK_NUM];
IP4_ROUTE_TABLE *Next;
IP4_ROUTE_CACHE Cache;
};
|