summaryrefslogtreecommitdiff
path: root/include/cxl
diff options
context:
space:
mode:
authorShiju Jose <shiju.jose@huawei.com>2025-02-20 12:42:43 -0700
committerDave Jiang <dave.jiang@intel.com>2025-02-26 08:51:32 -0700
commit14d502cc2718e6af44b575c95670292689a3ad65 (patch)
tree622bd2f40cd4a66dba3af8e426057a0db64ae7af /include/cxl
parent5e5ac21f629de796ab5d598b59c5e468c6fe4f95 (diff)
downloadlinux-14d502cc2718e6af44b575c95670292689a3ad65.tar.gz
linux-14d502cc2718e6af44b575c95670292689a3ad65.tar.bz2
linux-14d502cc2718e6af44b575c95670292689a3ad65.zip
cxl/mbox: Add SET_FEATURE mailbox command
Add support for SET_FEATURE mailbox command. CXL spec r3.2 section 8.2.9.6 describes optional device specific features. CXL devices supports features with changeable attributes. The settings of a feature can be optionally modified using Set Feature command. CXL spec r3.2 section 8.2.9.6.3 describes Set Feature command. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Li Ming <ming.li@zohomail.com> Signed-off-by: Shiju Jose <shiju.jose@huawei.com> Link: https://patch.msgid.link/20250220194438.2281088-6-dave.jiang@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Diffstat (limited to 'include/cxl')
-rw-r--r--include/cxl/features.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/cxl/features.h b/include/cxl/features.h
index 766c09978e5e..ae56ef7ec9ab 100644
--- a/include/cxl/features.h
+++ b/include/cxl/features.h
@@ -90,6 +90,39 @@ enum cxl_get_feat_selection {
CXL_GET_FEAT_SEL_MAX
};
+/*
+ * Set Feature CXL spec r3.2 8.2.9.6.3
+ */
+
+/*
+ * Set Feature input payload
+ * CXL spec r3.2 section 8.2.9.6.3 Table 8-101
+ */
+struct cxl_mbox_set_feat_in {
+ __struct_group(cxl_mbox_set_feat_hdr, hdr, /* no attrs */,
+ uuid_t uuid;
+ __le32 flags;
+ __le16 offset;
+ u8 version;
+ u8 rsvd[9];
+ );
+ __u8 feat_data[];
+} __packed;
+
+/* Set Feature flags field */
+enum cxl_set_feat_flag_data_transfer {
+ CXL_SET_FEAT_FLAG_FULL_DATA_TRANSFER = 0,
+ CXL_SET_FEAT_FLAG_INITIATE_DATA_TRANSFER,
+ CXL_SET_FEAT_FLAG_CONTINUE_DATA_TRANSFER,
+ CXL_SET_FEAT_FLAG_FINISH_DATA_TRANSFER,
+ CXL_SET_FEAT_FLAG_ABORT_DATA_TRANSFER,
+ CXL_SET_FEAT_FLAG_DATA_TRANSFER_MAX
+};
+
+#define CXL_SET_FEAT_FLAG_DATA_TRANSFER_MASK GENMASK(2, 0)
+
+#define CXL_SET_FEAT_FLAG_DATA_SAVED_ACROSS_RESET BIT(3)
+
/**
* struct cxl_features_state - The Features state for the device
* @cxlds: Pointer to CXL device state