sync comments, fix function header, rename variable name to follow coding style.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6481 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -24,41 +24,41 @@ Revision history:
|
||||
/**
|
||||
This routine calls 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
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
pxe_reset (
|
||||
SNP_DRIVER *snp
|
||||
PxeReset (
|
||||
SNP_DRIVER *Snp
|
||||
)
|
||||
{
|
||||
snp->cdb.OpCode = PXE_OPCODE_RESET;
|
||||
snp->cdb.OpFlags = PXE_OPFLAGS_NOT_USED;
|
||||
snp->cdb.CPBsize = PXE_CPBSIZE_NOT_USED;
|
||||
snp->cdb.DBsize = PXE_DBSIZE_NOT_USED;
|
||||
snp->cdb.CPBaddr = PXE_CPBADDR_NOT_USED;
|
||||
snp->cdb.DBaddr = PXE_DBADDR_NOT_USED;
|
||||
snp->cdb.StatCode = PXE_STATCODE_INITIALIZE;
|
||||
snp->cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
|
||||
snp->cdb.IFnum = snp->if_num;
|
||||
snp->cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
|
||||
Snp->Cdb.OpCode = PXE_OPCODE_RESET;
|
||||
Snp->Cdb.OpFlags = PXE_OPFLAGS_NOT_USED;
|
||||
Snp->Cdb.CPBsize = PXE_CPBSIZE_NOT_USED;
|
||||
Snp->Cdb.DBsize = PXE_DBSIZE_NOT_USED;
|
||||
Snp->Cdb.CPBaddr = PXE_CPBADDR_NOT_USED;
|
||||
Snp->Cdb.DBaddr = PXE_DBADDR_NOT_USED;
|
||||
Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
|
||||
Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
|
||||
Snp->Cdb.IFnum = Snp->IfNum;
|
||||
Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
|
||||
|
||||
//
|
||||
// Issue UNDI command and check result.
|
||||
//
|
||||
DEBUG ((EFI_D_NET, "\nsnp->undi.reset() "));
|
||||
|
||||
(*snp->issue_undi32_command) ((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_WARN,
|
||||
"\nsnp->undi32.reset() %xh:%xh\n",
|
||||
snp->cdb.StatFlags,
|
||||
snp->cdb.StatCode)
|
||||
Snp->Cdb.StatFlags,
|
||||
Snp->Cdb.StatCode)
|
||||
);
|
||||
|
||||
//
|
||||
@@ -72,23 +72,37 @@ pxe_reset (
|
||||
|
||||
|
||||
/**
|
||||
This is the SNP interface routine for resetting the NIC
|
||||
This routine basically retrieves snp structure, checks the SNP state and
|
||||
calls the pxe_reset routine to actually do the reset!
|
||||
Resets a network adapter and reinitializes it with the parameters that were
|
||||
provided in the previous call to Initialize().
|
||||
|
||||
@param this context pointer
|
||||
@param ExtendedVerification not implemented
|
||||
This function resets a network adapter and reinitializes it with the parameters
|
||||
that were provided in the previous call to Initialize(). The transmit and
|
||||
receive queues are emptied and all pending interrupts are cleared.
|
||||
Receive filters, the station address, the statistics, and the multicast-IP-to-HW
|
||||
MAC addresses are not reset by this call. If the network interface was
|
||||
successfully reset, then EFI_SUCCESS will be returned. If the driver has not
|
||||
been initialized, EFI_DEVICE_ERROR will be returned.
|
||||
|
||||
@param This A pointer to the EFI_SIMPLE_NETWORK_PROTOCOL instance.
|
||||
@param ExtendedVerification Indicates that the driver may perform a more
|
||||
exhaustive verification operation of the device
|
||||
during reset.
|
||||
|
||||
@retval EFI_SUCCESS The network interface was reset.
|
||||
@retval EFI_NOT_STARTED The network interface has not been started.
|
||||
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
|
||||
@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
|
||||
EFIAPI
|
||||
snp_undi32_reset (
|
||||
IN EFI_SIMPLE_NETWORK_PROTOCOL *this,
|
||||
SnpUndi32Reset (
|
||||
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
)
|
||||
{
|
||||
SNP_DRIVER *snp;
|
||||
SNP_DRIVER *Snp;
|
||||
EFI_TPL OldTpl;
|
||||
EFI_STATUS Status;
|
||||
|
||||
@@ -98,15 +112,15 @@ snp_undi32_reset (
|
||||
ExtendedVerification = 0;
|
||||
DEBUG ((EFI_D_WARN, "ExtendedVerification = %d is not implemented!\n", ExtendedVerification));
|
||||
|
||||
if (this == NULL) {
|
||||
if (This == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (this);
|
||||
Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
|
||||
|
||||
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
|
||||
|
||||
switch (snp->mode.State) {
|
||||
switch (Snp->Mode.State) {
|
||||
case EfiSimpleNetworkInitialized:
|
||||
break;
|
||||
|
||||
@@ -119,7 +133,7 @@ snp_undi32_reset (
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
Status = pxe_reset (snp);
|
||||
Status = PxeReset (Snp);
|
||||
|
||||
ON_EXIT:
|
||||
gBS->RestoreTPL (OldTpl);
|
||||
|
Reference in New Issue
Block a user