nvme.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  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. NVME_FWACT_REPL = (0 << 3),
  292. NVME_FWACT_REPL_ACTV = (1 << 3),
  293. NVME_FWACT_ACTV = (2 << 3),
  294. };
  295. struct nvme_identify {
  296. __u8 opcode;
  297. __u8 flags;
  298. __u16 command_id;
  299. __le32 nsid;
  300. __u64 rsvd2[2];
  301. __le64 prp1;
  302. __le64 prp2;
  303. __le32 cns;
  304. __u32 rsvd11[5];
  305. };
  306. struct nvme_features {
  307. __u8 opcode;
  308. __u8 flags;
  309. __u16 command_id;
  310. __le32 nsid;
  311. __u64 rsvd2[2];
  312. __le64 prp1;
  313. __le64 prp2;
  314. __le32 fid;
  315. __le32 dword11;
  316. __u32 rsvd12[4];
  317. };
  318. struct nvme_create_cq {
  319. __u8 opcode;
  320. __u8 flags;
  321. __u16 command_id;
  322. __u32 rsvd1[5];
  323. __le64 prp1;
  324. __u64 rsvd8;
  325. __le16 cqid;
  326. __le16 qsize;
  327. __le16 cq_flags;
  328. __le16 irq_vector;
  329. __u32 rsvd12[4];
  330. };
  331. struct nvme_create_sq {
  332. __u8 opcode;
  333. __u8 flags;
  334. __u16 command_id;
  335. __u32 rsvd1[5];
  336. __le64 prp1;
  337. __u64 rsvd8;
  338. __le16 sqid;
  339. __le16 qsize;
  340. __le16 sq_flags;
  341. __le16 cqid;
  342. __u32 rsvd12[4];
  343. };
  344. struct nvme_delete_queue {
  345. __u8 opcode;
  346. __u8 flags;
  347. __u16 command_id;
  348. __u32 rsvd1[9];
  349. __le16 qid;
  350. __u16 rsvd10;
  351. __u32 rsvd11[5];
  352. };
  353. struct nvme_download_firmware {
  354. __u8 opcode;
  355. __u8 flags;
  356. __u16 command_id;
  357. __u32 rsvd1[5];
  358. __le64 prp1;
  359. __le64 prp2;
  360. __le32 numd;
  361. __le32 offset;
  362. __u32 rsvd12[4];
  363. };
  364. struct nvme_format_cmd {
  365. __u8 opcode;
  366. __u8 flags;
  367. __u16 command_id;
  368. __le32 nsid;
  369. __u64 rsvd2[4];
  370. __le32 cdw10;
  371. __u32 rsvd11[5];
  372. };
  373. struct nvme_command {
  374. union {
  375. struct nvme_common_command common;
  376. struct nvme_rw_command rw;
  377. struct nvme_identify identify;
  378. struct nvme_features features;
  379. struct nvme_create_cq create_cq;
  380. struct nvme_create_sq create_sq;
  381. struct nvme_delete_queue delete_queue;
  382. struct nvme_download_firmware dlfw;
  383. struct nvme_format_cmd format;
  384. struct nvme_dsm_cmd dsm;
  385. };
  386. };
  387. enum {
  388. NVME_SC_SUCCESS = 0x0,
  389. NVME_SC_INVALID_OPCODE = 0x1,
  390. NVME_SC_INVALID_FIELD = 0x2,
  391. NVME_SC_CMDID_CONFLICT = 0x3,
  392. NVME_SC_DATA_XFER_ERROR = 0x4,
  393. NVME_SC_POWER_LOSS = 0x5,
  394. NVME_SC_INTERNAL = 0x6,
  395. NVME_SC_ABORT_REQ = 0x7,
  396. NVME_SC_ABORT_QUEUE = 0x8,
  397. NVME_SC_FUSED_FAIL = 0x9,
  398. NVME_SC_FUSED_MISSING = 0xa,
  399. NVME_SC_INVALID_NS = 0xb,
  400. NVME_SC_CMD_SEQ_ERROR = 0xc,
  401. NVME_SC_LBA_RANGE = 0x80,
  402. NVME_SC_CAP_EXCEEDED = 0x81,
  403. NVME_SC_NS_NOT_READY = 0x82,
  404. NVME_SC_CQ_INVALID = 0x100,
  405. NVME_SC_QID_INVALID = 0x101,
  406. NVME_SC_QUEUE_SIZE = 0x102,
  407. NVME_SC_ABORT_LIMIT = 0x103,
  408. NVME_SC_ABORT_MISSING = 0x104,
  409. NVME_SC_ASYNC_LIMIT = 0x105,
  410. NVME_SC_FIRMWARE_SLOT = 0x106,
  411. NVME_SC_FIRMWARE_IMAGE = 0x107,
  412. NVME_SC_INVALID_VECTOR = 0x108,
  413. NVME_SC_INVALID_LOG_PAGE = 0x109,
  414. NVME_SC_INVALID_FORMAT = 0x10a,
  415. NVME_SC_BAD_ATTRIBUTES = 0x180,
  416. NVME_SC_WRITE_FAULT = 0x280,
  417. NVME_SC_READ_ERROR = 0x281,
  418. NVME_SC_GUARD_CHECK = 0x282,
  419. NVME_SC_APPTAG_CHECK = 0x283,
  420. NVME_SC_REFTAG_CHECK = 0x284,
  421. NVME_SC_COMPARE_FAILED = 0x285,
  422. NVME_SC_ACCESS_DENIED = 0x286,
  423. };
  424. struct nvme_completion {
  425. __le32 result; /* Used by admin commands to return data */
  426. __u32 rsvd;
  427. __le16 sq_head; /* how much of this queue may be reclaimed */
  428. __le16 sq_id; /* submission queue that generated this entry */
  429. __u16 command_id; /* of the command which completed */
  430. __le16 status; /* did the command fail, and if so, why? */
  431. };
  432. struct nvme_user_io {
  433. __u8 opcode;
  434. __u8 flags;
  435. __u16 control;
  436. __u16 nblocks;
  437. __u16 rsvd;
  438. __u64 metadata;
  439. __u64 addr;
  440. __u64 slba;
  441. __u32 dsmgmt;
  442. __u32 reftag;
  443. __u16 apptag;
  444. __u16 appmask;
  445. };
  446. struct nvme_admin_cmd {
  447. __u8 opcode;
  448. __u8 flags;
  449. __u16 rsvd1;
  450. __u32 nsid;
  451. __u32 cdw2;
  452. __u32 cdw3;
  453. __u64 metadata;
  454. __u64 addr;
  455. __u32 metadata_len;
  456. __u32 data_len;
  457. __u32 cdw10;
  458. __u32 cdw11;
  459. __u32 cdw12;
  460. __u32 cdw13;
  461. __u32 cdw14;
  462. __u32 cdw15;
  463. __u32 timeout_ms;
  464. __u32 result;
  465. };
  466. #define NVME_IOCTL_ID _IO('N', 0x40)
  467. #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
  468. #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
  469. #ifdef __KERNEL__
  470. #include <linux/pci.h>
  471. #include <linux/miscdevice.h>
  472. #include <linux/kref.h>
  473. #define NVME_IO_TIMEOUT (5 * HZ)
  474. /*
  475. * Represents an NVM Express device. Each nvme_dev is a PCI function.
  476. */
  477. struct nvme_dev {
  478. struct list_head node;
  479. struct nvme_queue **queues;
  480. u32 __iomem *dbs;
  481. struct pci_dev *pci_dev;
  482. struct dma_pool *prp_page_pool;
  483. struct dma_pool *prp_small_pool;
  484. int instance;
  485. int queue_count;
  486. int db_stride;
  487. u32 ctrl_config;
  488. struct msix_entry *entry;
  489. struct nvme_bar __iomem *bar;
  490. struct list_head namespaces;
  491. struct kref kref;
  492. struct miscdevice miscdev;
  493. char name[12];
  494. char serial[20];
  495. char model[40];
  496. char firmware_rev[8];
  497. u32 max_hw_sectors;
  498. u32 stripe_size;
  499. u16 oncs;
  500. };
  501. /*
  502. * An NVM Express namespace is equivalent to a SCSI LUN
  503. */
  504. struct nvme_ns {
  505. struct list_head list;
  506. struct nvme_dev *dev;
  507. struct request_queue *queue;
  508. struct gendisk *disk;
  509. int ns_id;
  510. int lba_shift;
  511. int ms;
  512. u64 mode_select_num_blocks;
  513. u32 mode_select_block_len;
  514. };
  515. /*
  516. * The nvme_iod describes the data in an I/O, including the list of PRP
  517. * entries. You can't see it in this data structure because C doesn't let
  518. * me express that. Use nvme_alloc_iod to ensure there's enough space
  519. * allocated to store the PRP list.
  520. */
  521. struct nvme_iod {
  522. void *private; /* For the use of the submitter of the I/O */
  523. int npages; /* In the PRP list. 0 means small pool in use */
  524. int offset; /* Of PRP list */
  525. int nents; /* Used in scatterlist */
  526. int length; /* Of data, in bytes */
  527. dma_addr_t first_dma;
  528. struct scatterlist sg[0];
  529. };
  530. static inline u64 nvme_block_nr(struct nvme_ns *ns, sector_t sector)
  531. {
  532. return (sector >> (ns->lba_shift - 9));
  533. }
  534. /**
  535. * nvme_free_iod - frees an nvme_iod
  536. * @dev: The device that the I/O was submitted to
  537. * @iod: The memory to free
  538. */
  539. void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod);
  540. int nvme_setup_prps(struct nvme_dev *dev, struct nvme_common_command *cmd,
  541. struct nvme_iod *iod, int total_len, gfp_t gfp);
  542. struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write,
  543. unsigned long addr, unsigned length);
  544. void nvme_unmap_user_pages(struct nvme_dev *dev, int write,
  545. struct nvme_iod *iod);
  546. struct nvme_queue *get_nvmeq(struct nvme_dev *dev);
  547. void put_nvmeq(struct nvme_queue *nvmeq);
  548. int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, struct nvme_command *cmd,
  549. u32 *result, unsigned timeout);
  550. int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns);
  551. int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *,
  552. u32 *result);
  553. int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns,
  554. dma_addr_t dma_addr);
  555. int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
  556. dma_addr_t dma_addr, u32 *result);
  557. int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
  558. dma_addr_t dma_addr, u32 *result);
  559. struct sg_io_hdr;
  560. int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr);
  561. int nvme_sg_get_version_num(int __user *ip);
  562. #endif
  563. #endif /* _LINUX_NVME_H */