]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/SnpDxe/Station_address.c
BaseTools:Change the path of the file that Binary Cache
[mirror_edk2.git] / MdeModulePkg / Universal / Network / SnpDxe / Station_address.c
index 5a98e0f256e26a92c27e6f211ce14101358d54c3..a5c87d4799c457b29fac35676666642e5551ed6c 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
     Implementation of reading the MAC address of a network adapter.\r
\r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
-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 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -16,11 +10,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 \r
 /**\r
-  Call UNDI to read the MAC address of the NIC and update the mode structure \r
-  with the address. \r
+  Call UNDI to read the MAC address of the NIC and update the mode structure\r
+  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
@@ -39,7 +33,7 @@ PxeGetStnAddr (
   Snp->Cdb.CPBaddr    = PXE_CPBADDR_NOT_USED;\r
   Snp->Cdb.CPBsize    = PXE_CPBSIZE_NOT_USED;\r
 \r
-  Snp->Cdb.DBsize     = sizeof (PXE_DB_STATION_ADDRESS);\r
+  Snp->Cdb.DBsize     = (UINT16) sizeof (PXE_DB_STATION_ADDRESS);\r
   Snp->Cdb.DBaddr     = (UINT64)(UINTN) Db;\r
 \r
   Snp->Cdb.StatCode   = PXE_STATCODE_INITIALIZE;\r
@@ -117,18 +111,17 @@ PxeSetStnAddr (
     Snp->Cdb.CPBsize  = PXE_CPBSIZE_NOT_USED;\r
     Snp->Cdb.CPBaddr  = PXE_CPBADDR_NOT_USED;\r
   } else {\r
-    Snp->Cdb.OpFlags = PXE_OPFLAGS_STATION_ADDRESS_READ;\r
+    Snp->Cdb.OpFlags = PXE_OPFLAGS_STATION_ADDRESS_WRITE;\r
     //\r
-    // even though the OPFLAGS are set to READ, supplying a new address\r
-    // in the CPB will make undi change the mac address to the new one.\r
+    // Supplying a new address in the CPB will make undi change the mac address to the new one.\r
     //\r
     CopyMem (&Cpb->StationAddr, NewMacAddr, Snp->Mode.HwAddressSize);\r
 \r
-    Snp->Cdb.CPBsize  = sizeof (PXE_CPB_STATION_ADDRESS);\r
+    Snp->Cdb.CPBsize  = (UINT16) sizeof (PXE_CPB_STATION_ADDRESS);\r
     Snp->Cdb.CPBaddr  = (UINT64)(UINTN) Cpb;\r
   }\r
 \r
-  Snp->Cdb.DBsize     = sizeof (PXE_DB_STATION_ADDRESS);\r
+  Snp->Cdb.DBsize     = (UINT16) sizeof (PXE_DB_STATION_ADDRESS);\r
   Snp->Cdb.DBaddr     = (UINT64)(UINTN) Db;\r
 \r
   Snp->Cdb.StatCode   = PXE_STATCODE_INITIALIZE;\r
@@ -167,33 +160,33 @@ PxeSetStnAddr (
 \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