Skip to main content

PciExtendedCapability

Trait PciExtendedCapability 

Source
pub trait PciExtendedCapability:
    Send
    + Sync
    + Inspect
    + ProtobufSaveRestore {
    // Required methods
    fn label(&self) -> &str;
    fn extended_capability_id(&self) -> u16;
    fn capability_version(&self) -> u8;
    fn len(&self) -> usize;
    fn read(&self, offset: u16, value: ByteEnabledDwordRead<'_>);
    fn write(&mut self, offset: u16, val: ByteEnabledDwordWrite);
    fn reset(&mut self);
}
Expand description

A generic PCIe extended capability structure.

Required Methods§

Source

fn label(&self) -> &str

A descriptive label for use in Save/Restore + Inspect output.

Source

fn extended_capability_id(&self) -> u16

Returns the PCIe extended capability ID for this capability.

Source

fn capability_version(&self) -> u8

Returns this extended capability structure version.

Source

fn len(&self) -> usize

Length of the extended capability structure in bytes.

Implementations must satisfy all of the following invariants:

  • Length must be non-zero.
  • Length must be 32-bit aligned (a multiple of 4).
  • When packed into config space by cfg_space_emu starting at 0x100, the cumulative size of all extended capabilities must not exceed 0x1000.
Source

fn read(&self, offset: u16, value: ByteEnabledDwordRead<'_>)

Read a byte-enabled DWORD at the given capability-relative offset. The offset must be 32-bit aligned.

Source

fn write(&mut self, offset: u16, val: ByteEnabledDwordWrite)

Write a byte-enabled DWORD to the given capability-relative offset. The offset must be 32-bit aligned.

Source

fn reset(&mut self)

Reset the capability.

Implementors§