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§
Sourcefn extended_capability_id(&self) -> u16
fn extended_capability_id(&self) -> u16
Returns the PCIe extended capability ID for this capability.
Sourcefn capability_version(&self) -> u8
fn capability_version(&self) -> u8
Returns this extended capability structure version.
Sourcefn len(&self) -> usize
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_emustarting at 0x100, the cumulative size of all extended capabilities must not exceed 0x1000.
Sourcefn read(&self, offset: u16, value: ByteEnabledDwordRead<'_>)
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.