]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
NetworkPkg/UefiPxeBcDxe: Fix various typos
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcSupport.c
index 4b6f8c9c7feff899abe478e69962476b0d2f8790..8eb1558d30a963301652f95b798186980d53d737 100644 (file)
@@ -3,13 +3,7 @@
 \r
   Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -17,7 +11,7 @@
 \r
 \r
 /**\r
-  Flush the previous configration using the new station Ip address.\r
+  Flush the previous configuration using the new station Ip address.\r
 \r
   @param[in]   Private        The pointer to the PxeBc private data.\r
   @param[in]   StationIp      The pointer to the station Ip address.\r
@@ -48,7 +42,7 @@ PxeBcFlushStationIp (
     //\r
     CopyMem (&Private->Udp6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS));\r
     CopyMem (&Private->Ip6CfgData.StationAddress, StationIp, sizeof (EFI_IPv6_ADDRESS));\r
-    \r
+\r
     //\r
     // Reconfigure the Ip6 instance to capture background ICMP6 packets with new station Ip address.\r
     //\r
@@ -79,7 +73,7 @@ PxeBcFlushStationIp (
       CopyMem (&Private->Udp4CfgData.StationAddress, StationIp, sizeof (EFI_IPv4_ADDRESS));\r
       CopyMem (&Private->Ip4CfgData.StationAddress, StationIp, sizeof (EFI_IPv4_ADDRESS));\r
     }\r
-    \r
+\r
     if (SubnetMask != NULL) {\r
       //\r
       // Overwrite Udp4CfgData/Ip4CfgData SubnetMask.\r
@@ -97,7 +91,7 @@ PxeBcFlushStationIp (
       Mode->RouteTable[0].SubnetMask.Addr[0] = SubnetMask->Addr[0];\r
       Mode->RouteTable[0].GwAddr.Addr[0]     = 0;\r
     }\r
-    \r
+\r
     if (StationIp != NULL || SubnetMask != NULL) {\r
       //\r
       // Reconfigure the Ip4 instance to capture background ICMP packets with new station Ip address.\r
@@ -142,7 +136,7 @@ PxeBcCommonNotify (
 \r
   @param  Mode           The pointer to EFI_PXE_BASE_CODE_MODE.\r
   @param  Ip4Addr        The Ip4 address for resolution.\r
-  @param  MacAddress     The resoluted MAC address if the resolution is successful.\r
+  @param  MacAddress     The resolved MAC address if the resolution is successful.\r
                          The value is undefined if the resolution fails.\r
 \r
   @retval TRUE           Found an matched entry.\r
@@ -306,7 +300,7 @@ PxeBcIcmpErrorDpcHandle (
     //\r
     goto ON_RECYCLE;\r
   }\r
-  \r
+\r
   //\r
   // The protocol has been configured to only receive ICMP packet.\r
   //\r
@@ -482,7 +476,7 @@ PxeBcIcmp6ErrorDpcHandle (
 \r
 ON_RECYCLE:\r
   gBS->SignalEvent (RxData->RecycleSignal);\r
-  \r
+\r
 ON_EXIT:\r
   Private->Icmp6Token.Status = EFI_NOT_READY;\r
   Ip6->Receive (Ip6, &Private->Icmp6Token);\r
@@ -517,7 +511,7 @@ PxeBcIcmp6ErrorUpdate (
   @param[in, out]  SrcPort              The pointer to the source port.\r
   @param[in]       DoNotFragment        If TRUE, fragment is not enabled.\r
                                         Otherwise, fragment is enabled.\r
-  @param[in]       Ttl                  The time to live field of the IP header. \r
+  @param[in]       Ttl                  The time to live field of the IP header.\r
   @param[in]       ToS                  The type of service field of the IP header.\r
 \r
   @retval          EFI_SUCCESS          Successfully configured this instance.\r
@@ -1182,7 +1176,7 @@ PxeBcUdp4Read (
          Token->Status == EFI_NOT_READY &&\r
          EFI_ERROR (gBS->CheckEvent (TimeoutEvent))) {\r
     //\r
-    // Poll the token utill reply/ICMPv6 error message received or timeout.\r
+    // Poll the token until reply/ICMPv6 error message received or timeout.\r
     //\r
     Udp4->Poll (Udp4);\r
     if (Token->Status == EFI_ICMP_ERROR ||\r
@@ -1286,7 +1280,7 @@ PxeBcUdp6Read (
          Token->Status == EFI_NOT_READY &&\r
          EFI_ERROR (gBS->CheckEvent (TimeoutEvent))) {\r
     //\r
-    // Poll the token utill reply/ICMPv6 error message received or timeout.\r
+    // Poll the token until reply/ICMPv6 error message received or timeout.\r
     //\r
     Udp6->Poll (Udp6);\r
     if (Token->Status == EFI_ICMP_ERROR ||\r
@@ -1510,14 +1504,14 @@ CalcElapsedTime (
   //\r
   ZeroMem (&Time, sizeof (EFI_TIME));\r
   gRT->GetTime (&Time, NULL);\r
-  CurrentStamp = (UINT64)\r
-    (\r
-      ((((((Time.Year - 1900) * 360 +\r
-       (Time.Month - 1)) * 30 +\r
-       (Time.Day - 1)) * 24 + Time.Hour) * 60 +\r
-       Time.Minute) * 60 + Time.Second) * 100\r
-       + DivU64x32(Time.Nanosecond, 10000000)\r
-    );\r
+  CurrentStamp = MultU64x32 (\r
+                   ((((UINT32)(Time.Year - 1900) * 360 + (Time.Month - 1) * 30 + (Time.Day - 1)) * 24 + Time.Hour) * 60 + Time.Minute) * 60 + Time.Second,\r
+                   100\r
+                   ) +\r
+                 DivU64x32 (\r
+                   Time.Nanosecond,\r
+                   10000000\r
+                   );\r
 \r
   //\r
   // Sentinel value of 0 means that this is the first DHCP packet that we are\r