STRUCT CDX_DRIVER(9)
β¨ struct cdx_driver β CDX device driver β¨
okay so bestie, welcome to the struct cdx_driver glow-up π
this is the page from the Kernel API Manual, manual name and all β and it's giving "the blueprint every CDX device driver fills in to become a real one" π
πΈ NAME πΈ
struct cdx_driver β the CDX device driver struct, aka the personality sheet your driver has to fill out π
π¦ SYNOPSIS π¦
struct cdx_driver {
struct device_driver driver;
const struct cdx_device_id *match_id_table;
int (*probe)(struct cdx_device *dev);
int (*remove)(struct cdx_device *dev);
void (*shutdown)(struct cdx_device *dev);
void (*reset_prepare)(struct cdx_device *dev);
void (*reset_done)(struct cdx_device *dev);
bool driver_managed_dma;
};
π Members π
β driver
the generic device driver, nestled in there like the base layer of the fit π«Ά
β match_id_table
the table of supported device matching Ids β basically the vibes list of which devices this driver is willing to be seen with π
β probe
the function called when a device is added π this is the "hi bestie, you're here!" moment
β remove
the function called when a device is removed π the goodbye handler, fr fr
β shutdown
the function called at shutdown time to quiesce the device π quiet it down, tuck it in, no more chaos
β reset_prepare
the function called before is reset to notify driver β heads up before the reset happens, so the driver is never caught off guard π
β reset_done
the function called after reset is complete to notify driver β "okay bestie, we're back, you good?" β¨
β driver_managed_dma
this one is the whole main character, listen up π₯ the Device driver doesn't use kernel DMA API for DMA. For most device drivers, no need to care about this flag as long as all DMAs are handled through the kernel DMA API. For some special ones, for example VFIO drivers, they know how to manage the DMA themselves and set this flag so that the IOMMU layer will allow them to setup and manage their own I/O address space π
so lowkey: if all your DMA goes through the kernel DMA API, you can literally ignore this flag and go live your life π set it only if you're one of those special drivers that handles DMA on its own, iykyk
π§ SEE ALSO π§
- Kernel file
./include/linux/cdx/cdx_bus.h CDX_DEVICE(9)CDX_DEVICE_DRIVER_OVERRIDE(9)struct cdx_ops(9)struct cdx_controller(9)struct cdx_device(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)
and that's the whole page, bestie, no cap π this lil slice of the kernel API lives in ./include/linux/cdx and the version on deck is from October 2026 β go forth and register your drivers, slay πβ¨π¦
π¦ 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