pci_cfg_space_size_ext(9)
π pci_cfg_space_size_ext(9) π
okay bestie, so this one is straight out of the Kernel API Manual (yes, that manual, the big scary one β you're gonna be fine, i promise π«Ά), and it's all about figuring out how much config space a PCI device is actually packing. lowkey iconic detective work tbh πβ¨
πΈ NAME πΈ
pci_cfg_space_size_ext β get the configuration space size of the PCI device. that's it, that's the whole vibe check. π
β¨ SYNOPSIS β¨
int pci_cfg_space_size_ext (struct pci_dev *dev );
π ARGUMENTS π
devβ the PCI device. yeah. that's the whole argument. she's low maintenance, we love her for it. π
π¦ DESCRIPTION π¦
okay so here's the tea. regular PCI devices have 256 bytes of config space β cute, compact, no notes. but PCI-X 2 and PCI Express devices have 4096 bytes β main character energy, way more room to work with. π π₯
and likeβ¦ here's the part where it gets messy. even if the device is capable of the big 4096-byte situation, that doesn't mean we can access it. π and why, you ask? two reasons on the table:
- maybe we don't have a way to generate extended config space accesses β like, the plumbing just isn't there, bestie.
- or the device is behind a reverse Express bridge β yeah. that's a thing. and it's giving obstacle. π
so what do we do?? we do a vibe check, obviously: we try reading the dword at 0x100, and that value must either be 0 or a valid extended capability header. if it plays nice, great. if not, well β that's the whole test. π§β
no cap: this is a probe, not a promise. the read is how we find out if extended config space is actually reachable, so don't skip straight to assuming the big space is yours. π«‘
π SEE ALSO π
oh you want the whole friend group? say less. π these all live in the kernel file ./drivers/pci/probe.c:
__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_intx_mask_broken(9)pci_setup_device(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 page, bestie β go read some config space and slay. πβ¨
sign-off szn: this little number comes from the ./drivers/pci directory, dated October 2026. ποΈπ periodt.
π¦ 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