1.2.5.2.6 TCPIP_MAC_DATA_SEGMENT Structure

C

typedef struct _tag_MAC_DATA_SEGMENT {
struct _tag_MAC_DATA_SEGMENT* next;
uint8_t* segLoad;
uint16_t segLen;
uint16_t segSize;
uint16_t segFlags;
uint16_t segLoadOffset;
uint16_t segAllocSize;
uint8_t segClientData[2];
} TCPIP_MAC_DATA_SEGMENT;

Description

TCPIP MAC Data Segment.

Structure of a segment buffer transferred with the MAC. A MAC TX or RX packet can consist of multiple data segments. On TX the MAC has to be able to transmit packets that span multiple data segments. On RX of a network frame the MAC may have to use multiple segments to construct a packet. (For performance reasons, a contiguous MAC packet, with just one segment, if possible, is preferred).

Members

MembersDescription
nextMulti-segment support, next segment in the chain.
segLoadPointer to segment data payload Points to TCPIP_MAC_SEGMENT_PAYLOAD::segmentPayload. It specifies the address of the 1st payload byte. If the processor has cache, then it is always cache line size aligned. Otherwise is 32 bits aligned.
segLenSegment payload size; TX: Number of bytes from this segment that has to be transmitted. This is the total number of bytes including the Ethernet header but not the FCS (that should be added by the driver) RX: Number of payload bytes in the segment. The MAC driver subtracts the FCS and Ethernet header length before handing over the packet to the stack. Then the segLen field is updated by each stack layer in turn.
segSizeSegment allocated total usable size. This does not include the segLoadOffset (see below).
segFlagsTCPIP_MAC_SEGMENT_FLAGS segment flags: TCPIP_MAC_SEG_FLAG_STATIC, TCPIP_MAC_SEG_FLAG_RX, TCPIP_MAC_SEG_FLAG_RX, TCPIP_MAC_SEG_FLAG_RX_STICKY.
segLoadOffsetOffset in bytes between the address pointed by segLoad and the address where the segment buffer starts/was allocated. It specifies the gap space at the beginning of the TCPIP_MAC_SEGMENT_PAYLOAD before the segmentPayload begins. segLoadOffset == sizeof(TCPIP_MAC_SEGMENT_PAYLOAD::segmentPktPtr) + sizeof(TCPIP_MAC_SEGMENT_PAYLOAD::segmentDataGap). This currently is greater or equal than 8 bytes depending on the MAC drivers that are part of the build! See TCPIP_MAC_DATA_SEGMENT. For implementations that may work outside the Harmony TCP/IP stack it is up to the MAC to check that the value of this offset is enforced.
segAllocSizeThe size this segment payload allocation. Debug/trace purposes.
segClientData[2]Additional client segment data. Ignored by the MAC driver.

Remarks

See notes for the segLoadOffset member. On 32-bit machines, the segment payload is allocated so that it is always cache line size aligned and its size is 32-bits multiple.

Structures

NameDescription
_tag_MAC_DATA_SEGMENTA data segment that's part of a TX/RX packet.