]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/nvme.h
Merge tag 'trace-v4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[mirror_ubuntu-artful-kernel.git] / include / linux / nvme.h
index fc3c2420659395039be1288a82e8d62d98aefab3..3d1c6f1b15c9bd351fa04d4e9824ff83b5c0045a 100644 (file)
@@ -242,6 +242,7 @@ enum {
        NVME_CTRL_ONCS_COMPARE                  = 1 << 0,
        NVME_CTRL_ONCS_WRITE_UNCORRECTABLE      = 1 << 1,
        NVME_CTRL_ONCS_DSM                      = 1 << 2,
+       NVME_CTRL_ONCS_WRITE_ZEROES             = 1 << 3,
        NVME_CTRL_VWC_PRESENT                   = 1 << 0,
 };
 
@@ -558,6 +559,23 @@ struct nvme_dsm_range {
        __le64                  slba;
 };
 
+struct nvme_write_zeroes_cmd {
+       __u8                    opcode;
+       __u8                    flags;
+       __u16                   command_id;
+       __le32                  nsid;
+       __u64                   rsvd2;
+       __le64                  metadata;
+       union nvme_data_ptr     dptr;
+       __le64                  slba;
+       __le16                  length;
+       __le16                  control;
+       __le32                  dsmgmt;
+       __le32                  reftag;
+       __le16                  apptag;
+       __le16                  appmask;
+};
+
 /* Admin commands */
 
 enum nvme_admin_opcode {
@@ -857,6 +875,7 @@ struct nvme_command {
                struct nvme_download_firmware dlfw;
                struct nvme_format_cmd format;
                struct nvme_dsm_cmd dsm;
+               struct nvme_write_zeroes_cmd write_zeroes;
                struct nvme_abort_cmd abort;
                struct nvme_get_log_page_command get_log_page;
                struct nvmf_common_command fabrics;
@@ -947,6 +966,7 @@ enum {
        NVME_SC_BAD_ATTRIBUTES          = 0x180,
        NVME_SC_INVALID_PI              = 0x181,
        NVME_SC_READ_ONLY               = 0x182,
+       NVME_SC_ONCS_NOT_SUPPORTED      = 0x183,
 
        /*
         * I/O Command Set Specific - Fabrics commands:
@@ -973,17 +993,30 @@ enum {
        NVME_SC_UNWRITTEN_BLOCK         = 0x287,
 
        NVME_SC_DNR                     = 0x4000,
+
+
+       /*
+        * FC Transport-specific error status values for NVME commands
+        *
+        * Transport-specific status code values must be in the range 0xB0..0xBF
+        */
+
+       /* Generic FC failure - catchall */
+       NVME_SC_FC_TRANSPORT_ERROR      = 0x00B0,
+
+       /* I/O failure due to FC ABTS'd */
+       NVME_SC_FC_TRANSPORT_ABORTED    = 0x00B1,
 };
 
 struct nvme_completion {
        /*
         * Used by Admin and Fabrics commands to return data:
         */
-       union {
-               __le16  result16;
-               __le32  result;
-               __le64  result64;
-       };
+       union nvme_result {
+               __le16  u16;
+               __le32  u32;
+               __le64  u64;
+       } result;
        __le16  sq_head;        /* how much of this queue may be reclaimed */
        __le16  sq_id;          /* submission queue that generated this entry */
        __u16   command_id;     /* of the command which completed */