pci_get_subsys(9)
πΈ 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, orPCI_ANY_IDif youβre feeling βmatch all vendor idsβ energy β¨deviceβ the PCI device id to match, orPCI_ANY_IDto match all device ids π¦ss_vendorβ the PCI subsystem vendor id to match, orPCI_ANY_IDto match all vendor ids πss_deviceβ the PCI subsystem device id to match, orPCI_ANY_IDto match all device ids πΈfromβ the previous PCI device found in the search, orNULLif 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:
pci_find_bus(9)pci_find_next_bus(9)pci_get_slot(9)pci_get_domain_bus_and_slot(9)pci_get_device(9)pci_get_class(9)pci_get_base_class(9)pci_dev_present(9)
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
- 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