Struct driver_virtio::PciTransport
pub struct PciTransport { /* private fields */ }
Expand description
PCI transport for VirtIO.
Ref: 4.1 Virtio Over PCI Bus
Implementations§
§impl PciTransport
impl PciTransport
pub fn new<H>(
root: &mut PciRoot,
device_function: DeviceFunction
) -> Result<PciTransport, VirtioPciError>where
H: Hal,
pub fn new<H>(
root: &mut PciRoot,
device_function: DeviceFunction
) -> Result<PciTransport, VirtioPciError>where
H: Hal,
Construct a new PCI VirtIO device driver for the given device function on the given PCI root controller.
The PCI device must already have had its BARs allocated.
Trait Implementations§
§impl Debug for PciTransport
impl Debug for PciTransport
§impl Transport for PciTransport
impl Transport for PciTransport
§fn device_type(&self) -> DeviceType
fn device_type(&self) -> DeviceType
Gets the device type.
§fn read_device_features(&mut self) -> u64
fn read_device_features(&mut self) -> u64
Reads device features.
§fn write_driver_features(&mut self, driver_features: u64)
fn write_driver_features(&mut self, driver_features: u64)
Writes device features.
§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.
§fn get_status(&self) -> DeviceStatus
fn get_status(&self) -> DeviceStatus
Gets the device status.
§fn set_status(&mut self, status: DeviceStatus)
fn set_status(&mut self, status: DeviceStatus)
Sets the device status.
§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.
§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
§fn queue_set(
&mut self,
queue: u16,
size: u32,
descriptors: usize,
driver_area: usize,
device_area: usize
)
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)
fn queue_unset(&mut self, _queue: u16)
Disables and resets the given queue.
§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.
§fn ack_interrupt(&mut self) -> bool
fn ack_interrupt(&mut self) -> bool
Acknowledges an interrupt. Read more
§fn config_space<T>(&self) -> Result<NonNull<T>, Error>
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
fn begin_init<F>(&mut self, supported_features: F) -> F
Begins initializing the device. Read more
§fn finish_init(&mut self)
fn finish_init(&mut self)
Finishes initializing the device.
Auto Trait Implementations§
impl RefUnwindSafe for PciTransport
impl !Send for PciTransport
impl !Sync for PciTransport
impl Unpin for PciTransport
impl UnwindSafe for PciTransport
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