]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: Split max power flags
authorBao Tran <bao.tran1@wdc.com>
Wed, 28 Jun 2023 22:14:11 +0000 (15:14 -0700)
committerDaniel Wagner <dwagner@suse.de>
Thu, 20 Jul 2023 08:25:59 +0000 (10:25 +0200)
Split max power flags into max power scale and non-operational state
bits for clarity.

nvme-print-json.c

index 870f7c5c4c090f2cc9b1bf376b7d292bfef3be0c..ff99d5e76721931513479a308413a602d55e9c0d 100644 (file)
@@ -229,7 +229,10 @@ static void json_nvme_id_ns(struct nvme_id_ns *ns, unsigned int nsid,
 
                json_object_add_value_int(psd, "max_power",
                        le16_to_cpu(ctrl->psd[i].mp));
-               json_object_add_value_int(psd, "flags", ctrl->psd[i].flags);
+               json_object_add_value_int(psd, "max_power_scale",
+                       ctrl->psd[i].flags & 0x1);
+               json_object_add_value_int(psd, "non-operational_state",
+                       (ctrl->psd[i].flags & 0x2) >> 1);
                json_object_add_value_uint(psd, "entry_lat",
                        le32_to_cpu(ctrl->psd[i].enlat));
                json_object_add_value_uint(psd, "exit_lat",