]> git.proxmox.com Git - mirror_edk2.git/commitdiff
refine the code and add more security check.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 8 Jan 2010 02:35:56 +0000 (02:35 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 8 Jan 2010 02:35:56 +0000 (02:35 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9691 6f19259b-4bc3-4df7-8a09-765794883524

18 files changed:
MdeModulePkg/Include/Library/NetLib.h
MdeModulePkg/Include/Library/UdpIoLib.h
MdeModulePkg/Library/DxeNetLib/DxeNetLib.c
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.c
MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Driver.c
MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.c
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Driver.c
MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c
MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.c
MdeModulePkg/Universal/Network/SnpDxe/Snp.c
MdeModulePkg/Universal/Network/SnpDxe/Statistics.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c
MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c

index 039e04f696f4a7f4d860a1702cc5d65e5ebb6a15..d90f82d97a66580b00e0bf3bba5c1cb73a7a2883 100644 (file)
@@ -2,7 +2,7 @@
   This library is only intended to be used by UEFI network stack modules.\r
   It provides basic functions for the UEFI network stack.\r
 \r
   This library is only intended to be used by UEFI network stack modules.\r
   It provides basic functions for the UEFI network stack.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation\r
+Copyright (c) 2005 - 2010, Intel Corporation\r
 All rights reserved. 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
 All rights reserved. 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
@@ -1025,9 +1025,9 @@ NetLibGetVlanId (
   This function will append VLAN device path node to the parent device path,\r
   and then use LocateDevicePath() to find the correct VLAN device handle.\r
 \r
   This function will append VLAN device path node to the parent device path,\r
   and then use LocateDevicePath() to find the correct VLAN device handle.\r
 \r
-  @param[in]   ServiceHandle    The handle where network service binding protocols are\r
+  @param[in]   ControllerHandle The handle where network service binding protocols are\r
                                 installed on.\r
                                 installed on.\r
-  @param[in]   VLanId           The configured VLAN ID for the VLAN device.\r
+  @param[in]   VlanId           The configured VLAN ID for the VLAN device.\r
 \r
   @return The VLAN device handle, or NULL if not found.\r
 \r
 \r
   @return The VLAN device handle, or NULL if not found.\r
 \r
index c93fb1208590754855ed1384a337c5af7f68c103..a680cc6179afae4e03f6d4899938bba9004c5bf7 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
   UdpIoRecvDatagram() or UdpIoSendDatagram(). When receiving, Netbuf is allocated by the\r
   UDP access point and released by the user. When sending, the user allocates the the NetBuf, which is then\r
   provided to the callback as a reference.\r
   UdpIoRecvDatagram() or UdpIoSendDatagram(). When receiving, Netbuf is allocated by the\r
   UDP access point and released by the user. When sending, the user allocates the the NetBuf, which is then\r
   provided to the callback as a reference.\r
-  \r
+\r
   @param[in] Packet       Packet received or sent\r
   @param[in] EndPoint     The UDP address pair corresponds to the UDP IO\r
   @param[in] IoStatus     Packet receiving or sending status\r
   @param[in] Packet       Packet received or sent\r
   @param[in] EndPoint     The UDP address pair corresponds to the UDP IO\r
   @param[in] IoStatus     Packet receiving or sending status\r
@@ -127,7 +127,7 @@ typedef struct {
 ///\r
 /// Type defined as UDP_IO.\r
 ///\r
 ///\r
 /// Type defined as UDP_IO.\r
 ///\r
-/// This data structure wraps the UDP instance and configuration. \r
+/// This data structure wraps the UDP instance and configuration.\r
 /// UdpIo Library uses this structure for all Udp4 or Udp6 operations.\r
 ///\r
 struct _UDP_IO {\r
 /// UdpIo Library uses this structure for all Udp4 or Udp6 operations.\r
 ///\r
 struct _UDP_IO {\r
@@ -151,7 +151,7 @@ struct _UDP_IO {
   union {\r
     EFI_UDP4_PROTOCOL       *Udp4;\r
     EFI_UDP6_PROTOCOL       *Udp6;\r
   union {\r
     EFI_UDP4_PROTOCOL       *Udp4;\r
     EFI_UDP6_PROTOCOL       *Udp6;\r
-  } Protocol;  \r
+  } Protocol;\r
 \r
   union {\r
     EFI_UDP4_CONFIG_DATA    Udp4;\r
 \r
   union {\r
     EFI_UDP4_CONFIG_DATA    Udp4;\r
@@ -161,12 +161,12 @@ struct _UDP_IO {
 \r
 /**\r
   Prototype called when UdpIo Library configures a UDP instance.\r
 \r
 /**\r
   Prototype called when UdpIo Library configures a UDP instance.\r
-  \r
+\r
   The prototype is set and called when creating a UDP_IO in UdpIoCreatePort().\r
   The prototype is set and called when creating a UDP_IO in UdpIoCreatePort().\r
-  \r
+\r
   @param[in] UdpIo         The UDP_IO to configure\r
   @param[in] Context       User-defined data when calling UdpIoCreatePort()\r
   @param[in] UdpIo         The UDP_IO to configure\r
   @param[in] Context       User-defined data when calling UdpIoCreatePort()\r
-  \r
+\r
   @retval EFI_SUCCESS  The configuration succeeded\r
   @retval Others       The UDP_IO fails to configure indicating\r
                        UdpIoCreatePort() should fail\r
   @retval EFI_SUCCESS  The configuration succeeded\r
   @retval Others       The UDP_IO fails to configure indicating\r
                        UdpIoCreatePort() should fail\r
@@ -179,11 +179,11 @@ EFI_STATUS
   );\r
 \r
 /**\r
   );\r
 \r
 /**\r
-  The select function to decide whether to cancel the UDP_TX_TOKEN. \r
-  \r
+  The select function to decide whether to cancel the UDP_TX_TOKEN.\r
+\r
   @param[in] Token        The UDP_TX_TOKEN to decide whether to cancel\r
   @param[in] Context      User-defined data in UdpIoCancelDgrams()\r
   @param[in] Token        The UDP_TX_TOKEN to decide whether to cancel\r
   @param[in] Context      User-defined data in UdpIoCancelDgrams()\r
-  \r
+\r
   @retval TRUE        Cancel the UDP_TX_TOKEN\r
   @retval FALSE       Do not cancel this UDP_TX_TOKEN\r
 \r
   @retval TRUE        Cancel the UDP_TX_TOKEN\r
   @retval FALSE       Do not cancel this UDP_TX_TOKEN\r
 \r
@@ -196,12 +196,13 @@ BOOLEAN
   );\r
 \r
 /**\r
   );\r
 \r
 /**\r
-  Cancel all sent datagrams selected by the parameter ToCancel.\r
+  Cancel all the sent datagram that pass the selection criteria of ToCancel.\r
   If ToCancel is NULL, all the datagrams are cancelled.\r
 \r
   @param[in]  UdpIo                 The UDP_IO to cancel packet.\r
   @param[in]  IoStatus              The IoStatus to return to the packet owners.\r
   If ToCancel is NULL, all the datagrams are cancelled.\r
 \r
   @param[in]  UdpIo                 The UDP_IO to cancel packet.\r
   @param[in]  IoStatus              The IoStatus to return to the packet owners.\r
-  @param[in]  ToCancel              Sets the criteria for canceling a packet. \r
+  @param[in]  ToCancel              The select funtion to test whether to cancel this\r
+                                    packet or not.\r
   @param[in]  Context               The opaque parameter to the ToCancel.\r
 \r
 **/\r
   @param[in]  Context               The opaque parameter to the ToCancel.\r
 \r
 **/\r
@@ -210,19 +211,18 @@ EFIAPI
 UdpIoCancelDgrams (\r
   IN UDP_IO                 *UdpIo,\r
   IN EFI_STATUS             IoStatus,\r
 UdpIoCancelDgrams (\r
   IN UDP_IO                 *UdpIo,\r
   IN EFI_STATUS             IoStatus,\r
-  IN UDP_IO_TO_CANCEL       ToCancel OPTIONAL,\r
+  IN UDP_IO_TO_CANCEL       ToCancel,        OPTIONAL\r
   IN VOID                   *Context\r
   );\r
 \r
 /**\r
   Creates a UDP_IO to access the UDP service. It creates and configures\r
   a UDP child.\r
   IN VOID                   *Context\r
   );\r
 \r
 /**\r
   Creates a UDP_IO to access the UDP service. It creates and configures\r
   a UDP child.\r
-  \r
-  This function:\r
-  # locates the UDP service binding prototype on the Controller parameter\r
-  # uses the UDP service binding prototype to create a UDP child (also known as a UDP instance)\r
-  # configures the UDP child by calling Configure function prototype. \r
-  Any failures in creating or configuring the UDP child return NULL for failure. \r
+\r
+  It locates the UDP service binding prototype on the Controller parameter\r
+  uses the UDP service binding prototype to create a UDP child (also known as\r
+  a UDP instance) configures the UDP child by calling Configure function prototype.\r
+  Any failures in creating or configuring the UDP child return NULL for failure.\r
 \r
   @param[in]  Controller            The controller that has the UDP service binding.\r
                                     protocol installed.\r
 \r
   @param[in]  Controller            The controller that has the UDP service binding.\r
                                     protocol installed.\r
@@ -246,7 +246,7 @@ UdpIoCreateIo (
 \r
 /**\r
   Free the UDP_IO and all its related resources.\r
 \r
 /**\r
   Free the UDP_IO and all its related resources.\r
-  \r
+\r
   The function cancels all sent datagrams and receive requests.\r
 \r
   @param[in]  UdpIo             The UDP_IO to free.\r
   The function cancels all sent datagrams and receive requests.\r
 \r
   @param[in]  UdpIo             The UDP_IO to free.\r
@@ -261,9 +261,9 @@ UdpIoFreeIo (
   );\r
 \r
 /**\r
   );\r
 \r
 /**\r
-  Cleans up the UDP_IO without freeing it. Call this function \r
+  Cleans up the UDP_IO without freeing it. Call this function\r
   if you intend to later re-use the UDP_IO.\r
   if you intend to later re-use the UDP_IO.\r
-  \r
+\r
   This function releases all transmitted datagrams and receive requests and configures NULL for the UDP instance.\r
 \r
   @param[in]  UdpIo                 The UDP_IO to clean up.\r
   This function releases all transmitted datagrams and receive requests and configures NULL for the UDP instance.\r
 \r
   @param[in]  UdpIo                 The UDP_IO to clean up.\r
@@ -277,7 +277,7 @@ UdpIoCleanIo (
 \r
 /**\r
   Send a packet through the UDP_IO.\r
 \r
 /**\r
   Send a packet through the UDP_IO.\r
-  \r
+\r
   The packet will be wrapped in UDP_TX_TOKEN. Function Callback will be called\r
   when the packet is sent. The optional parameter EndPoint overrides the default\r
   address pair if specified.\r
   The packet will be wrapped in UDP_TX_TOKEN. Function Callback will be called\r
   when the packet is sent. The optional parameter EndPoint overrides the default\r
   address pair if specified.\r
@@ -286,7 +286,7 @@ UdpIoCleanIo (
   @param[in]  Packet                The packet to send.\r
   @param[in]  EndPoint              The local and remote access point. Override the\r
                                     default address pair set during configuration.\r
   @param[in]  Packet                The packet to send.\r
   @param[in]  EndPoint              The local and remote access point. Override the\r
                                     default address pair set during configuration.\r
-  @param[in]  Gateway               The gateway to use.  \r
+  @param[in]  Gateway               The gateway to use.\r
   @param[in]  CallBack              The function being called when packet is\r
                                     transmitted or failed.\r
   @param[in]  Context               The opaque parameter passed to CallBack.\r
   @param[in]  CallBack              The function being called when packet is\r
                                     transmitted or failed.\r
   @param[in]  Context               The opaque parameter passed to CallBack.\r
@@ -310,7 +310,7 @@ UdpIoSendDatagram (
 /**\r
   Cancel a single sent datagram.\r
 \r
 /**\r
   Cancel a single sent datagram.\r
 \r
-  @param[in]  UdpIo                 The UDP_IO from which to cancel the packet \r
+  @param[in]  UdpIo                 The UDP_IO from which to cancel the packet\r
   @param[in]  Packet                The packet to cancel\r
 \r
 **/\r
   @param[in]  Packet                The packet to cancel\r
 \r
 **/\r
@@ -323,7 +323,7 @@ UdpIoCancelSentDatagram (
 \r
 /**\r
   Issue a receive request to the UDP_IO.\r
 \r
 /**\r
   Issue a receive request to the UDP_IO.\r
-  \r
+\r
   This function is called when upper-layer needs packet from UDP for processing.\r
   Only one receive request is acceptable at a time. Therefore, one common usage model is\r
   to invoke this function inside its Callback function when the former packet\r
   This function is called when upper-layer needs packet from UDP for processing.\r
   Only one receive request is acceptable at a time. Therefore, one common usage model is\r
   to invoke this function inside its Callback function when the former packet\r
index f58783cdfd3f8046b77b3301fc9f6b97ee8f6339..e18f4ab4745f4984f0a80df7e1e47247436cffd1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Network library.\r
 \r
 /** @file\r
   Network library.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -1530,7 +1530,7 @@ EFIAPI
 NetMapIterate (\r
   IN NET_MAP                *Map,\r
   IN NET_MAP_CALLBACK       CallBack,\r
 NetMapIterate (\r
   IN NET_MAP                *Map,\r
   IN NET_MAP_CALLBACK       CallBack,\r
-  IN VOID                   *Arg\r
+  IN VOID                   *Arg      OPTIONAL\r
   )\r
 {\r
 \r
   )\r
 {\r
 \r
@@ -1900,9 +1900,9 @@ NetLibGetVlanId (
   This function will append VLAN device path node to the parent device path,\r
   and then use LocateDevicePath() to find the correct VLAN device handle.\r
 \r
   This function will append VLAN device path node to the parent device path,\r
   and then use LocateDevicePath() to find the correct VLAN device handle.\r
 \r
-  @param[in]   ServiceHandle    The handle where network service binding protocols are\r
+  @param[in]   ControllerHandle The handle where network service binding protocols are\r
                                 installed on.\r
                                 installed on.\r
-  @param[in]   VLanId           The configured VLAN ID for the VLAN device.\r
+  @param[in]   VlanId           The configured VLAN ID for the VLAN device.\r
 \r
   @return The VLAN device handle, or NULL if not found.\r
 \r
 \r
   @return The VLAN device handle, or NULL if not found.\r
 \r
@@ -2399,7 +2399,7 @@ NetLibGetNicHandle (
   Handle = NULL;\r
 \r
   for (Index = 0; Index < OpenCount; Index++) {\r
   Handle = NULL;\r
 \r
   for (Index = 0; Index < OpenCount; Index++) {\r
-    if (OpenBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) {\r
+    if ((OpenBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {\r
       Handle = OpenBuffer[Index].ControllerHandle;\r
       break;\r
     }\r
       Handle = OpenBuffer[Index].ControllerHandle;\r
       break;\r
     }\r
index bb85aebc282a13f76bb603ded45eea784fa5b083..afcde8199a5ccff9eb3d1938c7bd2a0d40e3475d 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
   Help functions to access UDP service, it is used by both the DHCP and MTFTP.\r
 /** @file\r
   Help functions to access UDP service, it is used by both the DHCP and MTFTP.\r
-  \r
+\r
 Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -44,7 +44,7 @@ UdpIoFreeTxToken (
   } else {\r
     ASSERT (FALSE);\r
   }\r
   } else {\r
     ASSERT (FALSE);\r
   }\r
-  \r
+\r
   FreePool (TxToken);\r
 }\r
 \r
   FreePool (TxToken);\r
 }\r
 \r
@@ -65,14 +65,14 @@ UdpIoFreeRxToken (
     gBS->CloseEvent (RxToken->Token.Udp6.Event);\r
   } else {\r
     ASSERT (FALSE);\r
     gBS->CloseEvent (RxToken->Token.Udp6.Event);\r
   } else {\r
     ASSERT (FALSE);\r
-  }  \r
+  }\r
 \r
   FreePool (RxToken);\r
 }\r
 \r
 /**\r
   The callback function when the packet is sent by UDP.\r
 \r
   FreePool (RxToken);\r
 }\r
 \r
 /**\r
   The callback function when the packet is sent by UDP.\r
-  \r
+\r
   It will remove the packet from the local list then call\r
   the packet owner's callback function set by UdpIoSendDatagram.\r
 \r
   It will remove the packet from the local list then call\r
   the packet owner's callback function set by UdpIoSendDatagram.\r
 \r
@@ -91,7 +91,7 @@ UdpIoOnDgramSentDpc (
   ASSERT (TxToken->Signature == UDP_IO_TX_SIGNATURE);\r
   ASSERT ((TxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) ||\r
           (TxToken->UdpIo->UdpVersion == UDP_IO_UDP6_VERSION));\r
   ASSERT (TxToken->Signature == UDP_IO_TX_SIGNATURE);\r
   ASSERT ((TxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) ||\r
           (TxToken->UdpIo->UdpVersion == UDP_IO_UDP6_VERSION));\r
-  \r
+\r
   RemoveEntryList (&TxToken->Link);\r
 \r
   if (TxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) {\r
   RemoveEntryList (&TxToken->Link);\r
 \r
   if (TxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) {\r
@@ -105,7 +105,7 @@ UdpIoOnDgramSentDpc (
 \r
 /**\r
   Request UdpIoOnDgramSentDpc as a DPC at TPL_CALLBACK.\r
 \r
 /**\r
   Request UdpIoOnDgramSentDpc as a DPC at TPL_CALLBACK.\r
-  \r
+\r
   @param[in]  Event                 The event signaled.\r
   @param[in]  Context               The UDP TX Token.\r
 \r
   @param[in]  Event                 The event signaled.\r
   @param[in]  Context               The UDP TX Token.\r
 \r
@@ -133,7 +133,7 @@ VOID
 UdpIoRecycleDgram (\r
   IN VOID                   *Context\r
   )\r
 UdpIoRecycleDgram (\r
   IN VOID                   *Context\r
   )\r
-{ \r
+{\r
   UDP_RX_TOKEN              *RxToken;\r
 \r
   RxToken = (UDP_RX_TOKEN *) Context;\r
   UDP_RX_TOKEN              *RxToken;\r
 \r
   RxToken = (UDP_RX_TOKEN *) Context;\r
@@ -151,7 +151,7 @@ UdpIoRecycleDgram (
 \r
 /**\r
   The event handle for UDP receive request.\r
 \r
 /**\r
   The event handle for UDP receive request.\r
-  \r
+\r
   It will build a NET_BUF from the recieved UDP data, then deliver it\r
   to the receiver.\r
 \r
   It will build a NET_BUF from the recieved UDP data, then deliver it\r
   to the receiver.\r
 \r
@@ -176,7 +176,7 @@ UdpIoOnDgramRcvdDpc (
 \r
   ZeroMem (&EndPoint, sizeof(UDP_END_POINT));\r
 \r
 \r
   ZeroMem (&EndPoint, sizeof(UDP_END_POINT));\r
 \r
-  ASSERT ((RxToken->Signature == UDP_IO_RX_SIGNATURE) && \r
+  ASSERT ((RxToken->Signature == UDP_IO_RX_SIGNATURE) &&\r
           (RxToken == RxToken->UdpIo->RecvRequest));\r
 \r
   ASSERT ((RxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) ||\r
           (RxToken == RxToken->UdpIo->RecvRequest));\r
 \r
   ASSERT ((RxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) ||\r
@@ -214,7 +214,7 @@ UdpIoOnDgramRcvdDpc (
   // Build a NET_BUF from the UDP receive data, then deliver it up.\r
   //\r
   if (RxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) {\r
   // Build a NET_BUF from the UDP receive data, then deliver it up.\r
   //\r
   if (RxToken->UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) {\r
-    \r
+\r
     Netbuf = NetbufFromExt (\r
                (NET_FRAGMENT *)((EFI_UDP4_RECEIVE_DATA *) RxData)->FragmentTable,\r
                ((EFI_UDP4_RECEIVE_DATA *) RxData)->FragmentCount,\r
     Netbuf = NetbufFromExt (\r
                (NET_FRAGMENT *)((EFI_UDP4_RECEIVE_DATA *) RxData)->FragmentTable,\r
                ((EFI_UDP4_RECEIVE_DATA *) RxData)->FragmentCount,\r
@@ -251,7 +251,7 @@ UdpIoOnDgramRcvdDpc (
     EndPoint.LocalAddr.Addr[0]  = NTOHL (EndPoint.LocalAddr.Addr[0]);\r
     EndPoint.RemoteAddr.Addr[0] = NTOHL (EndPoint.RemoteAddr.Addr[0]);\r
   } else {\r
     EndPoint.LocalAddr.Addr[0]  = NTOHL (EndPoint.LocalAddr.Addr[0]);\r
     EndPoint.RemoteAddr.Addr[0] = NTOHL (EndPoint.RemoteAddr.Addr[0]);\r
   } else {\r
-  \r
+\r
     Netbuf = NetbufFromExt (\r
                (NET_FRAGMENT *)((EFI_UDP6_RECEIVE_DATA *) RxData)->FragmentTable,\r
                ((EFI_UDP6_RECEIVE_DATA *) RxData)->FragmentCount,\r
     Netbuf = NetbufFromExt (\r
                (NET_FRAGMENT *)((EFI_UDP6_RECEIVE_DATA *) RxData)->FragmentTable,\r
                ((EFI_UDP6_RECEIVE_DATA *) RxData)->FragmentCount,\r
@@ -260,19 +260,19 @@ UdpIoOnDgramRcvdDpc (
                UdpIoRecycleDgram,\r
                RxToken\r
                );\r
                UdpIoRecycleDgram,\r
                RxToken\r
                );\r
-  \r
+\r
     if (Netbuf == NULL) {\r
       gBS->SignalEvent (((EFI_UDP6_RECEIVE_DATA *) RxData)->RecycleSignal);\r
       RxToken->CallBack (NULL, NULL, EFI_OUT_OF_RESOURCES, RxToken->Context);\r
     if (Netbuf == NULL) {\r
       gBS->SignalEvent (((EFI_UDP6_RECEIVE_DATA *) RxData)->RecycleSignal);\r
       RxToken->CallBack (NULL, NULL, EFI_OUT_OF_RESOURCES, RxToken->Context);\r
-  \r
+\r
       UdpIoFreeRxToken (RxToken);\r
       return;\r
     }\r
       UdpIoFreeRxToken (RxToken);\r
       return;\r
     }\r
-  \r
+\r
     Session             = &((EFI_UDP6_RECEIVE_DATA *) RxData)->UdpSession;\r
     EndPoint.LocalPort  = ((EFI_UDP6_SESSION_DATA *) Session)->DestinationPort;\r
     EndPoint.RemotePort = ((EFI_UDP6_SESSION_DATA *) Session)->SourcePort;\r
     Session             = &((EFI_UDP6_RECEIVE_DATA *) RxData)->UdpSession;\r
     EndPoint.LocalPort  = ((EFI_UDP6_SESSION_DATA *) Session)->DestinationPort;\r
     EndPoint.RemotePort = ((EFI_UDP6_SESSION_DATA *) Session)->SourcePort;\r
-  \r
+\r
     CopyMem (\r
       &EndPoint.LocalAddr,\r
       &((EFI_UDP6_SESSION_DATA *) Session)->DestinationAddress,\r
     CopyMem (\r
       &EndPoint.LocalAddr,\r
       &((EFI_UDP6_SESSION_DATA *) Session)->DestinationAddress,\r
@@ -362,7 +362,7 @@ UdpIoCreateRxToken (
                     &Token->Token.Udp4.Event\r
                     );\r
     } else {\r
                     &Token->Token.Udp4.Event\r
                     );\r
     } else {\r
-  \r
+\r
     Token->Token.Udp6.Status        = EFI_NOT_READY;\r
     Token->Token.Udp6.Packet.RxData = NULL;\r
 \r
     Token->Token.Udp6.Status        = EFI_NOT_READY;\r
     Token->Token.Udp6.Packet.RxData = NULL;\r
 \r
@@ -373,7 +373,7 @@ UdpIoCreateRxToken (
                     Token,\r
                     &Token->Token.Udp6.Event\r
                     );\r
                     Token,\r
                     &Token->Token.Udp6.Event\r
                     );\r
-  } \r
+  }\r
 \r
 \r
   if (EFI_ERROR (Status)) {\r
 \r
 \r
   if (EFI_ERROR (Status)) {\r
@@ -394,7 +394,7 @@ UdpIoCreateRxToken (
   @param[in]  CallBack              The function to call when transmission completed.\r
   @param[in]  Context               The opaque parameter to the call back.\r
 \r
   @param[in]  CallBack              The function to call when transmission completed.\r
   @param[in]  Context               The opaque parameter to the call back.\r
 \r
-  @return The wrapped transmission request or NULL if failed to allocate resources \r
+  @return The wrapped transmission request or NULL if failed to allocate resources\r
           or for some errors.\r
 \r
 **/\r
           or for some errors.\r
 \r
 **/\r
@@ -414,7 +414,7 @@ UdpIoCreateTxToken (
   EFI_STATUS                Status;\r
   UINT32                    Count;\r
   UINTN                     Size;\r
   EFI_STATUS                Status;\r
   UINT32                    Count;\r
   UINTN                     Size;\r
-  IP4_ADDR                  Ip;  \r
+  IP4_ADDR                  Ip;\r
 \r
   ASSERT (Packet != NULL);\r
   ASSERT ((UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) ||\r
 \r
   ASSERT (Packet != NULL);\r
   ASSERT ((UdpIo->UdpVersion == UDP_IO_UDP4_VERSION) ||\r
@@ -478,15 +478,15 @@ UdpIoCreateTxToken (
     if (EndPoint != NULL) {\r
       Ip = HTONL (EndPoint->LocalAddr.Addr[0]);\r
       CopyMem (\r
     if (EndPoint != NULL) {\r
       Ip = HTONL (EndPoint->LocalAddr.Addr[0]);\r
       CopyMem (\r
-        &TxToken->Session.Udp4.SourceAddress, \r
-        &Ip, \r
+        &TxToken->Session.Udp4.SourceAddress,\r
+        &Ip,\r
         sizeof (EFI_IPv4_ADDRESS)\r
         );\r
 \r
       Ip = HTONL (EndPoint->RemoteAddr.Addr[0]);\r
       CopyMem (\r
         sizeof (EFI_IPv4_ADDRESS)\r
         );\r
 \r
       Ip = HTONL (EndPoint->RemoteAddr.Addr[0]);\r
       CopyMem (\r
-        &TxToken->Session.Udp4.DestinationAddress, \r
-        &Ip, \r
+        &TxToken->Session.Udp4.DestinationAddress,\r
+        &Ip,\r
         sizeof (EFI_IPv4_ADDRESS)\r
         );\r
 \r
         sizeof (EFI_IPv4_ADDRESS)\r
         );\r
 \r
@@ -498,13 +498,13 @@ UdpIoCreateTxToken (
     if (Gateway != NULL && (Gateway->Addr[0] != 0)) {\r
       Ip = HTONL (Gateway->Addr[0]);\r
       CopyMem (&TxToken->Gateway, &Ip, sizeof (EFI_IPv4_ADDRESS));\r
     if (Gateway != NULL && (Gateway->Addr[0] != 0)) {\r
       Ip = HTONL (Gateway->Addr[0]);\r
       CopyMem (&TxToken->Gateway, &Ip, sizeof (EFI_IPv4_ADDRESS));\r
-      ((EFI_UDP4_TRANSMIT_DATA *) Data)->GatewayAddress = &TxToken->Gateway;      \r
+      ((EFI_UDP4_TRANSMIT_DATA *) Data)->GatewayAddress = &TxToken->Gateway;\r
     }\r
 \r
   } else {\r
     }\r
 \r
   } else {\r
-  \r
+\r
     ((EFI_UDP6_COMPLETION_TOKEN *) Token)->Status = EFI_NOT_READY;\r
     ((EFI_UDP6_COMPLETION_TOKEN *) Token)->Status = EFI_NOT_READY;\r
-    \r
+\r
     Status = gBS->CreateEvent (\r
                     EVT_NOTIFY_SIGNAL,\r
                     TPL_NOTIFY,\r
     Status = gBS->CreateEvent (\r
                     EVT_NOTIFY_SIGNAL,\r
                     TPL_NOTIFY,\r
@@ -517,7 +517,7 @@ UdpIoCreateTxToken (
       FreePool (TxToken);\r
       return NULL;\r
     }\r
       FreePool (TxToken);\r
       return NULL;\r
     }\r
-    \r
+\r
     Data = &(TxToken->Data.Udp6);\r
     ((EFI_UDP6_COMPLETION_TOKEN *) Token)->Packet.TxData  = Data;\r
     ((EFI_UDP6_TRANSMIT_DATA *) Data)->UdpSessionData     = NULL;\r
     Data = &(TxToken->Data.Udp6);\r
     ((EFI_UDP6_COMPLETION_TOKEN *) Token)->Packet.TxData  = Data;\r
     ((EFI_UDP6_TRANSMIT_DATA *) Data)->UdpSessionData     = NULL;\r
@@ -533,21 +533,21 @@ UdpIoCreateTxToken (
 \r
     if (EndPoint != NULL) {\r
       CopyMem (\r
 \r
     if (EndPoint != NULL) {\r
       CopyMem (\r
-        &TxToken->Session.Udp6.SourceAddress, \r
-        &EndPoint->LocalAddr.v6, \r
+        &TxToken->Session.Udp6.SourceAddress,\r
+        &EndPoint->LocalAddr.v6,\r
         sizeof(EFI_IPv6_ADDRESS)\r
         );\r
 \r
       CopyMem (\r
         sizeof(EFI_IPv6_ADDRESS)\r
         );\r
 \r
       CopyMem (\r
-        &TxToken->Session.Udp6.DestinationAddress, \r
-        &EndPoint->RemoteAddr.v6, \r
+        &TxToken->Session.Udp6.DestinationAddress,\r
+        &EndPoint->RemoteAddr.v6,\r
         sizeof(EFI_IPv6_ADDRESS)\r
         );\r
 \r
       TxToken->Session.Udp6.SourcePort                   = EndPoint->LocalPort;\r
       TxToken->Session.Udp6.DestinationPort              = EndPoint->RemotePort;\r
       ((EFI_UDP6_TRANSMIT_DATA *) Data)->UdpSessionData  = &(TxToken->Session.Udp6);\r
         sizeof(EFI_IPv6_ADDRESS)\r
         );\r
 \r
       TxToken->Session.Udp6.SourcePort                   = EndPoint->LocalPort;\r
       TxToken->Session.Udp6.DestinationPort              = EndPoint->RemotePort;\r
       ((EFI_UDP6_TRANSMIT_DATA *) Data)->UdpSessionData  = &(TxToken->Session.Udp6);\r
-    } \r
+    }\r
   }\r
 \r
   return TxToken;\r
   }\r
 \r
   return TxToken;\r
@@ -556,12 +556,11 @@ UdpIoCreateTxToken (
 /**\r
   Creates a UDP_IO to access the UDP service. It creates and configures\r
   a UDP child.\r
 /**\r
   Creates a UDP_IO to access the UDP service. It creates and configures\r
   a UDP child.\r
-  \r
-  This function:\r
-  # locates the UDP service binding prototype on the Controller parameter\r
-  # uses the UDP service binding prototype to create a UDP child (also known as a UDP instance)\r
-  # configures the UDP child by calling Configure function prototype. \r
-  Any failures in creating or configuring the UDP child return NULL for failure. \r
+\r
+  It locates the UDP service binding prototype on the Controller parameter\r
+  uses the UDP service binding prototype to create a UDP child (also known as\r
+  a UDP instance) configures the UDP child by calling Configure function prototype.\r
+  Any failures in creating or configuring the UDP child return NULL for failure.\r
 \r
   @param[in]  Controller            The controller that has the UDP service binding.\r
                                     protocol installed.\r
 \r
   @param[in]  Controller            The controller that has the UDP service binding.\r
                                     protocol installed.\r
@@ -617,7 +616,7 @@ UdpIoCreateIo (
                &gEfiUdp4ServiceBindingProtocolGuid,\r
                &UdpIo->UdpHandle\r
                );\r
                &gEfiUdp4ServiceBindingProtocolGuid,\r
                &UdpIo->UdpHandle\r
                );\r
-  \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto FREE_MEM;\r
     }\r
     if (EFI_ERROR (Status)) {\r
       goto FREE_MEM;\r
     }\r
@@ -638,32 +637,32 @@ UdpIoCreateIo (
     if (EFI_ERROR (Configure (UdpIo, Context))) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
     if (EFI_ERROR (Configure (UdpIo, Context))) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
-  \r
+\r
     Status = UdpIo->Protocol.Udp4->GetModeData (\r
     Status = UdpIo->Protocol.Udp4->GetModeData (\r
-                                     UdpIo->Protocol.Udp4, \r
-                                     NULL, \r
-                                     NULL, \r
-                                     NULL, \r
+                                     UdpIo->Protocol.Udp4,\r
+                                     NULL,\r
+                                     NULL,\r
+                                     NULL,\r
                                      &UdpIo->SnpMode\r
                                      );\r
                                      &UdpIo->SnpMode\r
                                      );\r
-  \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
 \r
   } else {\r
     if (EFI_ERROR (Status)) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
 \r
   } else {\r
-    \r
+\r
     Status = NetLibCreateServiceChild (\r
                Controller,\r
                ImageHandle,\r
                &gEfiUdp6ServiceBindingProtocolGuid,\r
                &UdpIo->UdpHandle\r
                );\r
     Status = NetLibCreateServiceChild (\r
                Controller,\r
                ImageHandle,\r
                &gEfiUdp6ServiceBindingProtocolGuid,\r
                &UdpIo->UdpHandle\r
                );\r
-  \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto FREE_MEM;\r
     }\r
     if (EFI_ERROR (Status)) {\r
       goto FREE_MEM;\r
     }\r
-  \r
+\r
     Status = gBS->OpenProtocol (\r
                     UdpIo->UdpHandle,\r
                     &gEfiUdp6ProtocolGuid,\r
     Status = gBS->OpenProtocol (\r
                     UdpIo->UdpHandle,\r
                     &gEfiUdp6ProtocolGuid,\r
@@ -672,23 +671,23 @@ UdpIoCreateIo (
                     Controller,\r
                     EFI_OPEN_PROTOCOL_BY_DRIVER\r
                     );\r
                     Controller,\r
                     EFI_OPEN_PROTOCOL_BY_DRIVER\r
                     );\r
-  \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto FREE_CHILD;\r
     }\r
     if (EFI_ERROR (Status)) {\r
       goto FREE_CHILD;\r
     }\r
-  \r
+\r
     if (EFI_ERROR (Configure (UdpIo, Context))) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
     if (EFI_ERROR (Configure (UdpIo, Context))) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
-  \r
+\r
     Status = UdpIo->Protocol.Udp6->GetModeData (\r
     Status = UdpIo->Protocol.Udp6->GetModeData (\r
-                                     UdpIo->Protocol.Udp6, \r
-                                     NULL, \r
-                                     NULL, \r
-                                     NULL, \r
+                                     UdpIo->Protocol.Udp6,\r
+                                     NULL,\r
+                                     NULL,\r
+                                     NULL,\r
                                      &UdpIo->SnpMode\r
                                      );\r
                                      &UdpIo->SnpMode\r
                                      );\r
-  \r
+\r
     if (EFI_ERROR (Status)) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
     if (EFI_ERROR (Status)) {\r
       goto CLOSE_PROTOCOL;\r
     }\r
@@ -763,12 +762,12 @@ UdpIoCancelDgrams (
         UdpIo->Protocol.Udp6->Cancel (UdpIo->Protocol.Udp6, &TxToken->Token.Udp6);\r
       }\r
     }\r
         UdpIo->Protocol.Udp6->Cancel (UdpIo->Protocol.Udp6, &TxToken->Token.Udp6);\r
       }\r
     }\r
-  }  \r
+  }\r
 }\r
 \r
 /**\r
   Free the UDP_IO and all its related resources.\r
 }\r
 \r
 /**\r
   Free the UDP_IO and all its related resources.\r
-  \r
+\r
   The function will cancel all sent datagram and receive request.\r
 \r
   @param[in]  UdpIo             The UDP_IO to free.\r
   The function will cancel all sent datagram and receive request.\r
 \r
   @param[in]  UdpIo             The UDP_IO to free.\r
@@ -825,7 +824,7 @@ UdpIoFreeIo (
     if ((RxToken = UdpIo->RecvRequest) != NULL) {\r
       UdpIo->Protocol.Udp6->Cancel (UdpIo->Protocol.Udp6, &RxToken->Token.Udp6);\r
     }\r
     if ((RxToken = UdpIo->RecvRequest) != NULL) {\r
       UdpIo->Protocol.Udp6->Cancel (UdpIo->Protocol.Udp6, &RxToken->Token.Udp6);\r
     }\r
-    \r
+\r
     //\r
     // Close then destory the Udp6 child\r
     //\r
     //\r
     // Close then destory the Udp6 child\r
     //\r
@@ -835,7 +834,7 @@ UdpIoFreeIo (
            UdpIo->Image,\r
            UdpIo->Controller\r
            );\r
            UdpIo->Image,\r
            UdpIo->Controller\r
            );\r
-  \r
+\r
     NetLibDestroyServiceChild (\r
       UdpIo->Controller,\r
       UdpIo->Image,\r
     NetLibDestroyServiceChild (\r
       UdpIo->Controller,\r
       UdpIo->Image,\r
@@ -856,7 +855,7 @@ UdpIoFreeIo (
 /**\r
   Clean up the UDP_IO without freeing it. The function is called when\r
   user wants to re-use the UDP_IO later.\r
 /**\r
   Clean up the UDP_IO without freeing it. The function is called when\r
   user wants to re-use the UDP_IO later.\r
-  \r
+\r
   It will release all the transmitted datagrams and receive request. It will\r
   also configure NULL for the UDP instance.\r
 \r
   It will release all the transmitted datagrams and receive request. It will\r
   also configure NULL for the UDP instance.\r
 \r
@@ -897,7 +896,7 @@ UdpIoCleanIo (
 \r
 /**\r
   Send a packet through the UDP_IO.\r
 \r
 /**\r
   Send a packet through the UDP_IO.\r
-  \r
+\r
   The packet will be wrapped in UDP_TX_TOKEN. Function Callback will be called\r
   when the packet is sent. The optional parameter EndPoint overrides the default\r
   address pair if specified.\r
   The packet will be wrapped in UDP_TX_TOKEN. Function Callback will be called\r
   when the packet is sent. The optional parameter EndPoint overrides the default\r
   address pair if specified.\r
@@ -906,7 +905,7 @@ UdpIoCleanIo (
   @param[in]  Packet                The packet to send.\r
   @param[in]  EndPoint              The local and remote access point. Override the\r
                                     default address pair set during configuration.\r
   @param[in]  Packet                The packet to send.\r
   @param[in]  EndPoint              The local and remote access point. Override the\r
                                     default address pair set during configuration.\r
-  @param[in]  Gateway               The gateway to use.  \r
+  @param[in]  Gateway               The gateway to use.\r
   @param[in]  CallBack              The function being called when packet is\r
                                     transmitted or failed.\r
   @param[in]  Context               The opaque parameter passed to CallBack.\r
   @param[in]  CallBack              The function being called when packet is\r
                                     transmitted or failed.\r
   @param[in]  Context               The opaque parameter passed to CallBack.\r
@@ -1006,7 +1005,7 @@ UdpIoCancelSentDatagram (
 \r
 /**\r
   Issue a receive request to the UDP_IO.\r
 \r
 /**\r
   Issue a receive request to the UDP_IO.\r
-  \r
+\r
   This function is called when upper-layer needs packet from UDP for processing.\r
   Only one receive request is acceptable at a time so a common usage model is\r
   to invoke this function inside its Callback function when the former packet\r
   This function is called when upper-layer needs packet from UDP for processing.\r
   Only one receive request is acceptable at a time so a common usage model is\r
   to invoke this function inside its Callback function when the former packet\r
index 76c55c4478bcf861292e049cb16ecdc684619464..3136652f9869309b16a42745fc36421a460f9e99 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
 /** @file\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -32,7 +32,7 @@ EFI_SERVICE_BINDING_PROTOCOL mDhcp4ServiceBindingTemplate = {
   This is the declaration of an EFI image entry point. This entry point is\r
   the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
   both device drivers and bus drivers.\r
   This is the declaration of an EFI image entry point. This entry point is\r
   the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
   both device drivers and bus drivers.\r
-  \r
+\r
   Entry point of the DHCP driver to install various protocols.\r
 \r
   @param[in]  ImageHandle           The firmware allocated handle for the UEFI image.\r
   Entry point of the DHCP driver to install various protocols.\r
 \r
   @param[in]  ImageHandle           The firmware allocated handle for the UEFI image.\r
@@ -315,6 +315,7 @@ Dhcp4DriverBindingStart (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+  ASSERT (DhcpSb != NULL);\r
 \r
   //\r
   // Start the receiving\r
 \r
   //\r
   // Start the receiving\r
@@ -360,7 +361,7 @@ ON_ERROR:
   restrictions for this service. DisconnectController()\r
   must follow these calling restrictions. If any other agent wishes\r
   to call Stop() it must also follow these calling restrictions.\r
   restrictions for this service. DisconnectController()\r
   must follow these calling restrictions. If any other agent wishes\r
   to call Stop() it must also follow these calling restrictions.\r
-  \r
+\r
   @param[in]  This              Protocol instance pointer.\r
   @param[in]  ControllerHandle  Handle of device to stop driver on\r
   @param[in]  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
   @param[in]  This              Protocol instance pointer.\r
   @param[in]  ControllerHandle  Handle of device to stop driver on\r
   @param[in]  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
@@ -482,14 +483,14 @@ DhcpInitProtocol (
 \r
 /**\r
   Creates a child handle and installs a protocol.\r
 \r
 /**\r
   Creates a child handle and installs a protocol.\r
-  \r
-  The CreateChild() function installs a protocol on ChildHandle. \r
-  If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r
+\r
+  The CreateChild() function installs a protocol on ChildHandle.\r
+  If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
   If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
   @param  ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
   If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
   @param  ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
-                      then a new handle is created. If it is a pointer to an existing UEFI handle, \r
+                      then a new handle is created. If it is a pointer to an existing UEFI handle,\r
                       then the protocol is added to the existing UEFI handle.\r
 \r
   @retval EFI_SUCCES            The protocol was added to ChildHandle.\r
                       then the protocol is added to the existing UEFI handle.\r
 \r
   @retval EFI_SUCCES            The protocol was added to ChildHandle.\r
@@ -578,9 +579,9 @@ Dhcp4ServiceBindingCreateChild (
 \r
 /**\r
   Destroys a child handle with a protocol installed on it.\r
 \r
 /**\r
   Destroys a child handle with a protocol installed on it.\r
-  \r
-  The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
-  that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+\r
+  The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
+  that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
   last protocol on ChildHandle, then ChildHandle is destroyed.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
   last protocol on ChildHandle, then ChildHandle is destroyed.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
index fb0332722e18552cddf5e43aaea48d335baa5ab7..a0a53a4e33665cc160ad1a00d94f4eb9253e0cdb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This file implement the EFI_DHCP4_PROTOCOL interface.\r
 /** @file\r
   This file implement the EFI_DHCP4_PROTOCOL interface.\r
-  \r
-Copyright (c) 2006 - 2009, Intel Corporation.<BR>\r
+\r
+Copyright (c) 2006 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r
 \r
 /**\r
   Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r
-  \r
+\r
   The GetModeData() function returns the current operating mode and cached data\r
   packet for the EFI DHCPv4 Protocol driver.\r
 \r
   The GetModeData() function returns the current operating mode and cached data\r
   packet for the EFI DHCPv4 Protocol driver.\r
 \r
@@ -82,7 +82,7 @@ EFIAPI
 EfiDhcp4Configure (\r
   IN EFI_DHCP4_PROTOCOL     *This,\r
   IN EFI_DHCP4_CONFIG_DATA  *Dhcp4CfgData       OPTIONAL\r
 EfiDhcp4Configure (\r
   IN EFI_DHCP4_PROTOCOL     *This,\r
   IN EFI_DHCP4_CONFIG_DATA  *Dhcp4CfgData       OPTIONAL\r
-  );  \r
+  );\r
 \r
 /**\r
   Starts the DHCP configuration process.\r
 \r
 /**\r
   Starts the DHCP configuration process.\r
@@ -100,7 +100,7 @@ EfiDhcp4Configure (
   time when each event occurs in this process, the callback function that was set\r
   by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r
   opportunity to control the process.\r
   time when each event occurs in this process, the callback function that was set\r
   by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r
   opportunity to control the process.\r
-  \r
+\r
   @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
   @param[in]  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
                               EFI DHCPv4 Protocol driver is transferred into the\r
   @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
   @param[in]  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
                               EFI DHCPv4 Protocol driver is transferred into the\r
@@ -133,7 +133,7 @@ EfiDhcp4Start (
 \r
 /**\r
   Extends the lease time by sending a request packet.\r
 \r
 /**\r
   Extends the lease time by sending a request packet.\r
-  \r
+\r
   The RenewRebind() function is used to manually extend the lease time when the\r
   EFI DHCPv4 Protocol driver is in the Dhcp4Bound state and the lease time has\r
   not expired yet. This function will send a request packet to the previously\r
   The RenewRebind() function is used to manually extend the lease time when the\r
   EFI DHCPv4 Protocol driver is in the Dhcp4Bound state and the lease time has\r
   not expired yet. This function will send a request packet to the previously\r
@@ -206,7 +206,7 @@ EfiDhcp4Release (
 \r
 /**\r
   Stops the current address configuration.\r
 \r
 /**\r
   Stops the current address configuration.\r
-  \r
+\r
   The Stop() function is used to stop the DHCP configuration process. After this\r
   function is called successfully, the EFI DHCPv4 Protocol driver is transferred\r
   into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called\r
   The Stop() function is used to stop the DHCP configuration process. After this\r
   function is called successfully, the EFI DHCPv4 Protocol driver is transferred\r
   into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called\r
@@ -263,10 +263,10 @@ EfiDhcp4Build (
   IN EFI_DHCP4_PACKET_OPTION  *AppendList[] OPTIONAL,\r
   OUT EFI_DHCP4_PACKET        **NewPacket\r
   );\r
   IN EFI_DHCP4_PACKET_OPTION  *AppendList[] OPTIONAL,\r
   OUT EFI_DHCP4_PACKET        **NewPacket\r
   );\r
-  \r
+\r
 /**\r
   Transmits a DHCP formatted packet and optionally waits for responses.\r
 /**\r
   Transmits a DHCP formatted packet and optionally waits for responses.\r
-  \r
+\r
   The TransmitReceive() function is used to transmit a DHCP packet and optionally\r
   wait for the response from servers. This function does not change the state of\r
   the EFI DHCPv4 Protocol driver and thus can be used at any time.\r
   The TransmitReceive() function is used to transmit a DHCP packet and optionally\r
   wait for the response from servers. This function does not change the state of\r
   the EFI DHCPv4 Protocol driver and thus can be used at any time.\r
@@ -292,7 +292,7 @@ EfiDhcp4TransmitReceive (
 \r
 /**\r
   Parses the packed DHCP option data.\r
 \r
 /**\r
   Parses the packed DHCP option data.\r
-  \r
+\r
   The Parse() function is used to retrieve the option list from a DHCP packet.\r
   If *OptionCount isn't zero, and there is enough space for all the DHCP options\r
   in the Packet, each element of PacketOptionList is set to point to somewhere in\r
   The Parse() function is used to retrieve the option list from a DHCP packet.\r
   If *OptionCount isn't zero, and there is enough space for all the DHCP options\r
   in the Packet, each element of PacketOptionList is set to point to somewhere in\r
@@ -340,7 +340,7 @@ EFI_DHCP4_PROTOCOL  mDhcp4ProtocolTemplate = {
 \r
 /**\r
   Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r
 \r
 /**\r
   Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r
-  \r
+\r
   The GetModeData() function returns the current operating mode and cached data\r
   packet for the EFI DHCPv4 Protocol driver.\r
 \r
   The GetModeData() function returns the current operating mode and cached data\r
   packet for the EFI DHCPv4 Protocol driver.\r
 \r
@@ -647,15 +647,15 @@ EfiDhcp4Configure (
   }\r
 \r
   if (Dhcp4CfgData != NULL) {\r
   }\r
 \r
   if (Dhcp4CfgData != NULL) {\r
-    if (Dhcp4CfgData->DiscoverTryCount && (Dhcp4CfgData->DiscoverTimeout == NULL)) {\r
+    if ((Dhcp4CfgData->DiscoverTryCount != 0) && (Dhcp4CfgData->DiscoverTimeout == NULL)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
-    if (Dhcp4CfgData->RequestTryCount && (Dhcp4CfgData->RequestTimeout == NULL)) {\r
+    if ((Dhcp4CfgData->RequestTryCount != 0) && (Dhcp4CfgData->RequestTimeout == NULL)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
-    if (Dhcp4CfgData->OptionCount && (Dhcp4CfgData->OptionList == NULL)) {\r
+    if ((Dhcp4CfgData->OptionCount != 0) && (Dhcp4CfgData->OptionList == NULL)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
@@ -748,7 +748,7 @@ ON_EXIT:
   time when each event occurs in this process, the callback function that was set\r
   by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r
   opportunity to control the process.\r
   time when each event occurs in this process, the callback function that was set\r
   by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this\r
   opportunity to control the process.\r
-  \r
+\r
   @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
   @param[in]  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
                               EFI DHCPv4 Protocol driver is transferred into the\r
   @param[in]  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
   @param[in]  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
                               EFI DHCPv4 Protocol driver is transferred into the\r
@@ -842,7 +842,7 @@ ON_ERROR:
 \r
 /**\r
   Extends the lease time by sending a request packet.\r
 \r
 /**\r
   Extends the lease time by sending a request packet.\r
-  \r
+\r
   The RenewRebind() function is used to manually extend the lease time when the\r
   EFI DHCPv4 Protocol driver is in the Dhcp4Bound state and the lease time has\r
   not expired yet. This function will send a request packet to the previously\r
   The RenewRebind() function is used to manually extend the lease time when the\r
   EFI DHCPv4 Protocol driver is in the Dhcp4Bound state and the lease time has\r
   not expired yet. This function will send a request packet to the previously\r
@@ -1045,7 +1045,7 @@ ON_EXIT:
 \r
 /**\r
   Stops the current address configuration.\r
 \r
 /**\r
   Stops the current address configuration.\r
-  \r
+\r
   The Stop() function is used to stop the DHCP configuration process. After this\r
   function is called successfully, the EFI DHCPv4 Protocol driver is transferred\r
   into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called\r
   The Stop() function is used to stop the DHCP configuration process. After this\r
   function is called successfully, the EFI DHCPv4 Protocol driver is transferred\r
   into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called\r
@@ -1165,10 +1165,10 @@ EfiDhcp4Build (
 \r
 /**\r
   Callback by UdpIoCreatePort() when creating UdpIo for this Dhcp4 instance.\r
 \r
 /**\r
   Callback by UdpIoCreatePort() when creating UdpIo for this Dhcp4 instance.\r
-  \r
+\r
   @param[in] UdpIo      The UdpIo being created.\r
   @param[in] Context    Dhcp4 instance.\r
   @param[in] UdpIo      The UdpIo being created.\r
   @param[in] Context    Dhcp4 instance.\r
-  \r
+\r
   @retval EFI_SUCCESS   UdpIo is configured successfully.\r
   @retval other         Other error occurs.\r
 **/\r
   @retval EFI_SUCCESS   UdpIo is configured successfully.\r
   @retval other         Other error occurs.\r
 **/\r
@@ -1212,9 +1212,9 @@ Dhcp4InstanceConfigUdpIo (
 \r
 /**\r
   Create UdpIo for this Dhcp4 instance.\r
 \r
 /**\r
   Create UdpIo for this Dhcp4 instance.\r
-  \r
+\r
   @param Instance   The Dhcp4 instance.\r
   @param Instance   The Dhcp4 instance.\r
-  \r
+\r
   @retval EFI_SUCCESS                UdpIo is created successfully.\r
   @retval EFI_OUT_OF_RESOURCES       Fails to create UdpIo because of limited\r
                                      resources or configuration failure.\r
   @retval EFI_SUCCESS                UdpIo is created successfully.\r
   @retval EFI_OUT_OF_RESOURCES       Fails to create UdpIo because of limited\r
                                      resources or configuration failure.\r
@@ -1245,7 +1245,7 @@ Dhcp4InstanceCreateUdpIo (
 \r
 /**\r
   Callback of Dhcp packet. Does nothing.\r
 \r
 /**\r
   Callback of Dhcp packet. Does nothing.\r
-  \r
+\r
   @param Arg           The context.\r
 \r
 **/\r
   @param Arg           The context.\r
 \r
 **/\r
@@ -1258,15 +1258,15 @@ DhcpDummyExtFree (
 \r
 /**\r
   Callback of UdpIoRecvDatagram() that handles a Dhcp4 packet.\r
 \r
 /**\r
   Callback of UdpIoRecvDatagram() that handles a Dhcp4 packet.\r
-  \r
+\r
   Only BOOTP responses will be handled that correspond to the Xid of the request\r
   sent out. The packet will be queued to the response queue.\r
   Only BOOTP responses will be handled that correspond to the Xid of the request\r
   sent out. The packet will be queued to the response queue.\r
-  \r
+\r
   @param UdpPacket        The Dhcp4 packet.\r
   @param EndPoint         Udp4 address pair.\r
   @param IoStatus         Status of the input.\r
   @param Context          Extra info for the input.\r
   @param UdpPacket        The Dhcp4 packet.\r
   @param EndPoint         Udp4 address pair.\r
   @param IoStatus         Status of the input.\r
   @param Context          Extra info for the input.\r
-  \r
+\r
 **/\r
 VOID\r
 PxeDhcpInput (\r
 **/\r
 VOID\r
 PxeDhcpInput (\r
@@ -1368,7 +1368,7 @@ RESTART:
 \r
 /**\r
   Complete a Dhcp4 transaction and signal the upper layer.\r
 \r
 /**\r
   Complete a Dhcp4 transaction and signal the upper layer.\r
-  \r
+\r
   @param Instance      Dhcp4 instance.\r
 \r
 **/\r
   @param Instance      Dhcp4 instance.\r
 \r
 **/\r
@@ -1417,7 +1417,7 @@ SIGNAL_USER:
 \r
 /**\r
   Transmits a DHCP formatted packet and optionally waits for responses.\r
 \r
 /**\r
   Transmits a DHCP formatted packet and optionally waits for responses.\r
-  \r
+\r
   The TransmitReceive() function is used to transmit a DHCP packet and optionally\r
   wait for the response from servers. This function does not change the state of\r
   the EFI DHCPv4 Protocol driver and thus can be used at any time.\r
   The TransmitReceive() function is used to transmit a DHCP packet and optionally\r
   wait for the response from servers. This function does not change the state of\r
   the EFI DHCPv4 Protocol driver and thus can be used at any time.\r
@@ -1643,7 +1643,7 @@ Dhcp4ParseCheckOption (
 \r
 /**\r
   Parses the packed DHCP option data.\r
 \r
 /**\r
   Parses the packed DHCP option data.\r
-  \r
+\r
   The Parse() function is used to retrieve the option list from a DHCP packet.\r
   If *OptionCount isn't zero, and there is enough space for all the DHCP options\r
   in the Packet, each element of PacketOptionList is set to point to somewhere in\r
   The Parse() function is used to retrieve the option list from a DHCP packet.\r
   If *OptionCount isn't zero, and there is enough space for all the DHCP options\r
   in the Packet, each element of PacketOptionList is set to point to somewhere in\r
index 97e9bb2b4047d7faafa1c9d8600c21078396defa..5b94266e1f09abb517576efb88a3d53d9d685d71 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This file is for Challenge-Handshake Authentication Protocol (CHAP) Configuration.\r
 /** @file\r
   This file is for Challenge-Handshake Authentication Protocol (CHAP) Configuration.\r
\r
-Copyright (c) 2004 - 2009, Intel Corporation.<BR>\r
+\r
+Copyright (c) 2004 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -18,19 +18,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 EFI_GUID  mIScsiCHAPAuthInfoGuid = ISCSI_CHAP_AUTH_INFO_GUID;\r
 \r
 /**\r
 EFI_GUID  mIScsiCHAPAuthInfoGuid = ISCSI_CHAP_AUTH_INFO_GUID;\r
 \r
 /**\r
-  Initator caculates its own expected hash value. \r
-  \r
-  @param[in]   ChapIdentifier     iSCSI CHAP identifier sent by authenticator.  \r
-  @param[in]   ChapSecret         iSCSI CHAP secret of the authenticator.   \r
+  Initator caculates its own expected hash value.\r
+\r
+  @param[in]   ChapIdentifier     iSCSI CHAP identifier sent by authenticator.\r
+  @param[in]   ChapSecret         iSCSI CHAP secret of the authenticator.\r
   @param[in]   SecretLength       The length of iSCSI CHAP secret.\r
   @param[in]   SecretLength       The length of iSCSI CHAP secret.\r
-  @param[in]   ChapChallenge      The challenge message sent by authenticator.  \r
+  @param[in]   ChapChallenge      The challenge message sent by authenticator.\r
   @param[in]   ChallengeLength    The length of iSCSI CHAP challenge message.\r
   @param[out]  ChapResponse       The calculation of the expected hash value.\r
   @param[in]   ChallengeLength    The length of iSCSI CHAP challenge message.\r
   @param[out]  ChapResponse       The calculation of the expected hash value.\r
-  \r
+\r
   @retval EFI_SUCCESS             The expected hash value was caculatedly successfully.\r
   @retval EFI_SUCCESS             The expected hash value was caculatedly successfully.\r
-  @retval EFI_PROTOCOL_ERROR      The length of the secret should be at least the \r
+  @retval EFI_PROTOCOL_ERROR      The length of the secret should be at least the\r
                                   length of the hash value for the hashing algorithm chosen.\r
                                   length of the hash value for the hashing algorithm chosen.\r
-  @retval Others                  Other errors as indicated.                                \r
+  @retval Others                  Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiCHAPCalculateResponse (\r
 **/\r
 EFI_STATUS\r
 IScsiCHAPCalculateResponse (\r
@@ -75,10 +75,10 @@ IScsiCHAPCalculateResponse (
 \r
 /**\r
   The initator checks the CHAP response replied by target against its own\r
 \r
 /**\r
   The initator checks the CHAP response replied by target against its own\r
-  calculation of the expected hash value. \r
-  \r
-  @param[in]   AuthData             iSCSI CHAP authentication data. \r
-  @param[in]   TargetResponse       The response from target.    \r
+  calculation of the expected hash value.\r
+\r
+  @param[in]   AuthData             iSCSI CHAP authentication data.\r
+  @param[in]   TargetResponse       The response from target.\r
 \r
   @retval EFI_SUCCESS               The response from target passed authentication.\r
   @retval EFI_SECURITY_VIOLATION    The response from target was not expected value.\r
 \r
   @retval EFI_SUCCESS               The response from target passed authentication.\r
   @retval EFI_SECURITY_VIOLATION    The response from target was not expected value.\r
@@ -106,7 +106,7 @@ IScsiCHAPAuthTarget (
             VerifyRsp\r
             );\r
 \r
             VerifyRsp\r
             );\r
 \r
-  if (CompareMem (VerifyRsp, TargetResponse, ISCSI_CHAP_RSP_LEN)) {\r
+  if (CompareMem (VerifyRsp, TargetResponse, ISCSI_CHAP_RSP_LEN) != 0) {\r
     Status = EFI_SECURITY_VIOLATION;\r
   }\r
 \r
     Status = EFI_SECURITY_VIOLATION;\r
   }\r
 \r
@@ -116,7 +116,7 @@ IScsiCHAPAuthTarget (
 /**\r
   This function checks the received iSCSI Login Response during the security\r
   negotiation stage.\r
 /**\r
   This function checks the received iSCSI Login Response during the security\r
   negotiation stage.\r
-  \r
+\r
   @param[in] Conn             The iSCSI connection.\r
 \r
   @retval EFI_SUCCESS          The Login Response passed the CHAP validation.\r
   @param[in] Conn             The iSCSI connection.\r
 \r
   @retval EFI_SUCCESS          The Login Response passed the CHAP validation.\r
index 5e297821a2cf028f66906166c87eec5f15814955..cccaab6dee285b09bebba21c4ed830ed1ef8c4df 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The driver binding and service binding protocol for IP4 driver.\r
 /** @file\r
   The driver binding and service binding protocol for IP4 driver.\r
-  \r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
+\r
+Copyright (c) 2005 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -27,7 +27,7 @@ EFI_DRIVER_BINDING_PROTOCOL gIp4DriverBinding = {
   This is the declaration of an EFI image entry point. This entry point is\r
   the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
   both device drivers and bus drivers.\r
   This is the declaration of an EFI image entry point. This entry point is\r
   the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
   both device drivers and bus drivers.\r
-  \r
+\r
   The entry point for IP4 driver which install the driver\r
   binding and component name protocol on its image.\r
 \r
   The entry point for IP4 driver which install the driver\r
   binding and component name protocol on its image.\r
 \r
@@ -446,6 +446,7 @@ Ip4DriverBindingStart (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+  ASSERT (IpSb != NULL);\r
 \r
   //\r
   // Install the Ip4ServiceBinding Protocol onto ControlerHandle\r
 \r
   //\r
   // Install the Ip4ServiceBinding Protocol onto ControlerHandle\r
@@ -507,7 +508,7 @@ FREE_SERVICE:
   restrictions for this service. DisconnectController()\r
   must follow these calling restrictions. If any other agent wishes\r
   to call Stop() it must also follow these calling restrictions.\r
   restrictions for this service. DisconnectController()\r
   must follow these calling restrictions. If any other agent wishes\r
   to call Stop() it must also follow these calling restrictions.\r
-  \r
+\r
   @param[in]  This              Protocol instance pointer.\r
   @param[in]  ControllerHandle  Handle of device to stop driver on\r
   @param[in]  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number\r
   @param[in]  This              Protocol instance pointer.\r
   @param[in]  ControllerHandle  Handle of device to stop driver on\r
   @param[in]  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number\r
@@ -743,14 +744,14 @@ ON_ERROR:
 \r
 /**\r
   Creates a child handle and installs a protocol.\r
 \r
 /**\r
   Creates a child handle and installs a protocol.\r
-  \r
-  The CreateChild() function installs a protocol on ChildHandle. \r
-  If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle. \r
+\r
+  The CreateChild() function installs a protocol on ChildHandle.\r
+  If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r
   If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
   @param  ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
   If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
   @param  ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
-                      then a new handle is created. If it is a pointer to an existing UEFI handle, \r
+                      then a new handle is created. If it is a pointer to an existing UEFI handle,\r
                       then the protocol is added to the existing UEFI handle.\r
 \r
   @retval EFI_SUCCES            The protocol was added to ChildHandle.\r
                       then the protocol is added to the existing UEFI handle.\r
 \r
   @retval EFI_SUCCES            The protocol was added to ChildHandle.\r
@@ -849,9 +850,9 @@ ON_ERROR:
 \r
 /**\r
   Destroys a child handle with a protocol installed on it.\r
 \r
 /**\r
   Destroys a child handle with a protocol installed on it.\r
-  \r
-  The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
-  that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+\r
+  The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r
+  that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r
   last protocol on ChildHandle, then ChildHandle is destroyed.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
   last protocol on ChildHandle, then ChildHandle is destroyed.\r
 \r
   @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
index 05fd96d634cd98c2badf90b214265316fe543c65..ec545a6c542e9e8d9a80a97360b6f057973c4c09 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
 /** @file\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -17,7 +17,7 @@ EFI_IPSEC_PROTOCOL    *mIpSec = NULL;
 \r
 /**\r
   Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.\r
 \r
 /**\r
   Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.\r
-  \r
+\r
   The GetModeData() function returns the current operational mode data for this\r
   driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This\r
   function is used optionally to retrieve the operational mode data of underlying\r
   The GetModeData() function returns the current operational mode data for this\r
   driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This\r
   function is used optionally to retrieve the operational mode data of underlying\r
@@ -41,10 +41,10 @@ EfiIp4GetModeData (
   OUT       EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData   OPTIONAL,\r
   OUT       EFI_SIMPLE_NETWORK_MODE         *SnpModeData     OPTIONAL\r
   );\r
   OUT       EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData   OPTIONAL,\r
   OUT       EFI_SIMPLE_NETWORK_MODE         *SnpModeData     OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.\r
 /**\r
   Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.\r
-  \r
+\r
   The Configure() function is used to set, change, or reset the operational\r
   parameters and filter settings for this EFI IPv4 Protocol instance. Until these\r
   parameters have been set, no network traffic can be sent or received by this\r
   The Configure() function is used to set, change, or reset the operational\r
   parameters and filter settings for this EFI IPv4 Protocol instance. Until these\r
   parameters have been set, no network traffic can be sent or received by this\r
@@ -53,14 +53,14 @@ EfiIp4GetModeData (
   parameters have been set again. Each EFI IPv4 Protocol instance can be started\r
   and stopped independently of each other by enabling or disabling their receive\r
   filter settings with the Configure() function.\r
   parameters have been set again. Each EFI IPv4 Protocol instance can be started\r
   and stopped independently of each other by enabling or disabling their receive\r
   filter settings with the Configure() function.\r
-  \r
+\r
   When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will\r
   be appended as an alias address into the addresses list in the EFI IPv4 Protocol\r
   driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL\r
   to retrieve the default IPv4 address if it is not available yet. Clients could\r
   frequently call GetModeData() to check the status to ensure that the default IPv4\r
   address is ready.\r
   When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will\r
   be appended as an alias address into the addresses list in the EFI IPv4 Protocol\r
   driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL\r
   to retrieve the default IPv4 address if it is not available yet. Clients could\r
   frequently call GetModeData() to check the status to ensure that the default IPv4\r
   address is ready.\r
-  \r
+\r
   If operational parameters are reset or changed, any pending transmit and receive\r
   requests will be cancelled. Their completion token status will be set to EFI_ABORTED\r
   and their events will be signaled.\r
   If operational parameters are reset or changed, any pending transmit and receive\r
   requests will be cancelled. Their completion token status will be set to EFI_ABORTED\r
   and their events will be signaled.\r
@@ -91,14 +91,14 @@ EfiIp4Configure (
   IN EFI_IP4_PROTOCOL       *This,\r
   IN EFI_IP4_CONFIG_DATA    *IpConfigData       OPTIONAL\r
   );\r
   IN EFI_IP4_PROTOCOL       *This,\r
   IN EFI_IP4_CONFIG_DATA    *IpConfigData       OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Joins and leaves multicast groups.\r
 /**\r
   Joins and leaves multicast groups.\r
-  \r
+\r
   The Groups() function is used to join and leave multicast group sessions. Joining\r
   a group will enable reception of matching multicast packets. Leaving a group will\r
   disable the multicast packet reception.\r
   The Groups() function is used to join and leave multicast group sessions. Joining\r
   a group will enable reception of matching multicast packets. Leaving a group will\r
   disable the multicast packet reception.\r
-  \r
+\r
   If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r
 \r
   @param[in]  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
   If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r
 \r
   @param[in]  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
@@ -129,25 +129,25 @@ EfiIp4Groups (
   IN BOOLEAN                JoinFlag,\r
   IN EFI_IPv4_ADDRESS       *GroupAddress     OPTIONAL\r
   );\r
   IN BOOLEAN                JoinFlag,\r
   IN EFI_IPv4_ADDRESS       *GroupAddress     OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Adds and deletes routing table entries.\r
 \r
   The Routes() function adds a route to or deletes a route from the routing table.\r
 /**\r
   Adds and deletes routing table entries.\r
 \r
   The Routes() function adds a route to or deletes a route from the routing table.\r
-  \r
+\r
   Routes are determined by comparing the SubnetAddress with the destination IPv4\r
   address arithmetically AND-ed with the SubnetMask. The gateway address must be\r
   on the same subnet as the configured station address.\r
   Routes are determined by comparing the SubnetAddress with the destination IPv4\r
   address arithmetically AND-ed with the SubnetMask. The gateway address must be\r
   on the same subnet as the configured station address.\r
-  \r
+\r
   The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.\r
   The default route matches all destination IPv4 addresses that do not match any\r
   other routes.\r
   The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.\r
   The default route matches all destination IPv4 addresses that do not match any\r
   other routes.\r
-  \r
+\r
   A GatewayAddress that is zero is a nonroute. Packets are sent to the destination\r
   IP address if it can be found in the ARP cache or on the local subnet. One automatic\r
   nonroute entry will be inserted into the routing table for outgoing packets that\r
   are addressed to a local subnet (gateway address of 0.0.0.0).\r
   A GatewayAddress that is zero is a nonroute. Packets are sent to the destination\r
   IP address if it can be found in the ARP cache or on the local subnet. One automatic\r
   nonroute entry will be inserted into the routing table for outgoing packets that\r
   are addressed to a local subnet (gateway address of 0.0.0.0).\r
-  \r
+\r
   Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI\r
   IPv4 Protocol instances that use the default IPv4 address will also have copies\r
   of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these\r
   Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI\r
   IPv4 Protocol instances that use the default IPv4 address will also have copies\r
   of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these\r
@@ -178,7 +178,7 @@ EfiIp4Groups (
   @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
   @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
                                   DeleteRoute is FALSE).\r
   @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
   @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
                                   DeleteRoute is FALSE).\r
-                                 \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -189,7 +189,7 @@ EfiIp4Routes (
   IN EFI_IPv4_ADDRESS       *SubnetMask,\r
   IN EFI_IPv4_ADDRESS       *GatewayAddress\r
   );\r
   IN EFI_IPv4_ADDRESS       *SubnetMask,\r
   IN EFI_IPv4_ADDRESS       *GatewayAddress\r
   );\r
-  \r
+\r
 /**\r
   Places outgoing data packets into the transmit queue.\r
 \r
 /**\r
   Places outgoing data packets into the transmit queue.\r
 \r
@@ -208,7 +208,7 @@ EfiIp4Routes (
   @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
                                  was already in the transmit queue.\r
   @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
   @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
                                  was already in the transmit queue.\r
   @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
-                                 queue is full. \r
+                                 queue is full.\r
   @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
   @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
   @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
   @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
   @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
   @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
@@ -225,13 +225,13 @@ EfiIp4Transmit (
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token\r
   );\r
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token\r
   );\r
-  \r
+\r
 /**\r
   Places a receiving request into the receiving queue.\r
 /**\r
   Places a receiving request into the receiving queue.\r
-  \r
+\r
   The Receive() function places a completion token into the receive packet queue.\r
   This function is always asynchronous.\r
   The Receive() function places a completion token into the receive packet queue.\r
   This function is always asynchronous.\r
-  \r
+\r
   The Token.Event field in the completion token must be filled in by the caller\r
   and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol\r
   driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r
   The Token.Event field in the completion token must be filled in by the caller\r
   and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol\r
   driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r
@@ -264,10 +264,10 @@ EfiIp4Receive (
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token\r
   );\r
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token\r
   );\r
-  \r
+\r
 /**\r
   Abort an asynchronous transmit or receive request.\r
 /**\r
   Abort an asynchronous transmit or receive request.\r
-  \r
+\r
   The Cancel() function is used to abort a pending transmit or receive request.\r
   If the token is in the transmit or receive request queues, after calling this\r
   function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r
   The Cancel() function is used to abort a pending transmit or receive request.\r
   If the token is in the transmit or receive request queues, after calling this\r
   function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r
@@ -300,15 +300,15 @@ EfiIp4Cancel (
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token    OPTIONAL\r
   );\r
   IN EFI_IP4_PROTOCOL         *This,\r
   IN EFI_IP4_COMPLETION_TOKEN *Token    OPTIONAL\r
   );\r
-  \r
+\r
 /**\r
   Polls for incoming data packets and processes outgoing data packets.\r
 /**\r
   Polls for incoming data packets and processes outgoing data packets.\r
-  \r
+\r
   The Poll() function polls for incoming data packets and processes outgoing data\r
   packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()\r
   function to increase the rate that data packets are moved between the communications\r
   device and the transmit and receive queues.\r
   The Poll() function polls for incoming data packets and processes outgoing data\r
   packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()\r
   function to increase the rate that data packets are moved between the communications\r
   device and the transmit and receive queues.\r
-  \r
+\r
   In some systems the periodic timer event may not poll the underlying communications\r
   device fast enough to transmit and/or receive all data packets without missing\r
   incoming packets or dropping outgoing packets. Drivers and applications that are\r
   In some systems the periodic timer event may not poll the underlying communications\r
   device fast enough to transmit and/or receive all data packets without missing\r
   incoming packets or dropping outgoing packets. Drivers and applications that are\r
@@ -348,7 +348,7 @@ mEfiIp4ProtocolTemplete = {
 \r
 /**\r
   Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.\r
 \r
 /**\r
   Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.\r
-  \r
+\r
   The GetModeData() function returns the current operational mode data for this\r
   driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This\r
   function is used optionally to retrieve the operational mode data of underlying\r
   The GetModeData() function returns the current operational mode data for this\r
   driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This\r
   function is used optionally to retrieve the operational mode data of underlying\r
@@ -687,7 +687,7 @@ ON_EXIT:
 \r
 /**\r
   Request Ip4AutoConfigCallBackDpc as a DPC at TPL_CALLBACK.\r
 \r
 /**\r
   Request Ip4AutoConfigCallBackDpc as a DPC at TPL_CALLBACK.\r
-  \r
+\r
   @param Event     The event that is signalled.\r
   @param Context   The IP4 service binding instance.\r
 \r
   @param Event     The event that is signalled.\r
   @param Context   The IP4 service binding instance.\r
 \r
@@ -1126,7 +1126,7 @@ Ip4StationAddressValid (
 \r
 /**\r
   Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.\r
 \r
 /**\r
   Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.\r
-  \r
+\r
   The Configure() function is used to set, change, or reset the operational\r
   parameters and filter settings for this EFI IPv4 Protocol instance. Until these\r
   parameters have been set, no network traffic can be sent or received by this\r
   The Configure() function is used to set, change, or reset the operational\r
   parameters and filter settings for this EFI IPv4 Protocol instance. Until these\r
   parameters have been set, no network traffic can be sent or received by this\r
@@ -1135,14 +1135,14 @@ Ip4StationAddressValid (
   parameters have been set again. Each EFI IPv4 Protocol instance can be started\r
   and stopped independently of each other by enabling or disabling their receive\r
   filter settings with the Configure() function.\r
   parameters have been set again. Each EFI IPv4 Protocol instance can be started\r
   and stopped independently of each other by enabling or disabling their receive\r
   filter settings with the Configure() function.\r
-  \r
+\r
   When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will\r
   be appended as an alias address into the addresses list in the EFI IPv4 Protocol\r
   driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL\r
   to retrieve the default IPv4 address if it is not available yet. Clients could\r
   frequently call GetModeData() to check the status to ensure that the default IPv4\r
   address is ready.\r
   When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will\r
   be appended as an alias address into the addresses list in the EFI IPv4 Protocol\r
   driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL\r
   to retrieve the default IPv4 address if it is not available yet. Clients could\r
   frequently call GetModeData() to check the status to ensure that the default IPv4\r
   address is ready.\r
-  \r
+\r
   If operational parameters are reset or changed, any pending transmit and receive\r
   requests will be cancelled. Their completion token status will be set to EFI_ABORTED\r
   and their events will be signaled.\r
   If operational parameters are reset or changed, any pending transmit and receive\r
   requests will be cancelled. Their completion token status will be set to EFI_ABORTED\r
   and their events will be signaled.\r
@@ -1318,7 +1318,7 @@ Ip4Groups (
   // host byte order\r
   //\r
   if (JoinFlag) {\r
   // host byte order\r
   //\r
   if (JoinFlag) {\r
-    //  \r
+    //\r
     // When JoinFlag is TRUE, GroupAddress shouldn't be NULL.\r
     //\r
     ASSERT (GroupAddress != NULL);\r
     // When JoinFlag is TRUE, GroupAddress shouldn't be NULL.\r
     //\r
     ASSERT (GroupAddress != NULL);\r
@@ -1386,11 +1386,11 @@ Ip4Groups (
 \r
 /**\r
   Joins and leaves multicast groups.\r
 \r
 /**\r
   Joins and leaves multicast groups.\r
-  \r
+\r
   The Groups() function is used to join and leave multicast group sessions. Joining\r
   a group will enable reception of matching multicast packets. Leaving a group will\r
   disable the multicast packet reception.\r
   The Groups() function is used to join and leave multicast group sessions. Joining\r
   a group will enable reception of matching multicast packets. Leaving a group will\r
   disable the multicast packet reception.\r
-  \r
+\r
   If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r
 \r
   @param[in]  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
   If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left.\r
 \r
   @param[in]  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
@@ -1464,20 +1464,20 @@ ON_EXIT:
   Adds and deletes routing table entries.\r
 \r
   The Routes() function adds a route to or deletes a route from the routing table.\r
   Adds and deletes routing table entries.\r
 \r
   The Routes() function adds a route to or deletes a route from the routing table.\r
-  \r
+\r
   Routes are determined by comparing the SubnetAddress with the destination IPv4\r
   address arithmetically AND-ed with the SubnetMask. The gateway address must be\r
   on the same subnet as the configured station address.\r
   Routes are determined by comparing the SubnetAddress with the destination IPv4\r
   address arithmetically AND-ed with the SubnetMask. The gateway address must be\r
   on the same subnet as the configured station address.\r
-  \r
+\r
   The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.\r
   The default route matches all destination IPv4 addresses that do not match any\r
   other routes.\r
   The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0.\r
   The default route matches all destination IPv4 addresses that do not match any\r
   other routes.\r
-  \r
+\r
   A GatewayAddress that is zero is a nonroute. Packets are sent to the destination\r
   IP address if it can be found in the ARP cache or on the local subnet. One automatic\r
   nonroute entry will be inserted into the routing table for outgoing packets that\r
   are addressed to a local subnet (gateway address of 0.0.0.0).\r
   A GatewayAddress that is zero is a nonroute. Packets are sent to the destination\r
   IP address if it can be found in the ARP cache or on the local subnet. One automatic\r
   nonroute entry will be inserted into the routing table for outgoing packets that\r
   are addressed to a local subnet (gateway address of 0.0.0.0).\r
-  \r
+\r
   Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI\r
   IPv4 Protocol instances that use the default IPv4 address will also have copies\r
   of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these\r
   Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI\r
   IPv4 Protocol instances that use the default IPv4 address will also have copies\r
   of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these\r
@@ -1508,7 +1508,7 @@ ON_EXIT:
   @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
   @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
                                   DeleteRoute is FALSE).\r
   @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
   @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
                                   DeleteRoute is FALSE).\r
-                                 \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1693,7 +1693,7 @@ Ip4TxTokenValid (
   // Check the source and gateway: they must be a valid unicast.\r
   // Gateway must also be on the connected network.\r
   //\r
   // Check the source and gateway: they must be a valid unicast.\r
   // Gateway must also be on the connected network.\r
   //\r
-  if (TxData->OverrideData) {\r
+  if (TxData->OverrideData != NULL) {\r
     Override = TxData->OverrideData;\r
 \r
     CopyMem (&Src, &Override->SourceAddress, sizeof (IP4_ADDR));\r
     Override = TxData->OverrideData;\r
 \r
     CopyMem (&Src, &Override->SourceAddress, sizeof (IP4_ADDR));\r
@@ -1857,7 +1857,7 @@ Ip4OnPacketSent (
   @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
                                  was already in the transmit queue.\r
   @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
   @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
                                  was already in the transmit queue.\r
   @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
-                                 queue is full. \r
+                                 queue is full.\r
   @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
   @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
   @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
   @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
   @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
   @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
@@ -1936,7 +1936,7 @@ EfiIp4Transmit (
   CopyMem (&Head.Dst, &TxData->DestinationAddress, sizeof (IP4_ADDR));\r
   Head.Dst = NTOHL (Head.Dst);\r
 \r
   CopyMem (&Head.Dst, &TxData->DestinationAddress, sizeof (IP4_ADDR));\r
   Head.Dst = NTOHL (Head.Dst);\r
 \r
-  if (TxData->OverrideData) {\r
+  if (TxData->OverrideData != NULL) {\r
     Override      = TxData->OverrideData;\r
     Head.Protocol = Override->Protocol;\r
     Head.Tos      = Override->TypeOfService;\r
     Override      = TxData->OverrideData;\r
     Head.Protocol = Override->Protocol;\r
     Head.Tos      = Override->TypeOfService;\r
@@ -2039,10 +2039,10 @@ ON_EXIT:
 \r
 /**\r
   Places a receiving request into the receiving queue.\r
 \r
 /**\r
   Places a receiving request into the receiving queue.\r
-  \r
+\r
   The Receive() function places a completion token into the receive packet queue.\r
   This function is always asynchronous.\r
   The Receive() function places a completion token into the receive packet queue.\r
   This function is always asynchronous.\r
-  \r
+\r
   The Token.Event field in the completion token must be filled in by the caller\r
   and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol\r
   driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r
   The Token.Event field in the completion token must be filled in by the caller\r
   and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol\r
   driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event\r
@@ -2310,7 +2310,7 @@ Ip4Cancel (
 \r
 /**\r
   Abort an asynchronous transmit or receive request.\r
 \r
 /**\r
   Abort an asynchronous transmit or receive request.\r
-  \r
+\r
   The Cancel() function is used to abort a pending transmit or receive request.\r
   If the token is in the transmit or receive request queues, after calling this\r
   function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r
   The Cancel() function is used to abort a pending transmit or receive request.\r
   If the token is in the transmit or receive request queues, after calling this\r
   function, Token->Status will be set to EFI_ABORTED and then Token->Event will\r
@@ -2376,12 +2376,12 @@ ON_EXIT:
 \r
 /**\r
   Polls for incoming data packets and processes outgoing data packets.\r
 \r
 /**\r
   Polls for incoming data packets and processes outgoing data packets.\r
-  \r
+\r
   The Poll() function polls for incoming data packets and processes outgoing data\r
   packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()\r
   function to increase the rate that data packets are moved between the communications\r
   device and the transmit and receive queues.\r
   The Poll() function polls for incoming data packets and processes outgoing data\r
   packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll()\r
   function to increase the rate that data packets are moved between the communications\r
   device and the transmit and receive queues.\r
-  \r
+\r
   In some systems the periodic timer event may not poll the underlying communications\r
   device fast enough to transmit and/or receive all data packets without missing\r
   incoming packets or dropping outgoing packets. Drivers and applications that are\r
   In some systems the periodic timer event may not poll the underlying communications\r
   device fast enough to transmit and/or receive all data packets without missing\r
   incoming packets or dropping outgoing packets. Drivers and applications that are\r
index 8ceb2480644f09ba2c329c697945499903e35d15..b920e8b21adca26e39dfd1b8f02fd9e6fec3ffe8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of Mtftp drivers.\r
 /** @file\r
   Implementation of Mtftp drivers.\r
-  \r
-Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
+\r
+Copyright (c) 2006 - 2010, Intel Corporation<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -35,7 +35,7 @@ EFI_SERVICE_BINDING_PROTOCOL  gMtftp4ServiceBindingTemplete = {
   @param ImageHandle    The MTFTP's image handle.\r
   @param SystemTable    The system table.\r
 \r
   @param ImageHandle    The MTFTP's image handle.\r
   @param SystemTable    The system table.\r
 \r
-  @retval EFI_SUCCESS  The handles are successfully installed on the image. \r
+  @retval EFI_SUCCESS  The handles are successfully installed on the image.\r
   @retval others       some EFI_ERROR occured.\r
 \r
 **/\r
   @retval others       some EFI_ERROR occured.\r
 \r
 **/\r
@@ -67,14 +67,14 @@ Mtftp4DriverEntryPoint (
   @retval EFI_SUCCESS            The controller has UDP service binding protocol\r
                                  installed, MTFTP can support it.\r
   @retval EFI_ALREADY_STARTED    The device specified by ControllerHandle and\r
   @retval EFI_SUCCESS            The controller has UDP service binding protocol\r
                                  installed, MTFTP can support it.\r
   @retval EFI_ALREADY_STARTED    The device specified by ControllerHandle and\r
-                                 RemainingDevicePath is already being managed by \r
+                                 RemainingDevicePath is already being managed by\r
                                  the driver specified by This.\r
   @retval EFI_ACCESS_DENIED      The device specified by ControllerHandle and\r
                                  the driver specified by This.\r
   @retval EFI_ACCESS_DENIED      The device specified by ControllerHandle and\r
-                                 RemainingDevicePath is already being managed by a \r
-                                 different driver or an application that requires \r
+                                 RemainingDevicePath is already being managed by a\r
+                                 different driver or an application that requires\r
                                  exclusive access.\r
   @retval EFI_UNSUPPORTED        The device specified by ControllerHandle and\r
                                  exclusive access.\r
   @retval EFI_UNSUPPORTED        The device specified by ControllerHandle and\r
-                                 RemainingDevicePath is not supported by the driver \r
+                                 RemainingDevicePath is not supported by the driver\r
                                  specified by This.\r
 \r
 **/\r
                                  specified by This.\r
 \r
 **/\r
@@ -102,9 +102,9 @@ Mtftp4DriverBindingSupported (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Config a NULL UDP that is used to keep the connection between UDP and MTFTP. \r
-  \r
-  Just leave the Udp child unconfigured. When UDP is unloaded, \r
+  Config a NULL UDP that is used to keep the connection between UDP and MTFTP.\r
+\r
+  Just leave the Udp child unconfigured. When UDP is unloaded,\r
     MTFTP will be informed with DriverBinding Stop.\r
 \r
   @param  UdpIo                  The UDP_IO to configure\r
     MTFTP will be informed with DriverBinding Stop.\r
 \r
   @param  UdpIo                  The UDP_IO to configure\r
@@ -239,8 +239,8 @@ Mtftp4CleanService (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Start the MTFTP driver on this controller. \r
-  \r
+  Start the MTFTP driver on this controller.\r
+\r
   MTFTP driver will install a MTFTP SERVICE BINDING protocol on the supported\r
   controller, which can be used to create/destroy MTFTP children.\r
 \r
   MTFTP driver will install a MTFTP SERVICE BINDING protocol on the supported\r
   controller, which can be used to create/destroy MTFTP children.\r
 \r
@@ -286,6 +286,7 @@ Mtftp4DriverBindingStart (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
+  ASSERT (MtftpSb != NULL);\r
 \r
   Status = gBS->SetTimer (MtftpSb->Timer, TimerPeriodic, TICKS_PER_SECOND);\r
 \r
 \r
   Status = gBS->SetTimer (MtftpSb->Timer, TimerPeriodic, TICKS_PER_SECOND);\r
 \r
index 93e548ea1c5411761728d53eb94dffd0339cd148..bfefb66d44601506d4928008d1dbfdfc1da3076c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Routines to process MTFTP4 options.\r
 /** @file\r
   Routines to process MTFTP4 options.\r
-  \r
-Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
+\r
+Copyright (c) 2006 - 2010, Intel Corporation<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -224,8 +224,8 @@ Mtftp4FillOptions (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Allocate and fill in a array of Mtftp options from the Packet. \r
-  \r
+  Allocate and fill in a array of Mtftp options from the Packet.\r
+\r
   It first calls Mtftp4FillOption to get the option number, then allocate\r
   the array, at last, call Mtftp4FillOption again to save the options.\r
 \r
   It first calls Mtftp4FillOption to get the option number, then allocate\r
   the array, at last, call Mtftp4FillOption again to save the options.\r
 \r
@@ -525,6 +525,7 @@ Mtftp4ParseOptionOack (
   if (EFI_ERROR (Status) || (Count == 0)) {\r
     return Status;\r
   }\r
   if (EFI_ERROR (Status) || (Count == 0)) {\r
     return Status;\r
   }\r
+  ASSERT (OptionList != NULL);\r
 \r
   Status = Mtftp4ParseOption (OptionList, Count, FALSE, MtftpOption);\r
 \r
 \r
   Status = Mtftp4ParseOption (OptionList, Count, FALSE, MtftpOption);\r
 \r
index 213b724e5f6da7691df0fc338e3d9ba955f4189d..606b096328eae5e1a3019f88313e3af4f9c7120c 100644 (file)
@@ -1,11 +1,11 @@
 /** @file\r
   Implementation of driver entry point and driver binding protocol.\r
 /** @file\r
   Implementation of driver entry point and driver binding protocol.\r
\r
-Copyright (c) 2004 - 2009, Intel Corporation. <BR> \r
-All rights reserved. This program and the accompanying materials are licensed \r
-and made available under the terms and conditions of the BSD License which \r
-accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
+\r
+Copyright (c) 2004 - 2010, Intel Corporation. <BR>\r
+All rights reserved. This program and the accompanying materials are licensed\r
+and made available under the terms and conditions of the BSD License which\r
+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
 \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
@@ -49,13 +49,13 @@ SnpNotifyExitBootServices (
 \r
 /**\r
   Send command to UNDI. It does nothing currently.\r
 \r
 /**\r
   Send command to UNDI. It does nothing currently.\r
-  \r
+\r
   @param Cdb   command to be sent to UNDI.\r
   @param Cdb   command to be sent to UNDI.\r
-   \r
-  @retval EFI_INVALID_PARAMETER  The command is 0. \r
-  @retval EFI_UNSUPPORTED        Default return status because it's not \r
+\r
+  @retval EFI_INVALID_PARAMETER  The command is 0.\r
+  @retval EFI_UNSUPPORTED        Default return status because it's not\r
                                  supported currently.\r
                                  supported currently.\r
-   \r
+\r
 **/\r
 EFI_STATUS\r
 IssueHwUndiCommand (\r
 **/\r
 EFI_STATUS\r
 IssueHwUndiCommand (\r
@@ -81,7 +81,7 @@ IssueHwUndiCommand (
   @param  Buffer               Pointer to buffer.\r
   @param  Length               Length of buffer in bytes.\r
 \r
   @param  Buffer               Pointer to buffer.\r
   @param  Length               Length of buffer in bytes.\r
 \r
-  @return 8-bit checksum of all bytes in buffer, or zero if ptr is NULL or len \r
+  @return 8-bit checksum of all bytes in buffer, or zero if ptr is NULL or len\r
           is zero.\r
 \r
 **/\r
           is zero.\r
 \r
 **/\r
@@ -178,7 +178,7 @@ SimpleNetworkDriverSupported (
   //\r
   // Check to see if !PXE structure is valid. Paragraph alignment of !PXE structure is required.\r
   //\r
   //\r
   // Check to see if !PXE structure is valid. Paragraph alignment of !PXE structure is required.\r
   //\r
-  if (NiiProtocol->Id & 0x0F) {\r
+  if ((NiiProtocol->Id & 0x0F) != 0) {\r
     DEBUG ((EFI_D_NET, "\n!PXE structure is not paragraph aligned.\n"));\r
     Status = EFI_UNSUPPORTED;\r
     goto Done;\r
     DEBUG ((EFI_D_NET, "\n!PXE structure is not paragraph aligned.\n"));\r
     Status = EFI_UNSUPPORTED;\r
     goto Done;\r
@@ -615,7 +615,7 @@ SimpleNetworkDriverStart (
 \r
   }\r
 \r
 \r
   }\r
 \r
-  if (Pxe->hw.Implementation & PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED) {\r
+  if ((Pxe->hw.Implementation & PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED) != 0) {\r
     Snp->Mode.ReceiveFilterMask |= EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST;\r
 \r
   }\r
     Snp->Mode.ReceiveFilterMask |= EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST;\r
 \r
   }\r
@@ -725,7 +725,7 @@ NiiError:
   restrictions for this service. DisconnectController()\r
   must follow these calling restrictions. If any other agent wishes\r
   to call Stop() it must also follow these calling restrictions.\r
   restrictions for this service. DisconnectController()\r
   must follow these calling restrictions. If any other agent wishes\r
   to call Stop() it must also follow these calling restrictions.\r
-  \r
+\r
   @param  This              Protocol instance pointer.\r
   @param  ControllerHandle  Handle of device to stop driver on\r
   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
   @param  This              Protocol instance pointer.\r
   @param  ControllerHandle  Handle of device to stop driver on\r
   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
index c52fc23db36c01207c8eba78b2f23ddf377a86b9..ad97f2407d0719b8ed8c7ee6ff48d9efac977893 100644 (file)
@@ -1,11 +1,11 @@
 /** @file\r
     Implementation of collecting the statistics on a network interface.\r
 /** @file\r
     Implementation of collecting the statistics on a network interface.\r
\r
-Copyright (c) 2004 - 2007, Intel Corporation. <BR> \r
-All rights reserved. This program and the accompanying materials are licensed \r
-and made available under the terms and conditions of the BSD License which \r
-accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
+\r
+Copyright (c) 2004 - 2010, Intel Corporation. <BR>\r
+All rights reserved. This program and the accompanying materials are licensed\r
+and made available under the terms and conditions of the BSD License which\r
+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
 \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
@@ -18,15 +18,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   Resets or collects the statistics on a network interface.\r
 \r
 /**\r
   Resets or collects the statistics on a network interface.\r
-  \r
+\r
   This function resets or collects the statistics on a network interface. If the\r
   size of the statistics table specified by StatisticsSize is not big enough for\r
   all the statistics that are collected by the network interface, then a partial\r
   This function resets or collects the statistics on a network interface. If the\r
   size of the statistics table specified by StatisticsSize is not big enough for\r
   all the statistics that are collected by the network interface, then a partial\r
-  buffer of statistics is returned in StatisticsTable, StatisticsSize is set to \r
-  the size required to collect all the available statistics, and \r
+  buffer of statistics is returned in StatisticsTable, StatisticsSize is set to\r
+  the size required to collect all the available statistics, and\r
   EFI_BUFFER_TOO_SMALL is returned.\r
   EFI_BUFFER_TOO_SMALL is returned.\r
-  If StatisticsSize is big enough for all the statistics, then StatisticsTable \r
-  will be filled, StatisticsSize will be set to the size of the returned \r
+  If StatisticsSize is big enough for all the statistics, then StatisticsTable\r
+  will be filled, StatisticsSize will be set to the size of the returned\r
   StatisticsTable structure, and EFI_SUCCESS is returned.\r
   If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.\r
   If Reset is FALSE, and both StatisticsSize and StatisticsTable are NULL, then\r
   StatisticsTable structure, and EFI_SUCCESS is returned.\r
   If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.\r
   If Reset is FALSE, and both StatisticsSize and StatisticsTable are NULL, then\r
@@ -36,30 +36,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
   @param This            A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
   @param Reset           Set to TRUE to reset the statistics for the network interface.\r
 \r
   @param This            A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
   @param Reset           Set to TRUE to reset the statistics for the network interface.\r
-  @param StatisticsSize  On input the size, in bytes, of StatisticsTable. On output \r
+  @param StatisticsSize  On input the size, in bytes, of StatisticsTable. On output\r
                          the size, in bytes, of the resulting table of statistics.\r
                          the size, in bytes, of the resulting table of statistics.\r
-  @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that \r
-                         contains the statistics. Type EFI_NETWORK_STATISTICS is \r
-                         defined in "Related Definitions" below. \r
-  \r
+  @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
+                         contains the statistics. Type EFI_NETWORK_STATISTICS is\r
+                         defined in "Related Definitions" below.\r
+\r
   @retval EFI_SUCCESS           The requested operation succeeded.\r
   @retval EFI_NOT_STARTED       The Simple Network Protocol interface has not been\r
                                 started by calling Start().\r
   @retval EFI_SUCCESS           The requested operation succeeded.\r
   @retval EFI_NOT_STARTED       The Simple Network Protocol interface has not been\r
                                 started by calling Start().\r
-  @retval EFI_BUFFER_TOO_SMALL  StatisticsSize is not NULL and StatisticsTable is \r
-                                NULL. The current buffer size that is needed to \r
+  @retval EFI_BUFFER_TOO_SMALL  StatisticsSize is not NULL and StatisticsTable is\r
+                                NULL. The current buffer size that is needed to\r
                                 hold all the statistics is returned in StatisticsSize.\r
                                 hold all the statistics is returned in StatisticsSize.\r
-  @retval EFI_BUFFER_TOO_SMALL  StatisticsSize is not NULL and StatisticsTable is \r
+  @retval EFI_BUFFER_TOO_SMALL  StatisticsSize is not NULL and StatisticsTable is\r
                                 not NULL. The current buffer size that is needed\r
                                 not NULL. The current buffer size that is needed\r
-                                to hold all the statistics is returned in \r
-                                StatisticsSize. A partial set of statistics is \r
+                                to hold all the statistics is returned in\r
+                                StatisticsSize. A partial set of statistics is\r
                                 returned in StatisticsTable.\r
                                 returned in StatisticsTable.\r
-  @retval EFI_INVALID_PARAMETER StatisticsSize is NULL and StatisticsTable is not \r
+  @retval EFI_INVALID_PARAMETER StatisticsSize is NULL and StatisticsTable is not\r
                                 NULL.\r
                                 NULL.\r
-  @retval EFI_DEVICE_ERROR      The Simple Network Protocol interface has not \r
+  @retval EFI_DEVICE_ERROR      The Simple Network Protocol interface has not\r
                                 been initialized by calling Initialize().\r
                                 been initialized by calling Initialize().\r
-  @retval EFI_DEVICE_ERROR      An error was encountered collecting statistics \r
+  @retval EFI_DEVICE_ERROR      An error was encountered collecting statistics\r
                                 from the NIC.\r
                                 from the NIC.\r
-  @retval EFI_UNSUPPORTED       The NIC does not support collecting statistics \r
+  @retval EFI_UNSUPPORTED       The NIC does not support collecting statistics\r
                                 from the network interface.\r
 \r
 **/\r
                                 from the network interface.\r
 \r
 **/\r
@@ -197,7 +197,7 @@ SnpUndi32Statistics (
       break;\r
     }\r
 \r
       break;\r
     }\r
 \r
-    if (Db->Supported & Mask) {\r
+    if ((Db->Supported & Mask) != 0) {\r
       *Stp  = Db->Data[Index];\r
       Size  = Index + 1;\r
     } else {\r
       *Stp  = Db->Data[Index];\r
       Size  = Index + 1;\r
     } else {\r
@@ -208,7 +208,7 @@ SnpUndi32Statistics (
   // Compute size up to last supported statistic.\r
   //\r
   while (++Index < 64) {\r
   // Compute size up to last supported statistic.\r
   //\r
   while (++Index < 64) {\r
-    if (Db->Supported & (Mask = LShiftU64 (Mask, 1))) {\r
+    if ((Db->Supported & (Mask = LShiftU64 (Mask, 1))) != 0) {\r
       Size = Index;\r
     }\r
   }\r
       Size = Index;\r
     }\r
   }\r
index 2b924c4b4b954fe80901729fb0e191e545759444..664d25a1a2aa4c03afb544daaf280e161f4cbc4e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Tcp request dispatcher implementation.\r
 \r
 /** @file\r
   Tcp request dispatcher implementation.\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -52,7 +52,7 @@ Tcp4Route (
               RouteInfo->SubnetMask,\r
               RouteInfo->GatewayAddress\r
               );\r
               RouteInfo->SubnetMask,\r
               RouteInfo->GatewayAddress\r
               );\r
-              \r
+\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -249,7 +249,7 @@ Tcp4FlushPcb (
   Attach a Pcb to the socket.\r
 \r
   @param  Sk                     Pointer to the socket of this TCP instance.\r
   Attach a Pcb to the socket.\r
 \r
   @param  Sk                     Pointer to the socket of this TCP instance.\r
-  \r
+\r
   @retval EFI_SUCCESS            The operation is completed successfully.\r
   @retval EFI_OUT_OF_RESOURCES   Failed due to resource limit.\r
 \r
   @retval EFI_SUCCESS            The operation is completed successfully.\r
   @retval EFI_OUT_OF_RESOURCES   Failed due to resource limit.\r
 \r
@@ -300,7 +300,7 @@ Tcp4AttachPcb (
   Detach the Pcb of the socket.\r
 \r
   @param  Sk                     Pointer to the socket of this TCP instance.\r
   Detach the Pcb of the socket.\r
 \r
   @param  Sk                     Pointer to the socket of this TCP instance.\r
-  \r
+\r
 **/\r
 VOID\r
 Tcp4DetachPcb (\r
 **/\r
 VOID\r
 Tcp4DetachPcb (\r
@@ -532,15 +532,15 @@ Tcp4ConfigurePcb (
                             (UINT32) (Option->ConnectionTimeout * TCP_TICK_HZ)\r
                             );\r
 \r
                             (UINT32) (Option->ConnectionTimeout * TCP_TICK_HZ)\r
                             );\r
 \r
-    if (Option->EnableNagle == FALSE) {\r
+    if (!Option->EnableNagle) {\r
       TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE);\r
     }\r
 \r
       TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE);\r
     }\r
 \r
-    if (Option->EnableTimeStamp == FALSE) {\r
+    if (!Option->EnableTimeStamp) {\r
       TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_TS);\r
     }\r
 \r
       TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_TS);\r
     }\r
 \r
-    if (Option->EnableWindowScaling == FALSE) {\r
+    if (!Option->EnableWindowScaling) {\r
       TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_WS);\r
     }\r
   }\r
       TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_WS);\r
     }\r
   }\r
@@ -557,7 +557,7 @@ Tcp4ConfigurePcb (
   //\r
   // update state of Tcb and socket\r
   //\r
   //\r
   // update state of Tcb and socket\r
   //\r
-  if (CfgData->AccessPoint.ActiveFlag == FALSE) {\r
+  if (!CfgData->AccessPoint.ActiveFlag) {\r
 \r
     TcpSetState (Tcb, TCP_LISTEN);\r
     SockSetState (Sk, SO_LISTENING);\r
 \r
     TcpSetState (Tcb, TCP_LISTEN);\r
     SockSetState (Sk, SO_LISTENING);\r
index ed7ee73e91e23ca93624b08305cadf0e51488891..6b2da72b42ca9697076c770cc749073c824c58d8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support for PxeBc dhcp functions.\r
 /** @file\r
   Support for PxeBc dhcp functions.\r
-  \r
-Copyright (c) 2007 - 2009, Intel Corporation.<BR>                                                         \r
+\r
+Copyright (c) 2007 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -33,7 +33,7 @@ UINT8 mInterestedDhcp4Tags[PXEBC_DHCP4_TAG_INDEX_MAX] = {
   This function initialize the DHCP4 message instance.\r
 \r
   This function will pad each item of dhcp4 message packet.\r
   This function initialize the DHCP4 message instance.\r
 \r
   This function will pad each item of dhcp4 message packet.\r
-  \r
+\r
   @param  Seed    Pointer to the message instance of the DHCP4 packet.\r
   @param  Udp4    Pointer to the EFI_UDP4_PROTOCOL instance.\r
 \r
   @param  Seed    Pointer to the message instance of the DHCP4 packet.\r
   @param  Udp4    Pointer to the EFI_UDP4_PROTOCOL instance.\r
 \r
@@ -181,7 +181,7 @@ PxeBcParseCachedDhcpPacket (
   // serverhostname option.\r
   //\r
   Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];\r
   // serverhostname option.\r
   //\r
   Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];\r
-  if ((Option != NULL) && (Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE)) {\r
+  if ((Option != NULL) && ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0)) {\r
 \r
     Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = PxeBcParseExtendOptions (\r
                                                 (UINT8 *) Offer->Dhcp4.Header.BootFileName,\r
 \r
     Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = PxeBcParseExtendOptions (\r
                                                 (UINT8 *) Offer->Dhcp4.Header.BootFileName,\r
@@ -253,9 +253,9 @@ PxeBcParseCachedDhcpPacket (
                     the index is maximum offer number.\r
 \r
   @retval TRUE      Offer the service successfully under priority BINL.\r
                     the index is maximum offer number.\r
 \r
   @retval TRUE      Offer the service successfully under priority BINL.\r
-  @retval FALSE     Boot Service failed, parse cached dhcp packet failed or this \r
+  @retval FALSE     Boot Service failed, parse cached dhcp packet failed or this\r
                     BINL ack cannot find options set or bootfile name specified.\r
                     BINL ack cannot find options set or bootfile name specified.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 PxeBcTryBinl (\r
 **/\r
 BOOLEAN\r
 PxeBcTryBinl (\r
@@ -287,8 +287,8 @@ PxeBcTryBinl (
       );\r
   } else {\r
     CopyMem (\r
       );\r
   } else {\r
     CopyMem (\r
-      &ServerIp.Addr[0], \r
-      &Offer->Dhcp4.Header.ServerAddr, \r
+      &ServerIp.Addr[0],\r
+      &Offer->Dhcp4.Header.ServerAddr,\r
       sizeof (EFI_IPv4_ADDRESS)\r
       );\r
   }\r
       sizeof (EFI_IPv4_ADDRESS)\r
       );\r
   }\r
@@ -338,7 +338,7 @@ PxeBcTryBinl (
   Offer dhcp service for each proxy with a BINL dhcp offer.\r
 \r
   @param  Private     Pointer to PxeBc private data\r
   Offer dhcp service for each proxy with a BINL dhcp offer.\r
 \r
   @param  Private     Pointer to PxeBc private data\r
-  @param  OfferIndex  Pointer to the index of cached packets as complements of \r
+  @param  OfferIndex  Pointer to the index of cached packets as complements of\r
                       pxe mode data, the index is maximum offer number.\r
 \r
   @return If there is no service needed offer return FALSE, otherwise TRUE.\r
                       pxe mode data, the index is maximum offer number.\r
 \r
   @return If there is no service needed offer return FALSE, otherwise TRUE.\r
@@ -408,8 +408,8 @@ PxeBcCheckSelectedOffer (
     }\r
   } else if (SelectedOffer->OfferType == DHCP4_PACKET_TYPE_DHCP_ONLY) {\r
     //\r
     }\r
   } else if (SelectedOffer->OfferType == DHCP4_PACKET_TYPE_DHCP_ONLY) {\r
     //\r
-    // The selected offer to finish the D.O.R.A. is a DHCP only offer, we need \r
-    // try proxy offers if there are some, othewise the bootfile name must be \r
+    // The selected offer to finish the D.O.R.A. is a DHCP only offer, we need\r
+    // try proxy offers if there are some, othewise the bootfile name must be\r
     // set in this DHCP only offer.\r
     //\r
     if (Private->GotProxyOffer) {\r
     // set in this DHCP only offer.\r
     //\r
     if (Private->GotProxyOffer) {\r
@@ -439,7 +439,7 @@ PxeBcCheckSelectedOffer (
         }\r
       } else {\r
         //\r
         }\r
       } else {\r
         //\r
-        // The proxy offer type is not determined, choose proxy offer in the \r
+        // The proxy offer type is not determined, choose proxy offer in the\r
         // received order.\r
         //\r
         Status = EFI_NO_RESPONSE;\r
         // received order.\r
         //\r
         Status = EFI_NO_RESPONSE;\r
@@ -615,7 +615,7 @@ PxeBcCacheDhcpOffer (
 /**\r
   Select the specified proxy offer, such as BINL, DHCP_ONLY and so on.\r
   If the proxy does not exist, try offers with bootfile.\r
 /**\r
   Select the specified proxy offer, such as BINL, DHCP_ONLY and so on.\r
   If the proxy does not exist, try offers with bootfile.\r
-  \r
+\r
   @param  Private   Pointer to PxeBc private data.\r
 \r
 **/\r
   @param  Private   Pointer to PxeBc private data.\r
 \r
 **/\r
@@ -733,7 +733,7 @@ PxeBcSelectOffer (
 \r
 /**\r
   Callback routine.\r
 \r
 /**\r
   Callback routine.\r
-  \r
+\r
   EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver\r
   to intercept events that occurred in the configuration process. This structure\r
   provides advanced control of each state transition of the DHCP process. The\r
   EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver\r
   to intercept events that occurred in the configuration process. This structure\r
   provides advanced control of each state transition of the DHCP process. The\r
@@ -902,8 +902,8 @@ PxeBcDhcpCallBack (
 \r
   @param  Private          Pointer to PxeBc private data.\r
   @param  OptList          Pointer to a DHCP option list.\r
 \r
   @param  Private          Pointer to PxeBc private data.\r
   @param  OptList          Pointer to a DHCP option list.\r
-                           \r
-  @param  IsDhcpDiscover   Discover dhcp option or not.     \r
+\r
+  @param  IsDhcpDiscover   Discover dhcp option or not.\r
 \r
   @return The index item number of the option list.\r
 \r
 \r
   @return The index item number of the option list.\r
 \r
@@ -1048,7 +1048,7 @@ PxeBcBuildDhcpOptions (
   CvtNum (SYS_ARCH, OptEnt.Clid->ArchitectureType, sizeof (OptEnt.Clid->ArchitectureType));\r
 \r
   if (Private->Nii != NULL) {\r
   CvtNum (SYS_ARCH, OptEnt.Clid->ArchitectureType, sizeof (OptEnt.Clid->ArchitectureType));\r
 \r
   if (Private->Nii != NULL) {\r
-    // \r
+    //\r
     // If NII protocol exists, update DHCP option data\r
     //\r
     CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));\r
     // If NII protocol exists, update DHCP option data\r
     //\r
     CopyMem (OptEnt.Clid->InterfaceName, Private->Nii->StringId, sizeof (OptEnt.Clid->InterfaceName));\r
@@ -1069,8 +1069,8 @@ PxeBcBuildDhcpOptions (
   @param  Type                  PxeBc option boot item type\r
   @param  Layer                 PxeBc option boot item layer\r
   @param  UseBis                Use BIS or not\r
   @param  Type                  PxeBc option boot item type\r
   @param  Layer                 PxeBc option boot item layer\r
   @param  UseBis                Use BIS or not\r
-  @param  DestIp                Ip address for server      \r
-  @param  IpCount               The total count of the server ip address    \r
+  @param  DestIp                Ip address for server\r
+  @param  IpCount               The total count of the server ip address\r
   @param  SrvList               Server list\r
   @param  IsDiscv               Discover the vendor or not\r
   @param  Reply                 The dhcp4 packet of Pxe reply\r
   @param  SrvList               Server list\r
   @param  IsDiscv               Discover the vendor or not\r
   @param  Reply                 The dhcp4 packet of Pxe reply\r
@@ -1078,8 +1078,8 @@ PxeBcBuildDhcpOptions (
   @retval EFI_SUCCESS           Operation succeeds.\r
   @retval EFI_OUT_OF_RESOURCES  Allocate memory pool failed.\r
   @retval EFI_NOT_FOUND         There is no vendor option exists.\r
   @retval EFI_SUCCESS           Operation succeeds.\r
   @retval EFI_OUT_OF_RESOURCES  Allocate memory pool failed.\r
   @retval EFI_NOT_FOUND         There is no vendor option exists.\r
-  @retval EFI_TIMEOUT           Send Pxe Discover time out. \r
-  \r
+  @retval EFI_TIMEOUT           Send Pxe Discover time out.\r
+\r
 **/\r
 EFI_STATUS\r
 PxeBcDiscvBootService (\r
 **/\r
 EFI_STATUS\r
 PxeBcDiscvBootService (\r
@@ -1179,7 +1179,7 @@ PxeBcDiscvBootService (
 \r
     DhcpHeader->HwAddrLen = sizeof (EFI_GUID);\r
   }\r
 \r
     DhcpHeader->HwAddrLen = sizeof (EFI_GUID);\r
   }\r
-       \r
+\r
   Xid                                 = NET_RANDOM (NetRandomInitSeed ());\r
   Token.Packet->Dhcp4.Header.Xid      = HTONL(Xid);\r
   Token.Packet->Dhcp4.Header.Reserved = HTONS((UINT16) ((IsBCast) ? 0x8000 : 0));\r
   Xid                                 = NET_RANDOM (NetRandomInitSeed ());\r
   Token.Packet->Dhcp4.Header.Xid      = HTONL(Xid);\r
   Token.Packet->Dhcp4.Header.Reserved = HTONS((UINT16) ((IsBCast) ? 0x8000 : 0));\r
@@ -1288,7 +1288,7 @@ PxeBcDiscvBootService (
   @param  Length     The length of the dhcp options.\r
   @param  OptTag     The option OpCode.\r
 \r
   @param  Length     The length of the dhcp options.\r
   @param  OptTag     The option OpCode.\r
 \r
-  @return NULL if the buffer length is 0 and OpCode is not \r
+  @return NULL if the buffer length is 0 and OpCode is not\r
           PXEBC_DHCP4_TAG_EOP, or the pointer to the buffer.\r
 \r
 **/\r
           PXEBC_DHCP4_TAG_EOP, or the pointer to the buffer.\r
 \r
 **/\r
@@ -1451,8 +1451,8 @@ PxeBcParseVendorOptions (
 /**\r
   This function display boot item detail.\r
 \r
 /**\r
   This function display boot item detail.\r
 \r
-  If the length of the boot item string over 70 Char, just display 70 Char. \r
-   \r
+  If the length of the boot item string over 70 Char, just display 70 Char.\r
+\r
   @param  Str     Pointer to a string (boot item string).\r
   @param  Len     The length of string.\r
 \r
   @param  Str     Pointer to a string (boot item string).\r
   @param  Len     The length of string.\r
 \r
@@ -1479,11 +1479,11 @@ PxeBcDisplayBootItem (
   @param  Private              Pointer to PxeBc private data.\r
 \r
   @retval EFI_SUCCESS          Select boot prompt done.\r
   @param  Private              Pointer to PxeBc private data.\r
 \r
   @retval EFI_SUCCESS          Select boot prompt done.\r
-  @retval EFI_TIMEOUT          Select boot prompt time out. \r
+  @retval EFI_TIMEOUT          Select boot prompt time out.\r
   @retval EFI_NOT_FOUND        The proxy offer is not Pxe10.\r
   @retval EFI_ABORTED          User cancel the operation.\r
   @retval EFI_NOT_READY        Read the input key from the keybroad has not finish.\r
   @retval EFI_NOT_FOUND        The proxy offer is not Pxe10.\r
   @retval EFI_ABORTED          User cancel the operation.\r
   @retval EFI_NOT_READY        Read the input key from the keybroad has not finish.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 PxeBcSelectBootPrompt (\r
 **/\r
 EFI_STATUS\r
 PxeBcSelectBootPrompt (\r
@@ -1657,10 +1657,10 @@ ON_EXIT:
   @param  Private         Pointer to PxeBc private data.\r
   @param  Type            The type of the menu.\r
   @param  UseDefaultItem  Use default item or not.\r
   @param  Private         Pointer to PxeBc private data.\r
   @param  Type            The type of the menu.\r
   @param  UseDefaultItem  Use default item or not.\r
-  \r
+\r
   @retval EFI_ABORTED     User cancel operation.\r
   @retval EFI_SUCCESS     Select the boot menu success.\r
   @retval EFI_ABORTED     User cancel operation.\r
   @retval EFI_SUCCESS     Select the boot menu success.\r
-  @retval EFI_NOT_READY   Read the input key from the keybroad has not finish.    \r
+  @retval EFI_NOT_READY   Read the input key from the keybroad has not finish.\r
 \r
 **/\r
 EFI_STATUS\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1671,7 +1671,7 @@ PxeBcSelectBootMenu (
   )\r
 {\r
   PXEBC_CACHED_DHCP4_PACKET  *Packet;\r
   )\r
 {\r
   PXEBC_CACHED_DHCP4_PACKET  *Packet;\r
-  PXEBC_VENDOR_OPTION       *VendorOpt;\r
+  PXEBC_VENDOR_OPTION        *VendorOpt;\r
   EFI_INPUT_KEY              InputKey;\r
   UINT8                      MenuSize;\r
   UINT8                      MenuNum;\r
   EFI_INPUT_KEY              InputKey;\r
   UINT8                      MenuSize;\r
   UINT8                      MenuNum;\r
@@ -1754,7 +1754,7 @@ PxeBcSelectBootMenu (
       gBS->Stall (10 * TICKS_PER_MS);\r
     }\r
 \r
       gBS->Stall (10 * TICKS_PER_MS);\r
     }\r
 \r
-    if (!InputKey.ScanCode) {\r
+    if (InputKey.ScanCode != 0) {\r
       switch (InputKey.UnicodeChar) {\r
       case CTRL ('c'):\r
         InputKey.ScanCode = SCAN_ESC;\r
       switch (InputKey.UnicodeChar) {\r
       case CTRL ('c'):\r
         InputKey.ScanCode = SCAN_ESC;\r
index 2dc66f168ca960448aa4c2e21faf8d66fd751594..e5ff4addf67fee01f60df4cf5c8af7ef74a956b5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Interface routines for PxeBc.\r
 /** @file\r
   Interface routines for PxeBc.\r
-  \r
-Copyright (c) 2007 - 2009, Intel Corporation.<BR>\r
+\r
+Copyright (c) 2007 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -61,8 +61,8 @@ UpdateArpCache (
                            );\r
   for (Index = 0; Index < Mode->ArpCacheEntries; Index ++) {\r
     CopyMem (\r
                            );\r
   for (Index = 0; Index < Mode->ArpCacheEntries; Index ++) {\r
     CopyMem (\r
-      &Mode->ArpCache[Index].IpAddr, \r
-      Entries + 1, \r
+      &Mode->ArpCache[Index].IpAddr,\r
+      Entries + 1,\r
       Entries->SwAddressLength\r
       );\r
     CopyMem (\r
       Entries->SwAddressLength\r
       );\r
     CopyMem (\r
@@ -98,12 +98,12 @@ ArpCacheUpdateTimeout (
 \r
 /**\r
   Do arp resolution from arp cache in PxeBcMode.\r
 \r
 /**\r
   Do arp resolution from arp cache in PxeBcMode.\r
-  \r
+\r
   @param  PxeBcMode      The PXE BC mode to look into.\r
   @param  Ip4Addr        The Ip4 address for resolution.\r
   @param  MacAddress     The resoluted MAC address if the resolution is successful.\r
                          The value is undefined if resolution fails.\r
   @param  PxeBcMode      The PXE BC mode to look into.\r
   @param  Ip4Addr        The Ip4 address for resolution.\r
   @param  MacAddress     The resoluted MAC address if the resolution is successful.\r
                          The value is undefined if resolution fails.\r
-                         \r
+\r
   @retval TRUE           The resolution is successful.\r
   @retval FALSE          Otherwise.\r
 \r
   @retval TRUE           The resolution is successful.\r
   @retval FALSE          Otherwise.\r
 \r
@@ -243,7 +243,7 @@ IcmpErrorListenHandler (
   QueueDpc (TPL_CALLBACK, IcmpErrorListenHandlerDpc, Context);\r
 }\r
 \r
   QueueDpc (TPL_CALLBACK, IcmpErrorListenHandlerDpc, Context);\r
 }\r
 \r
-/**                                                                 \r
+/**\r
   Enables the use of the PXE Base Code Protocol functions.\r
 \r
   This function enables the use of the PXE Base Code Protocol functions. If the\r
   Enables the use of the PXE Base Code Protocol functions.\r
 \r
   This function enables the use of the PXE Base Code Protocol functions. If the\r
@@ -290,22 +290,22 @@ IcmpErrorListenHandler (
     TftpErrorZero-filled.\r
     MakeCallbacksSet to TRUE if the PXE Base Code Callback Protocol is available.\r
     Set to FALSE if the PXE Base Code Callback Protocol is not available.\r
     TftpErrorZero-filled.\r
     MakeCallbacksSet to TRUE if the PXE Base Code Callback Protocol is available.\r
     Set to FALSE if the PXE Base Code Callback Protocol is not available.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  UseIpv6               Specifies the type of IP addresses that are to be used during the session\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  UseIpv6               Specifies the type of IP addresses that are to be used during the session\r
-                                that is being started. Set to TRUE for IPv6 addresses, and FALSE for     \r
-                                IPv4 addresses.                                                                                                   \r
-                                \r
+                                that is being started. Set to TRUE for IPv6 addresses, and FALSE for\r
+                                IPv4 addresses.\r
+\r
   @retval EFI_SUCCESS           The PXE Base Code Protocol was started.\r
   @retval EFI_SUCCESS           The PXE Base Code Protocol was started.\r
-  @retval EFI_DEVICE_ERROR      The network device encountered an error during this oper  \r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this oper\r
   @retval EFI_UNSUPPORTED       UseIpv6 is TRUE, but the Ipv6Supported field of the\r
   @retval EFI_UNSUPPORTED       UseIpv6 is TRUE, but the Ipv6Supported field of the\r
-                                EFI_PXE_BASE_CODE_MODE structure is FALSE.  \r
-  @retval EFI_ALREADY_STARTED   The PXE Base Code Protocol is already in the started state.                                   \r
+                                EFI_PXE_BASE_CODE_MODE structure is FALSE.\r
+  @retval EFI_ALREADY_STARTED   The PXE Base Code Protocol is already in the started state.\r
   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
-                                EFI_PXE_BASE_CODE_PROTOCOL structure.      \r
-  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory or other resources to start the                                          \r
-                                PXE Base Code Protocol.                                         \r
-                                     \r
+                                EFI_PXE_BASE_CODE_PROTOCOL structure.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory or other resources to start the\r
+                                PXE Base Code Protocol.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -340,7 +340,7 @@ EfiPxeBcStart (
   // Configure the udp4 instance to let it receive data\r
   //\r
   Status = Private->Udp4Read->Configure (\r
   // Configure the udp4 instance to let it receive data\r
   //\r
   Status = Private->Udp4Read->Configure (\r
-                               Private->Udp4Read, \r
+                               Private->Udp4Read,\r
                                &Private->Udp4CfgData\r
                                );\r
   if (EFI_ERROR (Status)) {\r
                                &Private->Udp4CfgData\r
                                );\r
   if (EFI_ERROR (Status)) {\r
@@ -431,22 +431,22 @@ ON_EXIT:
 }\r
 \r
 \r
 }\r
 \r
 \r
-/**                                                                 \r
+/**\r
   Disables the use of the PXE Base Code Protocol functions.\r
 \r
   This function stops all activity on the network device. All the resources allocated\r
   in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is\r
   set to FALSE and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE\r
   structure is already FALSE, then EFI_NOT_STARTED will be returned.\r
   Disables the use of the PXE Base Code Protocol functions.\r
 \r
   This function stops all activity on the network device. All the resources allocated\r
   in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is\r
   set to FALSE and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE\r
   structure is already FALSE, then EFI_NOT_STARTED will be returned.\r
-  \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
\r
+\r
   @retval EFI_SUCCESS           The PXE Base Code Protocol was stopped.\r
   @retval EFI_SUCCESS           The PXE Base Code Protocol was stopped.\r
-  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is already in the stopped state.  \r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is already in the stopped state.\r
   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
-                                EFI_PXE_BASE_CODE_PROTOCOL structure.                  \r
-  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
-                                     \r
+                                EFI_PXE_BASE_CODE_PROTOCOL structure.\r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -508,7 +508,7 @@ EfiPxeBcStop (
 }\r
 \r
 \r
 }\r
 \r
 \r
-/**                                                                 \r
+/**\r
   Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r
   S.A.R.R (solicit / advertise / request / reply) sequence.\r
 \r
   Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r
   S.A.R.R (solicit / advertise / request / reply) sequence.\r
 \r
@@ -524,22 +524,22 @@ EfiPxeBcStop (
   caller. If the DHCP sequence does not complete, then EFI_TIMEOUT will be returned.\r
   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
   then the DHCP sequence will be stopped and EFI_ABORTED will be returned.\r
   caller. If the DHCP sequence does not complete, then EFI_TIMEOUT will be returned.\r
   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
   then the DHCP sequence will be stopped and EFI_ABORTED will be returned.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  SortOffers            TRUE if the offers received should be sorted. Set to FALSE to try the\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  SortOffers            TRUE if the offers received should be sorted. Set to FALSE to try the\r
-                                offers in the order that they are received.                          \r
\r
+                                offers in the order that they are received.\r
+\r
   @retval EFI_SUCCESS           Valid DHCP has completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
   @retval EFI_SUCCESS           Valid DHCP has completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
-                                EFI_PXE_BASE_CODE_PROTOCOL structure.                  \r
-  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
+                                EFI_PXE_BASE_CODE_PROTOCOL structure.\r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete the DHCP Protocol.\r
   @retval EFI_ABORTED           The callback function aborted the DHCP Protocol.\r
   @retval EFI_TIMEOUT           The DHCP Protocol timed out.\r
   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the DHCP session.\r
   @retval EFI_NO_RESPONSE       Valid PXE offer was not received.\r
   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete the DHCP Protocol.\r
   @retval EFI_ABORTED           The callback function aborted the DHCP Protocol.\r
   @retval EFI_TIMEOUT           The DHCP Protocol timed out.\r
   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the DHCP session.\r
   @retval EFI_NO_RESPONSE       Valid PXE offer was not received.\r
-                                     \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -596,7 +596,7 @@ EfiPxeBcDhcp (
   if (EFI_ERROR (Status)) {\r
     goto ON_EXIT;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     goto ON_EXIT;\r
   }\r
-  \r
+\r
   //\r
   // Zero those arrays to record the varies numbers of DHCP OFFERS.\r
   //\r
   //\r
   // Zero those arrays to record the varies numbers of DHCP OFFERS.\r
   //\r
@@ -688,7 +688,7 @@ ON_EXIT:
 }\r
 \r
 \r
 }\r
 \r
 \r
-/**                                                                 \r
+/**\r
   Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r
 \r
   This function attempts to complete the PXE Boot Server and/or boot image discovery\r
   Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r
 \r
   This function attempts to complete the PXE Boot Server and/or boot image discovery\r
@@ -710,26 +710,26 @@ ON_EXIT:
   additional details on the implementation of the Discovery sequence.\r
   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
   then the Discovery sequence is stopped and EFI_ABORTED will be returned.\r
   additional details on the implementation of the Discovery sequence.\r
   If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
   then the Discovery sequence is stopped and EFI_ABORTED will be returned.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  Type                  The type of bootstrap to perform.\r
   @param  Layer                 Pointer to the boot server layer number to discover, which must be\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  Type                  The type of bootstrap to perform.\r
   @param  Layer                 Pointer to the boot server layer number to discover, which must be\r
-                                PXE_BOOT_LAYER_INITIAL when a new server type is being            \r
-                                discovered.                                                       \r
-  @param  UseBis                TRUE if Boot Integrity Services are to be used. FALSE otherwise.                                \r
+                                PXE_BOOT_LAYER_INITIAL when a new server type is being\r
+                                discovered.\r
+  @param  UseBis                TRUE if Boot Integrity Services are to be used. FALSE otherwise.\r
   @param  Info                  Pointer to a data structure that contains additional information on the\r
   @param  Info                  Pointer to a data structure that contains additional information on the\r
-                                type of discovery operation that is to be performed.                   \r
-                                  \r
+                                type of discovery operation that is to be performed.\r
+\r
   @retval EFI_SUCCESS           The Discovery sequence has been completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The Discovery sequence has been completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
-  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete Discovery.\r
   @retval EFI_ABORTED           The callback function aborted the Discovery sequence.\r
   @retval EFI_TIMEOUT           The Discovery sequence timed out.\r
   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the PXE discovery\r
   @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete Discovery.\r
   @retval EFI_ABORTED           The callback function aborted the Discovery sequence.\r
   @retval EFI_TIMEOUT           The Discovery sequence timed out.\r
   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the PXE discovery\r
-                                session.                                                  \r
-                                       \r
+                                session.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -819,8 +819,8 @@ EfiPxeBcDiscover (
       // Get the multicast discover ip address from vendor option.\r
       //\r
       CopyMem (\r
       // Get the multicast discover ip address from vendor option.\r
       //\r
       CopyMem (\r
-        &DefaultInfo.ServerMCastIp.Addr, \r
-        &VendorOpt->DiscoverMcastIp, \r
+        &DefaultInfo.ServerMCastIp.Addr,\r
+        &VendorOpt->DiscoverMcastIp,\r
         sizeof (EFI_IPv4_ADDRESS)\r
         );\r
     }\r
         sizeof (EFI_IPv4_ADDRESS)\r
         );\r
     }\r
@@ -882,8 +882,8 @@ EfiPxeBcDiscover (
         Private->ServerIp.Addr[0] = SrvList[Index].IpAddr.Addr[0];\r
       } else {\r
         CopyMem (\r
         Private->ServerIp.Addr[0] = SrvList[Index].IpAddr.Addr[0];\r
       } else {\r
         CopyMem (\r
-          &Private->ServerIp, \r
-          &BootSvrEntry->IpAddr[Index], \r
+          &Private->ServerIp,\r
+          &BootSvrEntry->IpAddr[Index],\r
           sizeof (EFI_IPv4_ADDRESS)\r
           );\r
       }\r
           sizeof (EFI_IPv4_ADDRESS)\r
           );\r
       }\r
@@ -942,8 +942,8 @@ EfiPxeBcDiscover (
 \r
   if (Mode->PxeBisReplyReceived) {\r
     CopyMem (\r
 \r
   if (Mode->PxeBisReplyReceived) {\r
     CopyMem (\r
-      &Private->ServerIp, \r
-      &Mode->PxeReply.Dhcpv4.BootpSiAddr, \r
+      &Private->ServerIp,\r
+      &Mode->PxeReply.Dhcpv4.BootpSiAddr,\r
       sizeof (EFI_IPv4_ADDRESS)\r
       );\r
   }\r
       sizeof (EFI_IPv4_ADDRESS)\r
       );\r
   }\r
@@ -952,7 +952,7 @@ EfiPxeBcDiscover (
 }\r
 \r
 \r
 }\r
 \r
 \r
-/**                                                                 \r
+/**\r
   Used to perform TFTP and MTFTP services.\r
 \r
   This function is used to perform TFTP and MTFTP services. This includes the\r
   Used to perform TFTP and MTFTP services.\r
 \r
   This function is used to perform TFTP and MTFTP services. This includes the\r
@@ -997,31 +997,31 @@ EfiPxeBcDiscover (
   IP address preceding the filename of the form %d.%d.%d.%d for IP v4. The final\r
   entry is itself null-terminated, so that the final information string is terminated\r
   with two null octets.\r
   IP address preceding the filename of the form %d.%d.%d.%d for IP v4. The final\r
   entry is itself null-terminated, so that the final information string is terminated\r
   with two null octets.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  Operation             The type of operation to perform.\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  Operation             The type of operation to perform.\r
-  @param  BufferPtr             A pointer to the data buffer.                                                                     \r
+  @param  BufferPtr             A pointer to the data buffer.\r
   @param  Overwrite             Only used on write file operations. TRUE if a file on a remote server can\r
   @param  Overwrite             Only used on write file operations. TRUE if a file on a remote server can\r
-                                be overwritten.                                                          \r
+                                be overwritten.\r
   @param  BufferSize            For get-file-size operations, *BufferSize returns the size of the\r
   @param  BufferSize            For get-file-size operations, *BufferSize returns the size of the\r
-                                requested file.                                                  \r
+                                requested file.\r
   @param  BlockSize             The requested block size to be used during a TFTP transfer.\r
   @param  ServerIp              The TFTP / MTFTP server IP address.\r
   @param  Filename              A Null-terminated ASCII string that specifies a directory name or a file\r
   @param  BlockSize             The requested block size to be used during a TFTP transfer.\r
   @param  ServerIp              The TFTP / MTFTP server IP address.\r
   @param  Filename              A Null-terminated ASCII string that specifies a directory name or a file\r
-                                name.                                                                   \r
+                                name.\r
   @param  Info                  Pointer to the MTFTP information.\r
   @param  Info                  Pointer to the MTFTP information.\r
-  @param  DontUseBuffer         Set to FALSE for normal TFTP and MTFTP read file operation.                       \r
-                                  \r
+  @param  DontUseBuffer         Set to FALSE for normal TFTP and MTFTP read file operation.\r
+\r
   @retval EFI_SUCCESS           The TFTP/MTFTP operation was completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The TFTP/MTFTP operation was completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
-  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
-  @retval EFI_BUFFER_TOO_SMALL  The buffer is not large enough to complete the read operation.   \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer is not large enough to complete the read operation.\r
   @retval EFI_ABORTED           The callback function aborted the TFTP/MTFTP operation.\r
   @retval EFI_TIMEOUT           The TFTP/MTFTP operation timed out.\r
   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the MTFTP session.\r
   @retval EFI_TFTP_ERROR        A TFTP error packet was received during the MTFTP session.\r
   @retval EFI_ABORTED           The callback function aborted the TFTP/MTFTP operation.\r
   @retval EFI_TIMEOUT           The TFTP/MTFTP operation timed out.\r
   @retval EFI_ICMP_ERROR        An ICMP error packet was received during the MTFTP session.\r
   @retval EFI_TFTP_ERROR        A TFTP error packet was received during the MTFTP session.\r
-                                                                      \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1076,23 +1076,23 @@ EfiPxeBcMtftp (
   Mtftp4Config.TryCount          = PXEBC_MTFTP_RETRIES;\r
 \r
   CopyMem (\r
   Mtftp4Config.TryCount          = PXEBC_MTFTP_RETRIES;\r
 \r
   CopyMem (\r
-    &Mtftp4Config.StationIp, \r
-    &Private->StationIp, \r
+    &Mtftp4Config.StationIp,\r
+    &Private->StationIp,\r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
   CopyMem (\r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
   CopyMem (\r
-    &Mtftp4Config.SubnetMask, \r
-    &Private->SubnetMask, \r
+    &Mtftp4Config.SubnetMask,\r
+    &Private->SubnetMask,\r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
   CopyMem (\r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
   CopyMem (\r
-    &Mtftp4Config.GatewayIp, \r
-    &Private->GatewayIp, \r
+    &Mtftp4Config.GatewayIp,\r
+    &Private->GatewayIp,\r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
   CopyMem (\r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
   CopyMem (\r
-    &Mtftp4Config.ServerIp, \r
-    ServerIp, \r
+    &Mtftp4Config.ServerIp,\r
+    ServerIp,\r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
 \r
     sizeof (EFI_IPv4_ADDRESS)\r
     );\r
 \r
@@ -1172,7 +1172,7 @@ EfiPxeBcMtftp (
 }\r
 \r
 \r
 }\r
 \r
 \r
-/**                                                                 \r
+/**\r
   Writes a UDP packet to the network interface.\r
 \r
   This function writes a UDP packet specified by the (optional HeaderPtr and)\r
   Writes a UDP packet to the network interface.\r
 \r
   This function writes a UDP packet specified by the (optional HeaderPtr and)\r
@@ -1185,29 +1185,29 @@ EfiPxeBcMtftp (
   the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and\r
   EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return\r
   EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned.\r
   the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and\r
   EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return\r
   EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
-  @param  OpFlags               The UDP operation flags. \r
+  @param  OpFlags               The UDP operation flags.\r
   @param  DestIp                The destination IP address.\r
   @param  DestIp                The destination IP address.\r
-  @param  DestPort              The destination UDP port number.                                                                         \r
-  @param  GatewayIp             The gateway IP address.                                                 \r
+  @param  DestPort              The destination UDP port number.\r
+  @param  GatewayIp             The gateway IP address.\r
   @param  SrcIp                 The source IP address.\r
   @param  SrcPort               The source UDP port number.\r
   @param  HeaderSize            An optional field which may be set to the length of a header at\r
   @param  SrcIp                 The source IP address.\r
   @param  SrcPort               The source UDP port number.\r
   @param  HeaderSize            An optional field which may be set to the length of a header at\r
-                                HeaderPtr to be prefixed to the data at BufferPtr.             \r
+                                HeaderPtr to be prefixed to the data at BufferPtr.\r
   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
-                                data at BufferPtr.                                                    \r
+                                data at BufferPtr.\r
   @param  BufferSize            A pointer to the size of the data at BufferPtr.\r
   @param  BufferPtr             A pointer to the data to be written.\r
   @param  BufferSize            A pointer to the size of the data at BufferPtr.\r
   @param  BufferPtr             A pointer to the data to be written.\r
-                                  \r
+\r
   @retval EFI_SUCCESS           The UDP Write operation was completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The UDP Write operation was completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
-  @retval EFI_BAD_BUFFER_SIZE   The buffer is too long to be transmitted.  \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_BAD_BUFFER_SIZE   The buffer is too long to be transmitted.\r
   @retval EFI_ABORTED           The callback function aborted the UDP Write operation.\r
   @retval EFI_TIMEOUT           The UDP Write operation timed out.\r
   @retval EFI_ABORTED           The callback function aborted the UDP Write operation.\r
   @retval EFI_TIMEOUT           The UDP Write operation timed out.\r
-  @retval EFI_ICMP_ERROR        An ICMP error packet was received during the UDP write session.  \r
-                                                                      \r
+  @retval EFI_ICMP_ERROR        An ICMP error packet was received during the UDP write session.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1407,20 +1407,20 @@ CheckIpByFilter (
   }\r
 \r
   CopyMem (&DestIp4Address, &Session->DestinationAddress, sizeof (DestIp4Address));\r
   }\r
 \r
   CopyMem (&DestIp4Address, &Session->DestinationAddress, sizeof (DestIp4Address));\r
-  if ((PxeBcMode->IpFilter.Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST) &&\r
+  if (((PxeBcMode->IpFilter.Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST) != 0) &&\r
       IP4_IS_MULTICAST (EFI_NTOHL (DestIp4Address))\r
       ) {\r
     return TRUE;\r
   }\r
 \r
       IP4_IS_MULTICAST (EFI_NTOHL (DestIp4Address))\r
       ) {\r
     return TRUE;\r
   }\r
 \r
-  if ((PxeBcMode->IpFilter.Filters & EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST) &&\r
+  if (((PxeBcMode->IpFilter.Filters & EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST) != 0) &&\r
       IP4_IS_LOCAL_BROADCAST (EFI_NTOHL (DestIp4Address))\r
       ) {\r
     return TRUE;\r
   }\r
 \r
   CopyMem (&Ip4Address, &PxeBcMode->StationIp.v4, sizeof (Ip4Address));\r
       IP4_IS_LOCAL_BROADCAST (EFI_NTOHL (DestIp4Address))\r
       ) {\r
     return TRUE;\r
   }\r
 \r
   CopyMem (&Ip4Address, &PxeBcMode->StationIp.v4, sizeof (Ip4Address));\r
-  if ((PxeBcMode->IpFilter.Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) &&\r
+  if (((PxeBcMode->IpFilter.Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0) &&\r
       EFI_IP4_EQUAL (&Ip4Address, &DestIp4Address)\r
       ) {\r
     return TRUE;\r
       EFI_IP4_EQUAL (&Ip4Address, &DestIp4Address)\r
       ) {\r
     return TRUE;\r
@@ -1430,8 +1430,8 @@ CheckIpByFilter (
 \r
   for (Index = 0; Index < PxeBcMode->IpFilter.IpCnt; Index++) {\r
     CopyMem (\r
 \r
   for (Index = 0; Index < PxeBcMode->IpFilter.IpCnt; Index++) {\r
     CopyMem (\r
-      &Ip4Address, \r
-      &PxeBcMode->IpFilter.IpList[Index].v4, \r
+      &Ip4Address,\r
+      &PxeBcMode->IpFilter.IpList[Index].v4,\r
       sizeof (Ip4Address)\r
       );\r
     if (EFI_IP4_EQUAL (&Ip4Address, &DestIp4Address)) {\r
       sizeof (Ip4Address)\r
       );\r
     if (EFI_IP4_EQUAL (&Ip4Address, &DestIp4Address)) {\r
@@ -1442,7 +1442,7 @@ CheckIpByFilter (
   return FALSE;\r
 }\r
 \r
   return FALSE;\r
 }\r
 \r
-/**                                                                 \r
+/**\r
   Reads a UDP packet from the network interface.\r
 \r
   This function reads a UDP packet from a network interface. The data contents\r
   Reads a UDP packet from the network interface.\r
 \r
   This function reads a UDP packet from a network interface. The data contents\r
@@ -1453,31 +1453,31 @@ CheckIpByFilter (
   contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is\r
   successfully received, then EFI_SUCCESS will be returned, and the information\r
   from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if\r
   contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is\r
   successfully received, then EFI_SUCCESS will be returned, and the information\r
   from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if\r
-  they are not NULL. Depending on the values of OpFlags and the DestIp, DestPort, \r
-  SrcIp, and SrcPort input values, different types of UDP packet receive filtering \r
+  they are not NULL. Depending on the values of OpFlags and the DestIp, DestPort,\r
+  SrcIp, and SrcPort input values, different types of UDP packet receive filtering\r
   will be performed. The following tables summarize these receive filter operations.\r
   will be performed. The following tables summarize these receive filter operations.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
-  @param  OpFlags               The UDP operation flags. \r
+  @param  OpFlags               The UDP operation flags.\r
   @param  DestIp                The destination IP address.\r
   @param  DestPort              The destination UDP port number.\r
   @param  SrcIp                 The source IP address.\r
   @param  SrcPort               The source UDP port number.\r
   @param  HeaderSize            An optional field which may be set to the length of a header at\r
   @param  DestIp                The destination IP address.\r
   @param  DestPort              The destination UDP port number.\r
   @param  SrcIp                 The source IP address.\r
   @param  SrcPort               The source UDP port number.\r
   @param  HeaderSize            An optional field which may be set to the length of a header at\r
-                                HeaderPtr to be prefixed to the data at BufferPtr.             \r
+                                HeaderPtr to be prefixed to the data at BufferPtr.\r
   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
   @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
-                                data at BufferPtr.                                                    \r
+                                data at BufferPtr.\r
   @param  BufferSize            A pointer to the size of the data at BufferPtr.\r
   @param  BufferPtr             A pointer to the data to be read.\r
   @param  BufferSize            A pointer to the size of the data at BufferPtr.\r
   @param  BufferPtr             A pointer to the data to be read.\r
-                                  \r
+\r
   @retval EFI_SUCCESS           The UDP Read operation was completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The UDP Read operation was completed.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
   @retval EFI_BUFFER_TOO_SMALL  The packet is larger than Buffer can hold.\r
   @retval EFI_ABORTED           The callback function aborted the UDP Read operation.\r
   @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
   @retval EFI_BUFFER_TOO_SMALL  The packet is larger than Buffer can hold.\r
   @retval EFI_ABORTED           The callback function aborted the UDP Read operation.\r
-  @retval EFI_TIMEOUT           The UDP Read operation timed out.  \r
-                                                                      \r
+  @retval EFI_TIMEOUT           The UDP Read operation timed out.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1676,8 +1676,8 @@ TRY_AGAIN:
 \r
         *BufferSize = RxData->DataLength - CopyLen;\r
         CopyMem (\r
 \r
         *BufferSize = RxData->DataLength - CopyLen;\r
         CopyMem (\r
-          BufferPtr, \r
-          (UINT8 *) RxData->FragmentTable[0].FragmentBuffer + CopyLen, \r
+          BufferPtr,\r
+          (UINT8 *) RxData->FragmentTable[0].FragmentBuffer + CopyLen,\r
           *BufferSize\r
           );\r
       }\r
           *BufferSize\r
           );\r
       }\r
@@ -1705,9 +1705,9 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
   return Status;\r
 }\r
 \r
-/**                                                                 \r
+/**\r
   Updates the IP receive filters of a network device and enables software filtering.\r
   Updates the IP receive filters of a network device and enables software filtering.\r
-  \r
+\r
   The NewFilter field is used to modify the network device's current IP receive\r
   filter settings and to enable a software filter. This function updates the IpFilter\r
   field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter.\r
   The NewFilter field is used to modify the network device's current IP receive\r
   filter settings and to enable a software filter. This function updates the IpFilter\r
   field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter.\r
@@ -1728,14 +1728,14 @@ ON_EXIT:
   The IPlist field is used to enable IPs other than the StationIP. They may be\r
   multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP,\r
   then both the StationIP and the IPs from the IPlist will be used.\r
   The IPlist field is used to enable IPs other than the StationIP. They may be\r
   multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP,\r
   then both the StationIP and the IPs from the IPlist will be used.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  NewFilter             Pointer to the new set of IP receive filters.\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  NewFilter             Pointer to the new set of IP receive filters.\r
-  \r
+\r
   @retval EFI_SUCCESS           The IP receive filter settings were updated.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The IP receive filter settings were updated.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                  \r
-                                                                      \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1784,7 +1784,7 @@ EfiPxeBcSetIpFilter (
       return EFI_INVALID_PARAMETER;\r
     }\r
     if (NetIp4IsUnicast (EFI_IP4 (NewFilter->IpList[Index].v4), 0) &&\r
       return EFI_INVALID_PARAMETER;\r
     }\r
     if (NetIp4IsUnicast (EFI_IP4 (NewFilter->IpList[Index].v4), 0) &&\r
-        (NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP)\r
+        ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0)\r
        ) {\r
       //\r
       // If EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP is set and IP4 address is in IpList,\r
        ) {\r
       //\r
       // If EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP is set and IP4 address is in IpList,\r
@@ -1803,8 +1803,8 @@ EfiPxeBcSetIpFilter (
   Private->Udp4CfgData.AcceptBroadcast    = FALSE;\r
 \r
   if (PromiscuousNeed ||\r
   Private->Udp4CfgData.AcceptBroadcast    = FALSE;\r
 \r
   if (PromiscuousNeed ||\r
-      NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS ||\r
-      NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST\r
+      ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS) != 0) ||\r
+      ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST) != 0)\r
      ) {\r
     //\r
     // Configure the udp4 filter to receive all packages\r
      ) {\r
     //\r
     // Configure the udp4 filter to receive all packages\r
@@ -1821,7 +1821,7 @@ EfiPxeBcSetIpFilter (
 \r
   } else {\r
 \r
 \r
   } else {\r
 \r
-    if (NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST) {\r
+    if ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST) != 0) {\r
       //\r
       // Configure the udp4 filter to receive all broadcast packages\r
       //\r
       //\r
       // Configure the udp4 filter to receive all broadcast packages\r
       //\r
@@ -1836,7 +1836,7 @@ EfiPxeBcSetIpFilter (
       return Status;\r
     }\r
 \r
       return Status;\r
     }\r
 \r
-    if (NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) {\r
+    if ((NewFilter->Filters & EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP) != 0) {\r
 \r
       for (Index = 0; Index < NewFilter->IpCnt; ++Index) {\r
         if (IP4_IS_MULTICAST (EFI_NTOHL (NewFilter->IpList[Index].v4))) {\r
 \r
       for (Index = 0; Index < NewFilter->IpCnt; ++Index) {\r
         if (IP4_IS_MULTICAST (EFI_NTOHL (NewFilter->IpList[Index].v4))) {\r
@@ -1862,32 +1862,32 @@ EfiPxeBcSetIpFilter (
 }\r
 \r
 \r
 }\r
 \r
 \r
-/**                                                                 \r
+/**\r
   Uses the ARP protocol to resolve a MAC address.\r
   Uses the ARP protocol to resolve a MAC address.\r
-  \r
+\r
   This function uses the ARP protocol to resolve a MAC address. The UsingIpv6 field\r
   of the EFI_PXE_BASE_CODE_MODE structure is used to determine if IPv4 or IPv6\r
   addresses are being used. The IP address specified by IpAddr is used to resolve\r
   a MAC address. If the ARP protocol succeeds in resolving the specified address,\r
   then the ArpCacheEntries and ArpCache fields of the EFI_PXE_BASE_CODE_MODE structure\r
   are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved\r
   This function uses the ARP protocol to resolve a MAC address. The UsingIpv6 field\r
   of the EFI_PXE_BASE_CODE_MODE structure is used to determine if IPv4 or IPv6\r
   addresses are being used. The IP address specified by IpAddr is used to resolve\r
   a MAC address. If the ARP protocol succeeds in resolving the specified address,\r
   then the ArpCacheEntries and ArpCache fields of the EFI_PXE_BASE_CODE_MODE structure\r
   are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved\r
-  MAC address is placed there as well.  If the PXE Base Code protocol is in the \r
-  stopped state, then EFI_NOT_STARTED is returned. If the ARP protocol encounters \r
-  a timeout condition while attempting to resolve an address, then EFI_TIMEOUT is \r
-  returned. If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, \r
+  MAC address is placed there as well.  If the PXE Base Code protocol is in the\r
+  stopped state, then EFI_NOT_STARTED is returned. If the ARP protocol encounters\r
+  a timeout condition while attempting to resolve an address, then EFI_TIMEOUT is\r
+  returned. If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
   then EFI_ABORTED is returned.\r
   then EFI_ABORTED is returned.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  IpAddr                Pointer to the IP address that is used to resolve a MAC address.\r
   @param  MacAddr               If not NULL, a pointer to the MAC address that was resolved with the\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  IpAddr                Pointer to the IP address that is used to resolve a MAC address.\r
   @param  MacAddr               If not NULL, a pointer to the MAC address that was resolved with the\r
-                                ARP protocol.                                                       \r
-                                  \r
+                                ARP protocol.\r
+\r
   @retval EFI_SUCCESS           The IP or MAC address was resolved.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The IP or MAC address was resolved.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
-  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.  \r
-  @retval EFI_ICMP_ERROR        Something error occur with the ICMP packet message. \r
-                                                                       \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
+  @retval EFI_ICMP_ERROR        Something error occur with the ICMP packet message.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -1948,9 +1948,9 @@ EfiPxeBcArp (
   return EFI_SUCCESS;\r
 }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
-/**                                                                 \r
+/**\r
   Updates the parameters that affect the operation of the PXE Base Code Protocol.\r
   Updates the parameters that affect the operation of the PXE Base Code Protocol.\r
-  \r
+\r
   This function sets parameters that affect the operation of the PXE Base Code Protocol.\r
   The parameter specified by NewAutoArp is used to control the generation of ARP\r
   protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated\r
   This function sets parameters that affect the operation of the PXE Base Code Protocol.\r
   The parameter specified by NewAutoArp is used to control the generation of ARP\r
   protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated\r
@@ -1962,23 +1962,23 @@ EfiPxeBcArp (
   the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp.\r
   The SetParameters() call must be invoked after a Callback Protocol is installed\r
   to enable the use of callbacks.\r
   the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp.\r
   The SetParameters() call must be invoked after a Callback Protocol is installed\r
   to enable the use of callbacks.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  NewAutoArp            If not NULL, a pointer to a value that specifies whether to replace the\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  NewAutoArp            If not NULL, a pointer to a value that specifies whether to replace the\r
-                                current value of AutoARP.                                              \r
+                                current value of AutoARP.\r
   @param  NewSendGUID           If not NULL, a pointer to a value that specifies whether to replace the\r
   @param  NewSendGUID           If not NULL, a pointer to a value that specifies whether to replace the\r
-                                current value of SendGUID.                                             \r
+                                current value of SendGUID.\r
   @param  NewTTL                If not NULL, a pointer to be used in place of the current value of TTL,\r
   @param  NewTTL                If not NULL, a pointer to be used in place of the current value of TTL,\r
-                                the "time to live" field of the IP header.                           \r
+                                the "time to live" field of the IP header.\r
   @param  NewToS                If not NULL, a pointer to be used in place of the current value of ToS,\r
   @param  NewToS                If not NULL, a pointer to be used in place of the current value of ToS,\r
-                                the "type of service" field of the IP header.                        \r
+                                the "type of service" field of the IP header.\r
   @param  NewMakeCallback       If not NULL, a pointer to a value that specifies whether to replace the\r
   @param  NewMakeCallback       If not NULL, a pointer to a value that specifies whether to replace the\r
-                                current value of the MakeCallback field of the Mode structure.                                                                \r
-                                  \r
+                                current value of the MakeCallback field of the Mode structure.\r
+\r
   @retval EFI_SUCCESS           The new parameters values were updated.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The new parameters values were updated.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                  \r
-                                                                      \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -2073,9 +2073,9 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
   return Status;\r
 }\r
 \r
-/**                                                                 \r
+/**\r
   Updates the station IP address and/or subnet mask values of a network device.\r
   Updates the station IP address and/or subnet mask values of a network device.\r
-  \r
+\r
   This function updates the station IP address and/or subnet mask values of a network\r
   device. The NewStationIp field is used to modify the network device's current IP address.\r
   If NewStationIP is NULL, then the current IP address will not be modified. Otherwise,\r
   This function updates the station IP address and/or subnet mask values of a network\r
   device. The NewStationIp field is used to modify the network device's current IP address.\r
   If NewStationIP is NULL, then the current IP address will not be modified. Otherwise,\r
@@ -2084,15 +2084,15 @@ ON_EXIT:
   mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified.\r
   Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE\r
   structure with NewSubnetMask.\r
   mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified.\r
   Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE\r
   structure with NewSubnetMask.\r
-    \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
-  @param  NewStationIp          Pointer to the new IP address to be used by the network device.  \r
-  @param  NewSubnetMask         Pointer to the new subnet mask to be used by the network device.                                 \r
-                                  \r
+  @param  NewStationIp          Pointer to the new IP address to be used by the network device.\r
+  @param  NewSubnetMask         Pointer to the new subnet mask to be used by the network device.\r
+\r
   @retval EFI_SUCCESS           The new station IP address and/or subnet mask were updated.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_SUCCESS           The new station IP address and/or subnet mask were updated.\r
   @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
-  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                  \r
-                                                                      \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -2163,36 +2163,36 @@ EfiPxeBcSetStationIP (
   return EFI_SUCCESS;\r
 }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
-/**                                                                 \r
+/**\r
   Updates the contents of the cached DHCP and Discover packets.\r
   Updates the contents of the cached DHCP and Discover packets.\r
-  \r
+\r
   The pointers to the new packets are used to update the contents of the cached\r
   packets in the EFI_PXE_BASE_CODE_MODE structure.\r
   The pointers to the new packets are used to update the contents of the cached\r
   packets in the EFI_PXE_BASE_CODE_MODE structure.\r
-    \r
+\r
   @param  This                   Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  NewDhcpDiscoverValid   Pointer to a value that will replace the current\r
   @param  This                   Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
   @param  NewDhcpDiscoverValid   Pointer to a value that will replace the current\r
-                                 DhcpDiscoverValid field.                        \r
+                                 DhcpDiscoverValid field.\r
   @param  NewDhcpAckReceived     Pointer to a value that will replace the current\r
   @param  NewDhcpAckReceived     Pointer to a value that will replace the current\r
-                                 DhcpAckReceived field.                          \r
+                                 DhcpAckReceived field.\r
   @param  NewProxyOfferReceived  Pointer to a value that will replace the current\r
   @param  NewProxyOfferReceived  Pointer to a value that will replace the current\r
-                                 ProxyOfferReceived field.                       \r
-  @param  NewPxeDiscoverValid    Pointer to a value that will replace the current     \r
-                                 ProxyOfferReceived field.                       \r
+                                 ProxyOfferReceived field.\r
+  @param  NewPxeDiscoverValid    Pointer to a value that will replace the current\r
+                                 ProxyOfferReceived field.\r
   @param  NewPxeReplyReceived    Pointer to a value that will replace the current\r
   @param  NewPxeReplyReceived    Pointer to a value that will replace the current\r
-                                 PxeReplyReceived field.                         \r
+                                 PxeReplyReceived field.\r
   @param  NewPxeBisReplyReceived Pointer to a value that will replace the current\r
   @param  NewPxeBisReplyReceived Pointer to a value that will replace the current\r
-                                 PxeBisReplyReceived field.                      \r
-  @param  NewDhcpDiscover        Pointer to the new cached DHCP Discover packet contents.   \r
+                                 PxeBisReplyReceived field.\r
+  @param  NewDhcpDiscover        Pointer to the new cached DHCP Discover packet contents.\r
   @param  NewDhcpAck             Pointer to the new cached DHCP Ack packet contents.\r
   @param  NewProxyOffer          Pointer to the new cached Proxy Offer packet contents.\r
   @param  NewPxeDiscover         Pointer to the new cached PXE Discover packet contents.\r
   @param  NewPxeReply            Pointer to the new cached PXE Reply packet contents.\r
   @param  NewPxeBisReply         Pointer to the new cached PXE BIS Reply packet contents.\r
   @param  NewDhcpAck             Pointer to the new cached DHCP Ack packet contents.\r
   @param  NewProxyOffer          Pointer to the new cached Proxy Offer packet contents.\r
   @param  NewPxeDiscover         Pointer to the new cached PXE Discover packet contents.\r
   @param  NewPxeReply            Pointer to the new cached PXE Reply packet contents.\r
   @param  NewPxeBisReply         Pointer to the new cached PXE BIS Reply packet contents.\r
-                                   \r
+\r
   @retval EFI_SUCCESS            The cached packet contents were updated.\r
   @retval EFI_NOT_STARTED        The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_INVALID_PARAMETER  This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r
   @retval EFI_SUCCESS            The cached packet contents were updated.\r
   @retval EFI_NOT_STARTED        The PXE Base Code Protocol is in the stopped state.\r
   @retval EFI_INVALID_PARAMETER  This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r
-                                                                      \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -2296,10 +2296,10 @@ EFI_PXE_BASE_CODE_PROTOCOL  mPxeBcProtocolTemplate = {
   NULL\r
 };\r
 \r
   NULL\r
 };\r
 \r
-/**                                                                 \r
+/**\r
   Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has\r
   Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has\r
-  received, or is waiting to receive a packet.                                                 \r
-  \r
+  received, or is waiting to receive a packet.\r
+\r
   This function is invoked when the PXE Base Code Protocol is about to transmit, has received,\r
   or is waiting to receive a packet. Parameters Function and Received specify the type of event.\r
   Parameters PacketLen and Packet specify the packet that generated the event. If these fields\r
   This function is invoked when the PXE Base Code Protocol is about to transmit, has received,\r
   or is waiting to receive a packet. Parameters Function and Received specify the type of event.\r
   Parameters PacketLen and Packet specify the packet that generated the event. If these fields\r
@@ -2309,19 +2309,19 @@ EFI_PXE_BASE_CODE_PROTOCOL  mPxeBcProtocolTemplate = {
   the polling nature of UEFI device drivers, a callback function should not execute for more than 5 ms.\r
   The SetParameters() function must be called after a Callback Protocol is installed to enable the\r
   use of callbacks.\r
   the polling nature of UEFI device drivers, a callback function should not execute for more than 5 ms.\r
   The SetParameters() function must be called after a Callback Protocol is installed to enable the\r
   use of callbacks.\r
-  \r
+\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.\r
   @param  This                  Pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.\r
-  @param  Function              The PXE Base Code Protocol function that is waiting for an event.                                                              \r
+  @param  Function              The PXE Base Code Protocol function that is waiting for an event.\r
   @param  Received              TRUE if the callback is being invoked due to a receive event. FALSE if\r
   @param  Received              TRUE if the callback is being invoked due to a receive event. FALSE if\r
-                                the callback is being invoked due to a transmit event.                \r
+                                the callback is being invoked due to a transmit event.\r
   @param  PacketLength          The length, in bytes, of Packet. This field will have a value of zero if\r
   @param  PacketLength          The length, in bytes, of Packet. This field will have a value of zero if\r
-                                this is a wait for receive event.                                       \r
+                                this is a wait for receive event.\r
   @param  PacketPtr             If Received is TRUE, a pointer to the packet that was just received;\r
   @param  PacketPtr             If Received is TRUE, a pointer to the packet that was just received;\r
-                                otherwise a pointer to the packet that is about to be transmitted.  \r
-                                  \r
-  @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation    \r
+                                otherwise a pointer to the packet that is about to be transmitted.\r
+\r
+  @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation\r
   @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT    if Function specifies an abort operation\r
   @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT    if Function specifies an abort operation\r
-                                   \r
+\r
 **/\r
 EFI_PXE_BASE_CODE_CALLBACK_STATUS\r
 EFIAPI\r
 **/\r
 EFI_PXE_BASE_CODE_CALLBACK_STATUS\r
 EFIAPI\r
@@ -2398,15 +2398,15 @@ EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL mPxeBcCallBackTemplate = {
 /**\r
   Find the boot file.\r
 \r
 /**\r
   Find the boot file.\r
 \r
-  @param  Private      Pointer to PxeBc private data.                                                \r
-  @param  BufferSize   Pointer to buffer size.                                                  \r
-  @param  Buffer       Pointer to buffer.                               \r
+  @param  Private      Pointer to PxeBc private data.\r
+  @param  BufferSize   Pointer to buffer size.\r
+  @param  Buffer       Pointer to buffer.\r
 \r
   @retval EFI_SUCCESS          Discover the boot file successfully.\r
   @retval EFI_TIMEOUT          The TFTP/MTFTP operation timed out.\r
   @retval EFI_ABORTED          PXE bootstrap server, so local boot need abort.\r
   @retval EFI_BUFFER_TOO_SMALL The buffer is too small to load the boot file.\r
 \r
   @retval EFI_SUCCESS          Discover the boot file successfully.\r
   @retval EFI_TIMEOUT          The TFTP/MTFTP operation timed out.\r
   @retval EFI_ABORTED          PXE bootstrap server, so local boot need abort.\r
   @retval EFI_BUFFER_TOO_SMALL The buffer is too small to load the boot file.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 DiscoverBootFile (\r
 **/\r
 EFI_STATUS\r
 DiscoverBootFile (\r
@@ -2492,8 +2492,8 @@ DiscoverBootFile (
       );\r
   } else {\r
     CopyMem (\r
       );\r
   } else {\r
     CopyMem (\r
-      &Private->ServerIp, \r
-      &Packet->Packet.Offer.Dhcp4.Header.ServerAddr, \r
+      &Private->ServerIp,\r
+      &Packet->Packet.Offer.Dhcp4.Header.ServerAddr,\r
       sizeof (EFI_IPv4_ADDRESS)\r
       );\r
   }\r
       sizeof (EFI_IPv4_ADDRESS)\r
       );\r
   }\r
@@ -2544,21 +2544,21 @@ DiscoverBootFile (
 \r
   @param  This                  Protocol instance pointer.\r
   @param  FilePath              The device specific path of the file to load.\r
 \r
   @param  This                  Protocol instance pointer.\r
   @param  FilePath              The device specific path of the file to load.\r
-  @param  BootPolicy            If TRUE, indicates that the request originates from the \r
+  @param  BootPolicy            If TRUE, indicates that the request originates from the\r
                                 boot manager is attempting to load FilePath as a boot\r
                                 selection. If FALSE, then FilePath must match as exact file\r
                                 to be loaded.\r
   @param  BufferSize            On input the size of Buffer in bytes. On output with a return\r
                                 boot manager is attempting to load FilePath as a boot\r
                                 selection. If FALSE, then FilePath must match as exact file\r
                                 to be loaded.\r
   @param  BufferSize            On input the size of Buffer in bytes. On output with a return\r
-                                code of EFI_SUCCESS, the amount of data transferred to \r
+                                code of EFI_SUCCESS, the amount of data transferred to\r
                                 Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,\r
                                 the size of Buffer required to retrieve the requested file.\r
   @param  Buffer                The memory buffer to transfer the file to. IF Buffer is NULL,\r
                                 Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,\r
                                 the size of Buffer required to retrieve the requested file.\r
   @param  Buffer                The memory buffer to transfer the file to. IF Buffer is NULL,\r
-                                then no the size of the requested file is returned in \r
+                                then no the size of the requested file is returned in\r
                                 BufferSize.\r
 \r
   @retval EFI_SUCCESS                 The file was loaded.\r
   @retval EFI_UNSUPPORTED             The device does not support the provided BootPolicy\r
                                 BufferSize.\r
 \r
   @retval EFI_SUCCESS                 The file was loaded.\r
   @retval EFI_UNSUPPORTED             The device does not support the provided BootPolicy\r
-  @retval EFI_INVALID_PARAMETER       FilePath is not a valid device path, or \r
+  @retval EFI_INVALID_PARAMETER       FilePath is not a valid device path, or\r
                                       BufferSize is NULL.\r
   @retval EFI_NO_MEDIA                No medium was present to load the file.\r
   @retval EFI_DEVICE_ERROR            The file was not loaded due to a device error.\r
                                       BufferSize is NULL.\r
   @retval EFI_NO_MEDIA                No medium was present to load the file.\r
   @retval EFI_DEVICE_ERROR            The file was not loaded due to a device error.\r
@@ -2707,7 +2707,7 @@ EfiPxeLoadFile (
     if (Buffer != NULL) {\r
       AsciiPrint ("PXE-E05: Download buffer is smaller than requested file.\n");\r
     } else {\r
     if (Buffer != NULL) {\r
       AsciiPrint ("PXE-E05: Download buffer is smaller than requested file.\n");\r
     } else {\r
-      PxeBc->Stop (PxeBc); \r
+      PxeBc->Stop (PxeBc);\r
       return Status;\r
     }\r
 \r
       return Status;\r
     }\r
 \r
index 0a67fdeda26a2d8133e96906b2bcc400d348aab9..d425b1ff8f3aa6007ec20f3021ff75627a952423 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support routines for PxeBc.\r
 /** @file\r
   Support routines for PxeBc.\r
-  \r
-Copyright (c) 2007 - 2009, Intel Corporation.<BR>                                                         \r
+\r
+Copyright (c) 2007 - 2010, Intel Corporation.<BR>\r
 All rights reserved. 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
 All rights reserved. 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
@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   This function returns SMBIOS string given the string number.\r
 \r
 /**\r
   This function returns SMBIOS string given the string number.\r
-  \r
+\r
   @param  Smbios              Pointer to SMBIOS structure\r
   @param  StringNumber        String number to return. 0 is used to skip all\r
                               strings and  point to the next SMBIOS structure.\r
   @param  Smbios              Pointer to SMBIOS structure\r
   @param  StringNumber        String number to return. 0 is used to skip all\r
                               strings and  point to the next SMBIOS structure.\r
@@ -97,6 +97,7 @@ GetSmbiosSystemGuidAndSerialNumber (
   if (EFI_ERROR (Status)) {\r
     return EFI_NOT_FOUND;\r
   }\r
   if (EFI_ERROR (Status)) {\r
     return EFI_NOT_FOUND;\r
   }\r
+  ASSERT (SmbiosTable != NULL);\r
 \r
   Smbios.Hdr    = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress;\r
   SmbiosEnd.Raw = (UINT8 *) (UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength);\r
 \r
   Smbios.Hdr    = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress;\r
   SmbiosEnd.Raw = (UINT8 *) (UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength);\r
@@ -137,7 +138,7 @@ GetSmbiosSystemGuidAndSerialNumber (
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  The common notify function associated with various PxeBc events. \r
+  The common notify function associated with various PxeBc events.\r
 \r
   @param  Event     The event signaled.\r
   @param  Context   The context.\r
 \r
   @param  Event     The event signaled.\r
   @param  Context   The context.\r
@@ -156,13 +157,13 @@ PxeBcCommonNotify (
 \r
 /**\r
   This function initialize(or configure) the Udp4Write instance.\r
 \r
 /**\r
   This function initialize(or configure) the Udp4Write instance.\r
-  \r
+\r
   @param  Udp4       Pointer to the EFI_UDP4_PROTOCOL instance.\r
   @param  StationIp  Pointer to the station ip address.\r
   @param  SubnetMask Pointer to the subnetmask of the station ip address.\r
   @param  Gateway    Pointer to the gateway ip address.\r
   @param  SrcPort    Pointer to the srouce port of the station.\r
   @param  Udp4       Pointer to the EFI_UDP4_PROTOCOL instance.\r
   @param  StationIp  Pointer to the station ip address.\r
   @param  SubnetMask Pointer to the subnetmask of the station ip address.\r
   @param  Gateway    Pointer to the gateway ip address.\r
   @param  SrcPort    Pointer to the srouce port of the station.\r
-  \r
+\r
   @retval EFI_SUCCESS           The configuration settings were set, changed, or reset successfully.\r
   @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
                                 RARP, etc.) is not finished yet.\r
   @retval EFI_SUCCESS           The configuration settings were set, changed, or reset successfully.\r
   @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
                                 RARP, etc.) is not finished yet.\r
@@ -177,7 +178,7 @@ PxeBcCommonNotify (
   @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred and this instance\r
                                 was not opened.\r
   @retval Others                Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.\r
   @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred and this instance\r
                                 was not opened.\r
   @retval Others                Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 PxeBcConfigureUdpWriteInstance (\r
 **/\r
 EFI_STATUS\r
 PxeBcConfigureUdpWriteInstance (\r
index 8d72f585d040a0f9056face6c2022f19dcc737ea..54d317416d6468447653ed5fefdce470c83f73af 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   HII Config Access protocol implementation of VLAN configuration module.\r
 \r
 /** @file\r
   HII Config Access protocol implementation of VLAN configuration module.\r
 \r
-Copyright (c) 2009, Intel Corporation.<BR>\r
+Copyright (c) 2009 - 2010, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
 of the BSD License which accompanies this distribution.  The full\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
 of the BSD License which accompanies this distribution.  The full\r
@@ -238,6 +238,7 @@ VlanCallback (
     //\r
     // Remove VLAN\r
     //\r
     //\r
     // Remove VLAN\r
     //\r
+    ASSERT (PrivateData->NumberOfVlan <= MAX_VLAN_NUMBER);\r
     for (Index = 0; Index < PrivateData->NumberOfVlan; Index++) {\r
       if (Configuration->VlanList[Index] != 0) {\r
         //\r
     for (Index = 0; Index < PrivateData->NumberOfVlan; Index++) {\r
       if (Configuration->VlanList[Index] != 0) {\r
         //\r
@@ -421,7 +422,7 @@ InstallVlanConfigForm (
   EFI_STATUS                      Status;\r
   EFI_HII_HANDLE                  HiiHandle;\r
   EFI_HANDLE                      DriverHandle;\r
   EFI_STATUS                      Status;\r
   EFI_HII_HANDLE                  HiiHandle;\r
   EFI_HANDLE                      DriverHandle;\r
-  CHAR16                          Str[40];\r
+  CHAR16                          Str[26 + sizeof (EFI_MAC_ADDRESS) * 2 + 1];\r
   CHAR16                          *MacString;\r
   EFI_DEVICE_PATH_PROTOCOL        *ChildDevicePath;\r
   EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;\r
   CHAR16                          *MacString;\r
   EFI_DEVICE_PATH_PROTOCOL        *ChildDevicePath;\r
   EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;\r
@@ -479,6 +480,7 @@ InstallVlanConfigForm (
   PrivateData->MacString = MacString;\r
 \r
   StrCpy (Str, L"VLAN Configuration (MAC:");\r
   PrivateData->MacString = MacString;\r
 \r
   StrCpy (Str, L"VLAN Configuration (MAC:");\r
+  ASSERT (StrLen (MacString) <= (sizeof (EFI_MAC_ADDRESS) * 2));\r
   StrCat (Str, MacString);\r
   StrCat (Str, L")");\r
   HiiSetString (\r
   StrCat (Str, MacString);\r
   StrCat (Str, L")");\r
   HiiSetString (\r