]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
add fields and types for zoned namespaces
authorKlaus Jensen <k.jensen@samsung.com>
Tue, 14 Apr 2020 09:43:29 +0000 (11:43 +0200)
committerSteven Seungcheol Lee <sc108.lee@samsung.com>
Tue, 23 Jun 2020 01:43:36 +0000 (10:43 +0900)
zamds renamed as zasl(Zone Append Size Limit)

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Co-authored-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
linux/nvme.h
nvme-print.c

index f0ebca47476ef3e35899d982acf3b5f55cc64858..d0c1d517b2a24340624825c9d60f230ef15c4b20 100644 (file)
@@ -143,6 +143,7 @@ enum {
  */
 enum {
        NVME_IOCS_NVM   = 0x00,
+       NVME_IOCS_ZONED = 0x02,
 };
 
 #define NVME_AQ_DEPTH          32
@@ -418,8 +419,13 @@ struct nvme_id_ns {
 };
 
 struct nvme_iocs_vector {
-       __le64  nvm  : 1;
-       __le64  rsvd : 63;
+       union {
+               __le64 nvm   : 1;
+               __le64 rsvd1 : 1;
+               __le64 zoned : 1;
+               __le64 rsvd3 : 61;
+       };
+       __le64 a;
 };
 
 struct nvme_id_iocs {
@@ -1420,6 +1426,18 @@ enum {
        NVME_SC_DISCOVERY_RESTART       = 0x190,
        NVME_SC_AUTH_REQUIRED           = 0x191,
 
+       /*
+        * I/O Command Set Specific - Zoned Namespace commands:
+        */
+       NVME_SC_ZONE_BOUNDARY_ERROR             = 0x1B8,
+       NVME_SC_ZONE_IS_FULL                    = 0x1B9,
+       NVME_SC_ZONE_IS_READ_ONLY               = 0x1BA,
+       NVME_SC_ZONE_IS_OFFLINE                 = 0x1BB,
+       NVME_SC_ZONE_INVALID_WRITE              = 0x1BC,
+       NVME_SC_TOO_MANY_ACTIVE_ZONES           = 0x1BD,
+       NVME_SC_TOO_MANY_OPEN_ZONES             = 0x1BE,
+       NVME_SC_ZONE_INVALID_STATE_TRANSITION   = 0x1BF,
+
        /*
         * Media and Data Integrity Errors:
         */
@@ -1488,10 +1506,10 @@ struct nvme_zns_id_ns {
 
 /**
  * struct nvme_zns_id_ctrl -
- * @zamds:
+ * @zasl:
  */
 struct nvme_zns_id_ctrl {
-       __u8    zamds;
+       __u8    zasl;
        __u8    rsvd1[4095];
 };
 
index 3edcbd9f0632e2e0be77721947d63dfbfc94dd42..820db507ac3ecb254a79f97d81dde0f4c4403696 100644 (file)
@@ -2884,7 +2884,7 @@ static void json_nvme_zns_id_ctrl(struct nvme_zns_id_ctrl *ctrl, unsigned int mo
        struct json_object *root;
 
        root = json_create_object();
-       json_object_add_value_int(root, "zamds", ctrl->zamds);
+       json_object_add_value_int(root, "zasl", ctrl->zasl);
 
        json_print_object(root, NULL);
        printf("\n");
@@ -2899,7 +2899,7 @@ void nvme_show_zns_id_ctrl(struct nvme_zns_id_ctrl *ctrl, unsigned int mode)
                return json_nvme_zns_id_ctrl(ctrl, mode);
 
        printf("NVMe ZNS Identify Controller:\n");
-       printf("zamds: %u\n", ctrl->zamds);
+       printf("zasl: %u\n", ctrl->zasl);
 }
 
 void json_nvme_zns_id_ns(struct nvme_zns_id_ns *ns,