pci_get_slot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

Hii bestie! πŸ’– You're looking at the pci_get_slot(9) page from the Kernel API Manual, and the whole vibe is: locate the PCI device for a given PCI slot. That's the mission, no cap. ✨

  • pci_get_slot β€” locate PCI device for a given PCI slot πŸŽ€

πŸ› οΈ SYNOPSIS πŸ› οΈ

Okay so the signature is giving "kernel function, but make it official" πŸ’…:

struct pci_dev * pci_get_slot (struct pci_bus *bus , unsigned int devfn
);

πŸŽ€ ARGUMENTS πŸŽ€

  • bus β€” the PCI bus on which the desired PCI device resides. That's the hangout spot. πŸ¦‹
  • devfn β€” encodes the number of the PCI slot in which the desired PCI device resides, plus the logical device number within that slot in case of multi-function devices. It's doing double duty, highkey iconic. πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

Okay so here's the tea: given a PCI bus and slot/function number, the desired PCI device is located in the list of PCI devices. πŸ•΅οΈβ€β™€οΈβœ¨

If the device is found, its reference count is increased and this function returns a pointer to its data structure. Slay, but also responsibility. πŸ’–

🚨 Real talk, bestie: the caller must decrement the reference count by calling pci_dev_put. Do not forget this part, fr fr. πŸ™ˆ

If no device is found, NULL is returned. That's the whole mood. 😭


🌈 SEE ALSO 🌈


Mwah πŸ’‹ cute little sign-off time: the source/version bit is ./drivers/pci, the date is October 2026, and the page is pci_get_slot(9). Bestie, you're so ready. πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from