aboutsummaryrefslogtreecommitdiff
path: root/src/sg_logs.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2019-08-29 00:15:08 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2019-08-29 00:15:08 +0000
commitb8a9d0f9070ee4a0f10c7d2e779655bffbfe1624 (patch)
tree45c9d8fe86fc79abccfe6d40f221da341d144f6f /src/sg_logs.c
parentabf4073cf5d973125dd384bc42f7338ec7e49c48 (diff)
downloadsg3_utils-b8a9d0f9070ee4a0f10c7d2e779655bffbfe1624.tar.gz
add sg_get_elem_status utility; inhex folder; some NVMe 1.4; some zbc realms
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@830 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_logs.c')
-rw-r--r--src/sg_logs.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/sg_logs.c b/src/sg_logs.c
index c60b50a1..e11e8523 100644
--- a/src/sg_logs.c
+++ b/src/sg_logs.c
@@ -36,7 +36,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "1.75 20190516"; /* spc5r22 + sbc4r17 */
+static const char * version_str = "1.77 20190822"; /* spc5r22 + sbc4r17 */
#define MX_ALLOC_LEN (0xfffc)
#define SHORT_RESP_LEN 128
@@ -124,6 +124,7 @@ static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
{"hex", no_argument, 0, 'H'},
{"in", required_argument, 0, 'i'},
+ {"inhex", required_argument, 0, 'i'},
{"list", no_argument, 0, 'l'},
{"maxlen", required_argument, 0, 'm'},
{"name", no_argument, 0, 'n'},
@@ -4921,7 +4922,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x1:
printf(" Maximum explicitly open zones:");
@@ -4934,7 +4935,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x2:
printf(" Maximum implicitly open zones:");
@@ -4947,7 +4948,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x3:
printf(" Minimum empty zones:");
@@ -4960,10 +4961,10 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x4:
- printf(" Maximum number of non-sequential zones:");
+ printf(" Maximum non-sequential zones:");
if ((pl < 8) || (num < 8)) {
if (num < 8)
pr2serr("\n truncated by response length, expected "
@@ -4973,7 +4974,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x5:
printf(" Zones emptied:");
@@ -4986,7 +4987,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x6:
printf(" Suboptimal write commands:");
@@ -4999,7 +5000,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x7:
printf(" Commands exceeding optimal limit:");
@@ -5012,7 +5013,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x8:
printf(" Failed explicit opens:");
@@ -5025,7 +5026,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0x9:
printf(" Read rule violations:");
@@ -5038,7 +5039,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
case 0xa:
printf(" Write rule violations:");
@@ -5051,7 +5052,7 @@ show_zoned_block_dev_stats(const uint8_t * resp, int len,
pl);
break;
}
- printf(" %" PRIu64 "\n", sg_get_unaligned_be64(bp + 4));
+ printf(" %" PRIu32 "\n", sg_get_unaligned_be32(bp + 8));
break;
default:
printf(" Reserved [parameter_code=0x%x]:\n", pc);