blob: 578cefd27ab94883a3bb09d2913b2f6890ffad49 [file] [log] [blame]
Christopher Ferrisa9750ed2021-05-03 14:02:49 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_CXL_MEM_H_
20#define _UAPI_CXL_MEM_H_
21#include <linux/types.h>
22#define CXL_MEM_QUERY_COMMANDS _IOR(0xCE, 1, struct cxl_mem_query_commands)
23#define CXL_MEM_SEND_COMMAND _IOWR(0xCE, 2, struct cxl_send_command)
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000024#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"), ___C(GET_POISON, "Get Poison List"), ___C(INJECT_POISON, "Inject Poison"), ___C(CLEAR_POISON, "Clear Poison"), ___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), ___C(SCAN_MEDIA, "Scan Media"), ___C(GET_SCAN_MEDIA, "Get Scan Media Results"), ___C(MAX, "invalid / last command")
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070025#define ___C(a,b) CXL_MEM_COMMAND_ID_ ##a
26enum {
27 CXL_CMDS
28};
29#undef ___C
30#define ___C(a,b) { b }
31static const struct {
32 const char * name;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070033} cxl_command_names[] __attribute__((__unused__)) = {
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070034 CXL_CMDS
35};
36#undef ___C
37struct cxl_command_info {
38 __u32 id;
39 __u32 flags;
40#define CXL_MEM_COMMAND_FLAG_MASK GENMASK(0, 0)
Christopher Ferris80ae69d2022-08-02 16:32:21 -070041 __u32 size_in;
42 __u32 size_out;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070043};
44struct cxl_mem_query_commands {
45 __u32 n_commands;
46 __u32 rsvd;
47 struct cxl_command_info __user commands[];
48};
49struct cxl_send_command {
50 __u32 id;
51 __u32 flags;
52 union {
53 struct {
54 __u16 opcode;
55 __u16 rsvd;
56 } raw;
57 __u32 rsvd;
58 };
59 __u32 retval;
60 struct {
Christopher Ferris80ae69d2022-08-02 16:32:21 -070061 __u32 size;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070062 __u32 rsvd;
63 __u64 payload;
64 } in;
65 struct {
Christopher Ferris80ae69d2022-08-02 16:32:21 -070066 __u32 size;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -070067 __u32 rsvd;
68 __u64 payload;
69 } out;
70};
71#endif