pub struct VirtioPciCommonConfig {
    pub driver_status: u8,
    pub config_generation: u8,
    pub device_feature_select: u32,
    pub driver_feature_select: u32,
    pub queue_select: u16,
    pub msix_config: u16,
}
Expand description

Contains the data for reading and writing the common configuration structure of a virtio PCI device.

  • Registers:
    • About the whole device.
      • le32 device_feature_select; // read-write
      • le32 device_feature; // read-only for driver
      • le32 driver_feature_select; // read-write
      • le32 driver_feature; // read-write
      • le16 msix_config; // read-write
      • le16 num_queues; // read-only for driver
      • u8 device_status; // read-write (driver_status)
      • u8 config_generation; // read-only for driver
    • About a specific virtqueue.
      • le16 queue_select; // read-write
      • le16 queue_size; // read-write, power of 2, or 0.
      • le16 queue_msix_vector; // read-write
      • le16 queue_enable; // read-write (Ready)
      • le16 queue_notify_off; // read-only for driver
      • le64 queue_desc; // read-write
      • le64 queue_avail; // read-write
      • le64 queue_used; // read-write

Fields§

§driver_status: u8§config_generation: u8§device_feature_select: u32§driver_feature_select: u32§queue_select: u16§msix_config: u16

Implementations§

source§

impl VirtioPciCommonConfig

source

pub fn read( &mut self, offset: u64, data: &mut [u8], queues: &mut [QueueConfig], device: &mut dyn VirtioDevice )

source

pub fn write( &mut self, offset: u64, data: &[u8], queues: &mut [QueueConfig], device: &mut dyn VirtioDevice )

source

fn read_common_config_byte(&self, offset: u64) -> u8

source

fn write_common_config_byte(&mut self, offset: u64, value: u8)

source

fn read_common_config_word(&self, offset: u64, queues: &[QueueConfig]) -> u16

source

fn write_common_config_word( &mut self, offset: u64, value: u16, queues: &mut [QueueConfig] )

source

fn read_common_config_dword( &self, offset: u64, device: &dyn VirtioDevice ) -> u32

source

fn write_common_config_dword( &mut self, offset: u64, value: u32, queues: &mut [QueueConfig], device: &mut dyn VirtioDevice )

source

fn read_common_config_qword(&self, _offset: u64) -> u64

source

fn write_common_config_qword( &mut self, offset: u64, value: u64, queues: &mut [QueueConfig] )

source

fn with_queue<U, F>(&self, queues: &[QueueConfig], f: F) -> Option<U>
where F: FnOnce(&QueueConfig) -> U,

source

fn with_queue_mut<F: FnOnce(&mut QueueConfig)>( &self, queues: &mut [QueueConfig], f: F )

Trait Implementations§

source§

impl Clone for VirtioPciCommonConfig

source§

fn clone(&self) -> VirtioPciCommonConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'de> Deserialize<'de> for VirtioPciCommonConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for VirtioPciCommonConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for VirtioPciCommonConfig

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,