STRUCT CXL_DEV_STATE(9)
π struct cxl_dev_state(9) β like, the whole Kernel API Manual, but make it make sense
okay bestie, so this is struct cxl_dev_state(9) from the Kernel API Manual, and honestly? it's kind of a main character. it's the driver device state. let's get into it π«Ά
β¨ NAME β¨
struct cxl_dev_state β the driver device state. that's it, that's the vibe.
πΈ SYNOPSIS πΈ
struct cxl_dev_state {
struct device *dev;
struct cxl_memdev *cxlmd;
struct cxl_register_map reg_map;
struct cxl_device_regs regs;
int cxl_dvsec;
bool rcd;
bool media_ready;
struct resource dpa_res;
struct cxl_dpa_partition part[CXL_NR_PARTITIONS_MAX];
unsigned int nr_partitions;
u64 serial;
enum cxl_devtype type;
struct cxl_mailbox cxl_mbox;
#ifdef CONFIG_CXL_FEATURES;
struct cxl_features_state *cxlfs;
#endif;
};
no cap, that #ifdef CONFIG_CXL_FEATURES; block is conditional β only shows up when features are compiled in π
π Members π
okay so let's go member by member, because every single one is here for a reason:
devβ the device associated with this CXL state. like, the actual device it's all about πcxlmdβ the device representing the CXL.mem capabilities ofdevreg_mapβ component and ras register mapping parametersregsβ Parsed register blockscxl_dvsecβ Offset to the PCIe device DVSECrcdβ operating in RCD mode (CXL 3.0 9.11.8 CXL Devices Attached to an RCH). yes, the spec section is included, we don't skip citations here π§media_readyβ Indicate whether the device media is usabledpa_resβ Overall DPA resource tree for the devicepartβ DPA partition arraynr_partitionsβ Number of DPA partitionsserialβ PCIe Device Serial Numbertypeβ Generic Memory Class device or Vendor Specific Memory devicecxl_mboxβ CXL mailbox contextcxlfsβ CXL features context
π Description π
cxl_dev_state represents the CXL driver/device state. it gives you an interface to mailbox commands, plus some cached data about the device. lowkey iconic of it.
and a heads up so you're not surprised: Currently only memory devices are represented. that's the whole scope, bestie, don't come looking for anything else π
π¦ SEE ALSO π¦
- Kernel file
./include/cxl/cxl.hβenum cxl_devtype(9) struct cxl_register_map(9)struct cxl_dpa_perf(9)struct cxl_dpa_partition(9)
go read those next, iykyk π
alright that's the whole page, periodt. this lil beauty lives at ./include/cxl, dated October 2026, and yes it's filed under struct cxl_dev_state(9) β¨ 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