Trait intel_ethernet::descriptors::TxDescriptor
source · pub trait TxDescriptor: FromBytes {
// Required methods
fn init(&mut self);
fn send(
&mut self,
transmit_buffer_addr: PhysicalAddress,
transmit_buffer_length: u16
);
fn wait_for_packet_tx(&self);
}
Expand description
A trait for the minimum set of functions needed to transmit a packet using one of Intel’s transmit descriptor types. Transmit descriptors contain the physical address where an outgoing packet is stored, as well as bits that are updated by the HW once the packet is sent. There is one transmit descriptor per transmit buffer. Transmit functions defined in the Network_Interface_Card crate expect a transmit descriptor to implement this trait.
Required Methods§
sourcefn send(
&mut self,
transmit_buffer_addr: PhysicalAddress,
transmit_buffer_length: u16
)
fn send( &mut self, transmit_buffer_addr: PhysicalAddress, transmit_buffer_length: u16 )
Updates the transmit descriptor to send the packet. We assume that one transmit descriptor will be used to send one packet.
Arguments
transmit_buffer_addr
: physical address of the transmit buffer.transmit_buffer_length
: length of packet we want to send.
sourcefn wait_for_packet_tx(&self)
fn wait_for_packet_tx(&self)
Polls the Descriptor Done bit until the packet has been sent.