PCI_DEVICE_CLASS(9)
π PCI_DEVICE_CLASS(9) β like, the kernel API manual, but make it make sense π
okay so bestie, we're in the Kernel API Manual today and this one's a macro moment β a little one, but honestly kind of iconic if you're into PCI stuff. Let's get into it β¨
πΈ NAME πΈ
PCI_DEVICE_CLASS β the macro you use to describe one specific PCI device class. she's short, she's sweet, she does exactly one job and does it well π
β¨ SYNOPSIS β¨
PCI_DEVICE_CLASS (dev_class , dev_class_mask );
that's it. that's the whole vibe check. two arguments, no drama π¦
π ARGUMENTS π
dev_classβ the class, subclass, prog-if triple for this device. yes, a triple, like a little trio of numbers that tells the kernel what kind of hardware we're talking about πdev_class_maskβ the class mask for this device. this is the "how much of that triple actually matters" mask π₯
π DESCRIPTION π
so here's the tea bestie: this macro creates a struct pci_device_id that matches a specific PCI class. that's it, that's the whole thing π«Ά
the way it works is β the vendor, device, subvendor, and subdevice fields all get set to PCI_ANY_ID, so they wildcard out and don't filter anything. the class triple and mask do all the matching work. no cap, it's literally just "match me a class" energy π
ngl, the "any id" thing is the whole point β if you were expecting vendor/device filtering here you're in the wrong macro, go look at one of the friends down in SEE ALSO π
π SEE ALSO π
so many friends!! she's got connections β¨ and they all live in the kernel file ./include/linux/pci.h:
enum pci_interrupt_pin(9)pci_channel_state_t(9)pci_is_bridge(9)pci_is_vga(9)pci_is_display(9)struct pci_driver(9)PCI_DEVICE(9)PCI_DEVICE_DRIVER_OVERRIDE(9)PCI_DRIVER_OVERRIDE_DEVICE_VFIO(9)PCI_DEVICE_SUB(9)PCI_VDEVICE(9)PCI_VDEVICE_SUB(9)PCI_DEVICE_DATA(9)pcie_capability_clear_and_set_word(9)pci_bus_for_each_resource(9)module_pci_driver(9)builtin_pci_driver(9)pci_irq_type(9)pci_irqd_intx_xlate(9)pci_resource_is_io(9)pci_resource_is_mem(9)pci_pcie_cap(9)pci_is_pcie(9)pcie_caps_reg(9)pci_pcie_type(9)pcie_find_root_port(9)pci_vpd_alloc(9)pci_vpd_find_id_string(9)pci_vpd_find_ro_info_keyword(9)pci_vpd_check_csum(9)pci_ari_enabled(9)pci_is_thunderbolt_attached(9)
like, go read some of those, they're all slaying in their own way π
and that's the whole page, bestie π§ this gem came out of <mint>./include/linux</mint> and it's dated October 2026 β so yeah, shoutout to the kernel docs crew, mwah π 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