STRUCT CDX_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

struct cdx_device β€” the CDX device object, aka the whole entire main character of this page 🫢

So this is a thing from the Linux kernel API manual, bestie. It's struct cdx_device(9), and we're about to go through it field by field, no skipping, no cap. Grab a snack. πŸ“


✨ SYNOPSIS

struct cdx_device {
    struct device dev;
    struct cdx_controller *cdx;
    u16 vendor;
    u16 device;
    u16 subsystem_vendor;
    u16 subsystem_device;
    u32 class;
    u8 revision;
    u8 bus_num;
    u8 dev_num;
    struct resource res[MAX_CDX_DEV_RESOURCES];
    struct bin_attribute *res_attr[MAX_CDX_DEV_RESOURCES];
    struct dentry *debugfs_dir;
    u8 res_count;
    u64 dma_mask;
    u16 flags;
    u32 req_id;
    bool is_bus;
    bool enabled;
    u32 msi_dev_id;
    u32 num_msi;
    struct mutex irqchip_lock;
    bool msi_write_pending;
 };

Like… look at her. Twenty-something fields and every single one of them matters. Obsessed. πŸ’–


πŸŽ€ Members

Okay so this is the part where we go one by one, and I mean one by one. No field left behind. 🌈

  • dev β€” the Linux driver model device object. the lil' foundation of it all, lowkey iconic.
  • cdx β€” the CDX controller that's associated with this device. her handler, her person, iykyk.
  • vendor β€” the Vendor ID for the CDX device.
  • device β€” the Device ID for the CDX device.
  • subsystem_vendor β€” the Subsystem Vendor ID for the CDX device.
  • subsystem_device β€” the Subsystem Device ID for the CDX device.
  • class β€” the Class for the CDX device.
  • revision β€” the Revision of the CDX device.
  • bus_num β€” the Bus number for this CDX device.
  • dev_num β€” the Device number for this device.
  • res β€” an array of MMIO region entries. not one, an array, periodt.
  • res_attr β€” the resource binary attribute.
  • debugfs_dir β€” the debugfs directory for this device. peek inside, it's giving behind-the-scenes πŸ¦‹
  • res_count β€” the number of valid MMIO regions.
  • dma_mask β€” the Default DMA mask.
  • flags β€” CDX device flags.
  • req_id β€” the Requestor ID associated with the CDX device.
  • is_bus β€” is this bus device. a yes/no situation, very demure.
  • enabled β€” is this bus enabled.
  • msi_dev_id β€” the MSI Device ID associated with the CDX device.
  • num_msi β€” the Number of MSI's supported by the device.
  • irqchip_lock β€” a lock to synchronize irq/msi configuration. mutual exclusion but make it ✨self-care✨
  • msi_write_pending β€” MSI write pending for this device.
Ngl bestie, don't go poking at these fields arbitrarily β€” the manpage spells out what each one is, and that's the whole story. πŸ’…

πŸ¦‹ SEE ALSO

Run, don't walk, to these:


aaaand that's the whole page, bestie πŸ₯ΉπŸ’œ this baby lives in ./include/linux/cdx, and this particular glow-up is dated October 2026 β€” so if you're reading it after that, hi from the past, slay, hope the kernel still compiles. πŸŽ€βœ¨

πŸ“¦ where this page comes from