The Linux Kernel/PCI

⚲ Most used API
🗝️ 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:
 * -vv
 * column -t /proc/bus/pci/devices


 * ,, - pci device information handling

⚲ Kernel space API:


 * - has vendor, device and class IDs. It is used for probing.
 * - the central struct
 * - helper macro to register pci_driver. It uses and.
 * - device descriptor
 * , - must be called in probe and remove callbacks of pci_driver.
 * / or, / ,
 * /, or
 * / or, / ,
 * /, or
 * / or, / ,
 * /, or
 * /, or

👁 Examples:
 * PCI Linux Driver Template

📚 PCI subsystem docs
, newer on the top:



X86_REROUTE_FOR_BROKEN_BOOT_IRQS

pci=ioapicreroute



Querying information from shell:

find /sys/kernel/config/pci_ep/

EPC - EP Controller:

,

EPF - EP Function:

Internals:

Driver to test endpoint functionality:

, 2009

API:, ,

, 2008

MSI Example:

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

, 2006

API:, , ,



API:, ,

, 2004

API: ,,



,, ,

💾 Historical:
 * LDD3:PCI Drivers
 * LDD3:PCI Drivers, pdf
 * http://www.tldp.org/LDP/tlk/dd/pci.html

📚 References
 * https://wiki.osdev.org/PCI
 * https://lwn.net/Kernel/Index/#PCI
 * https://wiki.osdev.org/PCI
 * https://lwn.net/Kernel/Index/#PCI