blob: 91a805437876065cc1a1bbb78f7a0948698b4d22 [file] [log] [blame]
Matthew Wilcoxb60503b2011-01-20 12:50:14 -05001/*
2 * Definitions for the NVM Express interface
Matthew Wilcox8757ad62014-04-11 10:37:39 -04003 * Copyright (c) 2011-2014, Intel Corporation.
Matthew Wilcoxb60503b2011-01-20 12:50:14 -05004 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050013 */
14
15#ifndef _LINUX_NVME_H
16#define _LINUX_NVME_H
17
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050018struct nvme_bar {
19 __u64 cap; /* Controller Capabilities */
20 __u32 vs; /* Version */
Matthew Wilcox897cfe12011-02-14 12:20:15 -050021 __u32 intms; /* Interrupt Mask Set */
22 __u32 intmc; /* Interrupt Mask Clear */
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050023 __u32 cc; /* Controller Configuration */
Matthew Wilcox897cfe12011-02-14 12:20:15 -050024 __u32 rsvd1; /* Reserved */
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050025 __u32 csts; /* Controller Status */
Jon Derrick81f03fe2015-08-10 15:20:41 -060026 __u32 nssr; /* Subsystem Reset */
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050027 __u32 aqa; /* Admin Queue Attributes */
28 __u64 asq; /* Admin SQ Base Address */
29 __u64 acq; /* Admin CQ Base Address */
Jon Derrick8ffaadf2015-07-20 10:14:09 -060030 __u32 cmbloc; /* Controller Memory Buffer Location */
31 __u32 cmbsz; /* Controller Memory Buffer Size */
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050032};
33
Keith Buscha0cadb82012-07-27 13:57:23 -040034#define NVME_CAP_MQES(cap) ((cap) & 0xffff)
Matthew Wilcox22605f92011-04-19 15:04:20 -040035#define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff)
Matthew Wilcoxf1938f62011-10-20 17:00:41 -040036#define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf)
Keith Buschdfbac8c2015-08-10 15:20:40 -060037#define NVME_CAP_NSSRC(cap) (((cap) >> 36) & 0x1)
Keith Busch8fc23e02012-07-26 11:29:57 -060038#define NVME_CAP_MPSMIN(cap) (((cap) >> 48) & 0xf)
Keith Busch1d090622014-06-23 11:34:01 -060039#define NVME_CAP_MPSMAX(cap) (((cap) >> 52) & 0xf)
Matthew Wilcox22605f92011-04-19 15:04:20 -040040
Jon Derrick8ffaadf2015-07-20 10:14:09 -060041#define NVME_CMB_BIR(cmbloc) ((cmbloc) & 0x7)
42#define NVME_CMB_OFST(cmbloc) (((cmbloc) >> 12) & 0xfffff)
43#define NVME_CMB_SZ(cmbsz) (((cmbsz) >> 12) & 0xfffff)
44#define NVME_CMB_SZU(cmbsz) (((cmbsz) >> 8) & 0xf)
45
46#define NVME_CMB_WDS(cmbsz) ((cmbsz) & 0x10)
47#define NVME_CMB_RDS(cmbsz) ((cmbsz) & 0x8)
48#define NVME_CMB_LISTS(cmbsz) ((cmbsz) & 0x4)
49#define NVME_CMB_CQS(cmbsz) ((cmbsz) & 0x2)
50#define NVME_CMB_SQS(cmbsz) ((cmbsz) & 0x1)
51
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050052enum {
53 NVME_CC_ENABLE = 1 << 0,
54 NVME_CC_CSS_NVM = 0 << 4,
55 NVME_CC_MPS_SHIFT = 7,
56 NVME_CC_ARB_RR = 0 << 11,
57 NVME_CC_ARB_WRRU = 1 << 11,
Matthew Wilcox7f53f9d2011-03-22 15:55:45 -040058 NVME_CC_ARB_VS = 7 << 11,
59 NVME_CC_SHN_NONE = 0 << 14,
60 NVME_CC_SHN_NORMAL = 1 << 14,
61 NVME_CC_SHN_ABRUPT = 2 << 14,
Keith Busch1894d8f2013-07-15 15:02:22 -060062 NVME_CC_SHN_MASK = 3 << 14,
Matthew Wilcox7f53f9d2011-03-22 15:55:45 -040063 NVME_CC_IOSQES = 6 << 16,
64 NVME_CC_IOCQES = 4 << 20,
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050065 NVME_CSTS_RDY = 1 << 0,
66 NVME_CSTS_CFS = 1 << 1,
Keith Buschdfbac8c2015-08-10 15:20:40 -060067 NVME_CSTS_NSSRO = 1 << 4,
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050068 NVME_CSTS_SHST_NORMAL = 0 << 2,
69 NVME_CSTS_SHST_OCCUR = 1 << 2,
70 NVME_CSTS_SHST_CMPLT = 2 << 2,
Keith Busch1894d8f2013-07-15 15:02:22 -060071 NVME_CSTS_SHST_MASK = 3 << 2,
Matthew Wilcoxb60503b2011-01-20 12:50:14 -050072};
73
Christoph Hellwig9d99a8d2015-10-02 15:25:49 +020074struct nvme_id_power_state {
75 __le16 max_power; /* centiwatts */
76 __u8 rsvd2;
77 __u8 flags;
78 __le32 entry_lat; /* microseconds */
79 __le32 exit_lat; /* microseconds */
80 __u8 read_tput;
81 __u8 read_lat;
82 __u8 write_tput;
83 __u8 write_lat;
84 __le16 idle_power;
85 __u8 idle_scale;
86 __u8 rsvd19;
87 __le16 active_power;
88 __u8 active_work_scale;
89 __u8 rsvd23[9];
90};
91
92enum {
93 NVME_PS_FLAGS_MAX_POWER_SCALE = 1 << 0,
94 NVME_PS_FLAGS_NON_OP_STATE = 1 << 1,
95};
96
97struct nvme_id_ctrl {
98 __le16 vid;
99 __le16 ssvid;
100 char sn[20];
101 char mn[40];
102 char fr[8];
103 __u8 rab;
104 __u8 ieee[3];
105 __u8 mic;
106 __u8 mdts;
107 __u16 cntlid;
108 __u32 ver;
109 __u8 rsvd84[172];
110 __le16 oacs;
111 __u8 acl;
112 __u8 aerl;
113 __u8 frmw;
114 __u8 lpa;
115 __u8 elpe;
116 __u8 npss;
117 __u8 avscc;
118 __u8 apsta;
119 __le16 wctemp;
120 __le16 cctemp;
121 __u8 rsvd270[242];
122 __u8 sqes;
123 __u8 cqes;
124 __u8 rsvd514[2];
125 __le32 nn;
126 __le16 oncs;
127 __le16 fuses;
128 __u8 fna;
129 __u8 vwc;
130 __le16 awun;
131 __le16 awupf;
132 __u8 nvscc;
133 __u8 rsvd531;
134 __le16 acwu;
135 __u8 rsvd534[2];
136 __le32 sgls;
137 __u8 rsvd540[1508];
138 struct nvme_id_power_state psd[32];
139 __u8 vs[1024];
140};
141
142enum {
143 NVME_CTRL_ONCS_COMPARE = 1 << 0,
144 NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
145 NVME_CTRL_ONCS_DSM = 1 << 2,
146 NVME_CTRL_VWC_PRESENT = 1 << 0,
147};
148
149struct nvme_lbaf {
150 __le16 ms;
151 __u8 ds;
152 __u8 rp;
153};
154
155struct nvme_id_ns {
156 __le64 nsze;
157 __le64 ncap;
158 __le64 nuse;
159 __u8 nsfeat;
160 __u8 nlbaf;
161 __u8 flbas;
162 __u8 mc;
163 __u8 dpc;
164 __u8 dps;
165 __u8 nmic;
166 __u8 rescap;
167 __u8 fpi;
168 __u8 rsvd33;
169 __le16 nawun;
170 __le16 nawupf;
171 __le16 nacwu;
172 __le16 nabsn;
173 __le16 nabo;
174 __le16 nabspf;
175 __u16 rsvd46;
176 __le64 nvmcap[2];
177 __u8 rsvd64[40];
178 __u8 nguid[16];
179 __u8 eui64[8];
180 struct nvme_lbaf lbaf[16];
181 __u8 rsvd192[192];
182 __u8 vs[3712];
183};
184
185enum {
186 NVME_NS_FEAT_THIN = 1 << 0,
187 NVME_NS_FLBAS_LBA_MASK = 0xf,
188 NVME_NS_FLBAS_META_EXT = 0x10,
189 NVME_LBAF_RP_BEST = 0,
190 NVME_LBAF_RP_BETTER = 1,
191 NVME_LBAF_RP_GOOD = 2,
192 NVME_LBAF_RP_DEGRADED = 3,
193 NVME_NS_DPC_PI_LAST = 1 << 4,
194 NVME_NS_DPC_PI_FIRST = 1 << 3,
195 NVME_NS_DPC_PI_TYPE3 = 1 << 2,
196 NVME_NS_DPC_PI_TYPE2 = 1 << 1,
197 NVME_NS_DPC_PI_TYPE1 = 1 << 0,
198 NVME_NS_DPS_PI_FIRST = 1 << 3,
199 NVME_NS_DPS_PI_MASK = 0x7,
200 NVME_NS_DPS_PI_TYPE1 = 1,
201 NVME_NS_DPS_PI_TYPE2 = 2,
202 NVME_NS_DPS_PI_TYPE3 = 3,
203};
204
205struct nvme_smart_log {
206 __u8 critical_warning;
207 __u8 temperature[2];
208 __u8 avail_spare;
209 __u8 spare_thresh;
210 __u8 percent_used;
211 __u8 rsvd6[26];
212 __u8 data_units_read[16];
213 __u8 data_units_written[16];
214 __u8 host_reads[16];
215 __u8 host_writes[16];
216 __u8 ctrl_busy_time[16];
217 __u8 power_cycles[16];
218 __u8 power_on_hours[16];
219 __u8 unsafe_shutdowns[16];
220 __u8 media_errors[16];
221 __u8 num_err_log_entries[16];
222 __le32 warning_temp_time;
223 __le32 critical_comp_time;
224 __le16 temp_sensor[8];
225 __u8 rsvd216[296];
226};
227
228enum {
229 NVME_SMART_CRIT_SPARE = 1 << 0,
230 NVME_SMART_CRIT_TEMPERATURE = 1 << 1,
231 NVME_SMART_CRIT_RELIABILITY = 1 << 2,
232 NVME_SMART_CRIT_MEDIA = 1 << 3,
233 NVME_SMART_CRIT_VOLATILE_MEMORY = 1 << 4,
234};
235
236enum {
237 NVME_AER_NOTICE_NS_CHANGED = 0x0002,
238};
239
240struct nvme_lba_range_type {
241 __u8 type;
242 __u8 attributes;
243 __u8 rsvd2[14];
244 __u64 slba;
245 __u64 nlb;
246 __u8 guid[16];
247 __u8 rsvd48[16];
248};
249
250enum {
251 NVME_LBART_TYPE_FS = 0x01,
252 NVME_LBART_TYPE_RAID = 0x02,
253 NVME_LBART_TYPE_CACHE = 0x03,
254 NVME_LBART_TYPE_SWAP = 0x04,
255
256 NVME_LBART_ATTRIB_TEMP = 1 << 0,
257 NVME_LBART_ATTRIB_HIDE = 1 << 1,
258};
259
260struct nvme_reservation_status {
261 __le32 gen;
262 __u8 rtype;
263 __u8 regctl[2];
264 __u8 resv5[2];
265 __u8 ptpls;
266 __u8 resv10[13];
267 struct {
268 __le16 cntlid;
269 __u8 rcsts;
270 __u8 resv3[5];
271 __le64 hostid;
272 __le64 rkey;
273 } regctl_ds[];
274};
275
276/* I/O commands */
277
278enum nvme_opcode {
279 nvme_cmd_flush = 0x00,
280 nvme_cmd_write = 0x01,
281 nvme_cmd_read = 0x02,
282 nvme_cmd_write_uncor = 0x04,
283 nvme_cmd_compare = 0x05,
284 nvme_cmd_write_zeroes = 0x08,
285 nvme_cmd_dsm = 0x09,
286 nvme_cmd_resv_register = 0x0d,
287 nvme_cmd_resv_report = 0x0e,
288 nvme_cmd_resv_acquire = 0x11,
289 nvme_cmd_resv_release = 0x15,
290};
291
292struct nvme_common_command {
293 __u8 opcode;
294 __u8 flags;
295 __u16 command_id;
296 __le32 nsid;
297 __le32 cdw2[2];
298 __le64 metadata;
299 __le64 prp1;
300 __le64 prp2;
301 __le32 cdw10[6];
302};
303
304struct nvme_rw_command {
305 __u8 opcode;
306 __u8 flags;
307 __u16 command_id;
308 __le32 nsid;
309 __u64 rsvd2;
310 __le64 metadata;
311 __le64 prp1;
312 __le64 prp2;
313 __le64 slba;
314 __le16 length;
315 __le16 control;
316 __le32 dsmgmt;
317 __le32 reftag;
318 __le16 apptag;
319 __le16 appmask;
320};
321
322enum {
323 NVME_RW_LR = 1 << 15,
324 NVME_RW_FUA = 1 << 14,
325 NVME_RW_DSM_FREQ_UNSPEC = 0,
326 NVME_RW_DSM_FREQ_TYPICAL = 1,
327 NVME_RW_DSM_FREQ_RARE = 2,
328 NVME_RW_DSM_FREQ_READS = 3,
329 NVME_RW_DSM_FREQ_WRITES = 4,
330 NVME_RW_DSM_FREQ_RW = 5,
331 NVME_RW_DSM_FREQ_ONCE = 6,
332 NVME_RW_DSM_FREQ_PREFETCH = 7,
333 NVME_RW_DSM_FREQ_TEMP = 8,
334 NVME_RW_DSM_LATENCY_NONE = 0 << 4,
335 NVME_RW_DSM_LATENCY_IDLE = 1 << 4,
336 NVME_RW_DSM_LATENCY_NORM = 2 << 4,
337 NVME_RW_DSM_LATENCY_LOW = 3 << 4,
338 NVME_RW_DSM_SEQ_REQ = 1 << 6,
339 NVME_RW_DSM_COMPRESSED = 1 << 7,
340 NVME_RW_PRINFO_PRCHK_REF = 1 << 10,
341 NVME_RW_PRINFO_PRCHK_APP = 1 << 11,
342 NVME_RW_PRINFO_PRCHK_GUARD = 1 << 12,
343 NVME_RW_PRINFO_PRACT = 1 << 13,
344};
345
346struct nvme_dsm_cmd {
347 __u8 opcode;
348 __u8 flags;
349 __u16 command_id;
350 __le32 nsid;
351 __u64 rsvd2[2];
352 __le64 prp1;
353 __le64 prp2;
354 __le32 nr;
355 __le32 attributes;
356 __u32 rsvd12[4];
357};
358
359enum {
360 NVME_DSMGMT_IDR = 1 << 0,
361 NVME_DSMGMT_IDW = 1 << 1,
362 NVME_DSMGMT_AD = 1 << 2,
363};
364
365struct nvme_dsm_range {
366 __le32 cattr;
367 __le32 nlb;
368 __le64 slba;
369};
370
371/* Admin commands */
372
373enum nvme_admin_opcode {
374 nvme_admin_delete_sq = 0x00,
375 nvme_admin_create_sq = 0x01,
376 nvme_admin_get_log_page = 0x02,
377 nvme_admin_delete_cq = 0x04,
378 nvme_admin_create_cq = 0x05,
379 nvme_admin_identify = 0x06,
380 nvme_admin_abort_cmd = 0x08,
381 nvme_admin_set_features = 0x09,
382 nvme_admin_get_features = 0x0a,
383 nvme_admin_async_event = 0x0c,
384 nvme_admin_activate_fw = 0x10,
385 nvme_admin_download_fw = 0x11,
386 nvme_admin_format_nvm = 0x80,
387 nvme_admin_security_send = 0x81,
388 nvme_admin_security_recv = 0x82,
389};
390
391enum {
392 NVME_QUEUE_PHYS_CONTIG = (1 << 0),
393 NVME_CQ_IRQ_ENABLED = (1 << 1),
394 NVME_SQ_PRIO_URGENT = (0 << 1),
395 NVME_SQ_PRIO_HIGH = (1 << 1),
396 NVME_SQ_PRIO_MEDIUM = (2 << 1),
397 NVME_SQ_PRIO_LOW = (3 << 1),
398 NVME_FEAT_ARBITRATION = 0x01,
399 NVME_FEAT_POWER_MGMT = 0x02,
400 NVME_FEAT_LBA_RANGE = 0x03,
401 NVME_FEAT_TEMP_THRESH = 0x04,
402 NVME_FEAT_ERR_RECOVERY = 0x05,
403 NVME_FEAT_VOLATILE_WC = 0x06,
404 NVME_FEAT_NUM_QUEUES = 0x07,
405 NVME_FEAT_IRQ_COALESCE = 0x08,
406 NVME_FEAT_IRQ_CONFIG = 0x09,
407 NVME_FEAT_WRITE_ATOMIC = 0x0a,
408 NVME_FEAT_ASYNC_EVENT = 0x0b,
409 NVME_FEAT_AUTO_PST = 0x0c,
410 NVME_FEAT_SW_PROGRESS = 0x80,
411 NVME_FEAT_HOST_ID = 0x81,
412 NVME_FEAT_RESV_MASK = 0x82,
413 NVME_FEAT_RESV_PERSIST = 0x83,
414 NVME_LOG_ERROR = 0x01,
415 NVME_LOG_SMART = 0x02,
416 NVME_LOG_FW_SLOT = 0x03,
417 NVME_LOG_RESERVATION = 0x80,
418 NVME_FWACT_REPL = (0 << 3),
419 NVME_FWACT_REPL_ACTV = (1 << 3),
420 NVME_FWACT_ACTV = (2 << 3),
421};
422
423struct nvme_identify {
424 __u8 opcode;
425 __u8 flags;
426 __u16 command_id;
427 __le32 nsid;
428 __u64 rsvd2[2];
429 __le64 prp1;
430 __le64 prp2;
431 __le32 cns;
432 __u32 rsvd11[5];
433};
434
435struct nvme_features {
436 __u8 opcode;
437 __u8 flags;
438 __u16 command_id;
439 __le32 nsid;
440 __u64 rsvd2[2];
441 __le64 prp1;
442 __le64 prp2;
443 __le32 fid;
444 __le32 dword11;
445 __u32 rsvd12[4];
446};
447
448struct nvme_create_cq {
449 __u8 opcode;
450 __u8 flags;
451 __u16 command_id;
452 __u32 rsvd1[5];
453 __le64 prp1;
454 __u64 rsvd8;
455 __le16 cqid;
456 __le16 qsize;
457 __le16 cq_flags;
458 __le16 irq_vector;
459 __u32 rsvd12[4];
460};
461
462struct nvme_create_sq {
463 __u8 opcode;
464 __u8 flags;
465 __u16 command_id;
466 __u32 rsvd1[5];
467 __le64 prp1;
468 __u64 rsvd8;
469 __le16 sqid;
470 __le16 qsize;
471 __le16 sq_flags;
472 __le16 cqid;
473 __u32 rsvd12[4];
474};
475
476struct nvme_delete_queue {
477 __u8 opcode;
478 __u8 flags;
479 __u16 command_id;
480 __u32 rsvd1[9];
481 __le16 qid;
482 __u16 rsvd10;
483 __u32 rsvd11[5];
484};
485
486struct nvme_abort_cmd {
487 __u8 opcode;
488 __u8 flags;
489 __u16 command_id;
490 __u32 rsvd1[9];
491 __le16 sqid;
492 __u16 cid;
493 __u32 rsvd11[5];
494};
495
496struct nvme_download_firmware {
497 __u8 opcode;
498 __u8 flags;
499 __u16 command_id;
500 __u32 rsvd1[5];
501 __le64 prp1;
502 __le64 prp2;
503 __le32 numd;
504 __le32 offset;
505 __u32 rsvd12[4];
506};
507
508struct nvme_format_cmd {
509 __u8 opcode;
510 __u8 flags;
511 __u16 command_id;
512 __le32 nsid;
513 __u64 rsvd2[4];
514 __le32 cdw10;
515 __u32 rsvd11[5];
516};
517
518struct nvme_command {
519 union {
520 struct nvme_common_command common;
521 struct nvme_rw_command rw;
522 struct nvme_identify identify;
523 struct nvme_features features;
524 struct nvme_create_cq create_cq;
525 struct nvme_create_sq create_sq;
526 struct nvme_delete_queue delete_queue;
527 struct nvme_download_firmware dlfw;
528 struct nvme_format_cmd format;
529 struct nvme_dsm_cmd dsm;
530 struct nvme_abort_cmd abort;
531 };
532};
533
534enum {
535 NVME_SC_SUCCESS = 0x0,
536 NVME_SC_INVALID_OPCODE = 0x1,
537 NVME_SC_INVALID_FIELD = 0x2,
538 NVME_SC_CMDID_CONFLICT = 0x3,
539 NVME_SC_DATA_XFER_ERROR = 0x4,
540 NVME_SC_POWER_LOSS = 0x5,
541 NVME_SC_INTERNAL = 0x6,
542 NVME_SC_ABORT_REQ = 0x7,
543 NVME_SC_ABORT_QUEUE = 0x8,
544 NVME_SC_FUSED_FAIL = 0x9,
545 NVME_SC_FUSED_MISSING = 0xa,
546 NVME_SC_INVALID_NS = 0xb,
547 NVME_SC_CMD_SEQ_ERROR = 0xc,
548 NVME_SC_SGL_INVALID_LAST = 0xd,
549 NVME_SC_SGL_INVALID_COUNT = 0xe,
550 NVME_SC_SGL_INVALID_DATA = 0xf,
551 NVME_SC_SGL_INVALID_METADATA = 0x10,
552 NVME_SC_SGL_INVALID_TYPE = 0x11,
553 NVME_SC_LBA_RANGE = 0x80,
554 NVME_SC_CAP_EXCEEDED = 0x81,
555 NVME_SC_NS_NOT_READY = 0x82,
556 NVME_SC_RESERVATION_CONFLICT = 0x83,
557 NVME_SC_CQ_INVALID = 0x100,
558 NVME_SC_QID_INVALID = 0x101,
559 NVME_SC_QUEUE_SIZE = 0x102,
560 NVME_SC_ABORT_LIMIT = 0x103,
561 NVME_SC_ABORT_MISSING = 0x104,
562 NVME_SC_ASYNC_LIMIT = 0x105,
563 NVME_SC_FIRMWARE_SLOT = 0x106,
564 NVME_SC_FIRMWARE_IMAGE = 0x107,
565 NVME_SC_INVALID_VECTOR = 0x108,
566 NVME_SC_INVALID_LOG_PAGE = 0x109,
567 NVME_SC_INVALID_FORMAT = 0x10a,
568 NVME_SC_FIRMWARE_NEEDS_RESET = 0x10b,
569 NVME_SC_INVALID_QUEUE = 0x10c,
570 NVME_SC_FEATURE_NOT_SAVEABLE = 0x10d,
571 NVME_SC_FEATURE_NOT_CHANGEABLE = 0x10e,
572 NVME_SC_FEATURE_NOT_PER_NS = 0x10f,
573 NVME_SC_FW_NEEDS_RESET_SUBSYS = 0x110,
574 NVME_SC_BAD_ATTRIBUTES = 0x180,
575 NVME_SC_INVALID_PI = 0x181,
576 NVME_SC_READ_ONLY = 0x182,
577 NVME_SC_WRITE_FAULT = 0x280,
578 NVME_SC_READ_ERROR = 0x281,
579 NVME_SC_GUARD_CHECK = 0x282,
580 NVME_SC_APPTAG_CHECK = 0x283,
581 NVME_SC_REFTAG_CHECK = 0x284,
582 NVME_SC_COMPARE_FAILED = 0x285,
583 NVME_SC_ACCESS_DENIED = 0x286,
584 NVME_SC_DNR = 0x4000,
585};
586
587struct nvme_completion {
588 __le32 result; /* Used by admin commands to return data */
589 __u32 rsvd;
590 __le16 sq_head; /* how much of this queue may be reclaimed */
591 __le16 sq_id; /* submission queue that generated this entry */
592 __u16 command_id; /* of the command which completed */
593 __le16 status; /* did the command fail, and if so, why? */
594};
595
596#define NVME_VS(major, minor) (((major) << 16) | ((minor) << 8))
597
Matthew Wilcoxb60503b2011-01-20 12:50:14 -0500598#endif /* _LINUX_NVME_H */