pci_resource_num(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 a dev'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 ensuring res is among dev'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:


mwah πŸ’– source/version: ./drivers/pci β€” date: October 2026. signed off with Kernel API Manual energy, periodt 🌈✨

πŸ“¦ where this page comes from