pub enum SomeTransport {
Mmio(MmioTransport),
Pci(PciTransport),
}Expand description
A wrapper for an arbitrary VirtIO transport, either MMIO or PCI.
Variants§
Trait Implementations§
Source§impl Debug for SomeTransport
impl Debug for SomeTransport
Source§impl From<MmioTransport> for SomeTransport
impl From<MmioTransport> for SomeTransport
Source§fn from(mmio: MmioTransport) -> Self
fn from(mmio: MmioTransport) -> Self
Converts to this type from the input type.
Source§impl From<PciTransport> for SomeTransport
impl From<PciTransport> for SomeTransport
Source§fn from(pci: PciTransport) -> Self
fn from(pci: PciTransport) -> Self
Converts to this type from the input type.
Source§impl Transport for SomeTransport
impl Transport for SomeTransport
Source§fn device_type(&self) -> DeviceType
fn device_type(&self) -> DeviceType
Gets the device type.
Source§fn read_device_features(&mut self) -> u64
fn read_device_features(&mut self) -> u64
Reads device features.
Source§fn write_driver_features(&mut self, driver_features: u64)
fn write_driver_features(&mut self, driver_features: u64)
Writes device features.
Source§fn max_queue_size(&mut self, queue: u16) -> u32
fn max_queue_size(&mut self, queue: u16) -> u32
Gets the max size of the given queue.
Source§fn get_status(&self) -> DeviceStatus
fn get_status(&self) -> DeviceStatus
Gets the device status.
Source§fn set_status(&mut self, status: DeviceStatus)
fn set_status(&mut self, status: DeviceStatus)
Sets the device status.
Source§fn set_guest_page_size(&mut self, guest_page_size: u32)
fn set_guest_page_size(&mut self, guest_page_size: u32)
Sets the guest page size.
Source§fn requires_legacy_layout(&self) -> bool
fn requires_legacy_layout(&self) -> bool
Returns whether the transport requires queues to use the legacy layout. Read more
Source§fn queue_set(
&mut self,
queue: u16,
size: u32,
descriptors: PhysAddr,
driver_area: PhysAddr,
device_area: PhysAddr,
)
fn queue_set( &mut self, queue: u16, size: u32, descriptors: PhysAddr, driver_area: PhysAddr, device_area: PhysAddr, )
Sets up the given queue.
Source§fn queue_unset(&mut self, queue: u16)
fn queue_unset(&mut self, queue: u16)
Disables and resets the given queue.
Source§fn queue_used(&mut self, queue: u16) -> bool
fn queue_used(&mut self, queue: u16) -> bool
Returns whether the queue is in use, i.e. has a nonzero PFN or is marked as ready.
Source§fn ack_interrupt(&mut self) -> bool
fn ack_interrupt(&mut self) -> bool
Acknowledges an interrupt. Read more
Source§fn read_config_space<T: FromBytes>(&self, offset: usize) -> Result<T>
fn read_config_space<T: FromBytes>(&self, offset: usize) -> Result<T>
Reads a value from the device config space.
Source§fn write_config_space<T: IntoBytes>(
&mut self,
offset: usize,
value: T,
) -> Result<()>
fn write_config_space<T: IntoBytes>( &mut self, offset: usize, value: T, ) -> Result<()>
Writes a value to the device config space.
Source§fn begin_init<F: Flags<Bits = u64> + BitAnd<Output = F> + Debug>(
&mut self,
supported_features: F,
) -> F
fn begin_init<F: Flags<Bits = u64> + BitAnd<Output = F> + Debug>( &mut self, supported_features: F, ) -> F
Begins initializing the device. Read more
Source§fn finish_init(&mut self)
fn finish_init(&mut self)
Finishes initializing the device.
Auto Trait Implementations§
impl Freeze for SomeTransport
impl RefUnwindSafe for SomeTransport
impl Send for SomeTransport
impl Sync for SomeTransport
impl Unpin for SomeTransport
impl UnwindSafe for SomeTransport
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