Crate pci

source ·
Expand description

PCI Configuration Space Access

Terminology

This crate deals with multiple types of interrupts:

  • Legacy (INTx) interrupts are the oldest PCI interrupt representation.

    • Four interrupt pins are shared among all devices.
    • This crate refers to these legacy interrupts as “intx”.
  • MSI (Message Signaled Interrupts) appeared with PCI express.

    • They allow devices to allocate up to 32 interrupt numbers.
    • This crate refers to these interrupts as “msi”.
  • MSI-X messages appeared with PCIe 3.0.

    • They allow devices to allocate up to 2048 interrupt numbers.
    • This crate refers to these interrupts as “msix”.

Note: while pci currently uses port-io on x86 and mmio on aarch64, x86 may also support memory-based PCI configuration in the future; port-io is the legacy way to access the config space.

For context on the various interrupt mechanisms (MSI/MSI-X/INTx):

Structs

Enums

Functions

  • Returns a list of all PCI buses in this system. If the PCI bus hasn’t been initialized, this initializes the PCI bus & scans it to enumerates devices.
  • Returns a reference to the PciDevice with the given bus, slot, func identifier. If the PCI bus hasn’t been initialized, this initializes the PCI bus & scans it to enumerates devices.
  • Returns an iterator that iterates over all PciDevices, in no particular guaranteed order. If the PCI bus hasn’t been initialized, this initializes the PCI bus & scans it to enumerates devices.