summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Udp4Dxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-14 09:40:22 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-14 09:40:22 +0000
commite48e37fce2611df7a52aff271835ff72ee396d9b (patch)
treef6427ba11251479c615da9b5a3e38aa8c7b0f943 /MdeModulePkg/Universal/Network/Udp4Dxe
parentbb8ffffd1c0ff0ee697c26d377fd9767097cc02b (diff)
downloadedk2-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/Udp4Dxe')
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c28
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c88
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h12
-rw-r--r--MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c50
4 files changed, 89 insertions, 89 deletions
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
index 7a7c184498..0c54364127 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Driver.c
@@ -116,14 +116,14 @@ Udp4DriverBindingStart (
//
// Allocate Private Context Data Structure.
//
- Udp4Service = NetAllocatePool (sizeof (UDP4_SERVICE_DATA));
+ Udp4Service = AllocatePool (sizeof (UDP4_SERVICE_DATA));
if (Udp4Service == NULL) {
return EFI_OUT_OF_RESOURCES;
}
Status = Udp4CreateService (Udp4Service, This->DriverBindingHandle, ControllerHandle);
if (EFI_ERROR (Status)) {
- NetFreePool (Udp4Service);
+ gBS->FreePool (Udp4Service);
return Status;
}
@@ -138,7 +138,7 @@ Udp4DriverBindingStart (
);
if (EFI_ERROR (Status)) {
Udp4CleanService (Udp4Service);
- NetFreePool (Udp4Service);
+ gBS->FreePool (Udp4Service);
} else {
Udp4SetVariableData (Udp4Service);
}
@@ -213,10 +213,10 @@ Udp4DriverBindingStop (
Udp4CleanService (Udp4Service);
- NetFreePool (Udp4Service);
+ gBS->FreePool (Udp4Service);
} else {
- while (!NetListIsEmpty (&Udp4Service->ChildrenList)) {
+ while (!IsListEmpty (&Udp4Service->ChildrenList)) {
Instance = NET_LIST_HEAD (&Udp4Service->ChildrenList, UDP4_INSTANCE_DATA, Link);
ServiceBinding->DestroyChild (ServiceBinding, Instance->ChildHandle);
@@ -264,7 +264,7 @@ Udp4ServiceBindingCreateChild (
//
// Allocate the instance private data structure.
//
- Instance = NetAllocateZeroPool (sizeof (UDP4_INSTANCE_DATA));
+ Instance = AllocateZeroPool (sizeof (UDP4_INSTANCE_DATA));
if (Instance == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -310,15 +310,15 @@ Udp4ServiceBindingCreateChild (
goto ON_ERROR;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Link this instance into the service context data and increase the ChildrenNumber.
//
- NetListInsertTail (&Udp4Service->ChildrenList, &Instance->Link);
+ InsertTailList (&Udp4Service->ChildrenList, &Instance->Link);
Udp4Service->ChildrenNumber++;
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
@@ -339,7 +339,7 @@ ON_ERROR:
Udp4CleanInstance (Instance);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return Status;
}
@@ -440,12 +440,12 @@ Udp4ServiceBindingDestroyChild (
//
IpIoRemoveIp (Udp4Service->IpIo, Instance->IpInfo);
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Remove this instance from the service context data's ChildrenList.
//
- NetListRemoveEntry (&Instance->Link);
+ RemoveEntryList (&Instance->Link);
Udp4Service->ChildrenNumber--;
//
@@ -453,9 +453,9 @@ Udp4ServiceBindingDestroyChild (
//
Udp4CleanInstance (Instance);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
- NetFreePool (Instance);
+ gBS->FreePool (Instance);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
index 39924cfa7a..c190a1df80 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.c
@@ -36,7 +36,7 @@ Udp4CheckTimeout (
STATIC
BOOLEAN
Udp4FindInstanceByPort (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_IPv4_ADDRESS *Address,
IN UINT16 Port
);
@@ -153,7 +153,7 @@ Udp4CreateService (
EFI_STATUS Status;
IP_IO_OPEN_DATA OpenData;
- NetZeroMem (Udp4Service, sizeof (UDP4_SERVICE_DATA));
+ ZeroMem (Udp4Service, sizeof (UDP4_SERVICE_DATA));
Udp4Service->Signature = UDP4_SERVICE_DATA_SIGNATURE;
Udp4Service->ServiceBinding = mUdp4ServiceBinding;
@@ -161,7 +161,7 @@ Udp4CreateService (
Udp4Service->ControllerHandle = ControllerHandle;
Udp4Service->ChildrenNumber = 0;
- NetListInit (&Udp4Service->ChildrenList);
+ InitializeListHead (&Udp4Service->ChildrenList);
//
// Create the IpIo for this service context.
@@ -194,7 +194,7 @@ Udp4CreateService (
//
Status = gBS->CreateEvent (
EVT_TIMER | EVT_NOTIFY_SIGNAL,
- NET_TPL_TIMER,
+ TPL_CALLBACK,
Udp4CheckTimeout,
Udp4Service,
&Udp4Service->TimeoutEvent
@@ -279,10 +279,10 @@ Udp4CheckTimeout (
)
{
UDP4_SERVICE_DATA *Udp4Service;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
- NET_LIST_ENTRY *WrapEntry;
- NET_LIST_ENTRY *NextEntry;
+ LIST_ENTRY *WrapEntry;
+ LIST_ENTRY *NextEntry;
UDP4_RXDATA_WRAP *Wrap;
Udp4Service = (UDP4_SERVICE_DATA *) Context;
@@ -344,9 +344,9 @@ Udp4InitInstance (
//
// Init the lists.
//
- NetListInit (&Instance->Link);
- NetListInit (&Instance->RcvdDgramQue);
- NetListInit (&Instance->DeliveredDgramQue);
+ InitializeListHead (&Instance->Link);
+ InitializeListHead (&Instance->RcvdDgramQue);
+ InitializeListHead (&Instance->DeliveredDgramQue);
//
// Init the NET_MAPs.
@@ -400,12 +400,12 @@ Udp4CleanInstance (
STATIC
BOOLEAN
Udp4FindInstanceByPort (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_IPv4_ADDRESS *Address,
IN UINT16 Port
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
EFI_UDP4_CONFIG_DATA *ConfigData;
@@ -457,7 +457,7 @@ Udp4FindInstanceByPort (
**/
EFI_STATUS
Udp4Bind (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_UDP4_CONFIG_DATA *ConfigData
)
{
@@ -701,7 +701,7 @@ Udp4ValidateTxToken (
}
if (TxData->GatewayAddress != NULL) {
- NetCopyMem (&GatewayAddress, TxData->GatewayAddress, sizeof (IP4_ADDR));
+ CopyMem (&GatewayAddress, TxData->GatewayAddress, sizeof (IP4_ADDR));
if (!Ip4IsUnicast (NTOHL (GatewayAddress), 0)) {
//
@@ -716,7 +716,7 @@ Udp4ValidateTxToken (
if (UdpSessionData != NULL) {
- NetCopyMem (&SourceAddress, &UdpSessionData->SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&SourceAddress, &UdpSessionData->SourceAddress, sizeof (IP4_ADDR));
if ((SourceAddress != 0) && !Ip4IsUnicast (HTONL (SourceAddress), 0)) {
//
@@ -1069,7 +1069,7 @@ Udp4FlushRcvdDgram (
{
UDP4_RXDATA_WRAP *Wrap;
- while (!NetListIsEmpty (&Instance->RcvdDgramQue)) {
+ while (!IsListEmpty (&Instance->RcvdDgramQue)) {
//
// Iterate all the Wraps in the RcvdDgramQue.
//
@@ -1190,7 +1190,7 @@ Udp4MatchDgram (
return TRUE;
}
- NetCopyMem (&Destination, &Udp4Session->DestinationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Destination, &Udp4Session->DestinationAddress, sizeof (IP4_ADDR));
if (IP4_IS_LOCAL_BROADCAST (Destination) && ConfigData->AcceptBroadcast) {
//
@@ -1235,7 +1235,7 @@ Udp4RecycleRxDataWrap (
//
// Remove the Wrap from the list it belongs to.
//
- NetListRemoveEntry (&Wrap->Link);
+ RemoveEntryList (&Wrap->Link);
//
// Free the Packet associated with this Wrap.
@@ -1247,7 +1247,7 @@ Udp4RecycleRxDataWrap (
//
gBS->CloseEvent (Wrap->RxData.RecycleSignal);
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
}
@@ -1277,13 +1277,13 @@ Udp4WrapRxData (
//
// Allocate buffer for the Wrap.
//
- Wrap = NetAllocatePool (sizeof (UDP4_RXDATA_WRAP) +
+ Wrap = AllocatePool (sizeof (UDP4_RXDATA_WRAP) +
(Packet->BlockOpNum - 1) * sizeof (EFI_UDP4_FRAGMENT_DATA));
if (Wrap == NULL) {
return NULL;
}
- NetListInit (&Wrap->Link);
+ InitializeListHead (&Wrap->Link);
CopyMem (&Wrap->RxData, RxData, sizeof (Wrap->RxData));
@@ -1292,13 +1292,13 @@ Udp4WrapRxData (
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
- NET_TPL_RECYCLE,
+ TPL_NOTIFY,
Udp4RecycleRxDataWrap,
Wrap,
&Wrap->RxData.RecycleSignal
);
if (EFI_ERROR (Status)) {
- NetFreePool (Wrap);
+ gBS->FreePool (Wrap);
return NULL;
}
@@ -1329,7 +1329,7 @@ Udp4EnqueueDgram (
IN EFI_UDP4_RECEIVE_DATA *RxData
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
UDP4_RXDATA_WRAP *Wrap;
UINTN Enqueued;
@@ -1357,7 +1357,7 @@ Udp4EnqueueDgram (
NET_GET_REF (Packet);
- NetListInsertTail (&Instance->RcvdDgramQue, &Wrap->Link);
+ InsertTailList (&Instance->RcvdDgramQue, &Wrap->Link);
Enqueued++;
}
@@ -1386,7 +1386,7 @@ Udp4InstanceDeliverDgram (
EFI_UDP4_RECEIVE_DATA *RxData;
EFI_TPL OldTpl;
- if (!NetListIsEmpty (&Instance->RcvdDgramQue) &&
+ if (!IsListEmpty (&Instance->RcvdDgramQue) &&
!NetMapIsEmpty (&Instance->RxTokens)) {
Wrap = NET_LIST_HEAD (&Instance->RcvdDgramQue, UDP4_RXDATA_WRAP, Link);
@@ -1424,9 +1424,9 @@ Udp4InstanceDeliverDgram (
Token->Status = EFI_SUCCESS;
Token->Packet.RxData = &Wrap->RxData;
- OldTpl = NET_RAISE_TPL (NET_TPL_RECYCLE);
- NetListInsertTail (&Instance->DeliveredDgramQue, &Wrap->Link);
- NET_RESTORE_TPL (OldTpl);
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
+ InsertTailList (&Instance->DeliveredDgramQue, &Wrap->Link);
+ gBS->RestoreTPL (OldTpl);
gBS->SignalEvent (Token->Event);
}
@@ -1447,7 +1447,7 @@ Udp4DeliverDgram (
IN UDP4_SERVICE_DATA *Udp4Service
)
{
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
NET_LIST_FOR_EACH (Entry, &Udp4Service->ChildrenList) {
@@ -1524,8 +1524,8 @@ Udp4Demultiplex (
Udp4Session->SourcePort = NTOHS (Udp4Header->SrcPort);
Udp4Session->DestinationPort = NTOHS (Udp4Header->DstPort);
- NetCopyMem (&Udp4Session->SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Udp4Session->DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session->SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session->DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
//
// Trim the UDP header.
@@ -1629,13 +1629,13 @@ Udp4SendPortUnreach (
//
// Copy the IP header of the datagram tragged the error.
//
- NetCopyMem (&IcmpErrHdr->IpHead, IpHdr, EFI_IP4_HEADER_LEN (IpHdr));
+ CopyMem (&IcmpErrHdr->IpHead, IpHdr, EFI_IP4_HEADER_LEN (IpHdr));
//
// Copy the UDP header.
//
Ptr = (UINT8 *) &IcmpErrHdr->IpHead + EFI_IP4_HEADER_LEN (IpHdr);
- NetCopyMem (Ptr, Udp4Header, ICMP_ERROR_PACKET_LENGTH);
+ CopyMem (Ptr, Udp4Header, ICMP_ERROR_PACKET_LENGTH);
//
// Calculate the checksum.
@@ -1650,8 +1650,8 @@ Udp4SendPortUnreach (
Override.TimeToLive = 255;
Override.Protocol = EFI_IP_PROTO_ICMP;
- NetCopyMem (&Override.SourceAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
- NetZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Override.SourceAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
//
// Send out this icmp packet.
@@ -1686,13 +1686,13 @@ Udp4IcmpHandler (
{
EFI_UDP4_HEADER *Udp4Header;
EFI_UDP4_SESSION_DATA Udp4Session;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance;
Udp4Header = (EFI_UDP4_HEADER *) NetbufGetByte (Packet, 0, NULL);
- NetCopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
- NetCopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
Udp4Session.SourcePort = NTOHS (Udp4Header->DstPort);
Udp4Session.DestinationPort = NTOHS (Udp4Header->SrcPort);
@@ -1815,7 +1815,7 @@ Udp4SetVariableData (
)
{
UINT32 NumConfiguredInstance;
- NET_LIST_ENTRY *Entry;
+ LIST_ENTRY *Entry;
UINTN VariableDataSize;
EFI_UDP4_VARIABLE_DATA *Udp4VariableData;
EFI_UDP4_SERVICE_POINT *Udp4ServicePoint;
@@ -1852,7 +1852,7 @@ Udp4SetVariableData (
VariableDataSize += sizeof (EFI_UDP4_SERVICE_POINT) * (NumConfiguredInstance - 1);
}
- Udp4VariableData = NetAllocatePool (VariableDataSize);
+ Udp4VariableData = AllocatePool (VariableDataSize);
if (Udp4VariableData == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1913,7 +1913,7 @@ Udp4SetVariableData (
);
}
- NetFreePool (Udp4Service->MacString);
+ gBS->FreePool (Udp4Service->MacString);
}
Udp4Service->MacString = NewMacString;
@@ -1928,7 +1928,7 @@ Udp4SetVariableData (
ON_ERROR:
- NetFreePool (Udp4VariableData);
+ gBS->FreePool (Udp4VariableData);
return Status;
}
@@ -1957,6 +1957,6 @@ Udp4ClearVariableData (
NULL
);
- NetFreePool (Udp4Service->MacString);
+ gBS->FreePool (Udp4Service->MacString);
Udp4Service->MacString = NULL;
}
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
index 2cf4a541b4..4ad598da02 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Impl.h
@@ -71,7 +71,7 @@ typedef struct _UDP4_SERVICE_DATA_ {
EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;
EFI_HANDLE ImageHandle;
EFI_HANDLE ControllerHandle;
- NET_LIST_ENTRY ChildrenList;
+ LIST_ENTRY ChildrenList;
UINTN ChildrenNumber;
IP_IO *IpIo;
@@ -92,7 +92,7 @@ typedef struct _UDP4_SERVICE_DATA_ {
typedef struct _UDP4_INSTANCE_DATA_ {
UINT32 Signature;
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
UDP4_SERVICE_DATA *Udp4Service;
EFI_UDP4_PROTOCOL Udp4Proto;
@@ -106,8 +106,8 @@ typedef struct _UDP4_INSTANCE_DATA_ {
NET_MAP McastIps;
- NET_LIST_ENTRY RcvdDgramQue;
- NET_LIST_ENTRY DeliveredDgramQue;
+ LIST_ENTRY RcvdDgramQue;
+ LIST_ENTRY DeliveredDgramQue;
UINT16 HeadSum;
@@ -119,7 +119,7 @@ typedef struct _UDP4_INSTANCE_DATA_ {
} UDP4_INSTANCE_DATA;
typedef struct _UDP4_RXDATA_WRAP_ {
- NET_LIST_ENTRY Link;
+ LIST_ENTRY Link;
NET_BUF *Packet;
UINT32 TimeoutTick;
EFI_UDP4_RECEIVE_DATA RxData;
@@ -212,7 +212,7 @@ Udp4CleanInstance (
EFI_STATUS
Udp4Bind (
- IN NET_LIST_ENTRY *InstanceList,
+ IN LIST_ENTRY *InstanceList,
IN EFI_UDP4_CONFIG_DATA *ConfigData
);
diff --git a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
index 9d3b20a8a6..eb013e9150 100644
--- a/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
+++ b/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
@@ -80,7 +80,7 @@ Udp4GetModeData (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Udp4ConfigData != NULL) {
//
@@ -96,7 +96,7 @@ Udp4GetModeData (
//
Status = Ip->GetModeData (Ip, Ip4ModeData, MnpConfigData, SnpModeData);
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -169,13 +169,13 @@ Udp4Configure (
Udp4Service = Instance->Udp4Service;
Status = EFI_SUCCESS;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (UdpConfigData != NULL) {
- NetCopyMem (&StationAddress, &UdpConfigData->StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&SubnetMask, &UdpConfigData->SubnetMask, sizeof (IP4_ADDR));
- NetCopyMem (&RemoteAddress, &UdpConfigData->RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&StationAddress, &UdpConfigData->StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&SubnetMask, &UdpConfigData->SubnetMask, sizeof (IP4_ADDR));
+ CopyMem (&RemoteAddress, &UdpConfigData->RemoteAddress, sizeof (IP4_ADDR));
StationAddress = NTOHL (StationAddress);
SubnetMask = NTOHL (SubnetMask);
@@ -258,8 +258,8 @@ Udp4Configure (
//
// Pre calculate the checksum for the pseudo head, ignore the UDP length first.
//
- NetCopyMem (&LocalAddr, &Instance->ConfigData.StationAddress, sizeof (IP4_ADDR));
- NetCopyMem (&RemoteAddr, &Instance->ConfigData.RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&LocalAddr, &Instance->ConfigData.StationAddress, sizeof (IP4_ADDR));
+ CopyMem (&RemoteAddr, &Instance->ConfigData.RemoteAddress, sizeof (IP4_ADDR));
Instance->HeadSum = NetPseudoHeadChecksum (
LocalAddr,
RemoteAddr,
@@ -291,14 +291,14 @@ Udp4Configure (
//
Udp4FlushRcvdDgram (Instance);
- ASSERT (NetListIsEmpty (&Instance->DeliveredDgramQue));
+ ASSERT (IsListEmpty (&Instance->DeliveredDgramQue));
}
Udp4SetVariableData (Instance->Udp4Service);
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -351,7 +351,7 @@ Udp4Groups (
McastIp = 0;
if (JoinFlag) {
- NetCopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));
+ CopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));
if (!IP4_IS_MULTICAST (NTOHL (McastIp))) {
return EFI_INVALID_PARAMETER;
@@ -370,7 +370,7 @@ Udp4Groups (
Ip = Instance->IpInfo->Ip;
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Invoke the Ip instance the Udp4 instance consumes to do the group operation.
@@ -397,7 +397,7 @@ Udp4Groups (
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -543,7 +543,7 @@ Udp4Transmit (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Validate the Token, if the token is invalid return the error code.
@@ -607,7 +607,7 @@ Udp4Transmit (
// UdpSessionData.
//
if (!EFI_IP4_EQUAL (&UdpSessionData->SourceAddress, &mZeroIp4Addr)) {
- NetCopyMem (&Override.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Override.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
}
if (UdpSessionData->SourcePort != 0) {
@@ -618,8 +618,8 @@ Udp4Transmit (
Udp4Header->DstPort = HTONS (UdpSessionData->DestinationPort);
}
- NetCopyMem (&Source, &Override.SourceAddress, sizeof (IP4_ADDR));
- NetCopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR));
+ CopyMem (&Source, &Override.SourceAddress, sizeof (IP4_ADDR));
+ CopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR));
//
// calculate the pseudo head checksum using the overridden parameters.
@@ -634,7 +634,7 @@ Udp4Transmit (
//
// UdpSessionData is NULL, use the address and port information previously configured.
//
- NetCopyMem (&Destination, &ConfigData->RemoteAddress, sizeof (IP4_ADDR));
+ CopyMem (&Destination, &ConfigData->RemoteAddress, sizeof (IP4_ADDR));
HeadSum = Instance->HeadSum;
}
@@ -654,9 +654,9 @@ Udp4Transmit (
// Fill the IpIo Override data.
//
if (TxData->GatewayAddress != NULL) {
- NetCopyMem (&Override.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ CopyMem (&Override.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
} else {
- NetZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
+ ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
}
Override.Protocol = EFI_IP_PROTO_UDP;
@@ -697,7 +697,7 @@ FREE_PACKET:
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -755,7 +755,7 @@ Udp4Receive (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (EFI_ERROR (NetMapIterate (&Instance->RxTokens, Udp4TokenExist, Token))||
EFI_ERROR (NetMapIterate (&Instance->TxTokens, Udp4TokenExist, Token))) {
@@ -795,7 +795,7 @@ Udp4Receive (
ON_EXIT:
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}
@@ -848,7 +848,7 @@ Udp4Cancel (
return EFI_NOT_STARTED;
}
- OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
//
// Cancle the tokens specified by Token for this instance.
@@ -860,7 +860,7 @@ Udp4Cancel (
//
NetLibDispatchDpc ();
- NET_RESTORE_TPL (OldTpl);
+ gBS->RestoreTPL (OldTpl);
return Status;
}