2 Copyright (c) 2004 - 2007, Intel Corporation
3 All rights reserved. This program and the accompanying materials
4 are licensed and made available under the terms and conditions of the BSD License
5 which accompanies this distribution. The full text of the license may be found at
6 http://opensource.org/licenses/bsd-license.php
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 2000-Feb-09 M(f)J Genesis.
25 This routine calls undi to reset the nic.
27 @param snp pointer to the snp driver structure
29 @return EFI_SUCCESSFUL for a successful completion
30 @return other for failed calls
38 snp
->cdb
.OpCode
= PXE_OPCODE_RESET
;
39 snp
->cdb
.OpFlags
= PXE_OPFLAGS_NOT_USED
;
40 snp
->cdb
.CPBsize
= PXE_CPBSIZE_NOT_USED
;
41 snp
->cdb
.DBsize
= PXE_DBSIZE_NOT_USED
;
42 snp
->cdb
.CPBaddr
= PXE_CPBADDR_NOT_USED
;
43 snp
->cdb
.DBaddr
= PXE_DBADDR_NOT_USED
;
44 snp
->cdb
.StatCode
= PXE_STATCODE_INITIALIZE
;
45 snp
->cdb
.StatFlags
= PXE_STATFLAGS_INITIALIZE
;
46 snp
->cdb
.IFnum
= snp
->if_num
;
47 snp
->cdb
.Control
= PXE_CONTROL_LAST_CDB_IN_LIST
;
50 // Issue UNDI command and check result.
52 DEBUG ((EFI_D_NET
, "\nsnp->undi.reset() "));
54 (*snp
->issue_undi32_command
) ((UINT64
)(UINTN
) &snp
->cdb
);
56 if (snp
->cdb
.StatCode
!= PXE_STATCODE_SUCCESS
) {
59 "\nsnp->undi32.reset() %xh:%xh\n",
65 // UNDI could not be reset. Return UNDI error.
67 return EFI_DEVICE_ERROR
;
75 This is the SNP interface routine for resetting the NIC
76 This routine basically retrieves snp structure, checks the SNP state and
77 calls the pxe_reset routine to actually do the reset!
79 @param this context pointer
80 @param ExtendedVerification not implemented
87 IN EFI_SIMPLE_NETWORK_PROTOCOL
*this,
88 IN BOOLEAN ExtendedVerification
96 // Resolve Warning 4 unreferenced parameter problem
98 ExtendedVerification
= 0;
99 DEBUG ((EFI_D_WARN
, "ExtendedVerification = %d is not implemented!\n", ExtendedVerification
));
102 return EFI_INVALID_PARAMETER
;
105 snp
= EFI_SIMPLE_NETWORK_DEV_FROM_THIS (this);
107 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
109 switch (snp
->mode
.State
) {
110 case EfiSimpleNetworkInitialized
:
113 case EfiSimpleNetworkStopped
:
114 Status
= EFI_NOT_STARTED
;
118 Status
= EFI_DEVICE_ERROR
;
122 Status
= pxe_reset (snp
);
125 gBS
->RestoreTPL (OldTpl
);