The active and idle power scales occupy the upper 2 bits of their byte
fields. Shift the scales to use these bits when decoding their values.
Issue: https://github.com/linux-nvme/nvme-cli/issues/85
Signed-off-by: Keith Busch <keith.busch@intel.com>
__u8 rsvd23[9];
};
+/* idle and active power scales occupy the last 2 bits of the field */
+#define POWER_SCALE(s) ((s) >> 6)
+
enum {
NVME_PS_FLAGS_MAX_POWER_SCALE = 1 << 0,
NVME_PS_FLAGS_NON_OP_STATE = 1 << 1,
ctrl->psd[i].read_tput, ctrl->psd[i].read_lat,
ctrl->psd[i].write_tput, ctrl->psd[i].write_lat);
print_ps_power_and_scale(ctrl->psd[i].idle_power,
- ctrl->psd[i].idle_scale);
+ POWER_SCALE(ctrl->psd[i].idle_scale));
printf(" active_power:");
print_ps_power_and_scale(ctrl->psd[i].active_power,
- ctrl->psd[i].active_work_scale);
+ POWER_SCALE(ctrl->psd[i].active_work_scale));
printf("\n");
}