PCI bus support in Linux kernel


⚲ Most used API

edit

🗝️ Acronyms:

  • ACPI - Advanced Configuration and Power Interface
  • ACS - Access Control Service
  • AER - Advanced Error Reporting port service
  • ASPM - Active State Power Management
  • EDR - Error Disconnect Recover
  • FLR - function level reset
  • HT - Hypertransport
  • BAR - Base Address Registers
  • BW - Bandwidth
  • DPC - Downstream Port Containment port service
  • EP - Endpoint
  • mmrbc - maximum memory read byte count
  • mps - maximum payload size
  • MWI - Memory-Write-Invalidate
  • PM - Power Management
  • PMC - ... ... Controller
  • PME - ... ... Event, port service
  • SR-IOV - Single-root input/output virtualization
  • VF - virtual functions


⚲ User space API:

Querying information from a shell:


⚲ Kernel space API:

👁 Examples:

⚙️ Internals

edit

linux/pci_ids.h inc
drivers/pci src
pci_ops id

📚 Mainline documents

edit
PCI driver API doc
PCI Support Library doc
PCI Hotplug Support Library doc
PCI Peer-to-Peer DMA Support doc

📚 PCI subsystem docs

edit

PCI subsystem doc, newer on the top:


Boot Interrupts reroute doc

X86_REROUTE_FOR_BROKEN_BOOT_IRQS

Kernel parameters docpci=ioapicreroute


EP - Endpoint Framework doc

Querying information from shell:

find /sys/kernel/config/pci_ep/


EPC - EP Controller:

linux/pci-epc.h inc pci_epc_create id, devm_pci_epc_create id

EPF - EP Function:

linux/pci-epf.h inc pci_epf_create id

Internals: drivers/pci/endpoint/ src

Driver to test endpoint functionality: drivers/pci/endpoint/functions/pci-epf-test.c src

PCIe virtualization, SR-IOV doc, 2009

API: pci_enable_sriov id, pci_disable_sriov id, sriov_configure id

MSI - Message Signaled Interrupts doc, 2008

MSI Example:

vectors = pci_alloc_irq_vectors id(pci_dev, 1, 1, PCI_IRQ_MSI | PCI_IRQ_MSIX);
irq = pci_irq_vector id(pci_dev, 0);


AER - Advanced Error Reporting doc, 2006

API: linux/aer.h inc, pci_enable_pcie_error_reporting id, pci_disable_pcie_error_reporting id, pci_aer_clear_nonfatal_status id

ERS - Error Recovery System doc:

API: pci_error_handlers id, pci_ers_result id, pci_channel_state_t id

PCIe - PCI Express Port Bus Driver doc, 2004

API: pcie_port_service_driver id,pcie_port_service_register id, pcie_port_service_unregister id


Old manual PCI API doc

pci_get_device id, pci_get_class id, pci_get_subsys id, pci_dev_put id


💾 Historical:

📚 References