X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FSnpDxe%2FStation_address.c;h=a5c87d4799c457b29fac35676666642e5551ed6c;hb=c0fd7f734e2d33e22215899b40a47b843129541d;hp=42792c26e148e70e1b1e3afdcc406d14961aba60;hpb=f381602727922e793de5826ee390344cb907e07a;p=mirror_edk2.git
diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c b/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c
index 42792c26e1..a5c87d4799 100644
--- a/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c
+++ b/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c
@@ -1,14 +1,8 @@
/** @file
Implementation of reading the MAC address of a network adapter.
-
-Copyright (c) 2004 - 2007, Intel Corporation.
-All rights reserved. This program and the accompanying materials are licensed
-and made available under the terms and conditions of the BSD License which
-accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -16,11 +10,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
- Call UNDI to read the MAC address of the NIC and update the mode structure
- with the address.
+ Call UNDI to read the MAC address of the NIC and update the mode structure
+ with the address.
@param Snp Pointer to snp driver structure.
-
+
@retval EFI_SUCCESS The MAC address of the NIC is read successfully.
@retval EFI_DEVICE_ERROR Failed to read the MAC address of the NIC.
@@ -39,7 +33,7 @@ PxeGetStnAddr (
Snp->Cdb.CPBaddr = PXE_CPBADDR_NOT_USED;
Snp->Cdb.CPBsize = PXE_CPBSIZE_NOT_USED;
- Snp->Cdb.DBsize = sizeof (PXE_DB_STATION_ADDRESS);
+ Snp->Cdb.DBsize = (UINT16) sizeof (PXE_DB_STATION_ADDRESS);
Snp->Cdb.DBaddr = (UINT64)(UINTN) Db;
Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
@@ -50,7 +44,7 @@ PxeGetStnAddr (
//
// Issue UNDI command and check result.
//
- DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.station_addr() "));
+ DEBUG ((EFI_D_NET, "\nsnp->undi.station_addr() "));
(*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@@ -117,18 +111,17 @@ PxeSetStnAddr (
Snp->Cdb.CPBsize = PXE_CPBSIZE_NOT_USED;
Snp->Cdb.CPBaddr = PXE_CPBADDR_NOT_USED;
} else {
- Snp->Cdb.OpFlags = PXE_OPFLAGS_STATION_ADDRESS_READ;
+ Snp->Cdb.OpFlags = PXE_OPFLAGS_STATION_ADDRESS_WRITE;
//
- // even though the OPFLAGS are set to READ, supplying a new address
- // in the CPB will make undi change the mac address to the new one.
+ // Supplying a new address in the CPB will make undi change the mac address to the new one.
//
CopyMem (&Cpb->StationAddr, NewMacAddr, Snp->Mode.HwAddressSize);
- Snp->Cdb.CPBsize = sizeof (PXE_CPB_STATION_ADDRESS);
+ Snp->Cdb.CPBsize = (UINT16) sizeof (PXE_CPB_STATION_ADDRESS);
Snp->Cdb.CPBaddr = (UINT64)(UINTN) Cpb;
}
- Snp->Cdb.DBsize = sizeof (PXE_DB_STATION_ADDRESS);
+ Snp->Cdb.DBsize = (UINT16) sizeof (PXE_DB_STATION_ADDRESS);
Snp->Cdb.DBaddr = (UINT64)(UINTN) Db;
Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
@@ -139,7 +132,7 @@ PxeSetStnAddr (
//
// Issue UNDI command and check result.
//
- DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.station_addr() "));
+ DEBUG ((EFI_D_NET, "\nsnp->undi.station_addr() "));
(*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@@ -167,34 +160,34 @@ PxeSetStnAddr (
/**
Modifies or resets the current station address, if supported.
-
- This function modifies or resets the current station address of a network
+
+ This function modifies or resets the current station address of a network
interface, if supported. If Reset is TRUE, then the current station address is
- set to the network interfaceâs permanent address. If Reset is FALSE, and the
- network interface allows its station address to be modified, then the current
- station address is changed to the address specified by New. If the network
- interface does not allow its station address to be modified, then
+ set to the network interface's permanent address. If Reset is FALSE, and the
+ network interface allows its station address to be modified, then the current
+ station address is changed to the address specified by New. If the network
+ interface does not allow its station address to be modified, then
EFI_INVALID_PARAMETER will be returned. If the station address is successfully
updated on the network interface, EFI_SUCCESS will be returned. If the driver
has not been initialized, EFI_DEVICE_ERROR will be returned.
@param This A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.
- @param Reset Flag used to reset the station address to the network interfaceâs
+ @param Reset Flag used to reset the station address to the network interface's
permanent address.
@param New New station address to be used for the network interface.
- @retval EFI_SUCCESS The network interfaceâs station address was updated.
- @retval EFI_NOT_STARTED The Simple Network Protocol interface has not been
+ @retval EFI_SUCCESS The network interface's station address was updated.
+ @retval EFI_NOT_STARTED The Simple Network Protocol interface has not been
started by calling Start().
@retval EFI_INVALID_PARAMETER The New station address was not accepted by the NIC.
@retval EFI_INVALID_PARAMETER Reset is FALSE and New is NULL.
- @retval EFI_DEVICE_ERROR The Simple Network Protocol interface has not
+ @retval EFI_DEVICE_ERROR The Simple Network Protocol interface has not
been initialized by calling Initialize().
- @retval EFI_DEVICE_ERROR An error occurred attempting to set the new
+ @retval EFI_DEVICE_ERROR An error occurred attempting to set the new
station address.
- @retval EFI_UNSUPPORTED The NIC does not support changing the network
- interfaceâs station address.
+ @retval EFI_UNSUPPORTED The NIC does not support changing the network
+ interface's station address.
**/
EFI_STATUS