aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nvme.h
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2011-05-20 13:03:42 -0400
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2011-11-04 15:53:03 -0400
commit6bbf1acddeed0bfb345a5578f9fcada16f1e514f (patch)
tree965663c2a38ff10bc88fb2096fc0adbef500b11d /include/linux/nvme.h
parenteac623ba7a91474a688eb5d0fcd0eaa6a56dc41c (diff)
NVMe: Rework ioctls
Remove the special-purpose IDENTIFY, GET_RANGE_TYPE, DOWNLOAD_FIRMWARE and ACTIVATE_FIRMWARE commands. Replace them with a generic ADMIN_CMD ioctl that can submit any admin command. Add a new ID ioctl that returns the namespace ID of the queried device. It corresponds to the SCSI Idlun ioctl. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'include/linux/nvme.h')
-rw-r--r--include/linux/nvme.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index a19304fefa7d..c96ab0f5ef6f 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -153,11 +153,11 @@ struct nvme_common_command {
153 __u8 flags; 153 __u8 flags;
154 __u16 command_id; 154 __u16 command_id;
155 __le32 nsid; 155 __le32 nsid;
156 __u64 rsvd2; 156 __u32 cdw2[2];
157 __le64 metadata; 157 __le64 metadata;
158 __le64 prp1; 158 __le64 prp1;
159 __le64 prp2; 159 __le64 prp2;
160 __u32 rsvd10[6]; 160 __u32 cdw10[6];
161}; 161};
162 162
163struct nvme_rw_command { 163struct nvme_rw_command {
@@ -388,17 +388,29 @@ struct nvme_user_io {
388 __u16 appmask; 388 __u16 appmask;
389}; 389};
390 390
391struct nvme_dlfw { 391struct nvme_admin_cmd {
392 __u8 opcode;
393 __u8 flags;
394 __u16 rsvd1;
395 __u32 nsid;
396 __u32 cdw2;
397 __u32 cdw3;
398 __u64 metadata;
392 __u64 addr; 399 __u64 addr;
393 __u32 length; /* In dwords */ 400 __u32 metadata_len;
394 __u32 offset; /* In dwords */ 401 __u32 data_len;
402 __u32 cdw10;
403 __u32 cdw11;
404 __u32 cdw12;
405 __u32 cdw13;
406 __u32 cdw14;
407 __u32 cdw15;
408 __u32 timeout_ms;
409 __u32 result;
395}; 410};
396 411
397#define NVME_IOCTL_IDENTIFY_NS _IOW('N', 0x40, struct nvme_id_ns) 412#define NVME_IOCTL_ID _IO('N', 0x40)
398#define NVME_IOCTL_IDENTIFY_CTRL _IOW('N', 0x41, struct nvme_id_ctrl) 413#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
399#define NVME_IOCTL_GET_RANGE_TYPE _IOW('N', 0x42, struct nvme_lba_range_type) 414#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
400#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x43, struct nvme_user_io)
401#define NVME_IOCTL_DOWNLOAD_FW _IOW('N', 0x44, struct nvme_dlfw)
402#define NVME_IOCTL_ACTIVATE_FW _IO('N', 0x45)
403 415
404#endif /* _LINUX_NVME_H */ 416#endif /* _LINUX_NVME_H */