Struct driver_virtio::VirtIoNetDev
source · pub struct VirtIoNetDev<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§impl<H: Hal, T: Transport, const QS: usize> NetDriverOps for VirtIoNetDev<H, T, QS>
impl<H: Hal, T: Transport, const QS: usize> NetDriverOps for VirtIoNetDev<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 recycle_rx_buffer(&mut self, rx_buf: NetBufPtr) -> DevResult
fn recycle_rx_buffer(&mut self, rx_buf: NetBufPtr) -> DevResult
Gives back the
rx_buf
to the receive queue for later receiving. Read moresource§fn recycle_tx_buffers(&mut self) -> DevResult
fn recycle_tx_buffers(&mut self) -> DevResult
Poll the transmit queue and gives back the buffers for previous transmiting.
returns
DevResult
.source§fn transmit(&mut self, tx_buf: NetBufPtr) -> DevResult
fn transmit(&mut self, tx_buf: NetBufPtr) -> DevResult
Transmits a packet in the buffer to the network, without blocking,
returns
DevResult
.impl<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<H, T, const QS: usize> !RefUnwindSafe for VirtIoNetDev<H, T, QS>
impl<H, T, const QS: usize> Unpin for VirtIoNetDev<H, T, QS>
impl<H, T, const QS: usize> !UnwindSafe for VirtIoNetDev<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