Skip to main content

Module pci

Module pci 

Source
Expand description

PCI Configuration Space Access

Provides functions to scan the PCI bus and read/write configuration registers. Used to discover VirtIO and other PCI devices.

Reference: PCI Local Bus Specification 3.0

ModulesΒ§

cap_id
PCI capability IDs
class
PCI base class codes
command
PCI command register bits
config
PCI configuration register offsets
device
PCI Device IDs (VirtIO legacy)
intel_eth
Intel Ethernet device IDs
msi_cap
Offsets within an MSI capability block (relative to capability base).
msi_ctrl
MSI control register bit definitions (16-bit at cap_base + 2).
msix_cap
Offsets within an MSI-X capability block (relative to capability base).
msix_ctrl
MSI-X control register bit definitions (16-bit at cap_base + 2).
net_subclass
PCI subclasses for network controllers
sata_progif
Programming interface codes for mass-storage SATA controllers
storage_subclass
PCI subclasses for mass storage controllers
vendor
PCI Vendor IDs

StructsΒ§

PciAddress
A PCI device location
PciDevice
PCI device information
PciLineQuirk πŸ”’
PciScanner
Iterator for scanning PCI bus
ProbeCriteria
Full PCI probe criteria.

EnumsΒ§

Bar
Base Address Register (BAR) types

ConstantsΒ§

CONFIG_ADDRESS πŸ”’
PCI Configuration Address Port
CONFIG_DATA πŸ”’
PCI Configuration Data Port
MSI_ADDR_BASE
x86 MSI message address (delivers to LAPIC via system bus).
MSI_ADDR_DEST_SHIFT
PCI_IRQ_LINE_ZERO_IF_FF πŸ”’

StaticsΒ§

PCI_DEVICE_CACHE πŸ”’
Cached PCI device inventory.
PCI_IO_LOCK πŸ”’
Global lock for PCI configuration space I/O.

FunctionsΒ§

all_devices
Return a snapshot of all discovered PCI devices.
find_device
Helper to find a device by vendor and device ID
find_devices_by_class
Return all devices matching a PCI class/subclass pair.
find_devices_by_vendor
Return all devices for a given vendor from the cached PCI inventory.
find_virtio_device
Find a specific VirtIO device by device ID
find_virtio_devices
Find all VirtIO devices on the PCI bus
invalidate_cache
Invalidate PCI cache.
is_absent_vendor πŸ”’
is_ghost_device πŸ”’
probe_all
Return all devices matching criteria.
probe_device_full πŸ”’
Probe a PCI address using 4 batched dword reads under a single lock hold.
probe_first
Return the first device matching criteria.
probe_from_word00 πŸ”’
Build a PciDevice when word00 (vendor+device dword) was already read by the caller’s fast-path vendor check, avoiding a redundant I/O cycle.
quirk_zero_irq_line πŸ”’
raw_config_read πŸ”’
Single dword config read without building a PciDevice/PciAddress. Acquires PCI_IO_LOCK once.
raw_config_read_u8 πŸ”’
Read a single byte from config space (derived from a dword read).
valid_header_type πŸ”’
with_cache πŸ”’
Populate the cache if empty, then run f on the device slice.