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 _UAPI_LINUX_NVME_H
20 #define _UAPI_LINUX_NVME_H
21 #include <linux/types.h>
22 struct nvme_id_power_state {
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24   __le16 max_power;
25   __u8 rsvd2;
26   __u8 flags;
27   __le32 entry_lat;
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29   __le32 exit_lat;
30   __u8 read_tput;
31   __u8 read_lat;
32   __u8 write_tput;
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34   __u8 write_lat;
35   __le16 idle_power;
36   __u8 idle_scale;
37   __u8 rsvd19;
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39   __le16 active_power;
40   __u8 active_work_scale;
41   __u8 rsvd23[9];
42 };
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 enum {
45   NVME_PS_FLAGS_MAX_POWER_SCALE = 1 << 0,
46   NVME_PS_FLAGS_NON_OP_STATE = 1 << 1,
47 };
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 struct nvme_id_ctrl {
50   __le16 vid;
51   __le16 ssvid;
52   char sn[20];
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54   char mn[40];
55   char fr[8];
56   __u8 rab;
57   __u8 ieee[3];
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59   __u8 mic;
60   __u8 mdts;
61   __u16 cntlid;
62   __u32 ver;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64   __u8 rsvd84[172];
65   __le16 oacs;
66   __u8 acl;
67   __u8 aerl;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69   __u8 frmw;
70   __u8 lpa;
71   __u8 elpe;
72   __u8 npss;
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74   __u8 avscc;
75   __u8 apsta;
76   __le16 wctemp;
77   __le16 cctemp;
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79   __u8 rsvd270[242];
80   __u8 sqes;
81   __u8 cqes;
82   __u8 rsvd514[2];
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84   __le32 nn;
85   __le16 oncs;
86   __le16 fuses;
87   __u8 fna;
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89   __u8 vwc;
90   __le16 awun;
91   __le16 awupf;
92   __u8 nvscc;
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94   __u8 rsvd531;
95   __le16 acwu;
96   __u8 rsvd534[2];
97   __le32 sgls;
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99   __u8 rsvd540[1508];
100   struct nvme_id_power_state psd[32];
101   __u8 vs[1024];
102 };
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 enum {
105   NVME_CTRL_ONCS_COMPARE = 1 << 0,
106   NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
107   NVME_CTRL_ONCS_DSM = 1 << 2,
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   NVME_CTRL_VWC_PRESENT = 1 << 0,
110 };
111 struct nvme_lbaf {
112   __le16 ms;
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114   __u8 ds;
115   __u8 rp;
116 };
117 struct nvme_id_ns {
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119   __le64 nsze;
120   __le64 ncap;
121   __le64 nuse;
122   __u8 nsfeat;
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124   __u8 nlbaf;
125   __u8 flbas;
126   __u8 mc;
127   __u8 dpc;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129   __u8 dps;
130   __u8 nmic;
131   __u8 rescap;
132   __u8 fpi;
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134   __u8 rsvd33;
135   __le16 nawun;
136   __le16 nawupf;
137   __le16 nacwu;
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139   __u8 rsvd40[80];
140   __u8 eui64[8];
141   struct nvme_lbaf lbaf[16];
142   __u8 rsvd192[192];
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144   __u8 vs[3712];
145 };
146 enum {
147   NVME_NS_FEAT_THIN = 1 << 0,
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149   NVME_LBAF_RP_BEST = 0,
150   NVME_LBAF_RP_BETTER = 1,
151   NVME_LBAF_RP_GOOD = 2,
152   NVME_LBAF_RP_DEGRADED = 3,
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 };
155 struct nvme_smart_log {
156   __u8 critical_warning;
157   __u8 temperature[2];
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159   __u8 avail_spare;
160   __u8 spare_thresh;
161   __u8 percent_used;
162   __u8 rsvd6[26];
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164   __u8 data_units_read[16];
165   __u8 data_units_written[16];
166   __u8 host_reads[16];
167   __u8 host_writes[16];
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169   __u8 ctrl_busy_time[16];
170   __u8 power_cycles[16];
171   __u8 power_on_hours[16];
172   __u8 unsafe_shutdowns[16];
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174   __u8 media_errors[16];
175   __u8 num_err_log_entries[16];
176   __le32 warning_temp_time;
177   __le32 critical_comp_time;
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179   __le16 temp_sensor[8];
180   __u8 rsvd216[296];
181 };
182 enum {
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184   NVME_SMART_CRIT_SPARE = 1 << 0,
185   NVME_SMART_CRIT_TEMPERATURE = 1 << 1,
186   NVME_SMART_CRIT_RELIABILITY = 1 << 2,
187   NVME_SMART_CRIT_MEDIA = 1 << 3,
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189   NVME_SMART_CRIT_VOLATILE_MEMORY = 1 << 4,
190 };
191 struct nvme_lba_range_type {
192   __u8 type;
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194   __u8 attributes;
195   __u8 rsvd2[14];
196   __u64 slba;
197   __u64 nlb;
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199   __u8 guid[16];
200   __u8 rsvd48[16];
201 };
202 enum {
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204   NVME_LBART_TYPE_FS = 0x01,
205   NVME_LBART_TYPE_RAID = 0x02,
206   NVME_LBART_TYPE_CACHE = 0x03,
207   NVME_LBART_TYPE_SWAP = 0x04,
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209   NVME_LBART_ATTRIB_TEMP = 1 << 0,
210   NVME_LBART_ATTRIB_HIDE = 1 << 1,
211 };
212 enum nvme_opcode {
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214   nvme_cmd_flush = 0x00,
215   nvme_cmd_write = 0x01,
216   nvme_cmd_read = 0x02,
217   nvme_cmd_write_uncor = 0x04,
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219   nvme_cmd_compare = 0x05,
220   nvme_cmd_dsm = 0x09,
221 };
222 struct nvme_common_command {
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224   __u8 opcode;
225   __u8 flags;
226   __u16 command_id;
227   __le32 nsid;
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229   __le32 cdw2[2];
230   __le64 metadata;
231   __le64 prp1;
232   __le64 prp2;
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234   __le32 cdw10[6];
235 };
236 struct nvme_rw_command {
237   __u8 opcode;
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239   __u8 flags;
240   __u16 command_id;
241   __le32 nsid;
242   __u64 rsvd2;
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244   __le64 metadata;
245   __le64 prp1;
246   __le64 prp2;
247   __le64 slba;
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249   __le16 length;
250   __le16 control;
251   __le32 dsmgmt;
252   __le32 reftag;
253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254   __le16 apptag;
255   __le16 appmask;
256 };
257 enum {
258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259   NVME_RW_LR = 1 << 15,
260   NVME_RW_FUA = 1 << 14,
261   NVME_RW_DSM_FREQ_UNSPEC = 0,
262   NVME_RW_DSM_FREQ_TYPICAL = 1,
263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264   NVME_RW_DSM_FREQ_RARE = 2,
265   NVME_RW_DSM_FREQ_READS = 3,
266   NVME_RW_DSM_FREQ_WRITES = 4,
267   NVME_RW_DSM_FREQ_RW = 5,
268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269   NVME_RW_DSM_FREQ_ONCE = 6,
270   NVME_RW_DSM_FREQ_PREFETCH = 7,
271   NVME_RW_DSM_FREQ_TEMP = 8,
272   NVME_RW_DSM_LATENCY_NONE = 0 << 4,
273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274   NVME_RW_DSM_LATENCY_IDLE = 1 << 4,
275   NVME_RW_DSM_LATENCY_NORM = 2 << 4,
276   NVME_RW_DSM_LATENCY_LOW = 3 << 4,
277   NVME_RW_DSM_SEQ_REQ = 1 << 6,
278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279   NVME_RW_DSM_COMPRESSED = 1 << 7,
280 };
281 struct nvme_dsm_cmd {
282   __u8 opcode;
283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284   __u8 flags;
285   __u16 command_id;
286   __le32 nsid;
287   __u64 rsvd2[2];
288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289   __le64 prp1;
290   __le64 prp2;
291   __le32 nr;
292   __le32 attributes;
293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294   __u32 rsvd12[4];
295 };
296 enum {
297   NVME_DSMGMT_IDR = 1 << 0,
298 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299   NVME_DSMGMT_IDW = 1 << 1,
300   NVME_DSMGMT_AD = 1 << 2,
301 };
302 struct nvme_dsm_range {
303 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304   __le32 cattr;
305   __le32 nlb;
306   __le64 slba;
307 };
308 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309 enum nvme_admin_opcode {
310   nvme_admin_delete_sq = 0x00,
311   nvme_admin_create_sq = 0x01,
312   nvme_admin_get_log_page = 0x02,
313 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314   nvme_admin_delete_cq = 0x04,
315   nvme_admin_create_cq = 0x05,
316   nvme_admin_identify = 0x06,
317   nvme_admin_abort_cmd = 0x08,
318 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
319   nvme_admin_set_features = 0x09,
320   nvme_admin_get_features = 0x0a,
321   nvme_admin_async_event = 0x0c,
322   nvme_admin_activate_fw = 0x10,
323 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
324   nvme_admin_download_fw = 0x11,
325   nvme_admin_format_nvm = 0x80,
326   nvme_admin_security_send = 0x81,
327   nvme_admin_security_recv = 0x82,
328 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
329 };
330 enum {
331   NVME_QUEUE_PHYS_CONTIG = (1 << 0),
332   NVME_CQ_IRQ_ENABLED = (1 << 1),
333 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
334   NVME_SQ_PRIO_URGENT = (0 << 1),
335   NVME_SQ_PRIO_HIGH = (1 << 1),
336   NVME_SQ_PRIO_MEDIUM = (2 << 1),
337   NVME_SQ_PRIO_LOW = (3 << 1),
338 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
339   NVME_FEAT_ARBITRATION = 0x01,
340   NVME_FEAT_POWER_MGMT = 0x02,
341   NVME_FEAT_LBA_RANGE = 0x03,
342   NVME_FEAT_TEMP_THRESH = 0x04,
343 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
344   NVME_FEAT_ERR_RECOVERY = 0x05,
345   NVME_FEAT_VOLATILE_WC = 0x06,
346   NVME_FEAT_NUM_QUEUES = 0x07,
347   NVME_FEAT_IRQ_COALESCE = 0x08,
348 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
349   NVME_FEAT_IRQ_CONFIG = 0x09,
350   NVME_FEAT_WRITE_ATOMIC = 0x0a,
351   NVME_FEAT_ASYNC_EVENT = 0x0b,
352   NVME_FEAT_SW_PROGRESS = 0x0c,
353 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
354   NVME_LOG_ERROR = 0x01,
355   NVME_LOG_SMART = 0x02,
356   NVME_LOG_FW_SLOT = 0x03,
357   NVME_LOG_RESERVATION = 0x80,
358 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
359   NVME_FWACT_REPL = (0 << 3),
360   NVME_FWACT_REPL_ACTV = (1 << 3),
361   NVME_FWACT_ACTV = (2 << 3),
362 };
363 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
364 struct nvme_identify {
365   __u8 opcode;
366   __u8 flags;
367   __u16 command_id;
368 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
369   __le32 nsid;
370   __u64 rsvd2[2];
371   __le64 prp1;
372   __le64 prp2;
373 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
374   __le32 cns;
375   __u32 rsvd11[5];
376 };
377 struct nvme_features {
378 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
379   __u8 opcode;
380   __u8 flags;
381   __u16 command_id;
382   __le32 nsid;
383 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
384   __u64 rsvd2[2];
385   __le64 prp1;
386   __le64 prp2;
387   __le32 fid;
388 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
389   __le32 dword11;
390   __u32 rsvd12[4];
391 };
392 struct nvme_create_cq {
393 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
394   __u8 opcode;
395   __u8 flags;
396   __u16 command_id;
397   __u32 rsvd1[5];
398 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
399   __le64 prp1;
400   __u64 rsvd8;
401   __le16 cqid;
402   __le16 qsize;
403 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
404   __le16 cq_flags;
405   __le16 irq_vector;
406   __u32 rsvd12[4];
407 };
408 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
409 struct nvme_create_sq {
410   __u8 opcode;
411   __u8 flags;
412   __u16 command_id;
413 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
414   __u32 rsvd1[5];
415   __le64 prp1;
416   __u64 rsvd8;
417   __le16 sqid;
418 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
419   __le16 qsize;
420   __le16 sq_flags;
421   __le16 cqid;
422   __u32 rsvd12[4];
423 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
424 };
425 struct nvme_delete_queue {
426   __u8 opcode;
427   __u8 flags;
428 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
429   __u16 command_id;
430   __u32 rsvd1[9];
431   __le16 qid;
432   __u16 rsvd10;
433 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
434   __u32 rsvd11[5];
435 };
436 struct nvme_abort_cmd {
437   __u8 opcode;
438 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
439   __u8 flags;
440   __u16 command_id;
441   __u32 rsvd1[9];
442   __le16 sqid;
443 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
444   __u16 cid;
445   __u32 rsvd11[5];
446 };
447 struct nvme_download_firmware {
448 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
449   __u8 opcode;
450   __u8 flags;
451   __u16 command_id;
452   __u32 rsvd1[5];
453 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
454   __le64 prp1;
455   __le64 prp2;
456   __le32 numd;
457   __le32 offset;
458 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
459   __u32 rsvd12[4];
460 };
461 struct nvme_format_cmd {
462   __u8 opcode;
463 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
464   __u8 flags;
465   __u16 command_id;
466   __le32 nsid;
467   __u64 rsvd2[4];
468 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
469   __le32 cdw10;
470   __u32 rsvd11[5];
471 };
472 struct nvme_command {
473 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
474   union {
475     struct nvme_common_command common;
476     struct nvme_rw_command rw;
477     struct nvme_identify identify;
478 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
479     struct nvme_features features;
480     struct nvme_create_cq create_cq;
481     struct nvme_create_sq create_sq;
482     struct nvme_delete_queue delete_queue;
483 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
484     struct nvme_download_firmware dlfw;
485     struct nvme_format_cmd format;
486     struct nvme_dsm_cmd dsm;
487     struct nvme_abort_cmd abort;
488 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
489   };
490 };
491 enum {
492   NVME_SC_SUCCESS = 0x0,
493 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
494   NVME_SC_INVALID_OPCODE = 0x1,
495   NVME_SC_INVALID_FIELD = 0x2,
496   NVME_SC_CMDID_CONFLICT = 0x3,
497   NVME_SC_DATA_XFER_ERROR = 0x4,
498 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
499   NVME_SC_POWER_LOSS = 0x5,
500   NVME_SC_INTERNAL = 0x6,
501   NVME_SC_ABORT_REQ = 0x7,
502   NVME_SC_ABORT_QUEUE = 0x8,
503 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
504   NVME_SC_FUSED_FAIL = 0x9,
505   NVME_SC_FUSED_MISSING = 0xa,
506   NVME_SC_INVALID_NS = 0xb,
507   NVME_SC_CMD_SEQ_ERROR = 0xc,
508 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
509   NVME_SC_LBA_RANGE = 0x80,
510   NVME_SC_CAP_EXCEEDED = 0x81,
511   NVME_SC_NS_NOT_READY = 0x82,
512   NVME_SC_CQ_INVALID = 0x100,
513 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
514   NVME_SC_QID_INVALID = 0x101,
515   NVME_SC_QUEUE_SIZE = 0x102,
516   NVME_SC_ABORT_LIMIT = 0x103,
517   NVME_SC_ABORT_MISSING = 0x104,
518 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
519   NVME_SC_ASYNC_LIMIT = 0x105,
520   NVME_SC_FIRMWARE_SLOT = 0x106,
521   NVME_SC_FIRMWARE_IMAGE = 0x107,
522   NVME_SC_INVALID_VECTOR = 0x108,
523 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
524   NVME_SC_INVALID_LOG_PAGE = 0x109,
525   NVME_SC_INVALID_FORMAT = 0x10a,
526   NVME_SC_BAD_ATTRIBUTES = 0x180,
527   NVME_SC_WRITE_FAULT = 0x280,
528 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
529   NVME_SC_READ_ERROR = 0x281,
530   NVME_SC_GUARD_CHECK = 0x282,
531   NVME_SC_APPTAG_CHECK = 0x283,
532   NVME_SC_REFTAG_CHECK = 0x284,
533 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
534   NVME_SC_COMPARE_FAILED = 0x285,
535   NVME_SC_ACCESS_DENIED = 0x286,
536   NVME_SC_DNR = 0x4000,
537 };
538 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
539 struct nvme_completion {
540   __le32 result;
541   __u32 rsvd;
542   __le16 sq_head;
543 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
544   __le16 sq_id;
545   __u16 command_id;
546   __le16 status;
547 };
548 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
549 struct nvme_user_io {
550   __u8 opcode;
551   __u8 flags;
552   __u16 control;
553 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
554   __u16 nblocks;
555   __u16 rsvd;
556   __u64 metadata;
557   __u64 addr;
558 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
559   __u64 slba;
560   __u32 dsmgmt;
561   __u32 reftag;
562   __u16 apptag;
563 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
564   __u16 appmask;
565 };
566 struct nvme_admin_cmd {
567   __u8 opcode;
568 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
569   __u8 flags;
570   __u16 rsvd1;
571   __u32 nsid;
572   __u32 cdw2;
573 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
574   __u32 cdw3;
575   __u64 metadata;
576   __u64 addr;
577   __u32 metadata_len;
578 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
579   __u32 data_len;
580   __u32 cdw10;
581   __u32 cdw11;
582   __u32 cdw12;
583 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
584   __u32 cdw13;
585   __u32 cdw14;
586   __u32 cdw15;
587   __u32 timeout_ms;
588 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
589   __u32 result;
590 };
591 #define NVME_IOCTL_ID _IO('N', 0x40)
592 #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
593 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
594 #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
595 #endif
596