aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2014-09-12 18:07:20 -0400
committerJens Axboe <axboe@fb.com>2014-11-04 15:17:09 -0500
commit7963e521811ed19396d47793cc77d87c643ab891 (patch)
tree5587991bb23e2694f627e7ff73b784eda2dd1cc8 /include/uapi/linux
parent1b9dbf7fe02d85f70e8efc1c12c070206c0d5c5f (diff)
NVMe: Passthrough IOCTL for IO commands
The NVME_IOCTL_SUBMIT_IO only works for IO commands with block data transfers and isn't usable for other NVMe commands like flush, data set management, or any sort of vendor unique command. The NVME_IOCTL_ADMIN_CMD, however, can easily be modified to accept arbitrary IO commands in addition to arbitrary admin commands without breaking backward compatibility. This patch just adds a new IOCTL to distinguish if the driver should submit the command on an IO or Admin queue. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/nvme.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
index 134518b0100b..97106556408f 100644
--- a/include/uapi/linux/nvme.h
+++ b/include/uapi/linux/nvme.h
@@ -503,7 +503,7 @@ struct nvme_user_io {
503 __u16 appmask; 503 __u16 appmask;
504}; 504};
505 505
506struct nvme_admin_cmd { 506struct nvme_passthru_cmd {
507 __u8 opcode; 507 __u8 opcode;
508 __u8 flags; 508 __u8 flags;
509 __u16 rsvd1; 509 __u16 rsvd1;
@@ -524,8 +524,11 @@ struct nvme_admin_cmd {
524 __u32 result; 524 __u32 result;
525}; 525};
526 526
527#define nvme_admin_cmd nvme_passthru_cmd
528
527#define NVME_IOCTL_ID _IO('N', 0x40) 529#define NVME_IOCTL_ID _IO('N', 0x40)
528#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd) 530#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
529#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io) 531#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
532#define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd)
530 533
531#endif /* _UAPI_LINUX_NVME_H */ 534#endif /* _UAPI_LINUX_NVME_H */