blob: dc18a20a52a787e62f430e5e7122052aac921679 [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 Ferris6a9755d2017-01-13 14:09:31 -080029#define ND_SMART_SPARES_VALID (1 << 1)
30#define ND_SMART_USED_VALID (1 << 2)
31#define ND_SMART_TEMP_VALID (1 << 3)
32#define ND_SMART_CTEMP_VALID (1 << 4)
Christopher Ferris106b3a82016-08-24 12:15:38 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080034#define ND_SMART_ALARM_VALID (1 << 9)
35#define ND_SMART_SHUTDOWN_VALID (1 << 10)
36#define ND_SMART_VENDOR_VALID (1 << 11)
37#define ND_SMART_SPARE_TRIP (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080039#define ND_SMART_TEMP_TRIP (1 << 1)
40#define ND_SMART_CTEMP_TRIP (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -070041#define ND_SMART_NON_CRITICAL_HEALTH (1 << 0)
42#define ND_SMART_CRITICAL_HEALTH (1 << 1)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070044#define ND_SMART_FATAL_HEALTH (1 << 2)
45struct nd_smart_payload {
Christopher Ferris106b3a82016-08-24 12:15:38 -070046 __u32 flags;
47 __u8 reserved0[4];
Christopher Ferris106b3a82016-08-24 12:15:38 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris6a9755d2017-01-13 14:09:31 -080049 __u8 health;
Christopher Ferris106b3a82016-08-24 12:15:38 -070050 __u8 spares;
Christopher Ferris106b3a82016-08-24 12:15:38 -070051 __u8 life_used;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080052 __u8 alarm_flags;
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 __u16 temperature;
55 __u16 ctrl_temperature;
56 __u8 reserved1[15];
Christopher Ferris106b3a82016-08-24 12:15:38 -070057 __u8 shutdown_state;
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070059 __u32 vendor_size;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080060 __u8 vendor_data[92];
Christopher Ferris106b3a82016-08-24 12:15:38 -070061} __packed;
Christopher Ferris106b3a82016-08-24 12:15:38 -070062struct nd_cmd_smart_threshold {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080064 __u32 status;
65 __u8 data[8];
66} __packed;
Christopher Ferris106b3a82016-08-24 12:15:38 -070067struct nd_smart_threshold_payload {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 __u8 alarm_control;
70 __u8 reserved0;
Christopher Ferris106b3a82016-08-24 12:15:38 -070071 __u16 temperature;
72 __u8 spares;
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 __u8 reserved[3];
75} __packed;
76struct nd_cmd_dimm_flags {
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 flags;
80} __packed;
81struct nd_cmd_get_config_size {
Christopher Ferris05d08e92016-02-04 13:16:38 -080082 __u32 status;
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 config_size;
85 __u32 max_xfer;
86} __packed;
Christopher Ferris05d08e92016-02-04 13:16:38 -080087struct nd_cmd_get_config_data_hdr {
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 __u32 in_offset;
90 __u32 in_length;
91 __u32 status;
Christopher Ferris05d08e92016-02-04 13:16:38 -080092 __u8 out_buf[0];
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} __packed;
95struct nd_cmd_set_config_hdr {
96 __u32 in_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080097 __u32 in_length;
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 __u8 in_buf[0];
100} __packed;
101struct nd_cmd_vendor_hdr {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800102 __u32 opcode;
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 in_length;
105 __u8 in_buf[0];
106} __packed;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107struct nd_cmd_vendor_tail {
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 -0800109 __u32 status;
110 __u32 out_length;
111 __u8 out_buf[0];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800112} __packed;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800114struct nd_cmd_ars_cap {
115 __u64 address;
116 __u64 length;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800117 __u32 status;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700119 __u32 max_ars_out;
120 __u32 clear_err_unit;
121 __u32 reserved;
122} __packed;
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124struct nd_cmd_ars_start {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800125 __u64 address;
126 __u64 length;
127 __u16 type;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700129 __u8 flags;
130 __u8 reserved[5];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800131 __u32 status;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700132 __u32 scrub_time;
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800134} __packed;
135struct nd_cmd_ars_status {
136 __u32 status;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800137 __u32 out_length;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800139 __u64 address;
140 __u64 length;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700141 __u64 restart_address;
142 __u64 restart_length;
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 __u16 type;
145 __u16 flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800146 __u32 num_records;
147 struct nd_ars_record {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700149 __u32 handle;
150 __u32 reserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800151 __u64 err_address;
152 __u64 length;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800154 } __packed records[0];
155} __packed;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700156struct nd_cmd_clear_error {
157 __u64 address;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159 __u64 length;
160 __u32 status;
161 __u8 reserved[4];
162 __u64 cleared;
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164} __packed;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800165enum {
166 ND_CMD_IMPLEMENTED = 0,
167 ND_CMD_ARS_CAP = 1,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700169 ND_CMD_ARS_START = 2,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800170 ND_CMD_ARS_STATUS = 3,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700171 ND_CMD_CLEAR_ERROR = 4,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800172 ND_CMD_SMART = 1,
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_SMART_THRESHOLD = 2,
175 ND_CMD_DIMM_FLAGS = 3,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800176 ND_CMD_GET_CONFIG_SIZE = 4,
177 ND_CMD_GET_CONFIG_DATA = 5,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800179 ND_CMD_SET_CONFIG_DATA = 6,
180 ND_CMD_VENDOR_EFFECT_LOG_SIZE = 7,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800181 ND_CMD_VENDOR_EFFECT_LOG = 8,
182 ND_CMD_VENDOR = 9,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 ND_CMD_CALL = 10,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800185};
186enum {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800187 ND_ARS_VOLATILE = 1,
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 ND_ARS_PERSISTENT = 2,
190};
191#define ND_IOCTL 'N'
Christopher Ferris05d08e92016-02-04 13:16:38 -0800192#define ND_IOCTL_SMART _IOWR(ND_IOCTL, ND_CMD_SMART, struct nd_cmd_smart)
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_SMART_THRESHOLD _IOWR(ND_IOCTL, ND_CMD_SMART_THRESHOLD, struct nd_cmd_smart_threshold)
195#define ND_IOCTL_DIMM_FLAGS _IOWR(ND_IOCTL, ND_CMD_DIMM_FLAGS, struct nd_cmd_dimm_flags)
196#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 -0800197#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 -0700198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800199#define ND_IOCTL_SET_CONFIG_DATA _IOWR(ND_IOCTL, ND_CMD_SET_CONFIG_DATA, struct nd_cmd_set_config_hdr)
200#define ND_IOCTL_VENDOR _IOWR(ND_IOCTL, ND_CMD_VENDOR, struct nd_cmd_vendor_hdr)
201#define ND_IOCTL_ARS_CAP _IOWR(ND_IOCTL, ND_CMD_ARS_CAP, struct nd_cmd_ars_cap)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800202#define ND_IOCTL_ARS_START _IOWR(ND_IOCTL, ND_CMD_ARS_START, struct nd_cmd_ars_start)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800204#define ND_IOCTL_ARS_STATUS _IOWR(ND_IOCTL, ND_CMD_ARS_STATUS, struct nd_cmd_ars_status)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700205#define ND_IOCTL_CLEAR_ERROR _IOWR(ND_IOCTL, ND_CMD_CLEAR_ERROR, struct nd_cmd_clear_error)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800206#define ND_DEVICE_DIMM 1
207#define ND_DEVICE_REGION_PMEM 2
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209#define ND_DEVICE_REGION_BLK 3
210#define ND_DEVICE_NAMESPACE_IO 4
211#define ND_DEVICE_NAMESPACE_PMEM 5
212#define ND_DEVICE_NAMESPACE_BLK 6
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214#define ND_DEVICE_DAX_PMEM 7
Christopher Ferris05d08e92016-02-04 13:16:38 -0800215enum nd_driver_flags {
216 ND_DRIVER_DIMM = 1 << ND_DEVICE_DIMM,
217 ND_DRIVER_REGION_PMEM = 1 << ND_DEVICE_REGION_PMEM,
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_REGION_BLK = 1 << ND_DEVICE_REGION_BLK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800220 ND_DRIVER_NAMESPACE_IO = 1 << ND_DEVICE_NAMESPACE_IO,
221 ND_DRIVER_NAMESPACE_PMEM = 1 << ND_DEVICE_NAMESPACE_PMEM,
222 ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700224 ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
225};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800226enum {
227 ND_MIN_NAMESPACE_SIZE = 0x00400000,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800229};
230enum ars_masks {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800231 ARS_STATUS_MASK = 0x0000FFFF,
232 ARS_EXT_STATUS_SHIFT = 16,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700234};
235struct nd_cmd_pkg {
236 __u64 nd_family;
237 __u64 nd_command;
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 __u32 nd_size_in;
240 __u32 nd_size_out;
241 __u32 nd_reserved2[9];
242 __u32 nd_fw_size;
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 unsigned char nd_payload[];
245};
246#define NVDIMM_FAMILY_INTEL 0
247#define NVDIMM_FAMILY_HPE1 1
248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249#define NVDIMM_FAMILY_HPE2 2
Christopher Ferris49f525c2016-12-12 14:55:36 -0800250#define NVDIMM_FAMILY_MSFT 3
Christopher Ferris106b3a82016-08-24 12:15:38 -0700251#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL, struct nd_cmd_pkg)
252#endif
Christopher Ferris49f525c2016-12-12 14:55:36 -0800253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */