beautypg.com

E.4.19 receive, E.4.19.1 issuing the command – Intel Extensible Firmware Interface User Manual

Page 955

background image

32/64-Bit UNDI Specification

Version 1.10

12/01/02

E-89

E.4.19 Receive

When the network adapter has received a frame, this command is used to copy the frame into
driver/application storage. Once a frame has been copied, it is removed from the receive queue.

E.4.19.1

Issuing the Command

To issue a Receive command, create a CDB and fill it in as shown in the table below:

CDB Field

How to initialize the CDB structure for a Receive command

OpCode

PXE_OPCODE_RECEIVE

OpFlags

Set as needed.

CPBsize

sizeof(PXE_CPB_RECEIVE)

DBsize

sizeof(PXE_DB_RECEIVE)

CPBaddr

Address of a

PXE_CPB_RECEIVE

structure.

DBaddr

Address of a

PXE_DB_RECEIVE

structure.

StatCode

PXE_STATCODE_INITIALIZE

StatFlags

PXE_STATFLAGS_INITIALIZE

IFnum

A valid interface number from zero to

!PXE.IFcnt

.

Control

Set as needed.

Preparing the CPB

If multiple frames per command are supported (see

!PXE.Implementation

flags), multiple

CPBs can be packed together. For each complete received frame, a receive buffer large enough to
contain the entire unfragmented frame needs to be described in the CPB. Note that if a smaller than
required buffer is provided, only a portion of the packet is received into the buffer, and the
remainder of the packet is lost. Subsequent attempts to receive the same packet with a corrected
(larger) buffer will be unsuccessful, because the packet will have been flushed from the queue.

#pragma pack(1)
typedef struct s_pxe_cpb_receive {

// Address of first byte of receive buffer. This is also the
// first byte of the frame header. This address must be a
// processor-based address for S/W UNDI and a device-based
// address for H/W UNDI.

PXE_UINT64

BufferAddr;

// Length of receive buffer. This must be large enough to hold
// the received frame (media header + data). If the length of
// smaller than the received frame, data will be lost.

PXE_UINT32

BufferLen;

// Reserved, must be set to zero.

PXE_UINT32

reserved;

} PXE_CPB_RECEIVE;

#pragma pack()