pub struct TxDescriptor { /* private fields */ }Expand description
TX DMA descriptor — enhanced 8-word layout (32 bytes).
The ESP32 GMAC requires the enhanced descriptor format when
DMABUSMODE.ATDS = 1 (which is what the IDF / ph-esp32-mac driver
runs with). Reserved fields below are written by the DMA but unused
by the CPU; they exist purely so the descriptor stride is 32 bytes
and the DMA does not stomp adjacent descriptors when chained.
Implementations§
Source§impl TxDescriptor
impl TxDescriptor
Sourcepub fn setup_chained(&self, buffer: *const u8, next_desc: *const TxDescriptor)
pub fn setup_chained(&self, buffer: *const u8, next_desc: *const TxDescriptor)
Initialize descriptor for chained mode.
Sets the buffer pointer, next-descriptor pointer, and the
SECOND_ADDR_CHAINED flag. The descriptor is left CPU-owned.
Sourcepub fn clear_owned(&self)
pub fn clear_owned(&self)
Take ownership from DMA.
Sourcepub fn prepare(&self, len: usize, first: bool, last: bool)
pub fn prepare(&self, len: usize, first: bool, last: bool)
Prepare descriptor for transmission with segment flags.
Sets the buffer length and first/last segment flags.
Does not set the OWN bit — call set_owned
afterwards to submit to DMA.
CIC (Checksum Insertion Control) is always set to 0b11 (bits 23:22), which instructs the MAC to insert the IPv4 header checksum and the TCP/UDP/ICMP payload checksum including the pseudo-header. For non-IPv4 frames the MAC ignores the CIC field, so setting it unconditionally is safe.
Sourcepub fn prepare_and_submit(&self, len: usize, first: bool, last: bool)
pub fn prepare_and_submit(&self, len: usize, first: bool, last: bool)
Prepare and submit to DMA in one operation.
Sourcepub fn error_flags(&self) -> u32
pub fn error_flags(&self) -> u32
Get all error flags from TDES0.
Sourcepub fn buffer_addr(&self) -> u32
pub fn buffer_addr(&self) -> u32
Get buffer address (TDES2).
Sourcepub fn next_desc_addr(&self) -> u32
pub fn next_desc_addr(&self) -> u32
Get next descriptor address (TDES3, chained mode).