pub struct MmioTransport { /* private fields */ }
Expand description

MMIO Device Register Interface.

Ref: 4.2.2 MMIO Device Register Layout and 4.2.4 Legacy interface

Implementations§

§

impl MmioTransport

pub unsafe fn new( header: NonNull<VirtIOHeader> ) -> Result<MmioTransport, MmioError>

Constructs a new VirtIO MMIO transport, or returns an error if the header reports an unsupported version.

Safety

header must point to a properly aligned valid VirtIO MMIO region, which must remain valid for the lifetime of the transport that is returned.

pub fn version(&self) -> MmioVersion

Gets the version of the VirtIO MMIO transport.

pub fn vendor_id(&self) -> u32

Gets the vendor ID.

Trait Implementations§

§

impl Debug for MmioTransport

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Drop for MmioTransport

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl Transport for MmioTransport

§

fn device_type(&self) -> DeviceType

Gets the device type.
§

fn read_device_features(&mut self) -> u64

Reads device features.
§

fn write_driver_features(&mut self, driver_features: u64)

Writes device features.
§

fn max_queue_size(&mut self, queue: u16) -> u32

Gets the max size of the given queue.
§

fn notify(&mut self, queue: u16)

Notifies the given queue on the device.
§

fn get_status(&self) -> DeviceStatus

Gets the device status.
§

fn set_status(&mut self, status: DeviceStatus)

Sets the device status.
§

fn set_guest_page_size(&mut self, guest_page_size: u32)

Sets the guest page size.
§

fn requires_legacy_layout(&self) -> bool

Returns whether the transport requires queues to use the legacy layout. Read more
§

fn queue_set( &mut self, queue: u16, size: u32, descriptors: usize, driver_area: usize, device_area: usize )

Sets up the given queue.
§

fn queue_unset(&mut self, queue: u16)

Disables and resets the given queue.
§

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.
§

fn ack_interrupt(&mut self) -> bool

Acknowledges an interrupt. Read more
§

fn config_space<T>(&self) -> Result<NonNull<T>, Error>

Gets the pointer to the config space.
§

fn begin_init<F>(&mut self, supported_features: F) -> F
where F: Flags<Bits = u64> + BitAnd<Output = F> + Debug,

Begins initializing the device. Read more
§

fn finish_init(&mut self)

Finishes initializing the device.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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.