diff options
author | Ira Weiny <ira.weiny@intel.com> | 2023-12-20 16:17:33 -0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2024-01-09 15:41:22 -0800 |
commit | f9c683386f5bc0364615138ce2b14be50848dbcf (patch) | |
tree | 3679b512d53f842773aa697e1fbaf4ff1d24a65c /include/linux/cxl-event.h | |
parent | 6eade110754c085cee9e46f4d87d2c3ea4e59e8c (diff) | |
download | linux-f9c683386f5bc0364615138ce2b14be50848dbcf.tar.gz linux-f9c683386f5bc0364615138ce2b14be50848dbcf.tar.bz2 linux-f9c683386f5bc0364615138ce2b14be50848dbcf.zip |
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.h | 23 |
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 */ |