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
This commit is contained in:
niry 2008-12-29 01:16:13 +00:00
parent 99fd60317f
commit f381602727
19 changed files with 343 additions and 311 deletions

View File

@ -30,20 +30,22 @@ EFI_LOCK mLock;
// //
extern EFI_PCI_IO_PROTOCOL *mPciIo; extern EFI_PCI_IO_PROTOCOL *mPciIo;
/** /**
This is a callback routine supplied to UNDI at undi_start time. Convert a virtual or CPU address provided by SNP to a physical or device
UNDI call this routine with a virtual or CPU address that SNP provided to address.
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 This is a callback routine supplied to UNDI at undi_start time. Since EFI uses
for most of the addresses. an address above 4GB cannot generally be used as a the identical mapping, this routine returns the physical address same as the
device address, it needs to be mapped to a lower physical address. This virtual address for most of the addresses. an address above 4GB cannot
routine does not call the map routine itself, but it assumes that the mapping generally be used as a device address, it needs to be mapped to a lower
was done at the time of providing the address to UNDI. This routine just physical address. This routine does not call the map routine itself, but it
looks up the address in a map table (which is the v2p structure chain). 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 CpuAddr Virtual address.
@param DeviceAddrPtr pointer to the physical address. @param DeviceAddrPtr Pointer to the physical address, or 0 in case of any
The DeviceAddrPtr will contain 0 in case of any error. error.
**/ **/
VOID VOID
@ -59,7 +61,7 @@ SnpUndi32CallbackV2p30 (
// EFI uses identical mapping // EFI uses identical mapping
// //
if ((CpuAddr == 0) || (DeviceAddrPtr == 0)) { 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 ; return ;
} }
@ -80,12 +82,12 @@ SnpUndi32CallbackV2p30 (
} }
/** /**
This is a callback routine supplied to UNDI at undi_start time. Acquire or release a lock of an exclusive access to a critical section of the
UNDI call this routine when it wants to have exclusive access to a critical code/data.
section of the code/data.
@param Enable non-zero indicates acquire This is a callback routine supplied to UNDI at undi_start time.
zero indicates release
@param Enable Non-zero indicates acquire; Zero indicates release.
**/ **/
VOID VOID
@ -110,11 +112,11 @@ SnpUndi32CallbackBlock30 (
} }
/** /**
Delay MicroSeconds of micro seconds.
This is a callback routine supplied to UNDI at undi_start time. 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 VOID
@ -128,21 +130,22 @@ SnpUndi32CallbackDelay30 (
} }
/** /**
This is a callback routine supplied to UNDI at undi_start time. IO routine for UNDI.
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 This is a callback routine supplied to UNDI at undi_start time. This is not
@param NumBytes number of bytes to read or write currently being used by UNDI3.0 because Undi3.0 uses io/mem offsets relative
@param Address IO or memory address to read from or write to to the beginning of the device io/mem address and so it needs to use the
@param BufferAddr memory location to read into or that contains the bytes to PCI_IO_FUNCTION that abstracts the start of the device's io/mem addresses.
write 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 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. 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 New callbacks for 3.1: there won't be a virtual2physical callback for UNDI 3.1
section of the code/data. 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 @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to
store Undi interface context (Undi does not read or write store Undi interface context (Undi does not read or write
this variable) this variable).
@param Enable non-zero indicates acquire @param Enable Non-zero indicates acquire; Zero indicates release.
zero indicates release
**/ **/
VOID VOID
SnpUndi32CallbackBlock ( SnpUndi32CallbackBlock (
@ -256,14 +259,15 @@ SnpUndi32CallbackBlock (
} }
/** /**
Delay MicroSeconds of micro seconds.
This is a callback routine supplied to UNDI at undi_start time. 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 @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to
store Undi interface context (Undi does not read or write store Undi interface context (Undi does not read or write
this variable) this variable).
@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 VOID
SnpUndi32CallbackDelay ( 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 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 @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this
to store Undi interface context (Undi does not read or to store Undi interface context (Undi does not read or
write this variable) write this variable).
@param ReadOrWrite indicates read or write, IO or Memory. @param ReadOrWrite Indicates read or write, IO or Memory.
@param NumBytes number of bytes to read or write. @param NumBytes Number of bytes to read or write.
@param MemOrPortAddr IO or memory address to read from or write to. @param MemOrPortAddr IO or memory address to read from or write to.
@param BufferPtr memory location to read into or that contains the bytes @param BufferPtr Memory location to read into or that contains the bytes
to write. to write.
**/ **/
VOID VOID
SnpUndi32CallbackMemio ( SnpUndi32CallbackMemio (
@ -368,17 +374,18 @@ SnpUndi32CallbackMemio (
} }
/** /**
This is a callback routine supplied to UNDI at undi_start time. Map a CPU address to a device address.
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 This is a callback routine supplied to UNDI at undi_start time.
Undi interface context (Undi does not read or write this variable)
@param CpuAddr - Virtual address to be mapped! @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to
@param NumBytes - size of memory to be mapped store Undi interface context (Undi does not read or write
@param Direction - direction of data flow for this memory's usage: this variable).
cpu->device, device->cpu or both ways @param CpuAddr Virtual address to be mapped.
@param DeviceAddrPtr - pointer to return the mapped device address @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 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. 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. @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to
Undi interface context (Undi does not read or write this variable) store. Undi interface context (Undi does not read or write
@param CpuAddr Virtual address that was mapped! this variable).
@param NumBytes size of memory mapped @param CpuAddr Virtual address that was mapped.
@param Direction direction of data flow for this memory's usage: @param NumBytes Size of memory mapped.
cpu->device, device->cpu or both ways @param Direction Direction of data flow for this memory's usage:
@param DeviceAddr the mapped device address cpu->device, device->cpu or both ways.
@param DeviceAddr The mapped device address.
**/ **/
VOID 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")); DEBUG ((EFI_D_ERROR, "SNP could not find a mapping, failed to unmap.\n"));
return ; return ;
} }
@ -505,25 +512,26 @@ SnpUndi32CallbackUnmap (
return ; return ;
} }
/** /**
This is a callback routine supplied to UNDI at undi_start time. Synchronize the virtual buffer contents with the mapped buffer contents.
UNDI call this routine when it wants synchronize the virtual buffer contents
with the mapped buffer contents. The virtual and mapped buffers need not This is a callback routine supplied to UNDI at undi_start time. The virtual
correspond to the same physical memory (especially if the virtual address is and mapped buffers need not correspond to the same physical memory (especially
> 4GB). Depending on the direction for which the buffer is mapped, undi will if the virtual address is > 4GB). Depending on the direction for which the
need to synchronize their contents whenever it writes to/reads from the buffer buffer is mapped, undi will need to synchronize their contents whenever it
using either the cpu address or the device address. 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.
EFI does not provide a sync call, since virt=physical, we sould just do @param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to
the synchronization ourself here! store Undi interface context (Undi does not read or write
this variable).
@param UniqueId This was supplied to UNDI at Undi_Start, SNP uses this to store @param CpuAddr Virtual address that was mapped.
Undi interface context (Undi does not read or write this variable) @param NumBytes Size of memory mapped.
@param CpuAddr Virtual address that was mapped! @param Direction Direction of data flow for this memory's usage:
@param NumBytes size of memory mapped.
@param Direction direction of data flow for this memory's usage:
cpu->device, device->cpu or both ways. cpu->device, device->cpu or both ways.
@param DeviceAddr the mapped device address. @param DeviceAddr The mapped device address.
**/ **/
VOID VOID

