pci_get_subsys(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay bestie, welcome to the pci_get_subsys(9) page β€” this is the Kernel API Manual moment where we learn how to begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id. iconic little lookup behavior, no cap πŸ’…


✨ SYNOPSIS ✨

struct pci_dev * pci_get_subsys (unsigned int vendor , unsigned int
       device , unsigned int ss_vendor , unsigned int ss_device , struct
       pci_dev *from );

πŸŽ€ ARGUMENTS πŸŽ€

  • vendor β€” the PCI vendor id you wanna match, or PCI_ANY_ID if you’re feeling β€œmatch all vendor ids” energy ✨
  • device β€” the PCI device id to match, or PCI_ANY_ID to match all device ids πŸ¦‹
  • ss_vendor β€” the PCI subsystem vendor id to match, or PCI_ANY_ID to match all vendor ids πŸ’–
  • ss_device β€” the PCI subsystem device id to match, or PCI_ANY_ID to match all device ids 🌸
  • from β€” the previous PCI device found in the search, or NULL if you’re starting a brand-new search πŸ‘‘

πŸ’« DESCRIPTION πŸ’«

So basically, this function iterates through the list of known PCI devices πŸ”₯

If a PCI device is found with a matching vendor, device, ss_vendor, and ss_device, then a pointer to its device structure is returned, and the reference count to the device is incremented. slay. otherwise, NULL is returned 😭

A new search is initiated by passing NULL as the from argument. if from is not NULL, searches continue from the next device on the global list. and listen β€” the reference count for from is always decremented if it is not NULL. periodt πŸ’…

bestie, this is the part where you remember: from is doing double duty as β€œwhere we left off” and β€œplease clean up the old reference count.” very main character energy, but also very important πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/pci/search.c β€” and the whole bestie lineup:


and that’s the whole vibe 🫢 this little page comes from ./drivers/pci, dated October 2026, and yes bestie, it’s the one and only pci_get_subsys(9) πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from