cxl: Add mechanism for delivering AFU driver specific events
[cascardo/linux.git] / include / uapi / misc / cxl.h
index 8cd334f..cbae529 100644 (file)
@@ -93,6 +93,7 @@ enum cxl_event_type {
        CXL_EVENT_AFU_INTERRUPT = 1,
        CXL_EVENT_DATA_STORAGE  = 2,
        CXL_EVENT_AFU_ERROR     = 3,
+       CXL_EVENT_AFU_DRIVER    = 4,
 };
 
 struct cxl_event_header {
@@ -124,12 +125,28 @@ struct cxl_event_afu_error {
        __u64 error;
 };
 
+struct cxl_event_afu_driver_reserved {
+       /*
+        * Defines the buffer passed to the cxl driver by the AFU driver.
+        *
+        * This is not ABI since the event header.size passed to the user for
+        * existing events is set in the read call to sizeof(cxl_event_header)
+        * + sizeof(whatever event is being dispatched) and the user is already
+        * required to use a 4K buffer on the read call.
+        *
+        * Of course the contents will be ABI, but that's up the AFU driver.
+        */
+       size_t data_size;
+       u8 data[];
+};
+
 struct cxl_event {
        struct cxl_event_header header;
        union {
                struct cxl_event_afu_interrupt irq;
                struct cxl_event_data_storage fault;
                struct cxl_event_afu_error afu_error;
+               struct cxl_event_afu_driver_reserved afu_driver_event;
        };
 };