mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
nvmecontrol: Move intel temperature page printing to little endian orderinng
Sponsored by: Netflix Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D44658 (cherry picked from commit f0f7e9616da052e3d77b6e41301ccd655ae434fa)
This commit is contained in:
parent
1bc8c6d40d
commit
4e7cc8f545
2 changed files with 11 additions and 18 deletions
|
|
@ -218,16 +218,6 @@ read_logpage(int fd, uint8_t log_page, uint32_t nsid, uint8_t lsp,
|
|||
if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
|
||||
err(EX_IOERR, "get log page request failed");
|
||||
|
||||
/* Convert data to host endian */
|
||||
switch (log_page) {
|
||||
case INTEL_LOG_TEMP_STATS:
|
||||
intel_log_temp_stats_swapbytes(
|
||||
(struct intel_log_temp_stats *)payload);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (nvme_completion_is_error(&pt.cpl))
|
||||
errx(EX_IOERR, "get log page request returned error");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,18 +62,21 @@ print_intel_temp_stats(const struct nvme_controller_data *cdata __unused, void *
|
|||
printf("=====================\n");
|
||||
|
||||
printf("Current: ");
|
||||
print_temp_C(temp->current);
|
||||
printf("Overtemp Last Flags %#jx\n", (uintmax_t)temp->overtemp_flag_last);
|
||||
printf("Overtemp Lifetime Flags %#jx\n", (uintmax_t)temp->overtemp_flag_life);
|
||||
print_temp_C(letoh(temp->current));
|
||||
printf("Overtemp Last Flags %#jx\n",
|
||||
(uintmax_t)letoh(temp->overtemp_flag_last));
|
||||
printf("Overtemp Lifetime Flags %#jx\n",
|
||||
(uintmax_t)letoh(temp->overtemp_flag_life));
|
||||
printf("Max Temperature ");
|
||||
print_temp_C(temp->max_temp);
|
||||
print_temp_C(letoh(temp->max_temp));
|
||||
printf("Min Temperature ");
|
||||
print_temp_C(temp->min_temp);
|
||||
print_temp_C(letoh(temp->min_temp));
|
||||
printf("Max Operating Temperature ");
|
||||
print_temp_C(temp->max_oper_temp);
|
||||
print_temp_C(letoh(temp->max_oper_temp));
|
||||
printf("Min Operating Temperature ");
|
||||
print_temp_C(temp->min_oper_temp);
|
||||
printf("Estimated Temperature Offset: %ju C/K\n", (uintmax_t)temp->est_offset);
|
||||
print_temp_C(letoh(temp->min_oper_temp));
|
||||
printf("Estimated Temperature Offset: %ju C/K\n",
|
||||
(uintmax_t)letoh(temp->est_offset));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue