pub trait RxDescriptor: FromBytes {
    // Required methods
    fn init(&mut self, packet_buffer_address: PhysicalAddress);
    fn set_packet_address(&mut self, packet_buffer_address: PhysicalAddress);
    fn reset_status(&mut self);
    fn descriptor_done(&self) -> bool;
    fn end_of_packet(&self) -> bool;
    fn length(&self) -> u64;
}
Expand description

A trait for the minimum set of functions needed to receive a packet using one of Intel’s receive descriptor types. Receive descriptors contain the physical address where an incoming packet should be stored by the NIC, as well as bits that are updated by the HW once the packet is received. There is one receive descriptor per receive buffer. Receive functions defined in the Network_Interface_Card crate expect a receive descriptor to implement this trait.

Required Methods§

source

fn init(&mut self, packet_buffer_address: PhysicalAddress)

Initializes a receive descriptor by clearing its status and setting the descriptor’s physical address.

Arguments
  • packet_buffer_address: starting physical address of the receive buffer.
source

fn set_packet_address(&mut self, packet_buffer_address: PhysicalAddress)

Updates the descriptor’s physical address.

Arguments
  • packet_buffer_address: starting physical address of the receive buffer.
source

fn reset_status(&mut self)

Clears the status bits of the descriptor.

source

fn descriptor_done(&self) -> bool

Returns true if the descriptor has a received packet copied to its buffer.

source

fn end_of_packet(&self) -> bool

Returns true if the descriptor’s packet buffer is the last in a frame.

source

fn length(&self) -> u64

The length of the packet in the descriptor’s packet buffer.

Implementors§