summaryrefslogtreecommitdiffstats
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)
downloadlinux-6bbf1acddeed0bfb345a5578f9fcada16f1e514f.tar.gz
linux-6bbf1acddeed0bfb345a5578f9fcada16f1e514f.tar.bz2
linux-6bbf1acddeed0bfb345a5578f9fcada16f1e514f.zip
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 {
__u8 flags;
__u16 command_id;
__le32 nsid;
- __u64 rsvd2;
+ __u32 cdw2[2];
__le64 metadata;
__le64 prp1;
__le64 prp2;
- __u32 rsvd10[6];
+ __u32 cdw10[6];
};
struct nvme_rw_command {
@@ -388,17 +388,29 @@ struct nvme_user_io {
__u16 appmask;
};
-struct nvme_dlfw {
+struct nvme_admin_cmd {
+ __u8 opcode;
+ __u8 flags;
+ __u16 rsvd1;
+ __u32 nsid;
+ __u32 cdw2;
+ __u32 cdw3;
+ __u64 metadata;
__u64 addr;
- __u32 length; /* In dwords */
- __u32 offset; /* In dwords */
+ __u32 metadata_len;
+ __u32 data_len;
+ __u32 cdw10;
+ __u32 cdw11;
+ __u32 cdw12;
+ __u32 cdw13;
+ __u32 cdw14;
+ __u32 cdw15;
+ __u32 timeout_ms;
+ __u32 result;
};
-#define NVME_IOCTL_IDENTIFY_NS _IOW('N', 0x40, struct nvme_id_ns)
-#define NVME_IOCTL_IDENTIFY_CTRL _IOW('N', 0x41, struct nvme_id_ctrl)
-#define NVME_IOCTL_GET_RANGE_TYPE _IOW('N', 0x42, struct nvme_lba_range_type)
-#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x43, struct nvme_user_io)
-#define NVME_IOCTL_DOWNLOAD_FW _IOW('N', 0x44, struct nvme_dlfw)
-#define NVME_IOCTL_ACTIVATE_FW _IO('N', 0x45)
+#define NVME_IOCTL_ID _IO('N', 0x40)
+#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
+#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
#endif /* _LINUX_NVME_H */