Struct virtio_drivers::MmioTransport
source · [−]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
sourceimpl MmioTransport
impl MmioTransport
sourcepub unsafe fn new(header: NonNull<VirtIOHeader>) -> Result<Self, MmioError>
pub unsafe fn new(header: NonNull<VirtIOHeader>) -> Result<Self, 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.
sourcepub fn version(&self) -> MmioVersion
pub fn version(&self) -> MmioVersion
Gets the version of the VirtIO MMIO transport.
Trait Implementations
sourceimpl Debug for MmioTransport
impl Debug for MmioTransport
sourceimpl Transport for MmioTransport
impl Transport for MmioTransport
sourcefn device_type(&self) -> DeviceType
fn device_type(&self) -> DeviceType
Gets the device type.
sourcefn read_device_features(&mut self) -> u64
fn read_device_features(&mut self) -> u64
Reads device features.
sourcefn write_driver_features(&mut self, driver_features: u64)
fn write_driver_features(&mut self, driver_features: u64)
Writes device features.
sourcefn max_queue_size(&self) -> u32
fn max_queue_size(&self) -> u32
Gets the max size of queue.
sourcefn set_status(&mut self, status: DeviceStatus)
fn set_status(&mut self, status: DeviceStatus)
Sets the device status.
sourcefn 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.
sourcefn queue_set(
&mut self,
queue: u32,
size: u32,
descriptors: PhysAddr,
driver_area: PhysAddr,
device_area: PhysAddr
)
fn queue_set(
&mut self,
queue: u32,
size: u32,
descriptors: PhysAddr,
driver_area: PhysAddr,
device_area: PhysAddr
)
Sets up the given queue.
sourcefn queue_used(&mut self, queue: u32) -> bool
fn queue_used(&mut self, queue: u32) -> bool
Returns whether the queue is in use, i.e. has a nonzero PFN or is marked as ready.
sourcefn ack_interrupt(&mut self) -> bool
fn ack_interrupt(&mut self) -> bool
Acknowledges an interrupt. Read more
sourcefn config_space(&self) -> NonNull<u64>
fn config_space(&self) -> NonNull<u64>
Gets the pointer to the config space.
sourcefn begin_init(&mut self, negotiate_features: impl FnOnce(u64) -> u64)
fn begin_init(&mut self, negotiate_features: impl FnOnce(u64) -> u64)
Begins initializing the device. Read more
sourcefn finish_init(&mut self)
fn finish_init(&mut self)
Finishes initializing the device.
Auto Trait Implementations
impl RefUnwindSafe for MmioTransport
impl !Send for MmioTransport
impl !Sync for MmioTransport
impl Unpin for MmioTransport
impl UnwindSafe for MmioTransport
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more