pub struct PciExpressCapability { /* private fields */ }Expand description
Configurable PCI Express capability.
Implementations§
Source§impl PciExpressCapability
impl PciExpressCapability
Sourcepub fn new(
typ: DevicePortType,
flr_handler: Option<Arc<dyn FlrHandler>>,
) -> Self
pub fn new( typ: DevicePortType, flr_handler: Option<Arc<dyn FlrHandler>>, ) -> Self
Creates a new PCI Express capability with FLR support.
§Arguments
typ- The spec-defined device or port type.flr_handler- Optional handler to be called when FLR is initiated. This emulator will report that FLR is supported if flr_handler = Some(_)
Sourcepub fn with_hotplug_support(self, slot_number: u32) -> Self
pub fn with_hotplug_support(self, slot_number: u32) -> Self
Enable hotplug support for this PCIe capability. This configures the appropriate registers to support hotpluggable devices. Panics if called on device types other than RootPort or DownstreamSwitchPort.
§Arguments
slot_number- The physical slot number to assign to this hotplug-capable port
Sourcepub fn set_presence_detect_state(&self, present: bool)
pub fn set_presence_detect_state(&self, present: bool)
Set the presence detect state for the slot. This method only has effect if the slot is implemented (slot_implemented = true). If slot is not implemented, the call is silently ignored, as the spec says “If this register is implemented but the Slot Implemented bit is Clear, the field behavior of this entire register with the exception of the DLLSC bit is undefined.”
§Arguments
present- true if a device is present in the slot, false if the slot is empty
Trait Implementations§
Source§impl Inspect for PciExpressCapability
impl Inspect for PciExpressCapability
Source§impl PciCapability for PciExpressCapability
impl PciCapability for PciExpressCapability
Source§fn capability_id(&self) -> CapabilityId
fn capability_id(&self) -> CapabilityId
Returns the PCI capability ID for this capability
Source§fn as_pci_express(&self) -> Option<&PciExpressCapability>
fn as_pci_express(&self) -> Option<&PciExpressCapability>
Downcast to PCI Express capability
Source§fn as_pci_express_mut(&mut self) -> Option<&mut PciExpressCapability>
fn as_pci_express_mut(&mut self) -> Option<&mut PciExpressCapability>
Downcast to PCI Express capability (mutable)
Source§impl SaveRestore for PciExpressCapability
impl SaveRestore for PciExpressCapability
Auto Trait Implementations§
impl Freeze for PciExpressCapability
impl !RefUnwindSafe for PciExpressCapability
impl Send for PciExpressCapability
impl Sync for PciExpressCapability
impl Unpin for PciExpressCapability
impl !UnwindSafe for PciExpressCapability
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