pci_resource_num(9)
π NAME π
okay bestie, welcome to the pci_resource_num(9) page from the Kernel API Manual β it's literally about doing a reverse lookup of the resource number from device resources, and I'm obsessed β¨
pci_resource_numβ Reverse lookup resource number from device resources π«Ά
π SYNOPSIS π
int pci_resource_num (const struct pci_dev *dev , const struct resource
*res );
πΈ ARGUMENTS πΈ
devβ PCI device, the device we're working with πresβ Resource to lookup index for. It MUST be adev's resource β like, non-negotiable, bestie π
π¦ DESCRIPTION π¦
So the whole vibe is a reverse lookup: pci_resource_num performs a reverse lookup to determine the resource number for res within the dev resource array. It's giving "find this resource's spot in the lineup" energy π₯
β οΈ NOTE: The caller is responsible for ensuringresis amongdev's resources! No cap, that check is on you β do not skip it π
β RETURN β
The resource number. slay, that's the return value π
π₯ SEE ALSO π₯
Kernel file ./drivers/pci/pci.h, plus all these cross-reference cuties:
PCI_FIND_NEXT_CAP(9)PCI_FIND_NEXT_EXT_CAP(9)pci_bar_index_is_valid(9)pci_id_from_device(9)pci_match_one_id(9)pci_dev_set_io_state(9)struct aer_err_info(9)
mwah π source/version: ./drivers/pci β date: October 2026. signed off with Kernel API Manual energy, periodt πβ¨
π¦ 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