26 UINT16 CableDetectFlag
36 if (Snp->TxRxBufferSize != 0) {
37 Status = Snp->PciIo->AllocateBuffer (
41 SNP_MEM_PAGES (Snp->TxRxBufferSize),
49 "\nSnp->PxeInit() AllocateBuffer %xh (%r)\n",
59 Snp->TxRxBuffer = Addr;
77 Cpb->LoopBackMode = LOOPBACK_NORMAL;
80 Snp->Cdb.OpFlags = CableDetectFlag;
85 Snp->Cdb.CPBaddr = (UINT64)(
UINTN)Snp->Cpb;
86 Snp->Cdb.DBaddr = (UINT64)(
UINTN)Snp->Db;
88 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
89 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
90 Snp->Cdb.IFnum = Snp->IfNum;
91 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
93 DEBUG ((DEBUG_NET,
"\nSnp->undi.initialize() "));
95 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
112 if (CableDetectFlag == PXE_OPFLAGS_INITIALIZE_DETECT_CABLE) {
120 Snp->Mode.
State = EfiSimpleNetworkInitialized;
125 "\nSnp->undi.initialize() %xh:%xh\n",
130 if (Snp->TxRxBuffer !=
NULL) {
131 Snp->PciIo->FreeBuffer (
133 SNP_MEM_PAGES (Snp->TxRxBufferSize),
134 (VOID *)Snp->TxRxBuffer
138 Snp->TxRxBuffer =
NULL;
140 Status = EFI_DEVICE_ERROR;
183 IN UINTN ExtraRxBufferSize OPTIONAL,
184 IN UINTN ExtraTxBufferSize OPTIONAL
192 return EFI_INVALID_PARAMETER;
195 Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
197 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
200 EfiStatus = EFI_INVALID_PARAMETER;
204 switch (Snp->Mode.
State) {
205 case EfiSimpleNetworkStarted:
208 case EfiSimpleNetworkStopped:
209 EfiStatus = EFI_NOT_STARTED;
213 EfiStatus = EFI_DEVICE_ERROR;
217 EfiStatus =
gBS->CreateEvent (
225 if (EFI_ERROR (EfiStatus)) {
227 EfiStatus = EFI_DEVICE_ERROR;
246 Snp->TxRxBufferSize = (UINT32)(Snp->InitInfo.
MemoryRequired + ExtraRxBufferSize + ExtraTxBufferSize);
251 if (Snp->CableDetectSupported) {
259 EfiStatus =
PxeInit (Snp, PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE);
261 if (EFI_ERROR (EfiStatus)) {
269 if (Snp->MediaStatusSupported) {
274 gBS->RestoreTPL (OldTpl);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS PxeGetStatus(IN SNP_DRIVER *Snp, OUT UINT32 *InterruptStatusPtr, IN BOOLEAN GetTransmittedBuf)
#define DEBUG(Expression)
EFI_STATUS PxeInit(SNP_DRIVER *Snp, UINT16 CableDetectFlag)
EFI_STATUS EFIAPI SnpUndi32Initialize(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONAL)
VOID EFIAPI SnpWaitForPacketNotify(EFI_EVENT Event, VOID *SnpPtr)
#define PXE_STATFLAGS_STATUS_MASK
#define PXE_OPCODE_INITIALIZE
#define PXE_STATFLAGS_INITIALIZED_NO_MEDIA
#define PXE_STATCODE_SUCCESS
EFI_MAC_ADDRESS CurrentAddress
EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT]
EFI_MAC_ADDRESS PermanentAddress
UINT32 ReceiveFilterSetting
PXE_UINT32 MemoryRequired