1 /****************************************************************************
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 __NDCTL_H__
20 #define __NDCTL_H__
21 #include <linux/types.h>
22 struct nd_cmd_smart {
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24   __u32 status;
25   __u8 data[128];
26 } __packed;
27 struct nd_cmd_smart_threshold {
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29   __u32 status;
30   __u8 data[8];
31 } __packed;
32 struct nd_cmd_dimm_flags {
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34   __u32 status;
35   __u32 flags;
36 } __packed;
37 struct nd_cmd_get_config_size {
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39   __u32 status;
40   __u32 config_size;
41   __u32 max_xfer;
42 } __packed;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 struct nd_cmd_get_config_data_hdr {
45   __u32 in_offset;
46   __u32 in_length;
47   __u32 status;
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49   __u8 out_buf[0];
50 } __packed;
51 struct nd_cmd_set_config_hdr {
52   __u32 in_offset;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54   __u32 in_length;
55   __u8 in_buf[0];
56 } __packed;
57 struct nd_cmd_vendor_hdr {
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59   __u32 opcode;
60   __u32 in_length;
61   __u8 in_buf[0];
62 } __packed;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 struct nd_cmd_vendor_tail {
65   __u32 status;
66   __u32 out_length;
67   __u8 out_buf[0];
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 } __packed;
70 struct nd_cmd_ars_cap {
71   __u64 address;
72   __u64 length;
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74   __u32 status;
75   __u32 max_ars_out;
76 } __packed;
77 struct nd_cmd_ars_start {
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79   __u64 address;
80   __u64 length;
81   __u16 type;
82   __u8 reserved[6];
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84   __u32 status;
85 } __packed;
86 struct nd_cmd_ars_status {
87   __u32 status;
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89   __u32 out_length;
90   __u64 address;
91   __u64 length;
92   __u16 type;
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94   __u32 num_records;
95   struct nd_ars_record {
96     __u32 handle;
97     __u32 flags;
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99     __u64 err_address;
100     __u64 length;
101   } __packed records[0];
102 } __packed;
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 enum {
105   ND_CMD_IMPLEMENTED = 0,
106   ND_CMD_ARS_CAP = 1,
107   ND_CMD_ARS_START = 2,
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   ND_CMD_ARS_STATUS = 3,
110   ND_CMD_SMART = 1,
111   ND_CMD_SMART_THRESHOLD = 2,
112   ND_CMD_DIMM_FLAGS = 3,
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114   ND_CMD_GET_CONFIG_SIZE = 4,
115   ND_CMD_GET_CONFIG_DATA = 5,
116   ND_CMD_SET_CONFIG_DATA = 6,
117   ND_CMD_VENDOR_EFFECT_LOG_SIZE = 7,
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119   ND_CMD_VENDOR_EFFECT_LOG = 8,
120   ND_CMD_VENDOR = 9,
121 };
122 enum {
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124   ND_ARS_VOLATILE = 1,
125   ND_ARS_PERSISTENT = 2,
126 };
127 #define ND_IOCTL 'N'
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 #define ND_IOCTL_SMART _IOWR(ND_IOCTL, ND_CMD_SMART, struct nd_cmd_smart)
130 #define ND_IOCTL_SMART_THRESHOLD _IOWR(ND_IOCTL, ND_CMD_SMART_THRESHOLD, struct nd_cmd_smart_threshold)
131 #define ND_IOCTL_DIMM_FLAGS _IOWR(ND_IOCTL, ND_CMD_DIMM_FLAGS, struct nd_cmd_dimm_flags)
132 #define ND_IOCTL_GET_CONFIG_SIZE _IOWR(ND_IOCTL, ND_CMD_GET_CONFIG_SIZE, struct nd_cmd_get_config_size)
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 #define ND_IOCTL_GET_CONFIG_DATA _IOWR(ND_IOCTL, ND_CMD_GET_CONFIG_DATA, struct nd_cmd_get_config_data_hdr)
135 #define ND_IOCTL_SET_CONFIG_DATA _IOWR(ND_IOCTL, ND_CMD_SET_CONFIG_DATA, struct nd_cmd_set_config_hdr)
136 #define ND_IOCTL_VENDOR _IOWR(ND_IOCTL, ND_CMD_VENDOR, struct nd_cmd_vendor_hdr)
137 #define ND_IOCTL_ARS_CAP _IOWR(ND_IOCTL, ND_CMD_ARS_CAP, struct nd_cmd_ars_cap)
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 #define ND_IOCTL_ARS_START _IOWR(ND_IOCTL, ND_CMD_ARS_START, struct nd_cmd_ars_start)
140 #define ND_IOCTL_ARS_STATUS _IOWR(ND_IOCTL, ND_CMD_ARS_STATUS, struct nd_cmd_ars_status)
141 #define ND_DEVICE_DIMM 1
142 #define ND_DEVICE_REGION_PMEM 2
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 #define ND_DEVICE_REGION_BLK 3
145 #define ND_DEVICE_NAMESPACE_IO 4
146 #define ND_DEVICE_NAMESPACE_PMEM 5
147 #define ND_DEVICE_NAMESPACE_BLK 6
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 enum nd_driver_flags {
150   ND_DRIVER_DIMM = 1 << ND_DEVICE_DIMM,
151   ND_DRIVER_REGION_PMEM = 1 << ND_DEVICE_REGION_PMEM,
152   ND_DRIVER_REGION_BLK = 1 << ND_DEVICE_REGION_BLK,
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154   ND_DRIVER_NAMESPACE_IO = 1 << ND_DEVICE_NAMESPACE_IO,
155   ND_DRIVER_NAMESPACE_PMEM = 1 << ND_DEVICE_NAMESPACE_PMEM,
156   ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
157 };
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 enum {
160   ND_MIN_NAMESPACE_SIZE = 0x00400000,
161 };
162 enum ars_masks {
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164   ARS_STATUS_MASK = 0x0000FFFF,
165   ARS_EXT_STATUS_SHIFT = 16,
166 };
167 #endif
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169