pci_get_domain_bus_and_slot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ pci_get_domain_bus_and_slot(9) ✨

okay bestie, so this is a page from the Kernel API Manual and it's literally about pci_get_domain_bus_and_slot β€” like, the function that finds you a PCI device when you hand it a domain (segment), a bus, and a slot. she's a locator. she's a matchmaker. πŸ’…


🌸 NAME 🌸

pci_get_domain_bus_and_slot β€” locate PCI device for a given PCI domain (segment), bus, and slot

no cap, that's the whole gig πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct pci_dev * pci_get_domain_bus_and_slot (int domain , unsigned int
bus , unsigned int devfn );

three args, one pointer back. iconic signature tbh ✨


πŸ’œ ARGUMENTS πŸ’œ

  • domain β€” the PCI domain/segment where your PCI device is living. it's giving "which neighborhood" 🏑
  • bus β€” the PCI bus where the PCI device you want resides. like the street inside that neighborhood 🚌
  • devfn β€” this one's doing double duty, bestie: it encodes the number of the PCI slot where your desired PCI device resides and the logical device number within that slot in case of multi-function devices. two facts, one argument. multitasking queen πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

so basically: you give her a PCI domain, a bus, and a slot/function number, and the desired PCI device gets located in the list of PCI devices. she goes looking. πŸ”

if the device is found, its reference count is increased and this function returns a pointer to its data structure. 🫢

⚠️ okay this part MATTERS, do not skip it: the caller must decrement the reference count by calling pci_dev_put. that's your responsibility, not hers. like returning your bestie's charger. πŸ”Œ

and if no device is found? NULL is returned. that's it. she's not mad, she's just empty-handed πŸ’€


🌈 SEE ALSO 🌈

the whole friend group fr fr πŸ‘―β€β™€οΈ


and that's the page!! mwah πŸ’‹ this little beauty lives in ./drivers/pci, dated October 2026, and yes she's still rocking the pci_get_domain_bus_and_slot(9) title like the main character she is. go forth, find your devices, and please remember pci_dev_put. i'm begging. πŸ™πŸ’–

πŸ“¦ where this page comes from