1 /* 2 * This file is auto-generated. Modifications will be lost. 3 * 4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ 5 * for more information. 6 */ 7 #ifndef _UAPI_CXL_MEM_H_ 8 #define _UAPI_CXL_MEM_H_ 9 #include <linux/types.h> 10 #define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands) 11 #define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command) 12 #define CXL_CMDS ___C(INVALID, "Invalid Command"), ___C(IDENTIFY, "Identify Command"), ___C(RAW, "Raw device command"), ___C(GET_SUPPORTED_LOGS, "Get Supported Logs"), ___C(GET_FW_INFO, "Get FW Info"), ___C(GET_PARTITION_INFO, "Get Partition Information"), ___C(GET_LSA, "Get Label Storage Area"), ___C(GET_HEALTH_INFO, "Get Health Info"), ___C(GET_LOG, "Get Log"), ___C(SET_PARTITION_INFO, "Set Partition Information"), ___C(SET_LSA, "Set Label Storage Area"), ___C(GET_ALERT_CONFIG, "Get Alert Configuration"), ___C(SET_ALERT_CONFIG, "Set Alert Configuration"), ___C(GET_SHUTDOWN_STATE, "Get Shutdown State"), ___C(SET_SHUTDOWN_STATE, "Set Shutdown State"), ___DEPRECATED(GET_POISON, "Get Poison List"), ___DEPRECATED(INJECT_POISON, "Inject Poison"), ___DEPRECATED(CLEAR_POISON, "Clear Poison"), ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), ___DEPRECATED(SCAN_MEDIA, "Scan Media"), ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"), ___C(GET_TIMESTAMP, "Get Timestamp"), ___C(GET_LOG_CAPS, "Get Log Capabilities"), ___C(CLEAR_LOG, "Clear Log"), ___C(GET_SUP_LOG_SUBLIST, "Get Supported Logs Sub-List"), ___C(MAX, "invalid / last command") 13 #define ___C(a,b) CXL_MEM_COMMAND_ID_ ##a 14 #define ___DEPRECATED(a,b) CXL_MEM_DEPRECATED_ID_ ##a 15 enum { 16 CXL_CMDS 17 }; 18 #undef ___C 19 #undef ___DEPRECATED 20 #define ___C(a,b) { b } 21 #define ___DEPRECATED(a,b) { "Deprecated " b } 22 static const struct { 23 const char * name; 24 } cxl_command_names[] __attribute__((__unused__)) = { 25 CXL_CMDS 26 }; 27 #undef ___C 28 #undef ___DEPRECATED 29 #define ___C(a,b) (0) 30 #define ___DEPRECATED(a,b) (1) 31 #undef ___C 32 #undef ___DEPRECATED 33 struct cxl_command_info { 34 __u32 id; 35 __u32 flags; 36 #define CXL_MEM_COMMAND_FLAG_MASK GENMASK(1, 0) 37 #define CXL_MEM_COMMAND_FLAG_ENABLED BIT(0) 38 #define CXL_MEM_COMMAND_FLAG_EXCLUSIVE BIT(1) 39 __u32 size_in; 40 __u32 size_out; 41 }; 42 struct cxl_mem_query_commands { 43 __u32 n_commands; 44 __u32 rsvd; 45 struct cxl_command_info commands[]; 46 }; 47 struct cxl_send_command { 48 __u32 id; 49 __u32 flags; 50 union { 51 struct { 52 __u16 opcode; 53 __u16 rsvd; 54 } raw; 55 __u32 rsvd; 56 }; 57 __u32 retval; 58 struct { 59 __u32 size; 60 __u32 rsvd; 61 __u64 payload; 62 } in; 63 struct { 64 __u32 size; 65 __u32 rsvd; 66 __u64 payload; 67 } out; 68 }; 69 #endif 70