pci_pcie_cap(9)
π pci_pcie_cap (9) β the Kernel API Manual, bestie edition π
Okay so this is a page from the Kernel API Manual, and we're talking about pci_pcie_cap β literally the function that hands you back the saved PCIe capability offset. No searching, no stress, just vibes and a saved value. Let's get into it β¨
πΈ NAME πΈ
pci_pcie_cap β get the saved PCIe capability offset. That's it, that's the whole job, and she does it flawlessly π
π¦ SYNOPSIS π¦
int pci_pcie_cap (struct pci_dev *dev );
Look at her. Iconic signature. No notes π
π ARGUMENTS π
devβ the PCI device. Like, the actual device you're asking about. Give her thedevand she'll give you the offset, we love a fair trade π«Ά
β¨ DESCRIPTION β¨
So here's the tea, bestie π£οΈ The PCIe capability offset gets calculated at PCI device initialization time and then it's saved right there in the data structure. Like, stored. Remembered. Committed to memory. So when you call this function, it just returns that already-saved PCIe capability offset β no cap, no extra work π
The way this is lowkey the move: using this instead of pci_find_capability reduces unnecessary searching in the PCI configuration space. Why go digging through config space when the answer's already sitting there in the struct? Exactly. We don't do redundant searches in this house π
ββοΈ
But listen β if for some reason you genuinely need to calculate the PCIe capability offset from the raw device, please use pci_find_capability instead. Different tool, different situation, respect the division of labor, periodt π
π₯ SEE ALSO π₯
Kernel file ./include/linux/pci.h, plus the whole friend group β every single one of these icons, no skips:
enum pci_interrupt_pin(9)pci_channel_state_t(9)pci_is_bridge(9)pci_is_vga(9)pci_is_display(9)struct pci_driver(9)PCI_DEVICE(9)PCI_DEVICE_DRIVER_OVERRIDE(9)PCI_DRIVER_OVERRIDE_DEVICE_VFIO(9)PCI_DEVICE_SUB(9)PCI_DEVICE_CLASS(9)PCI_VDEVICE(9)PCI_VDEVICE_SUB(9)PCI_DEVICE_DATA(9)pcie_capability_clear_and_set_word(9)pci_bus_for_each_resource(9)module_pci_driver(9)builtin_pci_driver(9)pci_irq_type(9)pci_irqd_intx_xlate(9)pci_resource_is_io(9)pci_resource_is_mem(9)pci_is_pcie(9)pcie_caps_reg(9)pci_pcie_type(9)pcie_find_root_port(9)pci_vpd_alloc(9)pci_vpd_find_id_string(9)pci_vpd_find_ro_info_keyword(9)pci_vpd_check_csum(9)pci_ari_enabled(9)pci_is_thunderbolt_attached(9)
And that's the whole page, bestie π A huge shoutout to the ./include/linux crew β this one dropped October 2026, and it's giving reference-manual royalty. Go save yourself a config-space search, you deserve it πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms