summaryrefslogtreecommitdiff
path: root/include/linux/cxl-event.h
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2023-12-21 03:17:33 +0300
committerDan Williams <dan.j.williams@intel.com>2024-01-10 02:41:22 +0300
commitf9c683386f5bc0364615138ce2b14be50848dbcf (patch)
tree3679b512d53f842773aa697e1fbaf4ff1d24a65c /include/linux/cxl-event.h
parent6eade110754c085cee9e46f4d87d2c3ea4e59e8c (diff)
downloadlinux-f9c683386f5bc0364615138ce2b14be50848dbcf.tar.xz
cxl/events: Create a CXL event union
The CXL CPER and event log records share everything but a UUID/GUID in their structures. Define a cxl_event union without the UUID/GUID to be shared between the CPER and event log record formats. Adjust the code to use this union. Signed-off-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20231220-cxl-cper-v5-6-1bb8a4ca2c7a@intel.com Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/cxl-event.h')
-rw-r--r--include/linux/cxl-event.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/linux/cxl-event.h b/include/linux/cxl-event.h
index 3d9b5954d0c1..4d6c05f535f8 100644
--- a/include/linux/cxl-event.h
+++ b/include/linux/cxl-event.h
@@ -17,13 +17,8 @@ struct cxl_event_record_hdr {
u8 reserved[15];
} __packed;
-/*
- * Common Event Record Format
- * CXL rev 3.0 section 8.2.9.2.1; Table 8-42
- */
#define CXL_EVENT_RECORD_DATA_LENGTH 0x50
-struct cxl_event_record_raw {
- uuid_t id;
+struct cxl_event_generic {
struct cxl_event_record_hdr hdr;
u8 data[CXL_EVENT_RECORD_DATA_LENGTH];
} __packed;
@@ -96,4 +91,20 @@ struct cxl_event_mem_module {
u8 reserved[0x3d];
} __packed;
+union cxl_event {
+ struct cxl_event_generic generic;
+ struct cxl_event_gen_media gen_media;
+ struct cxl_event_dram dram;
+ struct cxl_event_mem_module mem_module;
+} __packed;
+
+/*
+ * Common Event Record Format; in event logs
+ * CXL rev 3.0 section 8.2.9.2.1; Table 8-42
+ */
+struct cxl_event_record_raw {
+ uuid_t id;
+ union cxl_event event;
+} __packed;
+
#endif /* _LINUX_CXL_EVENT_H */