pci_scan_slot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ pci_scan_slot β€” from the Kernel API Manual, bestie πŸ’…

Okay so picture this: you're deep in the kernel, you've got a PCI bus, and you need to know what's living in one specific slot. That's literally this function's whole job. Let's get into it ✨


🌸 NAME 🌸

pci_scan_slot β€” scan a PCI slot on a bus for devices πŸ¦‹


✨ SYNOPSIS ✨

int pci_scan_slot (struct pci_bus *bus , int devfn );

πŸ’– ARGUMENTS πŸ’–

  • bus β€” the PCI bus you wanna scan, bestie 🌈
  • devfn β€” the slot number to scan, and heads up: it must have zero function πŸ‘‘ (yes, that's a requirement, not a vibe suggestion)

🫢 DESCRIPTION 🫢

So what it does is: scan a PCI slot on the specified PCI bus for devices, and every device it discovers gets added to the bus->devices list. Iconic. πŸ’…

Lowkey important: new devices will not have is_added set. Not me pointing that out so you don't get caught out later 😭

And the return value? The number of new devices found. That's it, that's the tea β˜•βœ¨


🧚 SEE ALSO 🧚

Kernel file ./drivers/pci/probe.c, plus these absolute legends:


And that's the whole page, bestie πŸ“ This lil masterpiece lives in ./drivers/pci, dated October 2026 β€” go forth and scan those slots, you've got this fr fr πŸ’œβ­

πŸ“¦ where this page comes from