From: niry Date: Mon, 29 Dec 2008 01:16:13 +0000 (+0000) Subject: 1). Fix the debug level for DEBUG macro X-Git-Tag: edk2-stable201903~19104 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=f381602727922e793de5826ee390344cb907e07a 1). Fix the debug level for DEBUG macro 2). Uniform the function description comments git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7143 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Callback.c b/MdeModulePkg/Universal/Network/SnpDxe/Callback.c index c4789ba11d..fc018265c7 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Callback.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Callback.c @@ -30,20 +30,22 @@ EFI_LOCK mLock; // extern EFI_PCI_IO_PROTOCOL *mPciIo; -/** - This is a callback routine supplied to UNDI at undi_start time. - UNDI call this routine with a virtual or CPU address that SNP provided to - convert it to a physical or device address. Since EFI uses the identical - mapping, this routine returns the physical address same as the virtual address - for most of the addresses. an address above 4GB cannot generally be used as a - device address, it needs to be mapped to a lower physical address. This - routine does not call the map routine itself, but it assumes that the mapping - was done at the time of providing the address to UNDI. This routine just - looks up the address in a map table (which is the v2p structure chain). +/** + Convert a virtual or CPU address provided by SNP to a physical or device + address. + + This is a callback routine supplied to UNDI at undi_start time. Since EFI uses + the identical mapping, this routine returns the physical address same as the + virtual address for most of the addresses. an address above 4GB cannot + generally be used as a device address, it needs to be mapped to a lower + physical address. This routine does not call the map routine itself, but it + assumes that the mapping was done at the time of providing the address to + UNDI. This routine just looks up the address in a map table (which is the v2p + structure chain). - @param CpuAddr virtual address of a buffer. - @param DeviceAddrPtr pointer to the physical address. - The DeviceAddrPtr will contain 0 in case of any error. + @param CpuAddr Virtual address. + @param DeviceAddrPtr Pointer to the physical address, or 0 in case of any + error. **/ VOID @@ -59,7 +61,7 @@ SnpUndi32CallbackV2p30 ( // EFI uses identical mapping // if ((CpuAddr == 0) || (DeviceAddrPtr == 0)) { - DEBUG ((EFI_D_NET, "\nv2p: Null virtual address or physical pointer.\n")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nv2p: Null virtual address or physical pointer.\n")); return ; } @@ -80,12 +82,12 @@ SnpUndi32CallbackV2p30 ( } /** + Acquire or release a lock of an exclusive access to a critical section of the + code/data. + This is a callback routine supplied to UNDI at undi_start time. - UNDI call this routine when it wants to have exclusive access to a critical - section of the code/data. - @param Enable non-zero indicates acquire - zero indicates release + @param Enable Non-zero indicates acquire; Zero indicates release. **/ VOID @@ -110,11 +112,11 @@ SnpUndi32CallbackBlock30 ( } /** + Delay MicroSeconds of micro seconds. + This is a callback routine supplied to UNDI at undi_start time. - UNDI call this routine with the number of micro seconds when it wants to - pause. - @param MicroSeconds number of micro seconds to pause, ususlly multiple of 10. + @param MicroSeconds Number of micro seconds to pause, ususlly multiple of 10. **/ VOID @@ -128,21 +130,22 @@ SnpUndi32CallbackDelay30 ( } /** - This is a callback routine supplied to UNDI at undi_start time. - This is the IO routine for UNDI. This is not currently being used by UNDI3.0 - because Undi3.0 uses io/mem offsets relative to the beginning of the device - io/mem address and so it needs to use the PCI_IO_FUNCTION that abstracts the - start of the device's io/mem addresses. Since SNP cannot retrive the context - of the undi3.0 interface it cannot use the PCI_IO_FUNCTION that specific for - that NIC and uses one global IO functions structure, this does not work. - This however works fine for EFI1.0 Undis because they use absolute addresses - for io/mem access. - - @param ReadOrWrite indicates read or write, IO or Memory - @param NumBytes number of bytes to read or write - @param Address IO or memory address to read from or write to - @param BufferAddr memory location to read into or that contains the bytes to - write + IO routine for UNDI. + + This is a callback routine supplied to UNDI at undi_start time. This is not + currently being used by UNDI3.0 because Undi3.0 uses io/mem offsets relative + to the beginning of the device io/mem address and so it needs to use the + PCI_IO_FUNCTION that abstracts the start of the device's io/mem addresses. + Since SNP cannot retrive the context of the undi3.0 interface it cannot use + the PCI_IO_FUNCTION that specific for that NIC and uses one global IO + functions structure, this does not work. This however works fine for EFI1.0 + Undis because they use absolute addresses for io/mem access. + + @param ReadOrWrite Indicates read or write, IO or Memory. + @param NumBytes Number of bytes to read or write. + @param Address IO or memory address to read from or write to. + @param BufferAddr Memory location to read into or that contains the bytes to + write. **/ VOID @@ -222,18 +225,18 @@ SnpUndi32CallbackMemio30 ( } /** + Acquire or release a lock of the exclusive access to a critical section of the + code/data. + This is a callback routine supplied to UNDI3.1 at undi_start time. - UNDI call this routine when it wants to have exclusive access to a critical - section of the code/data. - New callbacks for 3.1: - there won't be a virtual2physical callback for UNDI 3.1 because undi3.1 uses - the MemMap call to map the required address by itself! + New callbacks for 3.1: there won't be a virtual2physical callback for UNDI 3.1 + because undi3.1 uses the MemMap call to map the required address by itself! @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to - store Undi interface context (Undi does not read or write - this variable) - @param Enable non-zero indicates acquire - zero indicates release + store Undi interface context (Undi does not read or write + this variable). + @param Enable Non-zero indicates acquire; Zero indicates release. + **/ VOID SnpUndi32CallbackBlock ( @@ -256,14 +259,15 @@ SnpUndi32CallbackBlock ( } /** + Delay MicroSeconds of micro seconds. + This is a callback routine supplied to UNDI at undi_start time. - UNDI call this routine with the number of micro seconds when it wants to - pause. @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to - store Undi interface context (Undi does not read or write - this variable) - @param MicroSeconds number of micro seconds to pause, ususlly multiple of 10. + store Undi interface context (Undi does not read or write + this variable). + @param MicroSeconds Number of micro seconds to pause, ususlly multiple of 10. + **/ VOID SnpUndi32CallbackDelay ( @@ -277,17 +281,19 @@ SnpUndi32CallbackDelay ( } /** + IO routine for UNDI3.1. + This is a callback routine supplied to UNDI at undi_start time. - This is the IO routine for UNDI3.1 to start CPB. - + @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this - to store Undi interface context (Undi does not read or - write this variable) - @param ReadOrWrite indicates read or write, IO or Memory. - @param NumBytes number of bytes to read or write. + to store Undi interface context (Undi does not read or + write this variable). + @param ReadOrWrite Indicates read or write, IO or Memory. + @param NumBytes Number of bytes to read or write. @param MemOrPortAddr IO or memory address to read from or write to. - @param BufferPtr memory location to read into or that contains the bytes - to write. + @param BufferPtr Memory location to read into or that contains the bytes + to write. + **/ VOID SnpUndi32CallbackMemio ( @@ -368,17 +374,18 @@ SnpUndi32CallbackMemio ( } /** + Map a CPU address to a device address. + This is a callback routine supplied to UNDI at undi_start time. - UNDI call this routine when it has to map a CPU address to a device - address. - @param UniqueId - This was supplied to UNDI at Undi_Start, SNP uses this to store - Undi interface context (Undi does not read or write this variable) - @param CpuAddr - Virtual address to be mapped! - @param NumBytes - size of memory to be mapped - @param Direction - direction of data flow for this memory's usage: - cpu->device, device->cpu or both ways - @param DeviceAddrPtr - pointer to return the mapped device address + @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to + store Undi interface context (Undi does not read or write + this variable). + @param CpuAddr Virtual address to be mapped. + @param NumBytes Size of memory to be mapped. + @param Direction Direction of data flow for this memory's usage: + cpu->device, device->cpu or both ways. + @param DeviceAddrPtr Pointer to return the mapped device address. **/ VOID @@ -460,17 +467,18 @@ SnpUndi32CallbackMap ( } /** + Unmap an address that was previously mapped using map callback. + This is a callback routine supplied to UNDI at undi_start time. - UNDI call this routine when it wants to unmap an address that was previously - mapped using map callback. - @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to store. - Undi interface context (Undi does not read or write this variable) - @param CpuAddr Virtual address that was mapped! - @param NumBytes size of memory mapped - @param Direction direction of data flow for this memory's usage: - cpu->device, device->cpu or both ways - @param DeviceAddr the mapped device address + @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to + store. Undi interface context (Undi does not read or write + this variable). + @param CpuAddr Virtual address that was mapped. + @param NumBytes Size of memory mapped. + @param Direction Direction of data flow for this memory's usage: + cpu->device, device->cpu or both ways. + @param DeviceAddr The mapped device address. **/ VOID @@ -493,8 +501,7 @@ SnpUndi32CallbackUnmap ( } } - if (Index >= MAX_MAP_LENGTH) - { + if (Index >= MAX_MAP_LENGTH) { DEBUG ((EFI_D_ERROR, "SNP could not find a mapping, failed to unmap.\n")); return ; } @@ -505,25 +512,26 @@ SnpUndi32CallbackUnmap ( return ; } -/** - This is a callback routine supplied to UNDI at undi_start time. - UNDI call this routine when it wants synchronize the virtual buffer contents - with the mapped buffer contents. The virtual and mapped buffers need not - correspond to the same physical memory (especially if the virtual address is - > 4GB). Depending on the direction for which the buffer is mapped, undi will - need to synchronize their contents whenever it writes to/reads from the buffer - using either the cpu address or the device address. - - EFI does not provide a sync call, since virt=physical, we sould just do - the synchronization ourself here! - - @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to store - Undi interface context (Undi does not read or write this variable) - @param CpuAddr Virtual address that was mapped! - @param NumBytes size of memory mapped. - @param Direction direction of data flow for this memory's usage: +/** + Synchronize the virtual buffer contents with the mapped buffer contents. + + This is a callback routine supplied to UNDI at undi_start time. The virtual + and mapped buffers need not correspond to the same physical memory (especially + if the virtual address is > 4GB). Depending on the direction for which the + buffer is mapped, undi will need to synchronize their contents whenever it + writes to/reads from the buffer using either the cpu address or the device + address. + EFI does not provide a sync call since virt=physical, we should just do the + synchronization ourselves here. + + @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to + store Undi interface context (Undi does not read or write + this variable). + @param CpuAddr Virtual address that was mapped. + @param NumBytes Size of memory mapped. + @param Direction Direction of data flow for this memory's usage: cpu->device, device->cpu or both ways. - @param DeviceAddr the mapped device address. + @param DeviceAddr The mapped device address. **/ VOID diff --git a/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c b/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c index 304e6205fd..956cd59c8b 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/ComponentName.c @@ -242,7 +242,8 @@ SimpleNetworkComponentNameGetDriverName ( and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not - support the language specified by Language, then EFI_UNSUPPORTED is returned. + support the language specified by Language, then EFI_UNSUPPORTED is returned. + Currently not implemented. @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c index 17078c81cf..e2c911dfd2 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Get_status.c @@ -16,15 +16,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Snp.h" /** - this routine calls undi to get the status of the interrupts, get the list of - transmit buffers that completed transmitting! - - @param Snp pointer to snp driver structure - @param InterruptStatusPtr a non null pointer gets the interrupt status - @param TransmitBufferListPtrs a non null ointer gets the list of pointers of - previously transmitted buffers whose - transmission was completed asynchrnously. - + Call undi to get the status of the interrupts, get the list of transmit + buffers that completed transmitting. + + @param Snp Pointer to snp driver structure. + @param InterruptStatusPtr A non null pointer to contain the interrupt + status. + @param TransmitBufferListPtrs A non null pointer to contain the list of + pointers of previous transmitted buffers whose + transmission was completed asynchrnously. + + @retval EFI_SUCCESS The status of the network interface was retrieved. + @retval EFI_DEVICE_ERROR The command could not be sent to the network + interface. **/ EFI_STATUS @@ -68,13 +72,13 @@ PxeGetStatus ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nSnp->undi.get_status() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.get_status() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); if (Snp->Cdb.StatCode != EFI_SUCCESS) { DEBUG ( - (EFI_D_NET, + (EFI_D_ERROR | EFI_D_NET, "\nSnp->undi.get_status() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatFlags) diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Initialize.c b/MdeModulePkg/Universal/Network/SnpDxe/Initialize.c index 5337b1cc2e..43b517e9e6 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Initialize.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Initialize.c @@ -16,14 +16,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Snp.h" /** - this routine calls undi to initialize the interface. + Call UNDI to initialize the interface. - @param Snp pointer to snp driver structure - @param CableDetectFlag Do/don't detect the cable (depending on what undi supports) + @param Snp Pointer to snp driver structure. + @param CableDetectFlag Do/don't detect the cable (depending on what + undi supports). - @retval EFI_SUCCESS UNDI is initialized successfully - @retval EFI_DEVICE_ERROR UNDI could not be initialized - @retval Other other errors + @retval EFI_SUCCESS UNDI is initialized successfully. + @retval EFI_DEVICE_ERROR UNDI could not be initialized. + @retval Other Other errors as indicated. **/ EFI_STATUS @@ -94,7 +95,7 @@ PxeInit ( Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; - DEBUG ((EFI_D_NET, "\nSnp->undi.initialize() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.initialize() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -104,7 +105,7 @@ PxeInit ( Status = EFI_SUCCESS; } else { DEBUG ( - (EFI_D_WARN, + (EFI_D_ERROR, "\nSnp->undi.initialize() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Mcast_ip_to_mac.c b/MdeModulePkg/Universal/Network/SnpDxe/Mcast_ip_to_mac.c index 00c80eb95f..e11b54afaa 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Mcast_ip_to_mac.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Mcast_ip_to_mac.c @@ -16,13 +16,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Snp.h" /** - this routine calls undi to convert an multicast IP address to a MAC address. + Call undi to convert an multicast IP address to a MAC address. - @param Snp pointer to snp driver structure - @param IPv6 flag to indicate if this is an ipv6 address - @param IP multicast IP address - @param MAC pointer to hold the return MAC address + @param Snp Pointer to snp driver structure. + @param IPv6 Flag to indicate if this is an ipv6 address. + @param IP Multicast IP address. + @param MAC Pointer to hold the return MAC address. + @retval EFI_SUCCESS The multicast IP address was mapped to the + multicast HW MAC address. + @retval EFI_INVALID_PARAMETER Invalid UNDI command. + @retval EFI_UNSUPPORTED Command is not supported by UNDI. + @retval EFI_DEVICE_ERROR Fail to execute UNDI command. **/ EFI_STATUS @@ -56,7 +61,7 @@ PxeIp2Mac ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nSnp->undi.mcast_ip_to_mac() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.mcast_ip_to_mac() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -69,7 +74,7 @@ PxeIp2Mac ( case PXE_STATCODE_UNSUPPORTED: DEBUG ( - (EFI_D_NET, + (EFI_D_ERROR | EFI_D_NET, "\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) @@ -82,7 +87,7 @@ PxeIp2Mac ( // to caller. // DEBUG ( - (EFI_D_NET, + (EFI_D_ERROR | EFI_D_NET, "\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Nvdata.c b/MdeModulePkg/Universal/Network/SnpDxe/Nvdata.c index 4b9259f87a..d7c55a6f10 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Nvdata.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Nvdata.c @@ -24,6 +24,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @param BufferSize number of bytes to read @param Buffer pointer where to read into + @retval EFI_SUCCESS The NVRAM access was performed. + @retval EFI_INVALID_PARAMETER Invalid UNDI command. + @retval EFI_UNSUPPORTED Command is not supported by UNDI. + @retval EFI_DEVICE_ERROR Fail to execute UNDI command. **/ EFI_STATUS @@ -55,7 +59,7 @@ PxeNvDataRead ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.nvdata () ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.nvdata () ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -65,7 +69,7 @@ PxeNvDataRead ( case PXE_STATCODE_UNSUPPORTED: DEBUG ( - (EFI_D_NET, + (EFI_D_ERROR | EFI_D_NET, "\nsnp->undi.nvdata() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) @@ -75,7 +79,7 @@ PxeNvDataRead ( default: DEBUG ( - (EFI_D_NET, + (EFI_D_ERROR | EFI_D_NET, "\nsnp->undi.nvdata() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Receive.c b/MdeModulePkg/Universal/Network/SnpDxe/Receive.c index bfabe11aa5..2392498283 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Receive.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Receive.c @@ -16,21 +16,29 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "Snp.h" /** - this routine calls undi to receive a packet and fills in the data in the - input pointers! - - @param Snp pointer to snp driver structure - @param Buffer pointer to the memory for the received data - @param BufferSize is a pointer to the length of the buffer on entry and - contains the length of the received data on return - @param HeaderSize pointer to the header portion of the data received. - @param SrcAddr optional parameter, is a pointer to contain the - source ethernet address on return - @param DestAddr optional parameter, is a pointer to contain the - destination ethernet address on return - @param Protocol optional parameter, is a pointer to contain the - protocol type from the ethernet header on return + Call UNDI to receive a packet and fills in the data in the input pointers. + @param Snp Pointer to snp driver structure + @param Buffer Pointer to the memory for the received data + @param BufferSize Pointer to the length of the buffer on entry and contains + the length of the received data on return + @param HeaderSize Pointer to the header portion of the data received. + @param SrcAddr Pointer to contain the source ethernet address on return + @param DestAddr Pointer to contain the destination ethernet address on + return + @param Protocol Pointer to contain the protocol type from the ethernet + header on return + + + @retval EFI_SUCCESS The received data was stored in Buffer, and + BufferSize has been updated to the number of + bytes received. + @retval EFI_DEVICE_ERROR Fail to execute UNDI command. + @retval EFI_NOT_READY No packets have been received on the network + interface. + @retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the received + packets. BufferSize has been updated to the + required size. **/ EFI_STATUS @@ -74,7 +82,7 @@ PxeReceive ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.receive () ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.receive () ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -84,7 +92,7 @@ PxeReceive ( case PXE_STATCODE_NO_DATA: DEBUG ( - (EFI_D_NET, + (EFI_D_ERROR | EFI_D_NET, "\nsnp->undi.receive () %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) @@ -94,7 +102,7 @@ PxeReceive ( default: DEBUG ( - (EFI_D_ERROR, + (EFI_D_ERROR | EFI_D_NET, "\nsnp->undi.receive() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) @@ -118,7 +126,10 @@ PxeReceive ( } if (Protocol != NULL) { - *Protocol = (UINT16) PXE_SWAP_UINT16 (Db->Protocol); /* we need to do the byte swapping */ + // + // We need to do the byte swapping + // + *Protocol = (UINT16) PXE_SWAP_UINT16 (Db->Protocol); } return (*BufferSize <= BuffSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL; diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c b/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c index db116330cd..24e89c5b48 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Receive_filters.c @@ -1,21 +1,16 @@ /** @file -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 + Implementation of managing the multicast receive filters of a network + interface. + +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. -Module name: - receive_filters.c - -Abstract: - -Revision history: - 2000-Feb-17 M(f)J Genesis. - **/ @@ -23,14 +18,18 @@ Revision history: #include "Snp.h" /** - this routine calls undi to enable the receive filters. - - @param Snp pointer to snp driver structure - @param EnableFlags bit mask for enabling the receive filters - @param MCastAddressCount multicast address count for a new multicast address - list - @param MCastAddressList list of new multicast addresses + Call undi to enable the receive filters. + @param Snp Pointer to snp driver structure. + @param EnableFlags Bit mask for enabling the receive filters. + @param MCastAddressCount Multicast address count for a new multicast address + list. + @param MCastAddressList List of new multicast addresses. + + @retval EFI_SUCCESS The multicast receive filter list was updated. + @retval EFI_INVALID_PARAMETER Invalid UNDI command. + @retval EFI_UNSUPPORTED Command is not supported by UNDI. + @retval EFI_DEVICE_ERROR Fail to execute UNDI command. **/ EFI_STATUS @@ -80,7 +79,7 @@ PxeRecvFilterEnable ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.receive_filters() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.receive_filters() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -112,14 +111,17 @@ PxeRecvFilterEnable ( } /** - this routine calls undi to disable the receive filters. + Call undi to disable the receive filters. - @param Snp pointer to snp driver structure - @param DisableFlags bit mask for disabling the receive filters - @param ResetMCastList boolean flag to reset/delete the multicast filter list + @param Snp Pointer to snp driver structure + @param DisableFlags Bit mask for disabling the receive filters + @param ResetMCastList Boolean flag to reset/delete the multicast filter + list. - -**/ + @retval EFI_SUCCESS The multicast receive filter list was updated. + @retval EFI_DEVICE_ERROR Fail to execute UNDI command. + +**/ EFI_STATUS PxeRecvFilterDisable ( SNP_DRIVER *Snp, @@ -165,7 +167,7 @@ PxeRecvFilterDisable ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.receive_filters() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.receive_filters() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -174,7 +176,7 @@ PxeRecvFilterDisable ( // UNDI command failed. Return UNDI status to caller. // DEBUG ( - (EFI_D_ERROR, + (EFI_D_ERROR | EFI_D_NET, "\nsnp->undi.receive_filters() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) @@ -187,11 +189,13 @@ PxeRecvFilterDisable ( } /** - this routine calls undi to read the receive filters. - - @param Snp pointer to snp driver structure + Call undi to read the receive filters. + @param Snp Pointer to snp driver structure. + @retval EFI_SUCCESS The receive filter was read. + @retval EFI_DEVICE_ERROR Fail to execute UNDI command. + **/ EFI_STATUS PxeRecvFilterRead ( @@ -215,7 +219,7 @@ PxeRecvFilterRead ( Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; - DEBUG ((EFI_D_NET, "\nsnp->undi.receive_filters() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.receive_filters() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Reset.c b/MdeModulePkg/Universal/Network/SnpDxe/Reset.c index f616d43584..057d3b51c5 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Reset.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Reset.c @@ -1,33 +1,27 @@ /** @file -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 + Implementation of resetting 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. -Module name: - reset.c - -Abstract: - -Revision history: - 2000-Feb-09 M(f)J Genesis. - **/ #include "Snp.h" /** - This routine calls undi to reset the nic. + Call UNDI to reset the NIC. - @param Snp pointer to the snp driver structure + @param Snp Pointer to the snp driver structure. - @return EFI_SUCCESSFUL for a successful completion - @return other for failed calls + @return EFI_SUCCESSFUL The NIC was reset. + @retval EFI_DEVICE_ERROR The NIC cannot be reset. **/ EFI_STATUS @@ -49,13 +43,13 @@ PxeReset ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.reset() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.reset() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { DEBUG ( - (EFI_D_WARN, + (EFI_D_ERROR | EFI_D_NET, "\nsnp->undi32.reset() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode) diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Shutdown.c b/MdeModulePkg/Universal/Network/SnpDxe/Shutdown.c index a996c2c50a..21ed2bfe20 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Shutdown.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Shutdown.c @@ -16,12 +16,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** - this routine calls undi to shut down the interface. + Call UNDI to shut down the interface. - @param Snp pointer to snp driver structure + @param Snp Pointer to snp driver structure. - @retval EFI_SUCCESS UNDI is shut down successfully - @retval EFI_DEVICE_ERROR UNDI could not be shut down + @retval EFI_SUCCESS UNDI is shut down successfully. + @retval EFI_DEVICE_ERROR UNDI could not be shut down. **/ EFI_STATUS @@ -43,7 +43,7 @@ PxeShutdown ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.shutdown() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.shutdown() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -51,7 +51,7 @@ PxeShutdown ( // // UNDI could not be shutdown. Return UNDI error. // - DEBUG ((EFI_D_WARN, "\nsnp->undi.shutdown() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode)); + DEBUG ((EFI_D_ERROR, "\nsnp->undi.shutdown() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode)); return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c index 80a05f102f..58451608e5 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Snp.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Snp.c @@ -24,10 +24,14 @@ V2P *mV2p = NULL; // undi3.0 map_list head /** - Unsupport currently. + Send command to UNDI. It does nothing currently. @param Cdb command to be sent to UNDI. - + + @retval EFI_INVALID_PARAMETER The command is 0. + @retval EFI_UNSUPPORTED Default return status because it's not + supported currently. + **/ EFI_STATUS IssueHwUndiCommand ( @@ -53,8 +57,8 @@ IssueHwUndiCommand ( @param Buffer Pointer to buffer. @param Length Length of buffer in bytes. - @return 8-bit checksum of all bytes in buffer. - @return If ptr is NULL or len is zero, zero is returned. + @return 8-bit checksum of all bytes in buffer, or zero if ptr is NULL or len + is zero. **/ UINT8 @@ -89,13 +93,13 @@ Calc8BitCksum ( Supported() it must also follow these calling restrictions. @param This Protocol instance pointer. - @param ControllerHandle Handle of device to test + @param ControllerHandle Handle of device to test. @param RemainingDevicePath Optional parameter use to pick a specific child device to start. - @retval EFI_SUCCESS This driver supports this device - @retval EFI_ALREADY_STARTED This driver is already running on this device - @retval other This driver does not support this device + @retval EFI_SUCCESS This driver supports this device. + @retval EFI_ALREADY_STARTED This driver is already running on this device. + @retval other This driver does not support this device. **/ EFI_STATUS @@ -151,7 +155,7 @@ SimpleNetworkDriverSupported ( // Check to see if !PXE structure is valid. Paragraph alignment of !PXE structure is required. // if (NiiProtocol->ID & 0x0F) { - DEBUG ((EFI_D_NET, "\n!PXE structure is not paragraph aligned.\n")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE structure is not paragraph aligned.\n")); Status = EFI_UNSUPPORTED; goto Done; } @@ -162,25 +166,25 @@ SimpleNetworkDriverSupported ( // Verify !PXE revisions. // if (Pxe->hw.Signature != PXE_ROMID_SIGNATURE) { - DEBUG ((EFI_D_NET, "\n!PXE signature is not valid.\n")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE signature is not valid.\n")); Status = EFI_UNSUPPORTED; goto Done; } if (Pxe->hw.Rev < PXE_ROMID_REV) { - DEBUG ((EFI_D_NET, "\n!PXE.Rev is not supported.\n")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE.Rev is not supported.\n")); Status = EFI_UNSUPPORTED; goto Done; } if (Pxe->hw.MajorVer < PXE_ROMID_MAJORVER) { - DEBUG ((EFI_D_NET, "\n!PXE.MajorVer is not supported.\n")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE.MajorVer is not supported.\n")); Status = EFI_UNSUPPORTED; goto Done; } else if (Pxe->hw.MajorVer == PXE_ROMID_MAJORVER && Pxe->hw.MinorVer < PXE_ROMID_MINORVER) { - DEBUG ((EFI_D_NET, "\n!PXE.MinorVer is not supported.")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE.MinorVer is not supported.")); Status = EFI_UNSUPPORTED; goto Done; } @@ -189,13 +193,13 @@ SimpleNetworkDriverSupported ( // if ((Pxe->hw.Implementation & PXE_ROMID_IMP_HW_UNDI) == 0) { if (Pxe->sw.EntryPoint < Pxe->sw.Len) { - DEBUG ((EFI_D_NET, "\n!PXE S/W entry point is not valid.")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE S/W entry point is not valid.")); Status = EFI_UNSUPPORTED; goto Done; } if (Pxe->sw.BusCnt == 0) { - DEBUG ((EFI_D_NET, "\n!PXE.BusCnt is zero.")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE.BusCnt is zero.")); Status = EFI_UNSUPPORTED; goto Done; } @@ -254,7 +258,7 @@ SimpleNetworkDriverStart ( UINT8 BarIndex; PXE_STATFLAGS InitStatFlags; - DEBUG ((EFI_D_NET, "\nSnpNotifyNetworkInterfaceIdentifier() ")); + DEBUG ((EFI_D_INFO, "\nSnpNotifyNetworkInterfaceIdentifier() ")); Status = gBS->OpenProtocol ( Controller, @@ -316,7 +320,7 @@ SimpleNetworkDriverStart ( Pxe = (PXE_UNDI *) (UINTN) (Nii->ID); if (Calc8BitCksum (Pxe, Pxe->hw.Len) != 0) { - DEBUG ((EFI_D_NET, "\n!PXE checksum is not correct.\n")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\n!PXE checksum is not correct.\n")); goto NiiError; } @@ -331,7 +335,7 @@ SimpleNetworkDriverStart ( // broadcast support or we cannot do DHCP! // } else { - DEBUG ((EFI_D_NET, "\nUNDI does not have promiscuous or broadcast support.")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\nUNDI does not have promiscuous or broadcast support.")); goto NiiError; } // @@ -348,7 +352,7 @@ SimpleNetworkDriverStart ( ); if (Status != EFI_SUCCESS) { - DEBUG ((EFI_D_NET, "\nCould not allocate SNP_DRIVER structure.\n")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\nCould not allocate SNP_DRIVER structure.\n")); goto NiiError; } @@ -422,7 +426,7 @@ SimpleNetworkDriverStart ( ); if (Status != EFI_SUCCESS) { - DEBUG ((EFI_D_NET, "\nCould not allocate CPB and DB structures.\n")); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\nCould not allocate CPB and DB structures.\n")); goto Error_DeleteSNP; } @@ -464,7 +468,7 @@ SimpleNetworkDriverStart ( Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; - DEBUG ((EFI_D_NET, "\nSnp->undi.get_init_info() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.get_init_info() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -474,7 +478,7 @@ SimpleNetworkDriverStart ( InitStatFlags = Snp->Cdb.StatFlags; if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { - DEBUG ((EFI_D_NET, "\nSnp->undi.init_info() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode)); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\nSnp->undi.init_info() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode)); PxeStop (Snp); goto Error_DeleteSNP; } @@ -494,12 +498,12 @@ SimpleNetworkDriverStart ( Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; - DEBUG ((EFI_D_NET, "\nSnp->undi.get_config_info() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.get_config_info() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { - DEBUG ((EFI_D_NET, "\nSnp->undi.config_info() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode)); + DEBUG ((EFI_D_ERROR | EFI_D_NET, "\nSnp->undi.config_info() %xh:%xh\n", Snp->Cdb.StatFlags, Snp->Cdb.StatCode)); PxeStop (Snp); goto Error_DeleteSNP; } @@ -609,7 +613,7 @@ SimpleNetworkDriverStart ( Status = PxeGetStnAddr (Snp); if (Status != EFI_SUCCESS) { - DEBUG ((EFI_D_ERROR, "\nSnp->undi.get_station_addr() failed.\n")); + DEBUG ((EFI_D_ERROR, "\nSnp->undi.get_station_addr() failed.\n")); PxeShutdown (Snp); PxeStop (Snp); goto Error_DeleteSNP; @@ -811,27 +815,27 @@ AddV2P ( return EFI_INVALID_PARAMETER; } - *V2p = AllocatePool (sizeof (V2P )); + *V2p = AllocatePool (sizeof (V2P)); if (*V2p != NULL) { return EFI_OUT_OF_RESOURCES; } Status = mPciIo->Map ( - mPciIo, - Type, - VirtualAddress, - &BufferSize, - &(*V2p)->PhysicalAddress, - &(*V2p)->Unmap - ); + mPciIo, + Type, + VirtualAddress, + &BufferSize, + &(*V2p)->PhysicalAddress, + &(*V2p)->Unmap + ); if (Status != EFI_SUCCESS) { FreePool (*V2p); return Status; } (*V2p)->VirtualAddress = VirtualAddress; - (*V2p)->BufferSize = BufferSize; - (*V2p)->Next = mV2p; - mV2p = *V2p; + (*V2p)->BufferSize = BufferSize; + (*V2p)->Next = mV2p; + mV2p = *V2p; return EFI_SUCCESS; } @@ -846,8 +850,8 @@ AddV2P ( @param VirtualAddr virtual address (or CPU address) to be searched in the map list - @retval EFI_SUCEESS if a match found! - @retval Other match not found + @retval EFI_SUCEESS A match was found. + @retval Other A match cannot be found. **/ EFI_STATUS @@ -874,13 +878,13 @@ FindV2p ( /** - This routine unmaps the given virtual address and frees the memory allocated - for the map list node corresponding to that address. + Unmap the given virtual address and free the memory allocated for the map list + node corresponding to that address. - @param VirtualAddress virtual address (or CPU address) to be unmapped + @param VirtualAddress virtual address (or CPU address) to be unmapped. - @retval EFI_SUCEESS if successfully unmapped - @retval Other as indicated by the error + @retval EFI_SUCEESS Successfully unmapped. + @retval Other Other errors as indicated. **/ EFI_STATUS diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Snp.h b/MdeModulePkg/Universal/Network/SnpDxe/Snp.h index 675057577c..ff7ad7b444 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Snp.h +++ b/MdeModulePkg/Universal/Network/SnpDxe/Snp.h @@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define _SNP_H_ -#include +#include #include #include diff --git a/MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf b/MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf index 6d38368549..c143c0b2dc 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf +++ b/MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf @@ -1,19 +1,16 @@ #/** @file -# Component name for module SNP +# Component description file for SNP module. # -# FIX ME! -# Copyright (c) 2006, Intel Corporation. +# Copyright (c) 2006, 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 # -# 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. # -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# -#**/ +**/ [Defines] INF_VERSION = 0x00010005 diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Start.c b/MdeModulePkg/Universal/Network/SnpDxe/Start.c index 5c5daeaa60..5beebad274 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Start.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Start.c @@ -16,12 +16,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** - this routine calls undi to start the interface and changes the snp state. + Call UNDI to start the interface and changes the snp state. - @param Snp pointer to snp driver structure + @param Snp pointer to snp driver structure. - @retval EFI_DEVICE_ERROR UNDI could not be started - @retval EFI_SUCCESS UNDI is started successfully + @retval EFI_SUCCESS UNDI is started successfully. + @retval EFI_DEVICE_ERROR UNDI could not be started. **/ EFI_STATUS @@ -72,7 +72,7 @@ PxeStart ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.start() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.start() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -99,7 +99,7 @@ PxeStart ( /** - Changes the state of a network interface from "stopped" to "started." + Change the state of a network interface from "stopped" to "started." This function starts a network interface. If the network interface successfully starts, then EFI_SUCCESS will be returned. diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c b/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c index 07df584a07..42792c26e1 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Station_address.c @@ -16,13 +16,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** - this routine calls undi to read the MAC address of the NIC and updates 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. + @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. + @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. **/ EFI_STATUS @@ -50,7 +50,7 @@ PxeGetStnAddr ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.station_addr() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.station_addr() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); @@ -90,10 +90,10 @@ PxeGetStnAddr ( /** - this routine calls undi to set a new MAC address for the NIC, + Call UNDI to set a new MAC address for the NIC. - @param Snp pointer to Snp driver structure - @param NewMacAddr pointer to a mac address to be set for the nic, if this is + @param Snp Pointer to Snp driver structure. + @param NewMacAddr Pointer to a MAC address to be set for the NIC, if this is NULL then this routine resets the mac address to the NIC's original address. @@ -139,7 +139,7 @@ PxeSetStnAddr ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.station_addr() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.station_addr() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Statistics.c b/MdeModulePkg/Universal/Network/SnpDxe/Statistics.c index c52fc23db3..5261a8441c 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Statistics.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Statistics.c @@ -139,7 +139,7 @@ SnpUndi32Statistics ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nsnp->undi.statistics() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.statistics() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Stop.c b/MdeModulePkg/Universal/Network/SnpDxe/Stop.c index 2eedfcd726..f707ed4fa1 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Stop.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Stop.c @@ -16,14 +16,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** - this routine calls undi to stop the interface and changes the snp state. + Call UNDI to stop the interface and changes the snp state. - @param Snp pointer to snp driver structure - - @retval EFI_INVALID_PARAMETER invalid parameter - @retval EFI_NOT_STARTED SNP is not started - @retval EFI_DEVICE_ERROR SNP is not initialized - @retval EFI_UNSUPPORTED operation unsupported + @param Snp Pointer to snp driver structure + + @retval EFI_SUCCESS The network interface was stopped. + @retval EFI_DEVICE_ERROR SNP is not initialized. **/ EFI_STATUS @@ -45,13 +43,13 @@ PxeStop ( // // Issue UNDI command // - DEBUG ((EFI_D_NET, "\nsnp->undi.stop() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nsnp->undi.stop() ")); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb); if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { DEBUG ( - (EFI_D_WARN, + (EFI_D_ERROR, "\nsnp->undi.stop() %xh:%xh\n", Snp->Cdb.StatCode, Snp->Cdb.StatFlags) @@ -74,15 +72,18 @@ PxeStop ( interface is in the started state. If the network interface was successfully stopped, then EFI_SUCCESS will be returned. - @param This A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance. + @param This A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL + instance. @retval EFI_SUCCESS The network interface was stopped. @retval EFI_NOT_STARTED The network interface has not been started. - @retval EFI_INVALID_PARAMETER This parameter was NULL or did not point to a valid - EFI_SIMPLE_NETWORK_PROTOCOL structure. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. + @retval EFI_INVALID_PARAMETER This parameter was NULL or did not point to a + valid EFI_SIMPLE_NETWORK_PROTOCOL structure. + @retval EFI_DEVICE_ERROR The command could not be sent to the network + interface. + @retval EFI_UNSUPPORTED This function is not supported by the network + interface. **/ EFI_STATUS diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c index c9d8e715aa..f103a59b3f 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c @@ -16,19 +16,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** - This routine calls undi to create the meadia header for the given data buffer. + Call UNDI to create the meadia header for the given data buffer. - @param Snp pointer to SNP driver structure - @param MacHeaderPtr address where the media header will be filled in. - @param HeaderSize size of the memory at MacHeaderPtr - @param Buffer data buffer pointer - @param BufferSize Size of data in the Buffer - @param DestAddr address of the destination mac address buffer - @param SrcAddr address of the source mac address buffer - @param ProtocolPtr address of the protocol type + @param Snp Pointer to SNP driver structure. + @param MacHeaderPtr Address where the media header will be filled in. + @param HeaderSize Size of the memory at MacHeaderPtr. + @param Buffer Data buffer pointer. + @param BufferSize Size of data in the Buffer + @param DestAddr Address of the destination mac address buffer. + @param SrcAddr Address of the source mac address buffer. + @param ProtocolPtr Address of the protocol type. - @retval EFI_SUCCESS if successfully completed the undi call - @retval Other error return from undi call. + @retval EFI_SUCCESS Successfully completed the undi call. + @retval Other Error return from undi call. **/ EFI_STATUS @@ -101,7 +101,7 @@ PxeFillHeader ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nSnp->undi.fill_header() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.fill_header() ")); (*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb); @@ -177,16 +177,16 @@ PxeTransmit ( // // Issue UNDI command and check result. // - DEBUG ((EFI_D_NET, "\nSnp->undi.transmit() ")); - DEBUG ((EFI_D_NET, "\nSnp->Cdb.OpCode == %x", Snp->Cdb.OpCode)); - DEBUG ((EFI_D_NET, "\nSnp->Cdb.CPBaddr == %LX", Snp->Cdb.CPBaddr)); - DEBUG ((EFI_D_NET, "\nSnp->Cdb.DBaddr == %LX", Snp->Cdb.DBaddr)); - DEBUG ((EFI_D_NET, "\nCpb->FrameAddr == %LX\n", Cpb->FrameAddr)); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.transmit() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->Cdb.OpCode == %x", Snp->Cdb.OpCode)); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->Cdb.CPBaddr == %LX", Snp->Cdb.CPBaddr)); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->Cdb.DBaddr == %LX", Snp->Cdb.DBaddr)); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nCpb->FrameAddr == %LX\n", Cpb->FrameAddr)); (*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb); - DEBUG ((EFI_D_NET, "\nexit Snp->undi.transmit() ")); - DEBUG ((EFI_D_NET, "\nSnp->Cdb.StatCode == %r", Snp->Cdb.StatCode)); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nexit Snp->undi.transmit() ")); + DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->Cdb.StatCode == %r", Snp->Cdb.StatCode)); // // we will unmap the buffers in get_status call, not here diff --git a/MdeModulePkg/Universal/Network/SnpDxe/WaitForPacket.c b/MdeModulePkg/Universal/Network/SnpDxe/WaitForPacket.c index 8dd8fd997e..5acdb7d6d7 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/WaitForPacket.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/WaitForPacket.c @@ -25,8 +25,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. VOID EFIAPI SnpWaitForPacketNotify ( - EFI_EVENT Event, - VOID *SnpPtr + EFI_EVENT Event, + VOID *SnpPtr ) { PXE_DB_GET_STATUS PxeDbGetStatus; @@ -90,5 +90,3 @@ SnpWaitForPacketNotify ( gBS->SignalEvent (Event); } } - -/* eof - WaitForPacket.c */