54 BuffSize = *BufferSize;
62 Snp->Cdb.OpFlags = PXE_OPFLAGS_NOT_USED;
65 Snp->Cdb.CPBaddr = (UINT64)(
UINTN)Cpb;
68 Snp->Cdb.DBaddr = (UINT64)(
UINTN)Db;
70 Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
71 Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
72 Snp->Cdb.IFnum = Snp->IfNum;
73 Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
78 DEBUG ((DEBUG_NET,
"\nsnp->undi.receive () "));
80 (*Snp->IssueUndi32Command)((UINT64)(
UINTN)&Snp->Cdb);
82 switch (Snp->Cdb.StatCode) {
86 case PXE_STATCODE_NO_DATA:
89 "\nsnp->undi.receive () %xh:%xh\n",
99 "\nsnp->undi.receive() %xh:%xh\n",
104 return EFI_DEVICE_ERROR;
109 if (HeaderSize !=
NULL) {
113 if (SrcAddr !=
NULL) {
117 if (DestAddr !=
NULL) {
121 if (Protocol !=
NULL) {
125 *Protocol = (UINT16)PXE_SWAP_UINT16 (Db->
Protocol);
138 return (*BufferSize <= BuffSize) ?
EFI_SUCCESS : EFI_BUFFER_TOO_SMALL;
198 OUT UINT16 *Protocol OPTIONAL
206 return EFI_INVALID_PARAMETER;
209 Snp = EFI_SIMPLE_NETWORK_DEV_FROM_THIS (This);
211 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
213 switch (Snp->Mode.
State) {
214 case EfiSimpleNetworkInitialized:
217 case EfiSimpleNetworkStopped:
218 Status = EFI_NOT_STARTED;
222 Status = EFI_DEVICE_ERROR;
226 if ((BufferSize ==
NULL) || (Buffer ==
NULL)) {
227 Status = EFI_INVALID_PARAMETER;
232 Status = EFI_DEVICE_ERROR;
247 gBS->RestoreTPL (OldTpl);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
#define DEBUG(Expression)
EFI_STATUS PxeReceive(SNP_DRIVER *Snp, VOID *Buffer, UINTN *BufferSize, UINTN *HeaderSize, EFI_MAC_ADDRESS *SrcAddr, EFI_MAC_ADDRESS *DestAddr, UINT16 *Protocol)
EFI_STATUS EFIAPI SnpUndi32Receive(IN EFI_SIMPLE_NETWORK_PROTOCOL *This, OUT UINTN *HeaderSize OPTIONAL, IN OUT UINTN *BufferSize, OUT VOID *Buffer, OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL, OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL)
#define PXE_OPCODE_RECEIVE
#define PXE_STATCODE_SUCCESS
BOOLEAN MediaPresentSupported
UINT32 ReceiveFilterSetting
PXE_UINT16 MediaHeaderLen
PXE_MEDIA_PROTOCOL Protocol