View File

@ -242,7 +242,8 @@ SimpleNetworkComponentNameGetDriverName (
and EFI_SUCCESS is returned. If the driver specified by This is not currently and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle, managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not 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 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance. EFI_COMPONENT_NAME_PROTOCOL instance.

View File

@ -16,15 +16,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Snp.h" #include "Snp.h"
/** /**
this routine calls undi to get the status of the interrupts, get the list of Call undi to get the status of the interrupts, get the list of transmit
transmit buffers that completed transmitting! 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.
@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 EFI_STATUS
@ -68,13 +72,13 @@ PxeGetStatus (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
if (Snp->Cdb.StatCode != EFI_SUCCESS) { if (Snp->Cdb.StatCode != EFI_SUCCESS) {
DEBUG ( DEBUG (
(EFI_D_NET, (EFI_D_ERROR | EFI_D_NET,
"\nSnp->undi.get_status() %xh:%xh\n", "\nSnp->undi.get_status() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatFlags) Snp->Cdb.StatFlags)

View File

@ -16,14 +16,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Snp.h" #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 Snp Pointer to snp driver structure.
@param CableDetectFlag Do/don't detect the cable (depending on what undi supports) @param CableDetectFlag Do/don't detect the cable (depending on what
undi supports).
@retval EFI_SUCCESS UNDI is initialized successfully @retval EFI_SUCCESS UNDI is initialized successfully.
@retval EFI_DEVICE_ERROR UNDI could not be initialized @retval EFI_DEVICE_ERROR UNDI could not be initialized.
@retval Other other errors @retval Other Other errors as indicated.
**/ **/
EFI_STATUS EFI_STATUS
@ -94,7 +95,7 @@ PxeInit (
Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.IFnum = Snp->IfNum;
Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@ -104,7 +105,7 @@ PxeInit (
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
} else { } else {
DEBUG ( DEBUG (
(EFI_D_WARN, (EFI_D_ERROR,
"\nSnp->undi.initialize() %xh:%xh\n", "\nSnp->undi.initialize() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)

View File

@ -16,13 +16,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Snp.h" #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 Snp Pointer to snp driver structure.
@param IPv6 flag to indicate if this is an ipv6 address @param IPv6 Flag to indicate if this is an ipv6 address.
@param IP multicast IP address @param IP Multicast IP address.
@param MAC pointer to hold the return MAC 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 EFI_STATUS
@ -56,7 +61,7 @@ PxeIp2Mac (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@ -69,7 +74,7 @@ PxeIp2Mac (
case PXE_STATCODE_UNSUPPORTED: case PXE_STATCODE_UNSUPPORTED:
DEBUG ( DEBUG (
(EFI_D_NET, (EFI_D_ERROR | EFI_D_NET,
"\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n", "\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)
@ -82,7 +87,7 @@ PxeIp2Mac (
// to caller. // to caller.
// //
DEBUG ( DEBUG (
(EFI_D_NET, (EFI_D_ERROR | EFI_D_NET,
"\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n", "\nSnp->undi.mcast_ip_to_mac() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)

View File

@ -24,6 +24,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@param BufferSize number of bytes to read @param BufferSize number of bytes to read
@param Buffer pointer where to read into @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 EFI_STATUS
@ -55,7 +59,7 @@ PxeNvDataRead (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@ -65,7 +69,7 @@ PxeNvDataRead (
case PXE_STATCODE_UNSUPPORTED: case PXE_STATCODE_UNSUPPORTED:
DEBUG ( DEBUG (
(EFI_D_NET, (EFI_D_ERROR | EFI_D_NET,
"\nsnp->undi.nvdata() %xh:%xh\n", "\nsnp->undi.nvdata() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)
@ -75,7 +79,7 @@ PxeNvDataRead (
default: default:
DEBUG ( DEBUG (
(EFI_D_NET, (EFI_D_ERROR | EFI_D_NET,
"\nsnp->undi.nvdata() %xh:%xh\n", "\nsnp->undi.nvdata() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)

View File

@ -16,22 +16,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Snp.h" #include "Snp.h"
/** /**
this routine calls undi to receive a packet and fills in the data in the Call UNDI to receive a packet and fills in the data in the input pointers.
input pointers!
@param Snp pointer to snp driver structure @param Snp Pointer to snp driver structure
@param Buffer pointer to the memory for the received data @param Buffer Pointer to the memory for the received data
@param BufferSize is a pointer to the length of the buffer on entry and @param BufferSize Pointer to the length of the buffer on entry and contains
contains the length of the received data on return the length of the received data on return
@param HeaderSize pointer to the header portion of the data received. @param HeaderSize Pointer to the header portion of the data received.
@param SrcAddr optional parameter, is a pointer to contain the @param SrcAddr Pointer to contain the source ethernet address on return
source ethernet address on return @param DestAddr Pointer to contain the destination ethernet address on
@param DestAddr optional parameter, is a pointer to contain the return
destination ethernet address on return @param Protocol Pointer to contain the protocol type from the ethernet
@param Protocol optional parameter, is a pointer to contain the header on return
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 EFI_STATUS
PxeReceive ( PxeReceive (
@ -74,7 +82,7 @@ PxeReceive (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@ -84,7 +92,7 @@ PxeReceive (
case PXE_STATCODE_NO_DATA: case PXE_STATCODE_NO_DATA:
DEBUG ( DEBUG (
(EFI_D_NET, (EFI_D_ERROR | EFI_D_NET,
"\nsnp->undi.receive () %xh:%xh\n", "\nsnp->undi.receive () %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)
@ -94,7 +102,7 @@ PxeReceive (
default: default:
DEBUG ( DEBUG (
(EFI_D_ERROR, (EFI_D_ERROR | EFI_D_NET,
"\nsnp->undi.receive() %xh:%xh\n", "\nsnp->undi.receive() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)
@ -118,7 +126,10 @@ PxeReceive (
} }
if (Protocol != NULL) { 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; return (*BufferSize <= BuffSize) ? EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;

View File

@ -1,21 +1,16 @@
/** @file /** @file
Copyright (c) 2004 - 2007, Intel Corporation Implementation of managing the multicast receive filters of a network
All rights reserved. This program and the accompanying materials interface.
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 Copyright (c) 2004 - 2007, Intel Corporation.<BR> All rights reserved. This
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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" #include "Snp.h"
/** /**
this routine calls undi to enable the receive filters. 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
@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 EFI_STATUS
@ -80,7 +79,7 @@ PxeRecvFilterEnable (
// //
// Issue UNDI command and check result. // 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); (*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 Snp Pointer to snp driver structure
@param DisableFlags bit mask for disabling the receive filters @param DisableFlags Bit mask for disabling the receive filters
@param ResetMCastList boolean flag to reset/delete the multicast filter list @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 EFI_STATUS
PxeRecvFilterDisable ( PxeRecvFilterDisable (
SNP_DRIVER *Snp, SNP_DRIVER *Snp,
@ -165,7 +167,7 @@ PxeRecvFilterDisable (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@ -174,7 +176,7 @@ PxeRecvFilterDisable (
// UNDI command failed. Return UNDI status to caller. // UNDI command failed. Return UNDI status to caller.
// //
DEBUG ( DEBUG (
(EFI_D_ERROR, (EFI_D_ERROR | EFI_D_NET,
"\nsnp->undi.receive_filters() %xh:%xh\n", "\nsnp->undi.receive_filters() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)
@ -187,11 +189,13 @@ PxeRecvFilterDisable (
} }
/** /**
this routine calls undi to read the receive filters. Call undi to read the receive filters.
@param Snp pointer to snp driver structure
@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 EFI_STATUS
PxeRecvFilterRead ( PxeRecvFilterRead (
@ -215,7 +219,7 @@ PxeRecvFilterRead (
Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.IFnum = Snp->IfNum;
Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);

View File

@ -1,33 +1,27 @@
/** @file /** @file
Copyright (c) 2004 - 2007, Intel Corporation Implementation of resetting a network adapter.
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License Copyright (c) 2004 - 2007, Intel Corporation.<BR> All rights reserved. This
which accompanies this distribution. The full text of the license may be found at program and the accompanying materials are licensed and made available under the
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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" #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 EFI_SUCCESSFUL The NIC was reset.
@return other for failed calls @retval EFI_DEVICE_ERROR The NIC cannot be reset.
**/ **/
EFI_STATUS EFI_STATUS
@ -49,13 +43,13 @@ PxeReset (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) {
DEBUG ( DEBUG (
(EFI_D_WARN, (EFI_D_ERROR | EFI_D_NET,
"\nsnp->undi32.reset() %xh:%xh\n", "\nsnp->undi32.reset() %xh:%xh\n",
Snp->Cdb.StatFlags, Snp->Cdb.StatFlags,
Snp->Cdb.StatCode) Snp->Cdb.StatCode)

View File

@ -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_SUCCESS UNDI is shut down successfully.
@retval EFI_DEVICE_ERROR UNDI could not be shut down @retval EFI_DEVICE_ERROR UNDI could not be shut down.
**/ **/
EFI_STATUS EFI_STATUS
@ -43,7 +43,7 @@ PxeShutdown (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@ -51,7 +51,7 @@ PxeShutdown (
// //
// UNDI could not be shutdown. Return UNDI error. // 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; return EFI_DEVICE_ERROR;
} }

View File

@ -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. @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 EFI_STATUS
IssueHwUndiCommand ( IssueHwUndiCommand (
@ -53,8 +57,8 @@ IssueHwUndiCommand (
@param Buffer Pointer to buffer. @param Buffer Pointer to buffer.
@param Length Length of buffer in bytes. @param Length Length of buffer in bytes.
@return 8-bit checksum of all bytes in buffer. @return 8-bit checksum of all bytes in buffer, or zero if ptr is NULL or len
@return If ptr is NULL or len is zero, zero is returned. is zero.
**/ **/
UINT8 UINT8
@ -89,13 +93,13 @@ Calc8BitCksum (
Supported() it must also follow these calling restrictions. Supported() it must also follow these calling restrictions.
@param This Protocol instance pointer. @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 @param RemainingDevicePath Optional parameter use to pick a specific child
device to start. device to start.
@retval EFI_SUCCESS This driver supports this device @retval EFI_SUCCESS This driver supports this device.
@retval EFI_ALREADY_STARTED This driver is already running on this device @retval EFI_ALREADY_STARTED This driver is already running on this device.
@retval other This driver does not support this device @retval other This driver does not support this device.
**/ **/
EFI_STATUS EFI_STATUS
@ -151,7 +155,7 @@ SimpleNetworkDriverSupported (
// Check to see if !PXE structure is valid. Paragraph alignment of !PXE structure is required. // Check to see if !PXE structure is valid. Paragraph alignment of !PXE structure is required.
// //
if (NiiProtocol->ID & 0x0F) { 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; Status = EFI_UNSUPPORTED;
goto Done; goto Done;
} }
@ -162,25 +166,25 @@ SimpleNetworkDriverSupported (
// Verify !PXE revisions. // Verify !PXE revisions.
// //
if (Pxe->hw.Signature != PXE_ROMID_SIGNATURE) { 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; Status = EFI_UNSUPPORTED;
goto Done; goto Done;
} }
if (Pxe->hw.Rev < PXE_ROMID_REV) { 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; Status = EFI_UNSUPPORTED;
goto Done; goto Done;
} }
if (Pxe->hw.MajorVer < PXE_ROMID_MAJORVER) { 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; Status = EFI_UNSUPPORTED;
goto Done; goto Done;
} else if (Pxe->hw.MajorVer == PXE_ROMID_MAJORVER && Pxe->hw.MinorVer < PXE_ROMID_MINORVER) { } 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; Status = EFI_UNSUPPORTED;
goto Done; goto Done;
} }
@ -189,13 +193,13 @@ SimpleNetworkDriverSupported (
// //
if ((Pxe->hw.Implementation & PXE_ROMID_IMP_HW_UNDI) == 0) { if ((Pxe->hw.Implementation & PXE_ROMID_IMP_HW_UNDI) == 0) {
if (Pxe->sw.EntryPoint < Pxe->sw.Len) { 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; Status = EFI_UNSUPPORTED;
goto Done; goto Done;
} }
if (Pxe->sw.BusCnt == 0) { 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; Status = EFI_UNSUPPORTED;
goto Done; goto Done;
} }
@ -254,7 +258,7 @@ SimpleNetworkDriverStart (
UINT8 BarIndex; UINT8 BarIndex;
PXE_STATFLAGS InitStatFlags; PXE_STATFLAGS InitStatFlags;
DEBUG ((EFI_D_NET, "\nSnpNotifyNetworkInterfaceIdentifier() ")); DEBUG ((EFI_D_INFO, "\nSnpNotifyNetworkInterfaceIdentifier() "));
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
@ -316,7 +320,7 @@ SimpleNetworkDriverStart (
Pxe = (PXE_UNDI *) (UINTN) (Nii->ID); Pxe = (PXE_UNDI *) (UINTN) (Nii->ID);
if (Calc8BitCksum (Pxe, Pxe->hw.Len) != 0) { 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; goto NiiError;
} }
@ -331,7 +335,7 @@ SimpleNetworkDriverStart (
// broadcast support or we cannot do DHCP! // broadcast support or we cannot do DHCP!
// //
} else { } 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; goto NiiError;
} }
// //
@ -348,7 +352,7 @@ SimpleNetworkDriverStart (
); );
if (Status != EFI_SUCCESS) { 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; goto NiiError;
} }
@ -422,7 +426,7 @@ SimpleNetworkDriverStart (
); );
if (Status != EFI_SUCCESS) { 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; goto Error_DeleteSNP;
} }
@ -464,7 +468,7 @@ SimpleNetworkDriverStart (
Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.IFnum = Snp->IfNum;
Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
@ -474,7 +478,7 @@ SimpleNetworkDriverStart (
InitStatFlags = Snp->Cdb.StatFlags; InitStatFlags = Snp->Cdb.StatFlags;
if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { 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); PxeStop (Snp);
goto Error_DeleteSNP; goto Error_DeleteSNP;
} }
@ -494,12 +498,12 @@ SimpleNetworkDriverStart (
Snp->Cdb.IFnum = Snp->IfNum; Snp->Cdb.IFnum = Snp->IfNum;
Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST; 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { 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); PxeStop (Snp);
goto Error_DeleteSNP; goto Error_DeleteSNP;
} }
@ -609,7 +613,7 @@ SimpleNetworkDriverStart (
Status = PxeGetStnAddr (Snp); Status = PxeGetStnAddr (Snp);
if (Status != EFI_SUCCESS) { 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); PxeShutdown (Snp);
PxeStop (Snp); PxeStop (Snp);
goto Error_DeleteSNP; goto Error_DeleteSNP;
@ -811,27 +815,27 @@ AddV2P (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
*V2p = AllocatePool (sizeof (V2P )); *V2p = AllocatePool (sizeof (V2P));
if (*V2p != NULL) { if (*V2p != NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
Status = mPciIo->Map ( Status = mPciIo->Map (
mPciIo, mPciIo,
Type, Type,
VirtualAddress, VirtualAddress,
&BufferSize, &BufferSize,
&(*V2p)->PhysicalAddress, &(*V2p)->PhysicalAddress,
&(*V2p)->Unmap &(*V2p)->Unmap
); );
if (Status != EFI_SUCCESS) { if (Status != EFI_SUCCESS) {
FreePool (*V2p); FreePool (*V2p);
return Status; return Status;
} }
(*V2p)->VirtualAddress = VirtualAddress; (*V2p)->VirtualAddress = VirtualAddress;
(*V2p)->BufferSize = BufferSize; (*V2p)->BufferSize = BufferSize;
(*V2p)->Next = mV2p; (*V2p)->Next = mV2p;
mV2p = *V2p; mV2p = *V2p;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -846,8 +850,8 @@ AddV2P (
@param VirtualAddr virtual address (or CPU address) to be searched in @param VirtualAddr virtual address (or CPU address) to be searched in
the map list the map list
@retval EFI_SUCEESS if a match found! @retval EFI_SUCEESS A match was found.
@retval Other match not found @retval Other A match cannot be found.
**/ **/
EFI_STATUS EFI_STATUS
@ -874,13 +878,13 @@ FindV2p (
/** /**
This routine unmaps the given virtual address and frees the memory allocated Unmap the given virtual address and free the memory allocated for the map list
for the map list node corresponding to that address. 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 EFI_SUCEESS Successfully unmapped.
@retval Other as indicated by the error @retval Other Other errors as indicated.
**/ **/
EFI_STATUS EFI_STATUS

View File

@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define _SNP_H_ #define _SNP_H_
#include <PiDxe.h> #include <Uefi.h>
#include <Protocol/SimpleNetwork.h> #include <Protocol/SimpleNetwork.h>
#include <Protocol/PciIo.h> #include <Protocol/PciIo.h>

View File

@ -1,19 +1,16 @@
#/** @file #/** @file
# Component name for module SNP # Component description file for SNP module.
# #
# FIX ME! # Copyright (c) 2006, Intel Corporation. <BR>
# 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 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# are licensed and made available under the terms and conditions of the BSD License # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
# 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.
#
#
#**/
[Defines] [Defines]
INF_VERSION = 0x00010005 INF_VERSION = 0x00010005

View File

@ -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 EFI_STATUS
@ -72,7 +72,7 @@ PxeStart (
// //
// Issue UNDI command and check result. // 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); (*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 This function starts a network interface. If the network interface successfully
starts, then EFI_SUCCESS will be returned. starts, then EFI_SUCCESS will be returned.

View File

@ -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 Call UNDI to read the MAC address of the NIC and update the mode structure
mode structure with the address. 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_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_DEVICE_ERROR Failed to read the MAC address of the NIC.
**/ **/
EFI_STATUS EFI_STATUS
@ -50,7 +50,7 @@ PxeGetStnAddr (
// //
// Issue UNDI command and check result. // 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); (*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 Snp Pointer to Snp driver structure.
@param NewMacAddr pointer to a mac address to be set for the nic, if this is @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 NULL then this routine resets the mac address to the NIC's
original address. original address.
@ -139,7 +139,7 @@ PxeSetStnAddr (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);

View File

@ -139,7 +139,7 @@ SnpUndi32Statistics (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);

View File

@ -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 @param Snp Pointer to snp driver structure
@retval EFI_INVALID_PARAMETER invalid parameter @retval EFI_SUCCESS The network interface was stopped.
@retval EFI_NOT_STARTED SNP is not started @retval EFI_DEVICE_ERROR SNP is not initialized.
@retval EFI_DEVICE_ERROR SNP is not initialized
@retval EFI_UNSUPPORTED operation unsupported
**/ **/
EFI_STATUS EFI_STATUS
@ -45,13 +43,13 @@ PxeStop (
// //
// Issue UNDI command // 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); (*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) { if (Snp->Cdb.StatCode != PXE_STATCODE_SUCCESS) {
DEBUG ( DEBUG (
(EFI_D_WARN, (EFI_D_ERROR,
"\nsnp->undi.stop() %xh:%xh\n", "\nsnp->undi.stop() %xh:%xh\n",
Snp->Cdb.StatCode, Snp->Cdb.StatCode,
Snp->Cdb.StatFlags) Snp->Cdb.StatFlags)
@ -74,15 +72,18 @@ PxeStop (
interface is in the started state. If the network interface was successfully interface is in the started state. If the network interface was successfully
stopped, then EFI_SUCCESS will be returned. 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_SUCCESS The network interface was stopped.
@retval EFI_NOT_STARTED The network interface has not been started. @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 @retval EFI_INVALID_PARAMETER This parameter was NULL or did not point to a
EFI_SIMPLE_NETWORK_PROTOCOL structure. valid EFI_SIMPLE_NETWORK_PROTOCOL structure.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface. @retval EFI_DEVICE_ERROR The command could not be sent to the network
@retval EFI_UNSUPPORTED This function is not supported by the network interface. interface.
@retval EFI_UNSUPPORTED This function is not supported by the network
interface.
**/ **/
EFI_STATUS EFI_STATUS

View File

@ -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 Snp Pointer to SNP driver structure.
@param MacHeaderPtr address where the media header will be filled in. @param MacHeaderPtr Address where the media header will be filled in.
@param HeaderSize size of the memory at MacHeaderPtr @param HeaderSize Size of the memory at MacHeaderPtr.
@param Buffer data buffer pointer @param Buffer Data buffer pointer.
@param BufferSize Size of data in the Buffer @param BufferSize Size of data in the Buffer
@param DestAddr address of the destination mac address buffer @param DestAddr Address of the destination mac address buffer.
@param SrcAddr address of the source mac address buffer @param SrcAddr Address of the source mac address buffer.
@param ProtocolPtr address of the protocol type @param ProtocolPtr Address of the protocol type.
@retval EFI_SUCCESS if successfully completed the undi call @retval EFI_SUCCESS Successfully completed the undi call.
@retval Other error return from undi call. @retval Other Error return from undi call.
**/ **/
EFI_STATUS EFI_STATUS
@ -101,7 +101,7 @@ PxeFillHeader (
// //
// Issue UNDI command and check result. // 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); (*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb);
@ -177,16 +177,16 @@ PxeTransmit (
// //
// Issue UNDI command and check result. // Issue UNDI command and check result.
// //
DEBUG ((EFI_D_NET, "\nSnp->undi.transmit() ")); DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->undi.transmit() "));
DEBUG ((EFI_D_NET, "\nSnp->Cdb.OpCode == %x", Snp->Cdb.OpCode)); DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->Cdb.OpCode == %x", Snp->Cdb.OpCode));
DEBUG ((EFI_D_NET, "\nSnp->Cdb.CPBaddr == %LX", Snp->Cdb.CPBaddr)); DEBUG ((EFI_D_INFO | EFI_D_NET, "\nSnp->Cdb.CPBaddr == %LX", Snp->Cdb.CPBaddr));
DEBUG ((EFI_D_NET, "\nSnp->Cdb.DBaddr == %LX", Snp->Cdb.DBaddr)); DEBUG ((EFI_D_INFO | 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, "\nCpb->FrameAddr == %LX\n", Cpb->FrameAddr));
(*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb); (*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb);
DEBUG ((EFI_D_NET, "\nexit Snp->undi.transmit() ")); DEBUG ((EFI_D_INFO | 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, "\nSnp->Cdb.StatCode == %r", Snp->Cdb.StatCode));
// //
// we will unmap the buffers in get_status call, not here // we will unmap the buffers in get_status call, not here

View File

@ -25,8 +25,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
VOID VOID
EFIAPI EFIAPI
SnpWaitForPacketNotify ( SnpWaitForPacketNotify (
EFI_EVENT Event, EFI_EVENT Event,
VOID *SnpPtr VOID *SnpPtr
) )
{ {
PXE_DB_GET_STATUS PxeDbGetStatus; PXE_DB_GET_STATUS PxeDbGetStatus;
@ -90,5 +90,3 @@ SnpWaitForPacketNotify (
gBS->SignalEvent (Event); gBS->SignalEvent (Event);
} }
} }
/* eof - WaitForPacket.c */