]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli: Implement printing the get host controlled thermal management feature.
authorRevanth Rajashekar <revanth.rajashekar@intel.com>
Wed, 13 Jun 2018 20:15:31 +0000 (14:15 -0600)
committerKeith Busch <keith.busch@intel.com>
Thu, 14 Jun 2018 22:31:45 +0000 (16:31 -0600)
Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
linux/nvme.h
nvme-print.c

index 01b4e6df783481ad275d5cfa4e647113135e2166..62e18fc74ecf6c2bb48a87440cfa2d87ae8c02bc 100644 (file)
@@ -857,6 +857,7 @@ enum {
        NVME_FEAT_HOST_MEM_BUF  = 0x0d,
        NVME_FEAT_TIMESTAMP     = 0x0e,
        NVME_FEAT_KATO          = 0x0f,
+       NVME_FEAT_HCTM          = 0X10,
        NVME_FEAT_RRL           = 0x12,
        NVME_FEAT_PLM_CONFIG    = 0x13,
        NVME_FEAT_PLM_WINDOW    = 0x14,
index 242eb4e4b50044ab705df278abeaf93596502b09..eee716e0ce5224194381caf7ce05a4c61dfc1ac0 100644 (file)
@@ -1451,6 +1451,7 @@ char *nvme_feature_to_string(int feature)
        case NVME_FEAT_RESV_MASK:       return "Reservation Notification Mask";
        case NVME_FEAT_RESV_PERSIST:    return "Reservation Persistence";
        case NVME_FEAT_TIMESTAMP:       return "Timestamp";
+       case NVME_FEAT_HCTM:            return "Host Controlled Thermal Management";
        default:                        return "Unknown";
        }
 }
@@ -1822,6 +1823,10 @@ void nvme_feature_show_fields(__u32 fid, unsigned int result, unsigned char *buf
        case NVME_FEAT_TIMESTAMP:
                show_timestamp((struct nvme_timestamp *)buf);
                break;
+       case NVME_FEAT_HCTM:
+               printf("\tThermal Management Temperature 1 (TMT1) : %u Kelvin\n", (result >> 16));
+               printf("\tThermal Management Temperature 2 (TMT2) : %u Kelvin\n", (result & 0x0000ffff));
+               break;
        }
 }