STRUCT CXL_DEV_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 of dev
  • reg_map β€” component and ras register mapping parameters
  • regs β€” Parsed register blocks
  • cxl_dvsec β€” Offset to the PCIe device DVSEC
  • rcd β€” 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 usable
  • dpa_res β€” Overall DPA resource tree for the device
  • part β€” DPA partition array
  • nr_partitions β€” Number of DPA partitions
  • serial β€” PCIe Device Serial Number
  • type β€” Generic Memory Class device or Vendor Specific Memory device
  • cxl_mbox β€” CXL mailbox context
  • cxlfs β€” 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