pub struct HardwareConfigFaultConfig {
pub vendor_id: Option<u16>,
pub device_id: Option<u16>,
}Expand description
A fault configuration for overriding the device’s hardware configuration (i.e. the values reported in PCI configuration space).
When a field is Some, its value replaces the corresponding field reported
by the NVMe fault controller’s PCI hardware IDs. When None, the real
hardware ID value is used unchanged. Unlike most other faults in this
module, hardware config faults are applied at device construction time
and are therefore not gated by the fault_active flag.
§Example
Override the Vendor ID and Device ID reported in PCI config space.
use mesh::CellUpdater;
use nvme_resources::fault::FaultConfiguration;
use nvme_resources::fault::HardwareConfigFaultConfig;
pub fn hardware_config_fault() -> FaultConfiguration {
let mut fault_start_updater = CellUpdater::new(false);
FaultConfiguration::new(fault_start_updater.cell())
.with_hardware_config_fault(
HardwareConfigFaultConfig::new()
.with_vendor_id(0x1414)
.with_device_id(0xc03e),
)
}Fields§
§vendor_id: Option<u16>Override for the device’s PCI Vendor ID. When None, the real Vendor
ID is used.
device_id: Option<u16>Override for the device’s PCI Device ID. When None, the real Device
ID is used.
Implementations§
Source§impl HardwareConfigFaultConfig
impl HardwareConfigFaultConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new no-op hardware config fault configuration. All fields
default to None, meaning the real hardware values are used.
Sourcepub fn with_vendor_id(self, vendor_id: u16) -> Self
pub fn with_vendor_id(self, vendor_id: u16) -> Self
Override the PCI Vendor ID reported by the device.
Sourcepub fn with_device_id(self, device_id: u16) -> Self
pub fn with_device_id(self, device_id: u16) -> Self
Override the PCI Device ID reported by the device.
Trait Implementations§
Source§impl Clone for HardwareConfigFaultConfig
impl Clone for HardwareConfigFaultConfig
Source§fn clone(&self) -> HardwareConfigFaultConfig
fn clone(&self) -> HardwareConfigFaultConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HardwareConfigFaultConfig
impl Debug for HardwareConfigFaultConfig
Source§impl Default for HardwareConfigFaultConfig
impl Default for HardwareConfigFaultConfig
Source§fn default() -> HardwareConfigFaultConfig
fn default() -> HardwareConfigFaultConfig
Source§impl DefaultEncoding for HardwareConfigFaultConfig
impl DefaultEncoding for HardwareConfigFaultConfig
Source§impl<'encoding> StructDecodeMetadata<'encoding, Resource> for HardwareConfigFaultConfig
impl<'encoding> StructDecodeMetadata<'encoding, Resource> for HardwareConfigFaultConfig
Source§impl StructEncodeMetadata<Resource> for HardwareConfigFaultConfig
impl StructEncodeMetadata<Resource> for HardwareConfigFaultConfig
Source§impl StructMetadata for HardwareConfigFaultConfig
impl StructMetadata for HardwareConfigFaultConfig
impl Copy for HardwareConfigFaultConfig
Auto Trait Implementations§
impl Freeze for HardwareConfigFaultConfig
impl RefUnwindSafe for HardwareConfigFaultConfig
impl Send for HardwareConfigFaultConfig
impl Sync for HardwareConfigFaultConfig
impl Unpin for HardwareConfigFaultConfig
impl UnsafeUnpin for HardwareConfigFaultConfig
impl UnwindSafe for HardwareConfigFaultConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> MeshField for T
impl<T> MeshField for T
§impl<T> MeshPayload for T
impl<T> MeshPayload for T
§impl<T> SerializeMessage for Twhere
T: 'static + MeshPayload + Send,
impl<T> SerializeMessage for Twhere
T: 'static + MeshPayload + Send,
§fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
fn compute_message_size(&mut self, sizer: MessageSizer<'_>)
MessageEncode::compute_message_size].§fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
fn write_message(self, writer: MessageWriter<'_, '_, Resource>)
MessageEncode::write_message].