nvme: introduce ctrl attributes enumeration
authorSagi Grimberg <sagi@grimberg.me>
Fri, 2 Nov 2018 17:28:12 +0000 (10:28 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 8 Dec 2018 05:26:55 +0000 (22:26 -0700)
We are growing more controller attributes, so use a proper enumeration
for it.  For now just add the 128-bit hostid which we support.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/admin-cmd.c
include/linux/nvme.h

index 1179f63..30778ff 100644 (file)
@@ -304,7 +304,7 @@ static void nvmet_execute_identify_ctrl(struct nvmet_req *req)
 
        /* XXX: figure out what to do about RTD3R/RTD3 */
        id->oaes = cpu_to_le32(NVMET_AEN_CFG_OPTIONAL);
-       id->ctratt = cpu_to_le32(1 << 0);
+       id->ctratt = cpu_to_le32(NVME_CTRL_ATTR_HID_128_BIT);
 
        id->oacs = 0;
 
index 818dbe9..753c83a 100644 (file)
@@ -198,6 +198,10 @@ enum {
        NVME_PS_FLAGS_NON_OP_STATE      = 1 << 1,
 };
 
+enum nvme_ctrl_attr {
+       NVME_CTRL_ATTR_HID_128_BIT      = (1 << 0),
+};
+
 struct nvme_id_ctrl {
        __le16                  vid;
        __le16                  ssvid;