Skip to main content

ExtSriovCapability

Type Alias ExtSriovCapability 

Source
pub type ExtSriovCapability<'a> = ConfigSpace<'a, ExtSriovRegs>;
Expand description

A typed view of an SR-IOV extended capability.

Aliased Type§

pub struct ExtSriovCapability<'a> { /* private fields */ }

Implementations§

Source§

impl ExtSriovCapability<'_>

Source

pub fn first_vf_offset(&self) -> u16

Returns the current PCIe First VF Offset in Routing ID space.

This value may change when NumVFs changes. Drivers should use PCI core helpers when they need to calculate a VF BDF; this accessor is intended for interfaces that require the First VF Offset itself.

Source

pub fn vf_bars(&self) -> Result<impl Iterator<Item = ExtSriovVfBar>>

Returns an iterator over decoded VF BAR register encodings.

All six raw VF BAR register slots are read and decoded up front. A 32-bit encoding yields one entry; a 64-bit encoding combines two slots into one entry.

A zero-valued low DWORD is yielded as a 32-bit BAR at address zero; this method does not probe whether a BAR is implemented.

Returns EINVAL and logs an error if a BAR low DWORD does not encode a 32-bit or 64-bit memory BAR, or if a 64-bit encoding has no upper DWORD.