Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 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 | */ |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 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) |
Christopher Ferris | 7ac54f5 | 2024-08-07 21:07:12 +0000 | [diff] [blame] | 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") |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 13 | #define ___C(a,b) CXL_MEM_COMMAND_ID_ ##a |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 14 | #define ___DEPRECATED(a,b) CXL_MEM_DEPRECATED_ID_ ##a |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 15 | enum { |
| 16 | CXL_CMDS |
| 17 | }; |
| 18 | #undef ___C |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 19 | #undef ___DEPRECATED |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 20 | #define ___C(a,b) { b } |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 21 | #define ___DEPRECATED(a,b) { "Deprecated " b } |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 22 | static const struct { |
| 23 | const char * name; |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 24 | } cxl_command_names[] __attribute__((__unused__)) = { |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 25 | CXL_CMDS |
| 26 | }; |
| 27 | #undef ___C |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame] | 28 | #undef ___DEPRECATED |
| 29 | #define ___C(a,b) (0) |
| 30 | #define ___DEPRECATED(a,b) (1) |
| 31 | #undef ___C |
| 32 | #undef ___DEPRECATED |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 33 | struct cxl_command_info { |
| 34 | __u32 id; |
| 35 | __u32 flags; |
Christopher Ferris | b7cef6d | 2023-05-09 19:04:15 +0000 | [diff] [blame] | 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) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 39 | __u32 size_in; |
| 40 | __u32 size_out; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 41 | }; |
| 42 | struct cxl_mem_query_commands { |
| 43 | __u32 n_commands; |
| 44 | __u32 rsvd; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 45 | struct cxl_command_info commands[]; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 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 { |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 59 | __u32 size; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 60 | __u32 rsvd; |
| 61 | __u64 payload; |
| 62 | } in; |
| 63 | struct { |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 64 | __u32 size; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 65 | __u32 rsvd; |
| 66 | __u64 payload; |
| 67 | } out; |
| 68 | }; |
| 69 | #endif |