]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/Snp.h
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / Snp.h
index 389cbee91d15ed1cc6bad66611fa5a68756546aa..e6b62930397d6aec9e2fb617c09f3d4d840ceb4c 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
     Declaration of strctures and functions for SnpDxe driver.\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
-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
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 #ifndef _SNP_H_\r
@@ -31,8 +25,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include <Library/PrintLib.h>\r
 \r
-#include <IndustryStandard/Pci22.h>\r
+#include <IndustryStandard/Pci.h>\r
+#include <IndustryStandard/Acpi.h>\r
 \r
 #define FOUR_GIGABYTES  (UINT64) 0x100000000ULL\r
 \r
@@ -47,12 +43,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define PCI_BAR_MEM_MODE      0x00000000\r
 #define PCI_BAR_MEM_64BIT     0x00000004\r
 \r
+#define SNP_TX_BUFFER_INCREASEMENT    MAX_XMIT_BUFFERS\r
+#define SNP_MAX_TX_BUFFER_NUM         65536\r
+\r
 typedef\r
 EFI_STATUS\r
-(*ISSUE_UNDI32_COMMAND) (\r
+(EFIAPI *ISSUE_UNDI32_COMMAND) (\r
   UINT64         Cdb\r
   );\r
-  \r
+\r
 typedef struct {\r
   UINT32                      Signature;\r
   EFI_LOCK                    Lock;\r
@@ -122,6 +121,33 @@ typedef struct {
   } MapList[MAX_MAP_LENGTH];\r
 \r
   EFI_EVENT              ExitBootServicesEvent;\r
+\r
+  //\r
+  // Whether UNDI support reporting media status from GET_STATUS command,\r
+  // i.e. PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED or\r
+  //      PXE_STATFLAGS_GET_STATUS_NO_MEDIA_NOT_SUPPORTED\r
+  //\r
+  BOOLEAN                MediaStatusSupported;\r
+\r
+  //\r
+  // Whether UNDI support cable detect for INITIALIZE command,\r
+  // i.e. PXE_STATFLAGS_CABLE_DETECT_SUPPORTED or\r
+  //      PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED\r
+  //\r
+  BOOLEAN                CableDetectSupported;\r
+\r
+  //\r
+  // Array of the recycled transmit buffer address from UNDI.\r
+  //\r
+  UINT64                 *RecycledTxBuf;\r
+  //\r
+  // The maximum number of recycled buffer pointers in RecycledTxBuf.\r
+  //\r
+  UINT32                 MaxRecycledTxBuf;\r
+  //\r
+  // Current number of recycled buffer pointers in RecycledTxBuf.\r
+  //\r
+  UINT32                 RecycledTxBufCount;\r
 } SNP_DRIVER;\r
 \r
 #define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) CR (a, SNP_DRIVER, Snp, SNP_DRIVER_SIGNATURE)\r
@@ -129,63 +155,10 @@ typedef struct {
 //\r
 // Global Variables\r
 //\r
+extern EFI_DRIVER_BINDING_PROTOCOL    gSimpleNetworkDriverBinding;\r
 extern EFI_COMPONENT_NAME_PROTOCOL    gSimpleNetworkComponentName;\r
 extern EFI_COMPONENT_NAME2_PROTOCOL   gSimpleNetworkComponentName2;\r
 \r
-//\r
-//  Virtual to physical mapping for all UNDI 3.0s.\r
-//\r
-typedef struct _V2P {\r
-  struct _V2P           *Next;\r
-  VOID                  *VirtualAddress;\r
-  UINTN                 BufferSize;\r
-  EFI_PHYSICAL_ADDRESS  PhysicalAddress;\r
-  VOID                  *Unmap;\r
-} V2P;\r
-\r
-/**\r
-  This routine maps the given CPU address to a Device address. It creates a\r
-  an entry in the map list with the virtual and physical addresses and the\r
-  un map cookie.\r
-\r
-  @param  V2p                  pointer to return a map list node pointer.\r
-  @param  Type                 the direction in which the data flows from the given\r
-                               virtual address device->cpu or cpu->device or both\r
-                               ways.\r
-  @param  VirtualAddress       virtual address (or CPU address) to be mapped.\r
-  @param  BufferSize           size of the buffer to be mapped.\r
-\r
-  @retval EFI_SUCEESS          routine has completed the mapping.\r
-  @retval other                error as indicated.\r
-\r
-**/\r
-EFI_STATUS\r
-AddV2p (\r
-  V2P                           **V2p,\r
-  EFI_PCI_IO_PROTOCOL_OPERATION Type,\r
-  VOID                          *VirtualAddress,\r
-  UINTN                         BufferSize\r
-  );\r
-\r
-/**\r
-  This routine searches the linked list of mapped address nodes (for undi3.0\r
-  interface) to find the node that corresponds to the given virtual address and\r
-  returns a pointer to that node.\r
-\r
-  @param  V2p                  pointer to return a map list node pointer.\r
-  @param  VirtualAddress                virtual address (or CPU address) to be searched in\r
-                               the map list\r
-\r
-  @retval EFI_SUCEESS          if a match found!\r
-  @retval Other                match not found\r
-\r
-**/\r
-EFI_STATUS\r
-FindV2p (\r
-  V2P          **V2p,\r
-  VOID         *VirtualAddress\r
-  );\r
-\r
 /**\r
   this routine calls undi to start the interface and changes the snp state.\r
 \r
@@ -193,7 +166,7 @@ FindV2p (
 \r
   @retval EFI_DEVICE_ERROR       UNDI could not be started\r
   @retval EFI_SUCCESS            UNDI is started successfully\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 PxeStart (\r
@@ -221,10 +194,10 @@ PxeStop (
 \r
   @param  Snp                   pointer to snp driver structure\r
   @param  CableDetectFlag       Do/don't detect the cable (depending on what undi supports)\r
-  \r
+\r
   @retval EFI_SUCCESS           UNDI is initialized successfully\r
   @retval EFI_DEVICE_ERROR      UNDI could not be initialized\r
-  @retval Other                 other errors \r
+  @retval Other                 other errors\r
 \r
 **/\r
 EFI_STATUS\r
@@ -232,7 +205,7 @@ PxeInit (
   SNP_DRIVER *Snp,\r
   UINT16     CableDetectFlag\r
   );\r
-  \r
+\r
 /**\r
   this routine calls undi to shut down the interface.\r
 \r
@@ -252,7 +225,7 @@ PxeShutdown (
   mode structure with the address.\r
 \r
   @param  Snp         pointer to snp driver structure.\r
-   \r
+\r
   @retval EFI_SUCCESS       the MAC address of the NIC is read successfully.\r
   @retval EFI_DEVICE_ERROR  failed to read the MAC address of the NIC.\r
 \r
@@ -263,93 +236,27 @@ PxeGetStnAddr (
   );\r
 \r
 /**\r
-  This routine unmaps the given virtual address and frees the memory allocated\r
-  for the map list node corresponding to that address.\r
+  Call undi to get the status of the interrupts, get the list of recycled transmit\r
+  buffers that completed transmitting. The recycled transmit buffer address will\r
+  be saved into Snp->RecycledTxBuf. This function will also update the MediaPresent\r
+  field of EFI_SIMPLE_NETWORK_MODE if UNDI support it.\r
 \r
-  @param  VirtualAddress       virtual address (or CPU address) to be unmapped\r
+  @param[in]   Snp                     Pointer to snp driver structure.\r
+  @param[out]  InterruptStatusPtr      A non null pointer to contain the interrupt\r
+                                       status.\r
+  @param[in]   GetTransmittedBuf       Set to TRUE to retrieve the recycled transmit\r
+                                       buffer address.\r
 \r
-  @retval EFI_SUCEESS          if successfully unmapped\r
-  @retval Other                as indicated by the error\r
+  @retval      EFI_SUCCESS             The status of the network interface was retrieved.\r
+  @retval      EFI_DEVICE_ERROR        The command could not be sent to the network\r
+                                       interface.\r
 \r
 **/\r
 EFI_STATUS\r
-DelV2p (\r
-  VOID *VirtualAddress\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  UNDI call this routine when it wants to have exclusive access to a critical\r
-  section of the code/data.\r
-\r
-  @param Enable   non-zero indicates acquire\r
-                  zero indicates release\r
-\r
-**/\r
-VOID\r
-SnpUndi32CallbackBlock30 (\r
-  IN UINT32 Enable\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  UNDI call this routine with the number of micro seconds when it wants to\r
-  pause.\r
-\r
-  @param MicroSeconds  number of micro seconds to pause, ususlly multiple of 10.\r
-\r
-**/\r
-VOID\r
-SnpUndi32CallbackDelay30 (\r
-  IN UINT64 MicroSeconds\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  This is the IO routine for UNDI. This is not currently being used by UNDI3.0\r
-  because Undi3.0 uses io/mem offsets relative to the beginning of the device\r
-  io/mem address and so it needs to use the PCI_IO_FUNCTION that abstracts the\r
-  start of the device's io/mem addresses. Since SNP cannot retrive the context\r
-  of the undi3.0 interface it cannot use the PCI_IO_FUNCTION that specific for\r
-  that NIC and uses one global IO functions structure, this does not work.\r
-  This however works fine for EFI1.0 Undis because they use absolute addresses\r
-  for io/mem access.\r
-\r
-  @param ReadOrWrite  indicates read or write, IO or Memory\r
-  @param NumBytes     number of bytes to read or write\r
-  @param Address      IO or memory address to read from or write to\r
-  @param BufferAddr   memory location to read into or that contains the bytes to \r
-                      write\r
-\r
-**/\r
-VOID\r
-SnpUndi32CallbackMemio30 (\r
-  IN UINT8      ReadOrWrite,\r
-  IN UINT8      NumBytes,\r
-  IN UINT64     Address,\r
-  IN OUT UINT64 BufferAddr\r
-  );\r
-\r
-/**\r
-  This is a callback routine supplied to UNDI at undi_start time.\r
-  UNDI call this routine with a virtual or CPU address that SNP provided to \r
-  convert it to a physical or device address. Since EFI uses the identical \r
-  mapping, this routine returns the physical address same as the virtual address\r
-  for most of the addresses. an address above 4GB cannot generally be used as a \r
-  device address, it needs to be mapped to a lower physical address. This \r
-  routine does not call the map routine itself, but it assumes that the mapping\r
-  was done at the time of providing the address to UNDI. This routine just \r
-  looks up the address in a map table (which is the v2p structure chain). \r
-  \r
-  @param  CpuAddr        virtual address of a buffer.\r
-  @param  DeviceAddrPtr  pointer to the physical address.\r
-                         The DeviceAddrPtr will contain 0 in case of any error.\r
-\r
-**/\r
-VOID\r
-SnpUndi32CallbackV2p30 (\r
-  IN UINT64     CpuAddr,\r
-  IN OUT UINT64 DeviceAddrPtr\r
+PxeGetStatus (\r
+  IN     SNP_DRIVER *Snp,\r
+     OUT UINT32     *InterruptStatusPtr,\r
+  IN     BOOLEAN    GetTransmittedBuf\r
   );\r
 \r
 /**\r
@@ -360,13 +267,14 @@ SnpUndi32CallbackV2p30 (
   there won't be a virtual2physical callback for UNDI 3.1 because undi3.1 uses\r
   the MemMap call to map the required address by itself!\r
 \r
-  @param UniqueId  This was supplied to UNDI at Undi_Start, SNP uses this to \r
-                                                                store Undi interface context (Undi does not read or write\r
-                                                                this variable)\r
+  @param UniqueId  This was supplied to UNDI at Undi_Start, SNP uses this to\r
+                   store Undi interface context (Undi does not read or write\r
+                   this variable)\r
   @param Enable    non-zero indicates acquire\r
                    zero indicates release\r
 **/\r
 VOID\r
+EFIAPI\r
 SnpUndi32CallbackBlock (\r
   IN UINT64 UniqueId,\r
   IN UINT32 Enable\r
@@ -378,11 +286,12 @@ SnpUndi32CallbackBlock (
   pause.\r
 \r
   @param UniqueId      This was supplied to UNDI at Undi_Start, SNP uses this to\r
-                                                                    store Undi interface context (Undi does not read or write\r
-                                                                    this variable)\r
+                       store Undi interface context (Undi does not read or write\r
+                       this variable)\r
   @param MicroSeconds  number of micro seconds to pause, ususlly multiple of 10.\r
 **/\r
 VOID\r
+EFIAPI\r
 SnpUndi32CallbackDelay (\r
   IN UINT64 UniqueId,\r
   IN UINT64 MicroSeconds\r
@@ -392,9 +301,9 @@ SnpUndi32CallbackDelay (
   This is a callback routine supplied to UNDI at undi_start time.\r
   This is the IO routine for UNDI3.1 to start CPB.\r
 \r
-  @param UniqueId       This was supplied to UNDI at Undi_Start, SNP uses this \r
-                                                                                       to store Undi interface context (Undi does not read or\r
-                                                                                       write this variable)\r
+  @param UniqueId       This was supplied to UNDI at Undi_Start, SNP uses this\r
+                        to store Undi interface context (Undi does not read or\r
+                        write this variable)\r
   @param ReadOrWrite    indicates read or write, IO or Memory.\r
   @param NumBytes       number of bytes to read or write.\r
   @param MemOrPortAddr  IO or memory address to read from or write to.\r
@@ -402,6 +311,7 @@ SnpUndi32CallbackDelay (
                         to write.\r
 **/\r
 VOID\r
+EFIAPI\r
 SnpUndi32CallbackMemio (\r
   IN UINT64     UniqueId,\r
   IN UINT8      ReadOrWrite,\r
@@ -425,6 +335,7 @@ SnpUndi32CallbackMemio (
 \r
 **/\r
 VOID\r
+EFIAPI\r
 SnpUndi32CallbackMap (\r
   IN UINT64     UniqueId,\r
   IN UINT64     CpuAddr,\r
@@ -448,6 +359,7 @@ SnpUndi32CallbackMap (
 \r
 **/\r
 VOID\r
+EFIAPI\r
 SnpUndi32CallbackUnmap (\r
   IN UINT64             UniqueId,\r
   IN UINT64             CpuAddr,\r
@@ -478,6 +390,7 @@ SnpUndi32CallbackUnmap (
 \r
 **/\r
 VOID\r
+EFIAPI\r
 SnpUndi32CallbackSync (\r
   IN UINT64             UniqueId,\r
   IN UINT64             CpuAddr,\r
@@ -488,7 +401,7 @@ SnpUndi32CallbackSync (
 \r
 /**\r
   Changes the state of a network interface from "stopped" to "started".\r
-  \r
+\r
   This function starts a network interface. If the network interface successfully\r
   starts, then EFI_SUCCESS will be returned.\r
 \r
@@ -496,7 +409,7 @@ SnpUndi32CallbackSync (
 \r
   @retval EFI_SUCCESS            The network interface was started.\r
   @retval EFI_ALREADY_STARTED    The network interface is already in the started state.\r
-  @retval EFI_INVALID_PARAMETER  This parameter was NULL or did not point to a valid \r
+  @retval EFI_INVALID_PARAMETER  This parameter was NULL or did not point to a valid\r
                                  EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
   @retval EFI_DEVICE_ERROR       The command could not be sent to the network interface.\r
   @retval EFI_UNSUPPORTED        This function is not supported by the network interface.\r
@@ -510,17 +423,17 @@ SnpUndi32Start (
 \r
 /**\r
   Changes the state of a network interface from "started" to "stopped".\r
-  \r
+\r
   This function stops a network interface. This call is only valid if the network\r
   interface is in the started state. If the network interface was successfully\r
   stopped, then EFI_SUCCESS will be returned.\r
-  \r
+\r
   @param  This                    A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
-  \r
-  \r
+\r
+\r
   @retval EFI_SUCCESS             The network interface was stopped.\r
   @retval EFI_NOT_STARTED         The network interface has not been started.\r
-  @retval EFI_INVALID_PARAMETER   This parameter was NULL or did not point to a valid \r
+  @retval EFI_INVALID_PARAMETER   This parameter was NULL or did not point to a valid\r
                                   EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
   @retval EFI_DEVICE_ERROR        The command could not be sent to the network interface.\r
   @retval EFI_UNSUPPORTED         This function is not supported by the network interface.\r
@@ -533,8 +446,8 @@ SnpUndi32Stop (
   );\r
 \r
 /**\r
-  Resets a network adapter and allocates the transmit and receive buffers \r
-  required by the network interface; optionally, also requests allocation of \r
+  Resets a network adapter and allocates the transmit and receive buffers\r
+  required by the network interface; optionally, also requests allocation of\r
   additional transmit and receive buffers.\r
 \r
   This function allocates the transmit and receive buffers required by the network\r
@@ -546,8 +459,8 @@ SnpUndi32Stop (
 \r
   @param ExtraRxBufferSize  The size, in bytes, of the extra receive buffer space\r
                             that the driver should allocate for the network interface.\r
-                            Some network interfaces will not be able to use the \r
-                            extra buffer, and the caller will not know if it is \r
+                            Some network interfaces will not be able to use the\r
+                            extra buffer, and the caller will not know if it is\r
                             actually being used.\r
   @param ExtraTxBufferSize  The size, in bytes, of the extra transmit buffer space\r
                             that the driver should allocate for the network interface.\r
@@ -565,7 +478,7 @@ SnpUndi32Stop (
   @retval EFI_UNSUPPORTED       The increased buffer size feature is not supported.\r
 \r
 **/\r
-EFI_STATUS \r
+EFI_STATUS\r
 EFIAPI\r
 SnpUndi32Initialize (\r
   IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
@@ -578,16 +491,16 @@ SnpUndi32Initialize (
   provided in the previous call to Initialize().\r
 \r
   This function resets a network adapter and reinitializes it with the parameters\r
-  that were provided in the previous call to Initialize(). The transmit and \r
+  that were provided in the previous call to Initialize(). The transmit and\r
   receive queues are emptied and all pending interrupts are cleared.\r
-  Receive filters, the station address, the statistics, and the multicast-IP-to-HW \r
-  MAC addresses are not reset by this call. If the network interface was \r
-  successfully reset, then EFI_SUCCESS will be returned. If the driver has not \r
+  Receive filters, the station address, the statistics, and the multicast-IP-to-HW\r
+  MAC addresses are not reset by this call. If the network interface was\r
+  successfully reset, then EFI_SUCCESS will be returned. If the driver has not\r
   been initialized, EFI_DEVICE_ERROR will be returned.\r
 \r
   @param This                 A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
-  @param ExtendedVerification Indicates that the driver may perform a more \r
-                              exhaustive verification operation of the device \r
+  @param ExtendedVerification Indicates that the driver may perform a more\r
+                              exhaustive verification operation of the device\r
                               during reset.\r
 \r
   @retval EFI_SUCCESS           The network interface was reset.\r
@@ -605,12 +518,12 @@ SnpUndi32Reset (
   );\r
 \r
 /**\r
-  Resets a network adapter and leaves it in a state that is safe for another \r
-  driver to initialize. \r
-  \r
+  Resets a network adapter and leaves it in a state that is safe for another\r
+  driver to initialize.\r
+\r
   This function releases the memory buffers assigned in the Initialize() call.\r
   Pending transmits and receives are lost, and interrupts are cleared and disabled.\r
-  After this call, only the Initialize() and Stop() calls may be used. If the \r
+  After this call, only the Initialize() and Stop() calls may be used. If the\r
   network interface was successfully shutdown, then EFI_SUCCESS will be returned.\r
   If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.\r
 \r
@@ -618,7 +531,7 @@ SnpUndi32Reset (
 \r
   @retval EFI_SUCCESS           The network interface was shutdown.\r
   @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_INVALID_PARAMETER This parameter was NULL or did not point to a valid \r
+  @retval EFI_INVALID_PARAMETER This parameter was NULL or did not point to a valid\r
                                 EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
   @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
 \r
@@ -631,70 +544,70 @@ SnpUndi32Shutdown (
 \r
 /**\r
   Manages the multicast receive filters of a network interface.\r
-  \r
-  This function is used enable and disable the hardware and software receive \r
+\r
+  This function is used enable and disable the hardware and software receive\r
   filters for the underlying network device.\r
-  The receive filter change is broken down into three steps: \r
-  * The filter mask bits that are set (ON) in the Enable parameter are added to \r
-    the current receive filter settings. \r
+  The receive filter change is broken down into three steps:\r
+  * The filter mask bits that are set (ON) in the Enable parameter are added to\r
+    the current receive filter settings.\r
   * The filter mask bits that are set (ON) in the Disable parameter are subtracted\r
     from the updated receive filter settings.\r
   * If the resulting receive filter setting is not supported by the hardware a\r
     more liberal setting is selected.\r
-  If the same bits are set in the Enable and Disable parameters, then the bits \r
+  If the same bits are set in the Enable and Disable parameters, then the bits\r
   in the Disable parameter takes precedence.\r
-  If the ResetMCastFilter parameter is TRUE, then the multicast address list \r
-  filter is disabled (irregardless of what other multicast bits are set in the \r
-  Enable and Disable parameters). The SNP->Mode->MCastFilterCount field is set \r
+  If the ResetMCastFilter parameter is TRUE, then the multicast address list\r
+  filter is disabled (irregardless of what other multicast bits are set in the\r
+  Enable and Disable parameters). The SNP->Mode->MCastFilterCount field is set\r
   to zero. The Snp->Mode->MCastFilter contents are undefined.\r
-  After enabling or disabling receive filter settings, software should verify \r
-  the new settings by checking the Snp->Mode->ReceiveFilterSettings, \r
+  After enabling or disabling receive filter settings, software should verify\r
+  the new settings by checking the Snp->Mode->ReceiveFilterSettings,\r
   Snp->Mode->MCastFilterCount and Snp->Mode->MCastFilter fields.\r
-  Note: Some network drivers and/or devices will automatically promote receive \r
+  Note: Some network drivers and/or devices will automatically promote receive\r
     filter settings if the requested setting can not be honored. For example, if\r
-    a request for four multicast addresses is made and the underlying hardware \r
-    only supports two multicast addresses the driver might set the promiscuous \r
+    a request for four multicast addresses is made and the underlying hardware\r
+    only supports two multicast addresses the driver might set the promiscuous\r
     or promiscuous multicast receive filters instead. The receiving software is\r
-    responsible for discarding any extra packets that get through the hardware \r
+    responsible for discarding any extra packets that get through the hardware\r
     receive filters.\r
-    Note: Note: To disable all receive filter hardware, the network driver must \r
+    Note: Note: To disable all receive filter hardware, the network driver must\r
       be Shutdown() and Stopped(). Calling ReceiveFilters() with Disable set to\r
-      Snp->Mode->ReceiveFilterSettings will make it so no more packets are \r
-      returned by the Receive() function, but the receive hardware may still be \r
+      Snp->Mode->ReceiveFilterSettings will make it so no more packets are\r
+      returned by the Receive() function, but the receive hardware may still be\r
       moving packets into system memory before inspecting and discarding them.\r
-      Unexpected system errors, reboots and hangs can occur if an OS is loaded \r
+      Unexpected system errors, reboots and hangs can occur if an OS is loaded\r
       and the network devices are not Shutdown() and Stopped().\r
-  If ResetMCastFilter is TRUE, then the multicast receive filter list on the \r
+  If ResetMCastFilter is TRUE, then the multicast receive filter list on the\r
   network interface will be reset to the default multicast receive filter list.\r
-  If ResetMCastFilter is FALSE, and this network interface allows the multicast \r
-  receive filter list to be modified, then the MCastFilterCnt and MCastFilter \r
-  are used to update the current multicast receive filter list. The modified \r
-  receive filter list settings can be found in the MCastFilter field of \r
+  If ResetMCastFilter is FALSE, and this network interface allows the multicast\r
+  receive filter list to be modified, then the MCastFilterCnt and MCastFilter\r
+  are used to update the current multicast receive filter list. The modified\r
+  receive filter list settings can be found in the MCastFilter field of\r
   EFI_SIMPLE_NETWORK_MODE. If the network interface does not allow the multicast\r
   receive filter list to be modified, then EFI_INVALID_PARAMETER will be returned.\r
   If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.\r
-  If the receive filter mask and multicast receive filter list have been \r
+  If the receive filter mask and multicast receive filter list have been\r
   successfully updated on the network interface, EFI_SUCCESS will be returned.\r
 \r
   @param This             A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
   @param Enable           A bit mask of receive filters to enable on the network\r
                           interface.\r
   @param Disable          A bit mask of receive filters to disable on the network\r
-                          interface. For backward compatibility with EFI 1.1 \r
+                          interface. For backward compatibility with EFI 1.1\r
                           platforms, the EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit\r
                           must be set when the ResetMCastFilter parameter is TRUE.\r
-  @param ResetMCastFilter Set to TRUE to reset the contents of the multicast \r
-                          receive filters on the network interface to their \r
-                          default values. \r
+  @param ResetMCastFilter Set to TRUE to reset the contents of the multicast\r
+                          receive filters on the network interface to their\r
+                          default values.\r
   @param MCastFilterCnt   Number of multicast HW MAC addresses in the new MCastFilter\r
-                          list. This value must be less than or equal to the \r
-                          MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. \r
+                          list. This value must be less than or equal to the\r
+                          MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE.\r
                           This field is optional if ResetMCastFilter is TRUE.\r
   @param MCastFilter      A pointer to a list of new multicast receive filter HW\r
-                          MAC addresses. This list will replace any existing \r
-                          multicast HW MAC address list. This field is optional \r
+                          MAC addresses. This list will replace any existing\r
+                          multicast HW MAC address list. This field is optional\r
                           if ResetMCastFilter is TRUE.\r
-   \r
+\r
   @retval EFI_SUCCESS            The multicast receive filter list was updated.\r
   @retval EFI_NOT_STARTED        The network interface has not been started.\r
   @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
@@ -703,9 +616,9 @@ SnpUndi32Shutdown (
                                    in Snp->Mode->ReceiveFilterMask\r
                                  * There are bits set in Disable that are not set\r
                                    in Snp->Mode->ReceiveFilterMask\r
-                                 * Multicast is being enabled (the \r
-                                   EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit is \r
-                                   set in Enable, it is not set in Disable, and \r
+                                 * Multicast is being enabled (the\r
+                                   EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit is\r
+                                   set in Enable, it is not set in Disable, and\r
                                    ResetMCastFilter is FALSE) and MCastFilterCount\r
                                    is zero\r
                                  * Multicast is being enabled and MCastFilterCount\r
@@ -717,7 +630,7 @@ SnpUndi32Shutdown (
   @retval EFI_DEVICE_ERROR       One or more of the following conditions is TRUE:\r
                                  * The network interface has been started but has\r
                                    not been initialized\r
-                                 * An unexpected error was returned by the \r
+                                 * An unexpected error was returned by the\r
                                    underlying network driver or device\r
   @retval EFI_UNSUPPORTED        This function is not supported by the network\r
                                  interface.\r
@@ -736,33 +649,33 @@ SnpUndi32ReceiveFilters (
 \r
 /**\r
   Modifies or resets the current station address, if supported.\r
-  \r
-  This function modifies or resets the current station address of a network \r
+\r
+  This function modifies or resets the current station address of a network\r
   interface, if supported. If Reset is TRUE, then the current station address is\r
-  set to the network interface's permanent address. If Reset is FALSE, and the \r
-  network interface allows its station address to be modified, then the current \r
-  station address is changed to the address specified by New. If the network \r
-  interface does not allow its station address to be modified, then \r
+  set to the network interface's permanent address. If Reset is FALSE, and the\r
+  network interface allows its station address to be modified, then the current\r
+  station address is changed to the address specified by New. If the network\r
+  interface does not allow its station address to be modified, then\r
   EFI_INVALID_PARAMETER will be returned. If the station address is successfully\r
   updated on the network interface, EFI_SUCCESS will be returned. If the driver\r
   has not been initialized, EFI_DEVICE_ERROR will be returned.\r
 \r
   @param This  A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
-  @param Reset Flag used to reset the station address to the network interface's \r
+  @param Reset Flag used to reset the station address to the network interface's\r
                permanent address.\r
   @param New   New station address to be used for the network interface.\r
 \r
 \r
   @retval EFI_SUCCESS           The network interface's station address was updated.\r
-  @retval EFI_NOT_STARTED       The Simple Network Protocol interface has not been \r
+  @retval EFI_NOT_STARTED       The Simple Network Protocol interface has not been\r
                                 started by calling Start().\r
   @retval EFI_INVALID_PARAMETER The New station address was not accepted by the NIC.\r
   @retval EFI_INVALID_PARAMETER Reset is FALSE and New is 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
-  @retval EFI_DEVICE_ERROR      An error occurred attempting to set the new \r
+  @retval EFI_DEVICE_ERROR      An error occurred attempting to set the new\r
                                 station address.\r
-  @retval EFI_UNSUPPORTED       The NIC does not support changing the network \r
+  @retval EFI_UNSUPPORTED       The NIC does not support changing the network\r
                                 interface's station address.\r
 \r
 **/\r
@@ -776,15 +689,15 @@ SnpUndi32StationAddress (
 \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
-  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
-  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
@@ -794,30 +707,30 @@ SnpUndi32StationAddress (
 \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
-  @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_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
-  @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
-                                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
-  @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
-  @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
-  @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
-  @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
@@ -832,29 +745,29 @@ SnpUndi32Statistics (
 \r
 /**\r
   Converts a multicast IP address to a multicast HW MAC address.\r
-  \r
-  This function converts a multicast IP address to a multicast HW MAC address \r
+\r
+  This function converts a multicast IP address to a multicast HW MAC address\r
   for all packet transactions. If the mapping is accepted, then EFI_SUCCESS will\r
   be returned.\r
 \r
   @param This A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
   @param IPv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460].\r
-              Set to FALSE if the multicast IP address is IPv4 [RFC 791]. \r
-  @param IP   The multicast IP address that is to be converted to a multicast \r
+              Set to FALSE if the multicast IP address is IPv4 [RFC 791].\r
+  @param IP   The multicast IP address that is to be converted to a multicast\r
               HW MAC address.\r
   @param MAC  The multicast HW MAC address that is to be generated from IP.\r
-  \r
+\r
   @retval EFI_SUCCESS           The multicast IP address was mapped to the\r
                                 multicast HW MAC address.\r
   @retval EFI_NOT_STARTED       The Simple Network Protocol interface has not\r
                                 been started by calling Start().\r
   @retval EFI_INVALID_PARAMETER IP is NULL.\r
   @retval EFI_INVALID_PARAMETER MAC is NULL.\r
-  @retval EFI_INVALID_PARAMETER IP does not point to a valid IPv4 or IPv6 \r
+  @retval EFI_INVALID_PARAMETER IP does not point to a valid IPv4 or IPv6\r
                                 multicast address.\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
-  @retval EFI_UNSUPPORTED       IPv6 is TRUE and the implementation does not \r
+  @retval EFI_UNSUPPORTED       IPv6 is TRUE and the implementation does not\r
                                 support IPv6 multicast to MAC address conversion.\r
 \r
 **/\r
@@ -868,51 +781,51 @@ SnpUndi32McastIpToMac (
   );\r
 \r
 /**\r
-  Performs read and write operations on the NVRAM device attached to a network \r
+  Performs read and write operations on the NVRAM device attached to a network\r
   interface.\r
-  \r
-  This function performs read and write operations on the NVRAM device attached \r
+\r
+  This function performs read and write operations on the NVRAM device attached\r
   to a network interface. If ReadWrite is TRUE, a read operation is performed.\r
-  If ReadWrite is FALSE, a write operation is performed. Offset specifies the \r
-  byte offset at which to start either operation. Offset must be a multiple of \r
-  NvRamAccessSize , and it must have a value between zero and NvRamSize. \r
+  If ReadWrite is FALSE, a write operation is performed. Offset specifies the\r
+  byte offset at which to start either operation. Offset must be a multiple of\r
+  NvRamAccessSize , and it must have a value between zero and NvRamSize.\r
   BufferSize specifies the length of the read or write operation. BufferSize must\r
   also be a multiple of NvRamAccessSize, and Offset + BufferSize must not exceed\r
-  NvRamSize. \r
-  If any of the above conditions is not met, then EFI_INVALID_PARAMETER will be \r
-  returned. \r
-  If all the conditions are met and the operation is "read," the NVRAM device \r
-  attached to the network interface will be read into Buffer and EFI_SUCCESS \r
+  NvRamSize.\r
+  If any of the above conditions is not met, then EFI_INVALID_PARAMETER will be\r
+  returned.\r
+  If all the conditions are met and the operation is "read," the NVRAM device\r
+  attached to the network interface will be read into Buffer and EFI_SUCCESS\r
   will be returned. If this is a write operation, the contents of Buffer will be\r
-  used to update the contents of the NVRAM device attached to the network \r
+  used to update the contents of the NVRAM device attached to the network\r
   interface and EFI_SUCCESS will be returned.\r
-  \r
+\r
   It does the basic checking on the input parameters and retrieves snp structure\r
   and then calls the read_nvdata() call which does the actual reading\r
 \r
   @param This       A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
   @param ReadWrite  TRUE for read operations, FALSE for write operations.\r
-  @param Offset     Byte offset in the NVRAM device at which to start the read or \r
-                    write operation. This must be a multiple of NvRamAccessSize \r
-                    and less than NvRamSize. (See EFI_SIMPLE_NETWORK_MODE)  \r
-  @param BufferSize The number of bytes to read or write from the NVRAM device. \r
+  @param Offset     Byte offset in the NVRAM device at which to start the read or\r
+                    write operation. This must be a multiple of NvRamAccessSize\r
+                    and less than NvRamSize. (See EFI_SIMPLE_NETWORK_MODE)\r
+  @param BufferSize The number of bytes to read or write from the NVRAM device.\r
                     This must also be a multiple of NvramAccessSize.\r
   @param Buffer     A pointer to the data buffer.\r
 \r
   @retval EFI_SUCCESS           The NVRAM access was performed.\r
   @retval EFI_NOT_STARTED       The network interface has not been started.\r
   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
-                                * The This parameter is NULL \r
-                                * The This parameter does not point to a valid \r
+                                * The This parameter is NULL\r
+                                * The This parameter does not point to a valid\r
                                   EFI_SIMPLE_NETWORK_PROTOCOL  structure\r
-                                * The Offset parameter is not a multiple of \r
+                                * The Offset parameter is not a multiple of\r
                                   EFI_SIMPLE_NETWORK_MODE.NvRamAccessSize\r
-                                * The Offset parameter is not less than \r
+                                * The Offset parameter is not less than\r
                                   EFI_SIMPLE_NETWORK_MODE.NvRamSize\r
-                                * The BufferSize parameter is not a multiple of \r
+                                * The BufferSize parameter is not a multiple of\r
                                   EFI_SIMPLE_NETWORK_MODE.NvRamAccessSize\r
                                 * The Buffer parameter is NULL\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network \r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network\r
                                 interface.\r
   @retval EFI_UNSUPPORTED       This function is not supported by the network\r
                                 interface.\r
@@ -931,38 +844,38 @@ SnpUndi32NvData (
 /**\r
   Reads the current interrupt status and recycled transmit buffer status from a\r
   network interface.\r
-  \r
-  This function gets the current interrupt and recycled transmit buffer status \r
+\r
+  This function gets the current interrupt and recycled transmit buffer status\r
   from the network interface. The interrupt status is returned as a bit mask in\r
   InterruptStatus. If InterruptStatus is NULL, the interrupt status will not be\r
   read. If TxBuf is not NULL, a recycled transmit buffer address will be retrieved.\r
   If a recycled transmit buffer address is returned in TxBuf, then the buffer has\r
   been successfully transmitted, and the status for that buffer is cleared. If\r
-  the status of the network interface is successfully collected, EFI_SUCCESS \r
+  the status of the network interface is successfully collected, EFI_SUCCESS\r
   will be returned. If the driver has not been initialized, EFI_DEVICE_ERROR will\r
   be returned.\r
 \r
   @param This            A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
-  @param InterruptStatus A pointer to the bit mask of the currently active \r
+  @param InterruptStatus A pointer to the bit mask of the currently active\r
                          interrupts (see "Related Definitions"). If this is NULL,\r
                          the interrupt status will not be read from the device.\r
                          If this is not NULL, the interrupt status will be read\r
-                         from the device. When the interrupt status is read, it \r
-                         will also be cleared. Clearing the transmit interrupt does \r
+                         from the device. When the interrupt status is read, it\r
+                         will also be cleared. Clearing the transmit interrupt does\r
                          not empty the recycled transmit buffer array.\r
   @param TxBuf           Recycled transmit buffer address. The network interface\r
-                         will not transmit if its internal recycled transmit \r
+                         will not transmit if its internal recycled transmit\r
                          buffer array is full. Reading the transmit buffer does\r
                          not clear the transmit interrupt. If this is NULL, then\r
-                         the transmit buffer status will not be read. If there \r
-                         are no transmit buffers to recycle and TxBuf is not NULL, \r
+                         the transmit buffer status will not be read. If there\r
+                         are no transmit buffers to recycle and TxBuf is not NULL,\r
                          TxBuf will be set to NULL.\r
 \r
   @retval EFI_SUCCESS           The status of the network interface was retrieved.\r
   @retval EFI_NOT_STARTED       The network interface has not been started.\r
-  @retval EFI_INVALID_PARAMETER This parameter was NULL or did not point to a valid \r
+  @retval EFI_INVALID_PARAMETER This parameter was NULL or did not point to a valid\r
                                 EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
-  @retval EFI_DEVICE_ERROR      The command could not be sent to the network \r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network\r
                                 interface.\r
 \r
 **/\r
@@ -976,45 +889,45 @@ SnpUndi32GetStatus (
 \r
 /**\r
   Places a packet in the transmit queue of a network interface.\r
-  \r
+\r
   This function places the packet specified by Header and Buffer on the transmit\r
-  queue. If HeaderSize is nonzero and HeaderSize is not equal to \r
-  This->Mode->MediaHeaderSize, then EFI_INVALID_PARAMETER will be returned. If \r
+  queue. If HeaderSize is nonzero and HeaderSize is not equal to\r
+  This->Mode->MediaHeaderSize, then EFI_INVALID_PARAMETER will be returned. If\r
   BufferSize is less than This->Mode->MediaHeaderSize, then EFI_BUFFER_TOO_SMALL\r
-  will be returned. If Buffer is NULL, then EFI_INVALID_PARAMETER will be \r
+  will be returned. If Buffer is NULL, then EFI_INVALID_PARAMETER will be\r
   returned. If HeaderSize is nonzero and DestAddr or Protocol is NULL, then\r
   EFI_INVALID_PARAMETER will be returned. If the transmit engine of the network\r
-  interface is busy, then EFI_NOT_READY will be returned. If this packet can be \r
-  accepted by the transmit engine of the network interface, the packet contents \r
-  specified by Buffer will be placed on the transmit queue of the network \r
-  interface, and EFI_SUCCESS will be returned. GetStatus() can be used to \r
-  determine when the packet has actually been transmitted. The contents of the \r
-  Buffer must not be modified until the packet has actually been transmitted. \r
+  interface is busy, then EFI_NOT_READY will be returned. If this packet can be\r
+  accepted by the transmit engine of the network interface, the packet contents\r
+  specified by Buffer will be placed on the transmit queue of the network\r
+  interface, and EFI_SUCCESS will be returned. GetStatus() can be used to\r
+  determine when the packet has actually been transmitted. The contents of the\r
+  Buffer must not be modified until the packet has actually been transmitted.\r
   The Transmit() function performs nonblocking I/O. A caller who wants to perform\r
-  blocking I/O, should call Transmit(), and then GetStatus() until the \r
+  blocking I/O, should call Transmit(), and then GetStatus() until the\r
   transmitted buffer shows up in the recycled transmit buffer.\r
   If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.\r
 \r
   @param This       A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
-  @param HeaderSize The size, in bytes, of the media header to be filled in by the \r
+  @param HeaderSize The size, in bytes, of the media header to be filled in by the\r
                     Transmit() function. If HeaderSize is nonzero, then it must\r
                     be equal to This->Mode->MediaHeaderSize and the DestAddr and\r
                     Protocol parameters must not be NULL.\r
   @param BufferSize The size, in bytes, of the entire packet (media header and\r
                     data) to be transmitted through the network interface.\r
-  @param Buffer     A pointer to the packet (media header followed by data) to be \r
-                    transmitted. This parameter cannot be NULL. If HeaderSize is \r
+  @param Buffer     A pointer to the packet (media header followed by data) to be\r
+                    transmitted. This parameter cannot be NULL. If HeaderSize is\r
                     zero, then the media header in Buffer must already be filled\r
-                    in by the caller. If HeaderSize is nonzero, then the media \r
+                    in by the caller. If HeaderSize is nonzero, then the media\r
                     header will be filled in by the Transmit() function.\r
-  @param SrcAddr    The source HW MAC address. If HeaderSize is zero, then this \r
-                    parameter is ignored. If HeaderSize is nonzero and SrcAddr \r
-                    is NULL, then This->Mode->CurrentAddress is used for the \r
+  @param SrcAddr    The source HW MAC address. If HeaderSize is zero, then this\r
+                    parameter is ignored. If HeaderSize is nonzero and SrcAddr\r
+                    is NULL, then This->Mode->CurrentAddress is used for the\r
                     source HW MAC address.\r
-  @param DestAddr   The destination HW MAC address. If HeaderSize is zero, then \r
+  @param DestAddr   The destination HW MAC address. If HeaderSize is zero, then\r
                     this parameter is ignored.\r
-  @param Protocol   The type of header to build. If HeaderSize is zero, then this \r
-                    parameter is ignored. See RFC 1700, section "Ether Types," \r
+  @param Protocol   The type of header to build. If HeaderSize is zero, then this\r
+                    parameter is ignored. See RFC 1700, section "Ether Types,"\r
                     for examples.\r
 \r
   @retval EFI_SUCCESS           The packet was placed on the transmit queue.\r
@@ -1028,7 +941,7 @@ SnpUndi32GetStatus (
   @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
 \r
 **/\r
-EFI_STATUS \r
+EFI_STATUS\r
 EFIAPI\r
 SnpUndi32Transmit (\r
   IN EFI_SIMPLE_NETWORK_PROTOCOL *This,\r
@@ -1044,44 +957,44 @@ SnpUndi32Transmit (
   Receives a packet from a network interface.\r
 \r
   This function retrieves one packet from the receive queue of a network interface.\r
-  If there are no packets on the receive queue, then EFI_NOT_READY will be \r
+  If there are no packets on the receive queue, then EFI_NOT_READY will be\r
   returned. If there is a packet on the receive queue, and the size of the packet\r
   is smaller than BufferSize, then the contents of the packet will be placed in\r
   Buffer, and BufferSize will be updated with the actual size of the packet.\r
   In addition, if SrcAddr, DestAddr, and Protocol are not NULL, then these values\r
-  will be extracted from the media header and returned. EFI_SUCCESS will be \r
+  will be extracted from the media header and returned. EFI_SUCCESS will be\r
   returned if a packet was successfully received.\r
   If BufferSize is smaller than the received packet, then the size of the receive\r
   packet will be placed in BufferSize and EFI_BUFFER_TOO_SMALL will be returned.\r
   If the driver has not been initialized, EFI_DEVICE_ERROR will be returned.\r
 \r
   @param This       A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.\r
-  @param HeaderSize The size, in bytes, of the media header received on the network \r
-                    interface. If this parameter is NULL, then the media header size \r
+  @param HeaderSize The size, in bytes, of the media header received on the network\r
+                    interface. If this parameter is NULL, then the media header size\r
                     will not be returned.\r
-  @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in \r
+  @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in\r
                     bytes, of the packet that was received on the network interface.\r
   @param Buffer     A pointer to the data buffer to receive both the media\r
                     header and the data.\r
   @param SrcAddr    The source HW MAC address. If this parameter is NULL, the HW\r
-                    MAC source address will not be extracted from the media header. \r
-  @param DestAddr   The destination HW MAC address. If this parameter is NULL, \r
-                    the HW MAC destination address will not be extracted from \r
+                    MAC source address will not be extracted from the media header.\r
+  @param DestAddr   The destination HW MAC address. If this parameter is NULL,\r
+                    the HW MAC destination address will not be extracted from\r
                     the media header.\r
-  @param Protocol   The media header type. If this parameter is NULL, then the \r
-                    protocol will not be extracted from the media header. See \r
+  @param Protocol   The media header type. If this parameter is NULL, then the\r
+                    protocol will not be extracted from the media header. See\r
                     RFC 1700 section "Ether Types" for examples.\r
 \r
-  @retval EFI_SUCCESS           The received data was stored in Buffer, and \r
-                                BufferSize has been updated to the number of \r
+  @retval EFI_SUCCESS           The received data was stored in Buffer, and\r
+                                BufferSize has been updated to the number of\r
                                 bytes received.\r
   @retval EFI_NOT_STARTED       The network interface has not been started.\r
   @retval EFI_NOT_READY         No packets have been received on the network interface.\r
-  @retval EFI_BUFFER_TOO_SMALL  BufferSize is too small for the received packets. \r
+  @retval EFI_BUFFER_TOO_SMALL  BufferSize is too small for the received packets.\r
                                 BufferSize has been updated to the required size.\r
   @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
                                 * The This parameter is NULL\r
-                                * The This parameter does not point to a valid \r
+                                * The This parameter does not point to a valid\r
                                   EFI_SIMPLE_NETWORK_PROTOCOL structure.\r
                                 * The BufferSize parameter is NULL\r
                                 * The Buffer parameter is NULL\r