]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/Udp6Dxe/Udp6Main.c
NetworkPkg: Apply uncrustify changes
[mirror_edk2.git] / NetworkPkg / Udp6Dxe / Udp6Main.c
index a33eb3c8cfdec52df6cc5b66b0477181402c9170..e64319fafbfde1b580b88d02963de3c08fde4be1 100644 (file)
@@ -19,7 +19,6 @@ EFI_UDP6_PROTOCOL  mUdp6Protocol = {
   Udp6Poll\r
 };\r
 \r
-\r
 /**\r
   This function copies the current operational settings of this EFI UDPv6 Protocol\r
   instance into user-supplied buffers. This function is used optionally to retrieve\r
@@ -91,7 +90,6 @@ Udp6GetModeData (
   return Status;\r
 }\r
 \r
-\r
 /**\r
   This function is used to do the following:\r
   Initialize and start this instance of the EFI UDPv6 Protocol.\r
@@ -159,16 +157,16 @@ Udp6Configure (
   Status      = EFI_SUCCESS;\r
   ASSERT (Udp6Service != NULL);\r
 \r
-  OldTpl      = gBS->RaiseTPL (TPL_CALLBACK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   if (UdpConfigData != NULL) {\r
-\r
     IP6_COPY_ADDRESS (&StationAddress, &UdpConfigData->StationAddress);\r
     IP6_COPY_ADDRESS (&RemoteAddress, &UdpConfigData->RemoteAddress);\r
 \r
     if ((!NetIp6IsUnspecifiedAddr (&StationAddress) && !NetIp6IsValidUnicast (&StationAddress)) ||\r
         (!NetIp6IsUnspecifiedAddr (&RemoteAddress) && !NetIp6IsValidUnicast (&RemoteAddress))\r
-        ){\r
+        )\r
+    {\r
       //\r
       // If not use default address, and StationAddress is not a valid unicast\r
       // if it is not IPv6 address or RemoteAddress is not a valid unicast IPv6\r
@@ -286,7 +284,6 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-\r
 /**\r
   This function is used to enable and disable the multicast group filtering.\r
 \r
@@ -348,12 +345,13 @@ Udp6Groups (
     if (McastIp != NULL) {\r
       FreePool (McastIp);\r
     }\r
+\r
     return EFI_NOT_STARTED;\r
   }\r
 \r
-  Ip      = Instance->IpInfo->Ip.Ip6;\r
+  Ip = Instance->IpInfo->Ip.Ip6;\r
 \r
-  OldTpl  = gBS->RaiseTPL (TPL_CALLBACK);\r
+  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
 \r
   //\r
   // Invoke the Ip instance the Udp6 instance consumes to do the group operation.\r
@@ -371,10 +369,8 @@ Udp6Groups (
   // the multicast datagrams destinated to multicast IPs the other instances configured.\r
   //\r
   if (JoinFlag) {\r
-\r
-    Status = NetMapInsertTail (&Instance->McastIps, (VOID *) McastIp, NULL);\r
+    Status = NetMapInsertTail (&Instance->McastIps, (VOID *)McastIp, NULL);\r
   } else {\r
-\r
     Status = NetMapIterate (&Instance->McastIps, Udp6LeaveGroup, MulticastAddress);\r
     if ((MulticastAddress != NULL) && (Status == EFI_ABORTED)) {\r
       Status = EFI_SUCCESS;\r
@@ -394,8 +390,6 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-\r
-\r
 /**\r
   This function places a sending request to this instance of the EFI UDPv6 Protocol,\r
   alongside the transmit data that was filled by the user.\r
@@ -490,7 +484,8 @@ Udp6Transmit (
 \r
   if (EFI_ERROR (NetMapIterate (&Instance->TxTokens, Udp6TokenExist, Token)) ||\r
       EFI_ERROR (NetMapIterate (&Instance->RxTokens, Udp6TokenExist, Token))\r
-      ){\r
+      )\r
+  {\r
     //\r
     // Try to find a duplicate token in the two token maps, if found, return\r
     // EFI_ACCESS_DENIED.\r
@@ -505,7 +500,7 @@ Udp6Transmit (
   // Create a net buffer to hold the user buffer and the udp header.\r
   //\r
   Packet = NetbufFromExt (\r
-             (NET_FRAGMENT *) TxData->FragmentTable,\r
+             (NET_FRAGMENT *)TxData->FragmentTable,\r
              TxData->FragmentCount,\r
              UDP6_HEADER_SIZE,\r
              0,\r
@@ -520,10 +515,10 @@ Udp6Transmit (
   //\r
   // Store the IpIo in ProtoData.\r
   //\r
-  Udp6Service                        = Instance->Udp6Service;\r
-  *((UINTN *) &Packet->ProtoData[0]) = (UINTN) (Udp6Service->IpIo);\r
+  Udp6Service                       = Instance->Udp6Service;\r
+  *((UINTN *)&Packet->ProtoData[0]) = (UINTN)(Udp6Service->IpIo);\r
 \r
-  Udp6Header = (EFI_UDP_HEADER *) NetbufAllocSpace (Packet, UDP6_HEADER_SIZE, TRUE);\r
+  Udp6Header = (EFI_UDP_HEADER *)NetbufAllocSpace (Packet, UDP6_HEADER_SIZE, TRUE);\r
   ASSERT (Udp6Header != NULL);\r
   if (Udp6Header == NULL) {\r
     Status = EFI_OUT_OF_RESOURCES;\r
@@ -535,10 +530,10 @@ Udp6Transmit (
   //\r
   // Fill the udp header.\r
   //\r
-  Udp6Header->SrcPort      = HTONS (ConfigData->StationPort);\r
-  Udp6Header->DstPort      = HTONS (ConfigData->RemotePort);\r
-  Udp6Header->Length       = HTONS ((UINT16) Packet->TotalSize);\r
-  Udp6Header->Checksum     = 0;\r
+  Udp6Header->SrcPort  = HTONS (ConfigData->StationPort);\r
+  Udp6Header->DstPort  = HTONS (ConfigData->RemotePort);\r
+  Udp6Header->Length   = HTONS ((UINT16)Packet->TotalSize);\r
+  Udp6Header->Checksum = 0;\r
   //\r
   // Set the UDP Header in NET_BUF, this UDP header is for IP6 can fast get the\r
   // Udp header for pseudoHeadCheckSum.\r
@@ -564,7 +559,7 @@ Udp6Transmit (
     }\r
 \r
     //\r
-    //Calculate the pseudo head checksum using the overridden parameters.\r
+    // Calculate the pseudo head checksum using the overridden parameters.\r
     //\r
     if (!NetIp6IsUnspecifiedAddr (&ConfigData->StationAddress)) {\r
       HeadSum = NetIp6PseudoHeadChecksum (\r
@@ -590,7 +585,6 @@ Udp6Transmit (
       // and the Ipv6 will fill the correct value of this checksum.\r
       //\r
       Udp6Header->Checksum = 0;\r
-\r
     }\r
   } else {\r
     //\r
@@ -611,8 +605,6 @@ Udp6Transmit (
     }\r
   }\r
 \r
-\r
-\r
   //\r
   // Fill the IpIo Override data.\r
   //\r
@@ -631,7 +623,7 @@ Udp6Transmit (
   //\r
   // Send out this datagram through IpIo.\r
   //\r
-  if (UdpSessionData != NULL){\r
+  if (UdpSessionData != NULL) {\r
     IP6_COPY_ADDRESS (&(IpDestAddr.v6), &Destination);\r
   } else {\r
     ZeroMem (&IpDestAddr.v6, sizeof (EFI_IPv6_ADDRESS));\r
@@ -664,7 +656,6 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-\r
 /**\r
   This function places a completion token into the receive packet queue. This function\r
   is always asynchronous.\r
@@ -717,7 +708,8 @@ Udp6Receive (
 \r
   if (EFI_ERROR (NetMapIterate (&Instance->RxTokens, Udp6TokenExist, Token)) ||\r
       EFI_ERROR (NetMapIterate (&Instance->TxTokens, Udp6TokenExist, Token))\r
-      ){\r
+      )\r
+  {\r
     //\r
     // Return EFI_ACCESS_DENIED if the specified token is already in the TxTokens or\r
     // RxTokens map.\r
@@ -759,7 +751,6 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-\r
 /**\r
   This function is used to abort a pending transmit or receive request.\r
 \r
@@ -821,7 +812,6 @@ Udp6Cancel (
   return Status;\r
 }\r
 \r
-\r
 /**\r
   This function can be used by network drivers and applications to increase the rate that\r
   data packets are moved between the communications device and the transmit/receive queues.\r