PCI_DEVICE_CLASS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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