Struct driver_virtio::VirtIoNetDev
source · pub struct VirtIoNetDev<'a, H: Hal, T: Transport, const QS: usize> { /* private fields */ }
Available on crate feature
net
only.Expand description
The VirtIO network device driver.
QS
is the VirtIO queue size.
Implementations§
Trait Implementations§
source§impl<H: Hal, T: Transport, const QS: usize> BaseDriverOps for VirtIoNetDev<'_, H, T, QS>
impl<H: Hal, T: Transport, const QS: usize> BaseDriverOps for VirtIoNetDev<'_, H, T, QS>
source§fn device_name(&self) -> &str
fn device_name(&self) -> &str
The name of the device.
source§fn device_type(&self) -> DeviceType
fn device_type(&self) -> DeviceType
The type of the device.
source§fn get_irq_num(&self) -> Option<usize>
fn get_irq_num(&self) -> Option<usize>
Get the interrupt number.
Only interrupt drivers need to implement this function.
source§fn ack_interrupt(&mut self) -> bool
fn ack_interrupt(&mut self) -> bool
Ack the interrupt.
Only interrupt drivers need to implement this function.
source§impl<'a, H: Hal, T: Transport, const QS: usize> NetDriverOps<'a> for VirtIoNetDev<'a, H, T, QS>
impl<'a, H: Hal, T: Transport, const QS: usize> NetDriverOps<'a> for VirtIoNetDev<'a, H, T, QS>
source§fn mac_address(&self) -> EthernetAddress
fn mac_address(&self) -> EthernetAddress
The ethernet address of the NIC.
source§fn can_transmit(&self) -> bool
fn can_transmit(&self) -> bool
Whether can transmit packets.
source§fn can_receive(&self) -> bool
fn can_receive(&self) -> bool
Whether can receive packets.
source§fn rx_queue_size(&self) -> usize
fn rx_queue_size(&self) -> usize
Size of the receive queue.
source§fn tx_queue_size(&self) -> usize
fn tx_queue_size(&self) -> usize
Size of the transmit queue.
source§fn fill_rx_buffers(&mut self, buf_pool: &'a NetBufferPool) -> DevResult
fn fill_rx_buffers(&mut self, buf_pool: &'a NetBufferPool) -> DevResult
Fills the receive queue with buffers. Read more
source§fn prepare_tx_buffer(
&self,
tx_buf: &mut NetBuffer<'_>,
pkt_len: usize
) -> DevResult
fn prepare_tx_buffer( &self, tx_buf: &mut NetBuffer<'_>, pkt_len: usize ) -> DevResult
Prepares a buffer for transmitting. Read more
source§fn recycle_rx_buffer(&mut self, rx_buf: NetBufferBox<'a>) -> DevResult
fn recycle_rx_buffer(&mut self, rx_buf: NetBufferBox<'a>) -> DevResult
Gives back the
rx_buf
to the receive queue for later receiving. Read moreimpl<H: Hal, T: Transport, const QS: usize> Send for VirtIoNetDev<'_, H, T, QS>
impl<H: Hal, T: Transport, const QS: usize> Sync for VirtIoNetDev<'_, H, T, QS>
Auto Trait Implementations§
impl<'a, H, T, const QS: usize> !RefUnwindSafe for VirtIoNetDev<'a, H, T, QS>
impl<'a, H, T, const QS: usize> Unpin for VirtIoNetDev<'a, H, T, QS>where H: Unpin, T: Unpin,
impl<'a, H, T, const QS: usize> !UnwindSafe for VirtIoNetDev<'a, H, T, QS>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more