pci_setup_device(9)
π pci_setup_device(9) β like, the whole Kernel API Manual but make it make sense
okay bestie, gather round, because this is one of those little functions that quietly does so much and honestly? it's giving main character energy π
β¨ NAME β¨
pci_setup_device β fills in the class and map info of a device π
π¦ SYNOPSIS π¦
int pci_setup_device (struct pci_dev *dev );
πΈ ARGUMENTS πΈ
devβ the device structure you're gonna fill up, no cap π
π DESCRIPTION π
so basically? this function initialises that device structure with everything the kernel needs to know about the device: its vendor, its class, its memory and IO-space addresses, its IRQ lines, etc. β the whole lil identity card πͺͺβ¨
it gets called at initialisation of the PCI subsystem, and it's also called by CardBus services. iykyk π
return value tea β:
- returns
0on success β slay, we love a zero π - returns a negative value if it's an unknown type of device β and to be clear, "unknown type" here means not a normal device, not a bridge, and not CardBus π
fr fr, don't ignore the negative return, that's your signal that the device didn't fit any of the three categories it knows how to handle π
π SEE ALSO π
kernel file ./drivers/pci/probe.c, plus these iconic siblings π:
__pci_size_bars(9)__pci_read_base(9)pcie_get_link_speed(9)pci_ea_fixed_busnrs(9)pci_ext_cfg_is_aliased(9)pci_cfg_space_size_ext(9)pci_intx_mask_broken(9)pcie_relaxed_ordering_enabled(9)pci_release_dev(9)pci_scan_slot(9)pci_scan_child_bus_extend(9)pci_scan_child_bus(9)pcibios_root_bridge_prepare(9)pci_rescan_bus_bridge_resize(9)pci_rescan_bus(9)
and that's the whole vibe check bestie π«Ά this page lives in ./drivers/pci and it's dated October 2026 β go forth and probe responsibly, mwah ππ
π¦ 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