X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FSnpDxe%2FReset.c;h=f616d43584ccbf974ee5999f31f1a06a8c141ae8;hp=cc869eb3201cc2d39e3b3b43e7168ff592e306c8;hb=4cda7726e5fd30aaf3e05c80207ae1b264bfa123;hpb=a7e0614aaff7dc8096d80819b622226e87b2f6aa diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Reset.c b/MdeModulePkg/Universal/Network/SnpDxe/Reset.c index cc869eb320..f616d43584 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Reset.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Reset.c @@ -24,42 +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 **/ -STATIC 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) ); // @@ -73,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! - - @param this context pointer - @param ExtendedVerification not implemented - + Resets a network adapter and reinitializes it with the parameters that were + provided in the previous call to Initialize(). + + 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; @@ -99,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; @@ -120,7 +133,7 @@ snp_undi32_reset ( goto ON_EXIT; } - Status = pxe_reset (snp); + Status = PxeReset (Snp); ON_EXIT: gBS->RestoreTPL (OldTpl);