NVMe: Add definitions for format command
authorVishal Verma <vishal.l.verma@intel.com>
Wed, 27 Mar 2013 11:13:41 +0000 (07:13 -0400)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Wed, 27 Mar 2013 11:17:49 +0000 (07:17 -0400)
The SCSI emulation has the ability to send format commands, so we need
to add the definition of the command.  Also add a missing error code.

Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
drivers/block/nvme-core.c
include/linux/nvme.h

index 1f98040cf677a8fe584e6150ab00c3b5abaf1709..d0cfb85d55823b1bb42ad3284bacd8b5fe8ac16e 100644 (file)
@@ -93,6 +93,7 @@ static inline void _nvme_check_size(void)
        BUILD_BUG_ON(sizeof(struct nvme_create_sq) != 64);
        BUILD_BUG_ON(sizeof(struct nvme_delete_queue) != 64);
        BUILD_BUG_ON(sizeof(struct nvme_features) != 64);
+       BUILD_BUG_ON(sizeof(struct nvme_format_cmd) != 64);
        BUILD_BUG_ON(sizeof(struct nvme_command) != 64);
        BUILD_BUG_ON(sizeof(struct nvme_id_ctrl) != 4096);
        BUILD_BUG_ON(sizeof(struct nvme_id_ns) != 4096);
index 6f899add14abc0275d71ddc7c0eb124163c5b602..f1974cab60cfb4160ce946ce9b5e21d732d837a7 100644 (file)
@@ -393,6 +393,16 @@ struct nvme_download_firmware {
        __u32                   rsvd12[4];
 };
 
+struct nvme_format_cmd {
+       __u8                    opcode;
+       __u8                    flags;
+       __u16                   command_id;
+       __le32                  nsid;
+       __u64                   rsvd2[4];
+       __le32                  cdw10;
+       __u32                   rsvd11[5];
+};
+
 struct nvme_command {
        union {
                struct nvme_common_command common;
@@ -403,6 +413,7 @@ struct nvme_command {
                struct nvme_create_sq create_sq;
                struct nvme_delete_queue delete_queue;
                struct nvme_download_firmware dlfw;
+               struct nvme_format_cmd format;
                struct nvme_dsm_cmd dsm;
        };
 };
@@ -420,6 +431,7 @@ enum {
        NVME_SC_FUSED_FAIL              = 0x9,
        NVME_SC_FUSED_MISSING           = 0xa,
        NVME_SC_INVALID_NS              = 0xb,
+       NVME_SC_CMD_SEQ_ERROR           = 0xc,
        NVME_SC_LBA_RANGE               = 0x80,
        NVME_SC_CAP_EXCEEDED            = 0x81,
        NVME_SC_NS_NOT_READY            = 0x82,