pci_pcie_cap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the dev and 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:


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