From: Andy Lutomirski Date: Fri, 22 Jan 2016 20:51:08 +0000 (-0800) Subject: Improve power state flags and max power decoding X-Git-Tag: v0.4~13^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5cd3e2774df8121e850e06a4bca6e8f17367dcc4;p=users%2Fsagi%2Fnvme-cli.git Improve power state flags and max power decoding Signed-off-by: Andy Lutomirski --- diff --git a/common.c b/common.c index b0f5309a..20318e73 100644 --- a/common.c +++ b/common.c @@ -579,9 +579,17 @@ void show_nvme_id_ctrl(struct nvme_id_ctrl *ctrl, unsigned int mode) show_nvme_id_ctrl_sgls(ctrl->sgls); for (i = 0; i <= ctrl->npss; i++) { - printf("ps %4d : mp:%d flags:%x enlat:%d exlat:%d rrt:%d rrl:%d\n" + printf("ps %4d : mp:", i); + + if (ctrl->psd[i].flags & NVME_PS_FLAGS_MAX_POWER_SCALE) + printf("%01u.%04uW ", ctrl->psd[i].max_power / 10000, ctrl->psd[i].max_power % 10000); + else + printf("%01u.%02uW ", ctrl->psd[i].max_power / 100, ctrl->psd[i].max_power % 100); + + if (ctrl->psd[i].flags & NVME_PS_FLAGS_NON_OP_STATE) + printf("non-"); + printf("operational enlat:%d exlat:%d rrt:%d rrl:%d\n" " rwt:%d rwl:%d idlp:%d ips:%x actp:%x ap flags:%x\n", - i, ctrl->psd[i].max_power, ctrl->psd[i].flags, ctrl->psd[i].entry_lat, ctrl->psd[i].exit_lat, ctrl->psd[i].read_tput, ctrl->psd[i].read_lat, ctrl->psd[i].write_tput, ctrl->psd[i].write_lat,