Struct nic_queues::TxQueue

source ·
pub struct TxQueue<S: TxQueueRegisters, T: TxDescriptor> {
    pub id: u8,
    pub regs: S,
    pub tx_descs: BorrowedSliceMappedPages<T, Mutable>,
    pub num_tx_descs: u16,
    pub tx_cur: u16,
    pub cpu_id: Option<CpuId>,
}
Expand description

A struct that holds all information for a transmit queue. There should be one such object per queue.

Fields§

§id: u8

The number of the queue, stored here for our convenience.

§regs: S

Registers for this transmit queue

§tx_descs: BorrowedSliceMappedPages<T, Mutable>

Transmit descriptors

§num_tx_descs: u16

The number of transmit descriptors in the descriptor ring

§tx_cur: u16

Current transmit descriptor index

§cpu_id: Option<CpuId>

The cpu which this queue is mapped to. This in itself doesn’t guarantee anything but we use this value when setting the cpu id for interrupts and DCA.

Implementations§

source§

impl<S: TxQueueRegisters, T: TxDescriptor> TxQueue<S, T>

source

pub fn send_on_queue(&mut self, transmit_buffer: TransmitBuffer)

Sends a packet on the transmit queue

Arguments:
  • transmit_buffer: buffer containing the packet to be sent

Auto Trait Implementations§

§

impl<S, T> RefUnwindSafe for TxQueue<S, T>where S: RefUnwindSafe, T: RefUnwindSafe,

§

impl<S, T> Send for TxQueue<S, T>where S: Send, T: Send,

§

impl<S, T> Sync for TxQueue<S, T>where S: Sync, T: Sync,

§

impl<S, T> Unpin for TxQueue<S, T>where S: Unpin, T: Unpin,

§

impl<S, T> UnwindSafe for TxQueue<S, T>where S: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.