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
- About the whole device.
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
impl VirtioPciCommonConfig
pub fn read( &mut self, offset: u64, data: &mut [u8], queues: &mut [QueueConfig], device: &mut dyn VirtioDevice )
pub fn write( &mut self, offset: u64, data: &[u8], queues: &mut [QueueConfig], device: &mut dyn VirtioDevice )
fn read_common_config_byte(&self, offset: u64) -> u8
fn write_common_config_byte(&mut self, offset: u64, value: u8)
fn read_common_config_word(&self, offset: u64, queues: &[QueueConfig]) -> u16
fn write_common_config_word( &mut self, offset: u64, value: u16, queues: &mut [QueueConfig] )
fn read_common_config_dword( &self, offset: u64, device: &dyn VirtioDevice ) -> u32
fn write_common_config_dword( &mut self, offset: u64, value: u32, queues: &mut [QueueConfig], device: &mut dyn VirtioDevice )
fn read_common_config_qword(&self, _offset: u64) -> u64
fn write_common_config_qword( &mut self, offset: u64, value: u64, queues: &mut [QueueConfig] )
fn with_queue<U, F>(&self, queues: &[QueueConfig], f: F) -> Option<U>where
F: FnOnce(&QueueConfig) -> U,
fn with_queue_mut<F: FnOnce(&mut QueueConfig)>( &self, queues: &mut [QueueConfig], f: F )
Trait Implementations§
source§impl Clone for VirtioPciCommonConfig
impl Clone for VirtioPciCommonConfig
source§fn clone(&self) -> VirtioPciCommonConfig
fn clone(&self) -> VirtioPciCommonConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'de> Deserialize<'de> for VirtioPciCommonConfig
impl<'de> Deserialize<'de> for VirtioPciCommonConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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
impl Serialize for VirtioPciCommonConfig
impl Copy for VirtioPciCommonConfig
Auto Trait Implementations§
impl RefUnwindSafe for VirtioPciCommonConfig
impl Send for VirtioPciCommonConfig
impl Sync for VirtioPciCommonConfig
impl Unpin for VirtioPciCommonConfig
impl UnwindSafe for VirtioPciCommonConfig
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn 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>
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)
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)
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.