nvme.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. /*
  2. * Definitions for the NVM Express interface
  3. * Copyright (c) 2011, Intel Corporation.
  4. *
  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.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #ifndef _LINUX_NVME_H
  19. #define _LINUX_NVME_H
  20. #include <linux/types.h>
  21. struct nvme_bar {
  22. __u64 cap; /* Controller Capabilities */
  23. __u32 vs; /* Version */
  24. __u32 intms; /* Interrupt Mask Set */
  25. __u32 intmc; /* Interrupt Mask Clear */
  26. __u32 cc; /* Controller Configuration */
  27. __u32 rsvd1; /* Reserved */
  28. __u32 csts; /* Controller Status */
  29. __u32 rsvd2; /* Reserved */
  30. __u32 aqa; /* Admin Queue Attributes */
  31. __u64 asq; /* Admin SQ Base Address */
  32. __u64 acq; /* Admin CQ Base Address */
  33. };
  34. #define NVME_CAP_MQES(cap) ((cap) & 0xffff)
  35. #define NVME_CAP_TIMEOUT(cap) (((cap) >> 24) & 0xff)
  36. #define NVME_CAP_STRIDE(cap) (((cap) >> 32) & 0xf)
  37. #define NVME_CAP_MPSMIN(cap) (((cap) >> 48) & 0xf)
  38. enum {
  39. NVME_CC_ENABLE = 1 << 0,
  40. NVME_CC_CSS_NVM = 0 << 4,
  41. NVME_CC_MPS_SHIFT = 7,
  42. NVME_CC_ARB_RR = 0 << 11,
  43. NVME_CC_ARB_WRRU = 1 << 11,
  44. NVME_CC_ARB_VS = 7 << 11,
  45. NVME_CC_SHN_NONE = 0 << 14,
  46. NVME_CC_SHN_NORMAL = 1 << 14,
  47. NVME_CC_SHN_ABRUPT = 2 << 14,
  48. NVME_CC_IOSQES = 6 << 16,
  49. NVME_CC_IOCQES = 4 << 20,
  50. NVME_CSTS_RDY = 1 << 0,
  51. NVME_CSTS_CFS = 1 << 1,
  52. NVME_CSTS_SHST_NORMAL = 0 << 2,
  53. NVME_CSTS_SHST_OCCUR = 1 << 2,
  54. NVME_CSTS_SHST_CMPLT = 2 << 2,
  55. };
  56. struct nvme_id_power_state {
  57. __le16 max_power; /* centiwatts */
  58. __u16 rsvd2;
  59. __le32 entry_lat; /* microseconds */
  60. __le32 exit_lat; /* microseconds */
  61. __u8 read_tput;
  62. __u8 read_lat;
  63. __u8 write_tput;
  64. __u8 write_lat;
  65. __u8 rsvd16[16];
  66. };
  67. #define NVME_VS(major, minor) (major << 16 | minor)
  68. struct nvme_id_ctrl {
  69. __le16 vid;
  70. __le16 ssvid;
  71. char sn[20];
  72. char mn[40];
  73. char fr[8];
  74. __u8 rab;
  75. __u8 ieee[3];
  76. __u8 mic;
  77. __u8 mdts;
  78. __u8 rsvd78[178];
  79. __le16 oacs;
  80. __u8 acl;
  81. __u8 aerl;
  82. __u8 frmw;
  83. __u8 lpa;
  84. __u8 elpe;
  85. __u8 npss;
  86. __u8 rsvd264[248];
  87. __u8 sqes;
  88. __u8 cqes;
  89. __u8 rsvd514[2];
  90. __le32 nn;
  91. __le16 oncs;
  92. __le16 fuses;
  93. __u8 fna;
  94. __u8 vwc;
  95. __le16 awun;
  96. __le16 awupf;
  97. __u8 rsvd530[1518];
  98. struct nvme_id_power_state psd[32];
  99. __u8 vs[1024];
  100. };
  101. enum {
  102. NVME_CTRL_ONCS_COMPARE = 1 << 0,
  103. NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
  104. NVME_CTRL_ONCS_DSM = 1 << 2,
  105. };
  106. struct nvme_lbaf {
  107. __le16 ms;
  108. __u8 ds;
  109. __u8 rp;
  110. };
  111. struct nvme_id_ns {
  112. __le64 nsze;
  113. __le64 ncap;
  114. __le64 nuse;
  115. __u8 nsfeat;
  116. __u8 nlbaf;
  117. __u8 flbas;
  118. __u8 mc;
  119. __u8 dpc;
  120. __u8 dps;
  121. __u8 rsvd30[98];
  122. struct nvme_lbaf lbaf[16];
  123. __u8 rsvd192[192];
  124. __u8 vs[3712];
  125. };
  126. enum {
  127. NVME_NS_FEAT_THIN = 1 << 0,
  128. NVME_LBAF_RP_BEST = 0,
  129. NVME_LBAF_RP_BETTER = 1,
  130. NVME_LBAF_RP_GOOD = 2,
  131. NVME_LBAF_RP_DEGRADED = 3,
  132. };
  133. struct nvme_smart_log {
  134. __u8 critical_warning;
  135. __u8 temperature[2];
  136. __u8 avail_spare;
  137. __u8 spare_thresh;
  138. __u8 percent_used;
  139. __u8 rsvd6[26];
  140. __u8 data_units_read[16];
  141. __u8 data_units_written[16];
  142. __u8 host_reads[16];
  143. __u8 host_writes[16];
  144. __u8 ctrl_busy_time[16];
  145. __u8 power_cycles[16];
  146. __u8 power_on_hours[16];
  147. __u8 unsafe_shutdowns[16];
  148. __u8 media_errors[16];
  149. __u8 num_err_log_entries[16];
  150. __u8 rsvd192[320];
  151. };
  152. enum {
  153. NVME_SMART_CRIT_SPARE = 1 << 0,
  154. NVME_SMART_CRIT_TEMPERATURE = 1 << 1,
  155. NVME_SMART_CRIT_RELIABILITY = 1 << 2,
  156. NVME_SMART_CRIT_MEDIA = 1 << 3,
  157. NVME_SMART_CRIT_VOLATILE_MEMORY = 1 << 4,
  158. };
  159. struct nvme_lba_range_type {
  160. __u8 type;
  161. __u8 attributes;
  162. __u8 rsvd2[14];
  163. __u64 slba;
  164. __u64 nlb;
  165. __u8 guid[16];
  166. __u8 rsvd48[16];
  167. };
  168. enum {
  169. NVME_LBART_TYPE_FS = 0x01,
  170. NVME_LBART_TYPE_RAID = 0x02,
  171. NVME_LBART_TYPE_CACHE = 0x03,
  172. NVME_LBART_TYPE_SWAP = 0x04,
  173. NVME_LBART_ATTRIB_TEMP = 1 << 0,
  174. NVME_LBART_ATTRIB_HIDE = 1 << 1,
  175. };
  176. /* I/O commands */
  177. enum nvme_opcode {
  178. nvme_cmd_flush = 0x00,
  179. nvme_cmd_write = 0x01,
  180. nvme_cmd_read = 0x02,
  181. nvme_cmd_write_uncor = 0x04,
  182. nvme_cmd_compare = 0x05,
  183. nvme_cmd_dsm = 0x09,
  184. };
  185. struct nvme_common_command {
  186. __u8 opcode;
  187. __u8 flags;
  188. __u16 command_id;
  189. __le32 nsid;
  190. __le32 cdw2[2];
  191. __le64 metadata;
  192. __le64 prp1;
  193. __le64 prp2;
  194. __le32 cdw10[6];
  195. };
  196. struct nvme_rw_command {
  197. __u8 opcode;
  198. __u8 flags;
  199. __u16 command_id;
  200. __le32 nsid;
  201. __u64 rsvd2;
  202. __le64 metadata;
  203. __le64 prp1;
  204. __le64 prp2;
  205. __le64 slba;
  206. __le16 length;
  207. __le16 control;
  208. __le32 dsmgmt;
  209. __le32 reftag;
  210. __le16 apptag;
  211. __le16 appmask;
  212. };
  213. enum {
  214. NVME_RW_LR = 1 << 15,
  215. NVME_RW_FUA = 1 << 14,
  216. NVME_RW_DSM_FREQ_UNSPEC = 0,
  217. NVME_RW_DSM_FREQ_TYPICAL = 1,
  218. NVME_RW_DSM_FREQ_RARE = 2,
  219. NVME_RW_DSM_FREQ_READS = 3,
  220. NVME_RW_DSM_FREQ_WRITES = 4,
  221. NVME_RW_DSM_FREQ_RW = 5,
  222. NVME_RW_DSM_FREQ_ONCE = 6,
  223. NVME_RW_DSM_FREQ_PREFETCH = 7,
  224. NVME_RW_DSM_FREQ_TEMP = 8,
  225. NVME_RW_DSM_LATENCY_NONE = 0 << 4,
  226. NVME_RW_DSM_LATENCY_IDLE = 1 << 4,
  227. NVME_RW_DSM_LATENCY_NORM = 2 << 4,
  228. NVME_RW_DSM_LATENCY_LOW = 3 << 4,
  229. NVME_RW_DSM_SEQ_REQ = 1 << 6,
  230. NVME_RW_DSM_COMPRESSED = 1 << 7,
  231. };
  232. struct nvme_dsm_cmd {
  233. __u8 opcode;
  234. __u8 flags;
  235. __u16 command_id;
  236. __le32 nsid;
  237. __u64 rsvd2[2];
  238. __le64 prp1;
  239. __le64 prp2;
  240. __le32 nr;
  241. __le32 attributes;
  242. __u32 rsvd12[4];
  243. };
  244. enum {
  245. NVME_DSMGMT_IDR = 1 << 0,
  246. NVME_DSMGMT_IDW = 1 << 1,
  247. NVME_DSMGMT_AD = 1 << 2,
  248. };
  249. struct nvme_dsm_range {
  250. __le32 cattr;
  251. __le32 nlb;
  252. __le64 slba;
  253. };
  254. /* Admin commands */
  255. enum nvme_admin_opcode {
  256. nvme_admin_delete_sq = 0x00,
  257. nvme_admin_create_sq = 0x01,
  258. nvme_admin_get_log_page = 0x02,
  259. nvme_admin_delete_cq = 0x04,
  260. nvme_admin_create_cq = 0x05,
  261. nvme_admin_identify = 0x06,
  262. nvme_admin_abort_cmd = 0x08,
  263. nvme_admin_set_features = 0x09,
  264. nvme_admin_get_features = 0x0a,
  265. nvme_admin_async_event = 0x0c,
  266. nvme_admin_activate_fw = 0x10,
  267. nvme_admin_download_fw = 0x11,
  268. nvme_admin_format_nvm = 0x80,
  269. nvme_admin_security_send = 0x81,
  270. nvme_admin_security_recv = 0x82,
  271. };
  272. enum {
  273. NVME_QUEUE_PHYS_CONTIG = (1 << 0),
  274. NVME_CQ_IRQ_ENABLED = (1 << 1),
  275. NVME_SQ_PRIO_URGENT = (0 << 1),
  276. NVME_SQ_PRIO_HIGH = (1 << 1),
  277. NVME_SQ_PRIO_MEDIUM = (2 << 1),
  278. NVME_SQ_PRIO_LOW = (3 << 1),
  279. NVME_FEAT_ARBITRATION = 0x01,
  280. NVME_FEAT_POWER_MGMT = 0x02,
  281. NVME_FEAT_LBA_RANGE = 0x03,
  282. NVME_FEAT_TEMP_THRESH = 0x04,
  283. NVME_FEAT_ERR_RECOVERY = 0x05,
  284. NVME_FEAT_VOLATILE_WC = 0x06,
  285. NVME_FEAT_NUM_QUEUES = 0x07,
  286. NVME_FEAT_IRQ_COALESCE = 0x08,
  287. NVME_FEAT_IRQ_CONFIG = 0x09,
  288. NVME_FEAT_WRITE_ATOMIC = 0x0a,
  289. NVME_FEAT_ASYNC_EVENT = 0x0b,
  290. NVME_FEAT_SW_PROGRESS = 0x0c,
  291. };
  292. struct nvme_identify {
  293. __u8 opcode;
  294. __u8 flags;
  295. __u16 command_id;
  296. __le32 nsid;
  297. __u64 rsvd2[2];
  298. __le64 prp1;
  299. __le64 prp2;
  300. __le32 cns;
  301. __u32 rsvd11[5];
  302. };
  303. struct nvme_features {
  304. __u8 opcode;
  305. __u8 flags;
  306. __u16 command_id;
  307. __le32 nsid;
  308. __u64 rsvd2[2];
  309. __le64 prp1;
  310. __le64 prp2;
  311. __le32 fid;
  312. __le32 dword11;
  313. __u32 rsvd12[4];
  314. };
  315. struct nvme_create_cq {
  316. __u8 opcode;
  317. __u8 flags;
  318. __u16 command_id;
  319. __u32 rsvd1[5];
  320. __le64 prp1;
  321. __u64 rsvd8;
  322. __le16 cqid;
  323. __le16 qsize;
  324. __le16 cq_flags;
  325. __le16 irq_vector;
  326. __u32 rsvd12[4];
  327. };
  328. struct nvme_create_sq {
  329. __u8 opcode;
  330. __u8 flags;
  331. __u16 command_id;
  332. __u32 rsvd1[5];
  333. __le64 prp1;
  334. __u64 rsvd8;
  335. __le16 sqid;
  336. __le16 qsize;
  337. __le16 sq_flags;
  338. __le16 cqid;
  339. __u32 rsvd12[4];
  340. };
  341. struct nvme_delete_queue {
  342. __u8 opcode;
  343. __u8 flags;
  344. __u16 command_id;
  345. __u32 rsvd1[9];
  346. __le16 qid;
  347. __u16 rsvd10;
  348. __u32 rsvd11[5];
  349. };
  350. struct nvme_download_firmware {
  351. __u8 opcode;
  352. __u8 flags;
  353. __u16 command_id;
  354. __u32 rsvd1[5];
  355. __le64 prp1;
  356. __le64 prp2;
  357. __le32 numd;
  358. __le32 offset;
  359. __u32 rsvd12[4];
  360. };
  361. struct nvme_format_cmd {
  362. __u8 opcode;
  363. __u8 flags;
  364. __u16 command_id;
  365. __le32 nsid;
  366. __u64 rsvd2[4];
  367. __le32 cdw10;
  368. __u32 rsvd11[5];
  369. };
  370. struct nvme_command {
  371. union {
  372. struct nvme_common_command common;
  373. struct nvme_rw_command rw;
  374. struct nvme_identify identify;
  375. struct nvme_features features;
  376. struct nvme_create_cq create_cq;
  377. struct nvme_create_sq create_sq;
  378. struct nvme_delete_queue delete_queue;
  379. struct nvme_download_firmware dlfw;
  380. struct nvme_format_cmd format;
  381. struct nvme_dsm_cmd dsm;
  382. };
  383. };
  384. enum {
  385. NVME_SC_SUCCESS = 0x0,
  386. NVME_SC_INVALID_OPCODE = 0x1,
  387. NVME_SC_INVALID_FIELD = 0x2,
  388. NVME_SC_CMDID_CONFLICT = 0x3,
  389. NVME_SC_DATA_XFER_ERROR = 0x4,
  390. NVME_SC_POWER_LOSS = 0x5,
  391. NVME_SC_INTERNAL = 0x6,
  392. NVME_SC_ABORT_REQ = 0x7,
  393. NVME_SC_ABORT_QUEUE = 0x8,
  394. NVME_SC_FUSED_FAIL = 0x9,
  395. NVME_SC_FUSED_MISSING = 0xa,
  396. NVME_SC_INVALID_NS = 0xb,
  397. NVME_SC_CMD_SEQ_ERROR = 0xc,
  398. NVME_SC_LBA_RANGE = 0x80,
  399. NVME_SC_CAP_EXCEEDED = 0x81,
  400. NVME_SC_NS_NOT_READY = 0x82,
  401. NVME_SC_CQ_INVALID = 0x100,
  402. NVME_SC_QID_INVALID = 0x101,
  403. NVME_SC_QUEUE_SIZE = 0x102,
  404. NVME_SC_ABORT_LIMIT = 0x103,
  405. NVME_SC_ABORT_MISSING = 0x104,
  406. NVME_SC_ASYNC_LIMIT = 0x105,
  407. NVME_SC_FIRMWARE_SLOT = 0x106,
  408. NVME_SC_FIRMWARE_IMAGE = 0x107,
  409. NVME_SC_INVALID_VECTOR = 0x108,
  410. NVME_SC_INVALID_LOG_PAGE = 0x109,
  411. NVME_SC_INVALID_FORMAT = 0x10a,
  412. NVME_SC_BAD_ATTRIBUTES = 0x180,
  413. NVME_SC_WRITE_FAULT = 0x280,
  414. NVME_SC_READ_ERROR = 0x281,
  415. NVME_SC_GUARD_CHECK = 0x282,
  416. NVME_SC_APPTAG_CHECK = 0x283,
  417. NVME_SC_REFTAG_CHECK = 0x284,
  418. NVME_SC_COMPARE_FAILED = 0x285,
  419. NVME_SC_ACCESS_DENIED = 0x286,
  420. };
  421. struct nvme_completion {
  422. __le32 result; /* Used by admin commands to return data */
  423. __u32 rsvd;
  424. __le16 sq_head; /* how much of this queue may be reclaimed */
  425. __le16 sq_id; /* submission queue that generated this entry */
  426. __u16 command_id; /* of the command which completed */
  427. __le16 status; /* did the command fail, and if so, why? */
  428. };
  429. struct nvme_user_io {
  430. __u8 opcode;
  431. __u8 flags;
  432. __u16 control;
  433. __u16 nblocks;
  434. __u16 rsvd;
  435. __u64 metadata;
  436. __u64 addr;
  437. __u64 slba;
  438. __u32 dsmgmt;
  439. __u32 reftag;
  440. __u16 apptag;
  441. __u16 appmask;
  442. };
  443. struct nvme_admin_cmd {
  444. __u8 opcode;
  445. __u8 flags;
  446. __u16 rsvd1;
  447. __u32 nsid;
  448. __u32 cdw2;
  449. __u32 cdw3;
  450. __u64 metadata;
  451. __u64 addr;
  452. __u32 metadata_len;
  453. __u32 data_len;
  454. __u32 cdw10;
  455. __u32 cdw11;
  456. __u32 cdw12;
  457. __u32 cdw13;
  458. __u32 cdw14;
  459. __u32 cdw15;
  460. __u32 timeout_ms;
  461. __u32 result;
  462. };
  463. #define NVME_IOCTL_ID _IO('N', 0x40)
  464. #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
  465. #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
  466. #ifdef __KERNEL__
  467. #include <linux/pci.h>
  468. #include <linux/miscdevice.h>
  469. #include <linux/kref.h>
  470. #define NVME_IO_TIMEOUT (5 * HZ)
  471. /*
  472. * Represents an NVM Express device. Each nvme_dev is a PCI function.
  473. */
  474. struct nvme_dev {
  475. struct list_head node;
  476. struct nvme_queue **queues;
  477. u32 __iomem *dbs;
  478. struct pci_dev *pci_dev;
  479. struct dma_pool *prp_page_pool;
  480. struct dma_pool *prp_small_pool;
  481. int instance;
  482. int queue_count;
  483. int db_stride;
  484. u32 ctrl_config;
  485. struct msix_entry *entry;
  486. struct nvme_bar __iomem *bar;
  487. struct list_head namespaces;
  488. struct kref kref;
  489. struct miscdevice miscdev;
  490. char name[12];
  491. char serial[20];
  492. char model[40];
  493. char firmware_rev[8];
  494. u32 max_hw_sectors;
  495. u32 stripe_size;
  496. u16 oncs;
  497. };
  498. /*
  499. * An NVM Express namespace is equivalent to a SCSI LUN
  500. */
  501. struct nvme_ns {
  502. struct list_head list;
  503. struct nvme_dev *dev;
  504. struct request_queue *queue;
  505. struct gendisk *disk;
  506. int ns_id;
  507. int lba_shift;
  508. u64 mode_select_num_blocks;
  509. u32 mode_select_block_len;
  510. };
  511. /*
  512. * The nvme_iod describes the data in an I/O, including the list of PRP
  513. * entries. You can't see it in this data structure because C doesn't let
  514. * me express that. Use nvme_alloc_iod to ensure there's enough space
  515. * allocated to store the PRP list.
  516. */
  517. struct nvme_iod {
  518. void *private; /* For the use of the submitter of the I/O */
  519. int npages; /* In the PRP list. 0 means small pool in use */
  520. int offset; /* Of PRP list */
  521. int nents; /* Used in scatterlist */
  522. int length; /* Of data, in bytes */
  523. dma_addr_t first_dma;
  524. struct scatterlist sg[0];
  525. };
  526. static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
  527. {
  528. return (sector >> (ns->lba_shift - 9));
  529. }
  530. /**
  531. * nvme_free_iod - frees an nvme_iod
  532. * @dev: The device that the I/O was submitted to
  533. * @iod: The memory to free
  534. */
  535. void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod);
  536. int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd,
  537. struct nvme_iod *iod, int total_len, gfp_t gfp);
  538. struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write,
  539. unsigned long addr, unsigned length);
  540. void nvme_unmap_user_pages(struct nvme_dev *dev, int write,
  541. struct nvme_iod *iod);
  542. struct nvme_queue *get_nvmeq(struct nvme_dev *dev);
  543. void put_nvmeq(struct nvme_queue *nvmeq);
  544. int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd,
  545. u32 *result, unsigned timeout);
  546. int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns);
  547. int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *,
  548. u32 *result);
  549. int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns,
  550. dma_addr_t dma_addr);
  551. int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
  552. dma_addr_t dma_addr, u32 *result);
  553. int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
  554. dma_addr_t dma_addr, u32 *result);
  555. struct sg_io_hdr;
  556. int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr);
  557. int nvme_sg_get_version_num(int __user *ip);
  558. #endif
  559. #endif /* _LINUX_NVME_H */