39 Snp->Cdb.OpFlags = PXE_OPFLAGS_NVDATA_READ;
45 Snp->Cdb.DBaddr = (UINT64)(
UINTN)Db;
47 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
48 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
49 Snp->Cdb.IFnum = Snp->IfNum;
50 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
55 DEBUG ((DEBUG_NET,
"\nsnp->undi.nvdata () "));
57 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
59 switch (Snp->Cdb.StatCode) {
63 case PXE_STATCODE_UNSUPPORTED:
66 "\nsnp->undi.nvdata() %xh:%xh\n",
71 return EFI_UNSUPPORTED;
76 "\nsnp->undi.nvdata() %xh:%xh\n",
81 return EFI_DEVICE_ERROR;
84 ASSERT (Offset <
sizeof (Db->
Data));
146 IN BOOLEAN ReadWrite,
160 return EFI_INVALID_PARAMETER;
163 Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
165 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
170 switch (Snp->Mode.
State) {
171 case EfiSimpleNetworkInitialized:
174 case EfiSimpleNetworkStopped:
175 Status = EFI_NOT_STARTED;
179 Status = EFI_DEVICE_ERROR;
187 Status = EFI_UNSUPPORTED;
194 if ((BufferSize == 0) ||
197 (Offset + BufferSize > Snp->Mode.
NvRamSize) ||
202 Status = EFI_INVALID_PARAMETER;
210 Status = EFI_UNSUPPORTED;
216 gBS->RestoreTPL (OldTpl);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define DEBUG(Expression)
EFI_STATUS EFIAPI SnpUndi32NvData(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, IN BOOLEAN ReadWrite, IN UINTN Offset, IN UINTN BufferSize, IN OUT VOID *Buffer)
EFI_STATUS PxeNvDataRead(IN SNP_DRIVER *Snp, IN UINTN Offset, IN UINTN BufferSize, IN OUT VOID *Buffer)
#define PXE_CPBSIZE_NOT_USED
zero
#define PXE_CPBADDR_NOT_USED
zero
#define PXE_OPCODE_NVDATA
#define PXE_STATCODE_SUCCESS
union s_pxe_db_nvdata::@1059 Data
PXE_UINT8 Byte[MAX_EEPROM_LEN<< 2]