From 605b21190ce9af77ee3533e12b2e59a7f883ffee Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Tue, 9 Jan 2018 03:09:10 +0000 Subject: FreeBSD port now works with NVMe SNTL and sg3_ses pass-through (NVME-MI); man page cleanups; improve SNTL translation to VPD page 0x83 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@743 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- src/sg_logs.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/sg_logs.c') diff --git a/src/sg_logs.c b/src/sg_logs.c index bf1a5ce2..94c3b504 100644 --- a/src/sg_logs.c +++ b/src/sg_logs.c @@ -5117,6 +5117,7 @@ show_pending_defects_page(const uint8_t * resp, int len, const struct opts_t * op) { int num, pl, pc; + uint32_t count; const uint8_t * bp; char str[PCB_STR_LEN]; @@ -5140,7 +5141,7 @@ show_pending_defects_page(const uint8_t * resp, int len, } switch (pc) { case 0x0: - printf(" Pending defect count:"); + printf(" Pending defect count: "); if ((pl < 8) || (num < 8)) { if (num < 8) pr2serr("\n truncated by response length, expected " @@ -5150,10 +5151,17 @@ show_pending_defects_page(const uint8_t * resp, int len, pl); break; } - printf(" %u\n", sg_get_unaligned_be32(bp + 4)); + count = sg_get_unaligned_be32(bp + 4); + if (0 == count) { + printf("0\n"); + break; + } + printf("%3u | LBA Accumulated power_on\n", count); + printf("-----------------------------|---------------"); + printf("-----------hours---------\n"); break; default: - printf(" Pending defect: %d\n", pc); + printf(" Pending defect %4d: ", pc); if ((pl < 16) || (num < 16)) { if (num < 16) pr2serr("\n truncated by response length, expected " @@ -5163,7 +5171,7 @@ show_pending_defects_page(const uint8_t * resp, int len, pl); break; } - printf(" LBA: 0x%" PRIx64 " accumulated_power_on_hours: %u\n", + printf(" 0x%-16" PRIx64 " %5u\n", sg_get_unaligned_be64(bp + 8), sg_get_unaligned_be32(bp + 4)); break; -- cgit v1.2.3