]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Main.c
Use Mde library and definition instead of some native definitions in NetLib, to simpl...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Udp4Dxe / Udp4Main.c
index 9d3b20a8a6021f7b066824a95c105840aefdce94..eb013e91500e068460f0405e21c02fbe08501e64 100644 (file)
@@ -80,7 +80,7 @@ Udp4GetModeData (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   if (Udp4ConfigData != NULL) {\r
     //\r
@@ -96,7 +96,7 @@ Udp4GetModeData (
   //\r
   Status = Ip->GetModeData (Ip, Ip4ModeData, MnpConfigData, SnpModeData);\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -169,13 +169,13 @@ Udp4Configure (
   Udp4Service = Instance->Udp4Service;\r
   Status      = EFI_SUCCESS;\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   if (UdpConfigData != NULL) {\r
 \r
-    NetCopyMem (&StationAddress, &UdpConfigData->StationAddress, sizeof (IP4_ADDR));\r
-    NetCopyMem (&SubnetMask, &UdpConfigData->SubnetMask, sizeof (IP4_ADDR));\r
-    NetCopyMem (&RemoteAddress, &UdpConfigData->RemoteAddress, sizeof (IP4_ADDR));\r
+    CopyMem (&StationAddress, &UdpConfigData->StationAddress, sizeof (IP4_ADDR));\r
+    CopyMem (&SubnetMask, &UdpConfigData->SubnetMask, sizeof (IP4_ADDR));\r
+    CopyMem (&RemoteAddress, &UdpConfigData->RemoteAddress, sizeof (IP4_ADDR));\r
 \r
     StationAddress = NTOHL (StationAddress);\r
     SubnetMask     = NTOHL (SubnetMask);\r
@@ -258,8 +258,8 @@ Udp4Configure (
       //\r
       // Pre calculate the checksum for the pseudo head, ignore the UDP length first.\r
       //\r
-      NetCopyMem (&LocalAddr, &Instance->ConfigData.StationAddress, sizeof (IP4_ADDR));\r
-      NetCopyMem (&RemoteAddr, &Instance->ConfigData.RemoteAddress, sizeof (IP4_ADDR));\r
+      CopyMem (&LocalAddr, &Instance->ConfigData.StationAddress, sizeof (IP4_ADDR));\r
+      CopyMem (&RemoteAddr, &Instance->ConfigData.RemoteAddress, sizeof (IP4_ADDR));\r
       Instance->HeadSum = NetPseudoHeadChecksum (\r
                             LocalAddr,\r
                             RemoteAddr,\r
@@ -291,14 +291,14 @@ Udp4Configure (
     //\r
     Udp4FlushRcvdDgram (Instance);\r
 \r
-    ASSERT (NetListIsEmpty (&Instance->DeliveredDgramQue));\r
+    ASSERT (IsListEmpty (&Instance->DeliveredDgramQue));\r
   }\r
 \r
   Udp4SetVariableData (Instance->Udp4Service);\r
 \r
 ON_EXIT:\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -351,7 +351,7 @@ Udp4Groups (
 \r
   McastIp = 0;\r
   if (JoinFlag) {\r
-    NetCopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));\r
+    CopyMem (&McastIp, MulticastAddress, sizeof (IP4_ADDR));\r
 \r
     if (!IP4_IS_MULTICAST (NTOHL (McastIp))) {\r
       return EFI_INVALID_PARAMETER;\r
@@ -370,7 +370,7 @@ Udp4Groups (
 \r
   Ip = Instance->IpInfo->Ip;\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Invoke the Ip instance the Udp4 instance consumes to do the group operation.\r
@@ -397,7 +397,7 @@ Udp4Groups (
 \r
 ON_EXIT:\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -543,7 +543,7 @@ Udp4Transmit (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Validate the Token, if the token is invalid return the error code.\r
@@ -607,7 +607,7 @@ Udp4Transmit (
     // UdpSessionData.\r
     //\r
     if (!EFI_IP4_EQUAL (&UdpSessionData->SourceAddress, &mZeroIp4Addr)) {\r
-      NetCopyMem (&Override.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));\r
+      CopyMem (&Override.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));\r
     }\r
 \r
     if (UdpSessionData->SourcePort != 0) {\r
@@ -618,8 +618,8 @@ Udp4Transmit (
       Udp4Header->DstPort = HTONS (UdpSessionData->DestinationPort);\r
     }\r
 \r
-    NetCopyMem (&Source, &Override.SourceAddress, sizeof (IP4_ADDR));\r
-    NetCopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR));\r
+    CopyMem (&Source, &Override.SourceAddress, sizeof (IP4_ADDR));\r
+    CopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR));\r
 \r
     //\r
     // calculate the pseudo head checksum using the overridden parameters.\r
@@ -634,7 +634,7 @@ Udp4Transmit (
     //\r
     // UdpSessionData is NULL, use the address and port information previously configured.\r
     //\r
-    NetCopyMem (&Destination, &ConfigData->RemoteAddress, sizeof (IP4_ADDR));\r
+    CopyMem (&Destination, &ConfigData->RemoteAddress, sizeof (IP4_ADDR));\r
 \r
     HeadSum = Instance->HeadSum;\r
   }\r
@@ -654,9 +654,9 @@ Udp4Transmit (
   // Fill the IpIo Override data.\r
   //\r
   if (TxData->GatewayAddress != NULL) {\r
-    NetCopyMem (&Override.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
+    CopyMem (&Override.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
   } else {\r
-    NetZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
+    ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
   }\r
 \r
   Override.Protocol                 = EFI_IP_PROTO_UDP;\r
@@ -697,7 +697,7 @@ FREE_PACKET:
 \r
 ON_EXIT:\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -755,7 +755,7 @@ Udp4Receive (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   if (EFI_ERROR (NetMapIterate (&Instance->RxTokens, Udp4TokenExist, Token))||\r
     EFI_ERROR (NetMapIterate (&Instance->TxTokens, Udp4TokenExist, Token))) {\r
@@ -795,7 +795,7 @@ Udp4Receive (
 \r
 ON_EXIT:\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r
@@ -848,7 +848,7 @@ Udp4Cancel (
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Cancle the tokens specified by Token for this instance.\r
@@ -860,7 +860,7 @@ Udp4Cancel (
   //\r
   NetLibDispatchDpc ();\r
 \r
-  NET_RESTORE_TPL (OldTpl);\r
+  gBS->RestoreTPL (OldTpl);\r
 \r
   return Status;\r
 }\r