STRUCT CDX_DEVICE(9)
π 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:
Kernel file ./include/linux/cdx/cdx_bus.hβ the source of truth, literally.CDX_DEVICE(9)CDX_DEVICE_DRIVER_OVERRIDE(9)struct cdx_ops(9)struct cdx_controller(9)struct cdx_driver(9)__cdx_driver_register(9)cdx_driver_unregister(9)cdx_dev_reset(9)cdx_set_master(9)cdx_clear_master(9)cdx_enable_msi(9)cdx_disable_msi(9)
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
- 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