STRUCT CDX_DEVICE_ID(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct cdx_device_id(9) πŸ’…

okay so this is a page straight out of the Kernel API Manual, and it's all about struct cdx_device_id β€” the lil ID card that says "yes bestie, this CDX device matches this driver" πŸŽ€


✨ NAME ✨

struct cdx_device_id β€” the CDX device identifier, i.e. the thing that tells you which CDX device you're looking at πŸ¦‹


✨ SYNOPSIS ✨

struct cdx_device_id {
    __u16 vendor;
    __u16 device;
    __u16 subvendor;
    __u16 subdevice;
    __u32 class;
    __u32 class_mask;
    __u32 override_only;
 };

no cap, that's the whole struct πŸ‘‘


✨ Members ✨

  • vendor β€” the Vendor ID 🌸
  • device β€” the Device ID πŸ’œ
  • subvendor β€” the Subsystem vendor ID (or CDX_ANY_ID if you're feeling flexible ✨)
  • subdevice β€” the Subsystem device ID (also CDX_ANY_ID if you don't wanna be picky πŸ™ˆ)
  • class β€” the Device class. real talk: most drivers do not need to specify class/class_mask, because vendor/device is normally sufficient πŸ’…
  • class_mask β€” limits which sub-fields of the class field actually get compared πŸ”
  • override_only β€” matches only when dev->driver_override is this driver, periodt πŸ‘‘

✨ Description ✨

so basically this is the type of the entries in the "device Id" table for CDX devices that a CDX device driver supports 🫢 like, it's the shape of every row in that table. iconic behavior honestly πŸ’–


✨ SEE ALSO ✨

the kernel file ./include/linux/device-id/cdx.h β€” go read it, iykyk πŸ“–βœ¨


πŸ’€ friendly reminder: this struct is literally the device ID table entry format, so don't go inventing fields, bestie β€” keep every field exactly as listed 😭

and that's the tea πŸ“ β€” this cutie came from ./include/linux/device-id, dated October 2026, in the Kernel API Manual. slay, go forth and match some devices πŸ’…πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from