nvme: add the temperature related fields for the health info page

Change-Id: I5231412d122615a92566e81a8712d83577c7327e
Signed-off-by: GangCao <gang.cao@intel.com>
This commit is contained in:
GangCao 2017-04-15 22:03:07 -04:00 committed by Daniel Verkamp
parent 177ab97b6e
commit 4613ed760c
2 changed files with 15 additions and 1 deletions

View File

@ -676,6 +676,7 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport
features[SPDK_NVME_FEAT_TEMPERATURE_THRESHOLD].result,
features[SPDK_NVME_FEAT_TEMPERATURE_THRESHOLD].result - 273);
printf("Available Spare: %u%%\n", health_page.available_spare);
printf("Available Spare Threshold: %u%%\n", health_page.available_spare_threshold);
printf("Life Percentage Used: %u%%\n", health_page.percentage_used);
printf("Data Units Read: ");
print_uint128_dec(health_page.data_units_read);
@ -707,6 +708,15 @@ print_controller(struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_transport
printf("Lifetime Error Log Entries: ");
print_uint128_dec(health_page.num_error_info_log_entries);
printf("\n");
printf("Warning Temperature Time: %u minutes\n", health_page.warning_temp_time);
printf("Critical Temperature Time: %u minutes\n", health_page.critical_temp_time);
for (i = 0; i < 8; i++) {
if (health_page.temp_sensor[i] != 0) {
printf("Temperature Sensor %d: %u Kelvin (%u Celsius)\n",
i + 1, health_page.temp_sensor[i],
health_page.temp_sensor[i] - 273);
}
}
printf("\n");
}

View File

@ -1409,8 +1409,12 @@ struct __attribute__((packed)) spdk_nvme_health_information_page {
uint64_t unsafe_shutdowns[2];
uint64_t media_errors[2];
uint64_t num_error_info_log_entries[2];
/* Controller temperature related. */
uint32_t warning_temp_time;
uint32_t critical_temp_time;
uint16_t temp_sensor[8];
uint8_t reserved2[320];
uint8_t reserved2[296];
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_health_information_page) == 512, "Incorrect size");