blob: 4a25ab82788e8dc4e23c587e5fb4da10a89e14bb [file] [log] [blame]
Christopher Ferris05d08e92016-02-04 13:16:38 -08001/****************************************************************************
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>
22struct nd_cmd_smart {
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 __u32 status;
25 __u8 data[128];
26} __packed;
Christopher Ferris106b3a82016-08-24 12:15:38 -070027#define ND_SMART_HEALTH_VALID (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070029#define ND_SMART_TEMP_VALID (1 << 1)
30#define ND_SMART_SPARES_VALID (1 << 2)
31#define ND_SMART_ALARM_VALID (1 << 3)
32#define ND_SMART_USED_VALID (1 << 4)
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define ND_SMART_SHUTDOWN_VALID (1 << 5)
35#define ND_SMART_VENDOR_VALID (1 << 6)
36#define ND_SMART_TEMP_TRIP (1 << 0)
37#define ND_SMART_SPARE_TRIP (1 << 1)
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define ND_SMART_NON_CRITICAL_HEALTH (1 << 0)
40#define ND_SMART_CRITICAL_HEALTH (1 << 1)
41#define ND_SMART_FATAL_HEALTH (1 << 2)
42struct nd_smart_payload {
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 __u32 flags;
45 __u8 reserved0[4];
46 __u8 health;
47 __u16 temperature;
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 __u8 spares;
50 __u8 alarm_flags;
51 __u8 life_used;
52 __u8 shutdown_state;
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 __u8 reserved1;
55 __u32 vendor_size;
56 __u8 vendor_data[108];
57} __packed;
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59struct nd_cmd_smart_threshold {
Christopher Ferris05d08e92016-02-04 13:16:38 -080060 __u32 status;
61 __u8 data[8];
62} __packed;
Christopher Ferris05d08e92016-02-04 13:16:38 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070064struct nd_smart_threshold_payload {
65 __u16 alarm_control;
66 __u16 temperature;
67 __u8 spares;
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 __u8 reserved[3];
70} __packed;
71struct nd_cmd_dimm_flags {
Christopher Ferris05d08e92016-02-04 13:16:38 -080072 __u32 status;
Christopher Ferris106b3a82016-08-24 12:15:38 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080074 __u32 flags;
75} __packed;
76struct nd_cmd_get_config_size {
Christopher Ferris05d08e92016-02-04 13:16:38 -080077 __u32 status;
Christopher Ferris106b3a82016-08-24 12:15:38 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080079 __u32 config_size;
80 __u32 max_xfer;
81} __packed;
Christopher Ferris05d08e92016-02-04 13:16:38 -080082struct nd_cmd_get_config_data_hdr {
Christopher Ferris106b3a82016-08-24 12:15:38 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080084 __u32 in_offset;
85 __u32 in_length;
86 __u32 status;
Christopher Ferris05d08e92016-02-04 13:16:38 -080087 __u8 out_buf[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080089} __packed;
90struct nd_cmd_set_config_hdr {
91 __u32 in_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080092 __u32 in_length;
Christopher Ferris106b3a82016-08-24 12:15:38 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080094 __u8 in_buf[0];
95} __packed;
96struct nd_cmd_vendor_hdr {
Christopher Ferris05d08e92016-02-04 13:16:38 -080097 __u32 opcode;
Christopher Ferris106b3a82016-08-24 12:15:38 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080099 __u32 in_length;
100 __u8 in_buf[0];
101} __packed;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800102struct nd_cmd_vendor_tail {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800104 __u32 status;
105 __u32 out_length;
106 __u8 out_buf[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107} __packed;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800109struct nd_cmd_ars_cap {
110 __u64 address;
111 __u64 length;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800112 __u32 status;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114 __u32 max_ars_out;
115 __u32 clear_err_unit;
116 __u32 reserved;
117} __packed;
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119struct nd_cmd_ars_start {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800120 __u64 address;
121 __u64 length;
122 __u16 type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700124 __u8 flags;
125 __u8 reserved[5];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800126 __u32 status;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700127 __u32 scrub_time;
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800129} __packed;
130struct nd_cmd_ars_status {
131 __u32 status;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800132 __u32 out_length;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800134 __u64 address;
135 __u64 length;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700136 __u64 restart_address;
137 __u64 restart_length;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139 __u16 type;
140 __u16 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800141 __u32 num_records;
142 struct nd_ars_record {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700144 __u32 handle;
145 __u32 reserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800146 __u64 err_address;
147 __u64 length;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800149 } __packed records[0];
150} __packed;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151struct nd_cmd_clear_error {
152 __u64 address;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700154 __u64 length;
155 __u32 status;
156 __u8 reserved[4];
157 __u64 cleared;
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159} __packed;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800160enum {
161 ND_CMD_IMPLEMENTED = 0,
162 ND_CMD_ARS_CAP = 1,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700164 ND_CMD_ARS_START = 2,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800165 ND_CMD_ARS_STATUS = 3,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700166 ND_CMD_CLEAR_ERROR = 4,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800167 ND_CMD_SMART = 1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800169 ND_CMD_SMART_THRESHOLD = 2,
170 ND_CMD_DIMM_FLAGS = 3,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800171 ND_CMD_GET_CONFIG_SIZE = 4,
172 ND_CMD_GET_CONFIG_DATA = 5,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800174 ND_CMD_SET_CONFIG_DATA = 6,
175 ND_CMD_VENDOR_EFFECT_LOG_SIZE = 7,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800176 ND_CMD_VENDOR_EFFECT_LOG = 8,
177 ND_CMD_VENDOR = 9,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179 ND_CMD_CALL = 10,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800180};
181enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800182 ND_ARS_VOLATILE = 1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800184 ND_ARS_PERSISTENT = 2,
185};
186#define ND_IOCTL 'N'
Christopher Ferris05d08e92016-02-04 13:16:38 -0800187#define ND_IOCTL_SMART _IOWR(ND_IOCTL, ND_CMD_SMART, struct nd_cmd_smart)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800189#define ND_IOCTL_SMART_THRESHOLD _IOWR(ND_IOCTL, ND_CMD_SMART_THRESHOLD, struct nd_cmd_smart_threshold)
190#define ND_IOCTL_DIMM_FLAGS _IOWR(ND_IOCTL, ND_CMD_DIMM_FLAGS, struct nd_cmd_dimm_flags)
191#define ND_IOCTL_GET_CONFIG_SIZE _IOWR(ND_IOCTL, ND_CMD_GET_CONFIG_SIZE, struct nd_cmd_get_config_size)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800192#define ND_IOCTL_GET_CONFIG_DATA _IOWR(ND_IOCTL, ND_CMD_GET_CONFIG_DATA, struct nd_cmd_get_config_data_hdr)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800194#define ND_IOCTL_SET_CONFIG_DATA _IOWR(ND_IOCTL, ND_CMD_SET_CONFIG_DATA, struct nd_cmd_set_config_hdr)
195#define ND_IOCTL_VENDOR _IOWR(ND_IOCTL, ND_CMD_VENDOR, struct nd_cmd_vendor_hdr)
196#define ND_IOCTL_ARS_CAP _IOWR(ND_IOCTL, ND_CMD_ARS_CAP, struct nd_cmd_ars_cap)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800197#define ND_IOCTL_ARS_START _IOWR(ND_IOCTL, ND_CMD_ARS_START, struct nd_cmd_ars_start)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800199#define ND_IOCTL_ARS_STATUS _IOWR(ND_IOCTL, ND_CMD_ARS_STATUS, struct nd_cmd_ars_status)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700200#define ND_IOCTL_CLEAR_ERROR _IOWR(ND_IOCTL, ND_CMD_CLEAR_ERROR, struct nd_cmd_clear_error)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800201#define ND_DEVICE_DIMM 1
202#define ND_DEVICE_REGION_PMEM 2
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204#define ND_DEVICE_REGION_BLK 3
205#define ND_DEVICE_NAMESPACE_IO 4
206#define ND_DEVICE_NAMESPACE_PMEM 5
207#define ND_DEVICE_NAMESPACE_BLK 6
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700209#define ND_DEVICE_DAX_PMEM 7
Christopher Ferris05d08e92016-02-04 13:16:38 -0800210enum nd_driver_flags {
211 ND_DRIVER_DIMM = 1 << ND_DEVICE_DIMM,
212 ND_DRIVER_REGION_PMEM = 1 << ND_DEVICE_REGION_PMEM,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214 ND_DRIVER_REGION_BLK = 1 << ND_DEVICE_REGION_BLK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800215 ND_DRIVER_NAMESPACE_IO = 1 << ND_DEVICE_NAMESPACE_IO,
216 ND_DRIVER_NAMESPACE_PMEM = 1 << ND_DEVICE_NAMESPACE_PMEM,
217 ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700219 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
220};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800221enum {
222 ND_MIN_NAMESPACE_SIZE = 0x00400000,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800224};
225enum ars_masks {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800226 ARS_STATUS_MASK = 0x0000FFFF,
227 ARS_EXT_STATUS_SHIFT = 16,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700229};
230struct nd_cmd_pkg {
231 __u64 nd_family;
232 __u64 nd_command;
233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 __u32 nd_size_in;
235 __u32 nd_size_out;
236 __u32 nd_reserved2[9];
237 __u32 nd_fw_size;
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 unsigned char nd_payload[];
240};
241#define NVDIMM_FAMILY_INTEL 0
242#define NVDIMM_FAMILY_HPE1 1
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244#define NVDIMM_FAMILY_HPE2 2
245#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL, struct nd_cmd_pkg)
246#endif