Programming Examples
8-128
ADSP-BF537 Blackfin Processor Hardware Reference
Listing 8-4. Ethernet Frame Buffer
typedef struct adi_ether_frame_buffer {
u16
NoBytes;
/* the no. of following bytes */
u8
Dest[6];
/* destination MAC address */
u8
Srce[6];
/* source MAC address */
u16
LTfield;
/* length/type field */
u8
Data[0];
/* payload bytes */
} ADI_ETHER_FRAME_BUFFER;
The
ADI_ETHER_BUFFER
structure in
, Top Level Structure, cov-
ers all the above structures and shows the general framework as described
in
and
. The two Dma[2]
structures are needed for descriptors 1A,1B and 2A,2B. The pointer
*frmData
represents the payload of the frame, which has a specific number
of bytes (as dictated by the NoBytes structure member). This is relevant
only in transmit mode—in receive mode the driver will not touch this
NoBytes variable. To ease programming by keeping the transmit and
receive structures the same, the MAC can pad the first 16-bit word (that
is, the data corresponding to the NoBytes structure member) with zeros if
the
RXDWA
bit in
EMAC_SYSCTL
is 1. The
*pNext
and
*pPrev
pointers are
necessary for creating a “linked list.” The
IPHdrChksum
and
IPPayloadChk-
sum
are available in case the Ethernet MAC is set to calculate this. See the
RXCKS
bit in the
EMAC_SYSCTL
register (shown in
). These two variables are relevant only in receive mode of the
Ethernet MAC. The
StatusWord
variable holds the
EMAC_RX_STAT
register
value in receive mode and holds the
EMAC_TX_STAT
register value in trans-
mit mode.
Listing 8-5. Top Level Structure
typedef struct adi_ether_buffer {
DMA_DESCRIPTOR
Dma[2];
/* first for the frame, second for the
status */
ADI_ETHER_FRAME_BUFFER
*FrmData;
/* pointer to data */
Summary of Contents for Blackfin ADSP-BF537
Page 42: ...Contents xlii ADSP BF537 Blackfin Processor Hardware Reference ...
Page 90: ...Development Tools 1 32 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 138: ...Programming Examples 4 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 340: ...SDC Programming Examples 6 84 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 606: ...Programming Examples 9 94 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 660: ...Programming Examples 10 54 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 720: ...Electrical Specifications 11 60 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 840: ...Programming Examples 13 42 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 876: ...Programming Examples 14 36 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 938: ...Programming Examples 15 62 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 958: ...Programming Examples 17 12 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 986: ...Programming Examples 18 28 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1162: ...G 26 ADSP BF537 Blackfin Processor Hardware Reference ...
Page 1218: ...Index I 56 ADSP BF537 Blackfin Processor Hardware Reference ...