diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2022-09-05 05:23:31 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2022-09-05 05:23:31 +0000 |
commit | eda37108f2a83c7944b1c0f63162647eddc9960d (patch) | |
tree | fd5990953d5dd017796554ff5d0c7efd407e64fa /src/sg_vpd_common.c | |
parent | 7e7308a2dbdec4c900b0805ad94324d3a288a163 (diff) | |
download | sg3_utils-eda37108f2a83c7944b1c0f63162647eddc9960d.tar.gz |
sg_inq+sg_vpd: ongoing updates; rescan_scsi_bus.sh
https://github.com/doug-gilbert/sg3_utils/pull/21
change to rescan_scsi_bus.sh was applied in an
earlier commit but not noted.
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@970 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_vpd_common.c')
-rw-r--r-- | src/sg_vpd_common.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/sg_vpd_common.c b/src/sg_vpd_common.c index 14b1bd2d..dcc7727b 100644 --- a/src/sg_vpd_common.c +++ b/src/sg_vpd_common.c @@ -1712,7 +1712,7 @@ decode_block_lb_prov_vpd(const uint8_t * buff, int len, struct opts_t * op, if (jsp->pr_as_json && jsp->pr_out_hr) sgj_js_str_out(jsp, b, strlen(b)); else - printf("%s", b); + sgj_pr_hr(jsp, "%s", b); } return 0; } @@ -2237,6 +2237,8 @@ decode_rod_descriptor(const uint8_t * buff, int len, struct opts_t * op, const uint8_t * bp = buff; sgj_state * jsp = &op->json_st; sgj_opaque_p jo2p; + char b[80]; + static const int blen = sizeof(b); static const char * ab_pdt = "abnormal use of 'pdt'"; for (k = 0; k < len; k += bump, bp += bump) { @@ -2285,11 +2287,11 @@ decode_rod_descriptor(const uint8_t * buff, int len, struct opts_t * op, sgj_haj_vi(jsp, jo2p, 4, "Maximum bytes in stream ROD", SGJ_SEP_COLON_1_SPACE, ull, true); ull = sg_get_unaligned_be64(bp + 16); - printf(" Optimal Bytes in stream ROD transfer: "); + snprintf(b, blen, " Optimal Bytes in stream ROD transfer: "); if (SG_LIB_UNBOUNDED_64BIT == ull) - printf("-1 [no limit]\n"); + sgj_pr_hr(jsp, "%s-1 [no limit]\n", b); else - printf("%" PRIu64 "\n", ull); + sgj_pr_hr(jsp, "%s%" PRIu64 "\n", b, ull); break; case 3: /* Copy manager ROD device type specific descriptor */ @@ -2297,14 +2299,14 @@ decode_rod_descriptor(const uint8_t * buff, int len, struct opts_t * op, pdt, false, NULL, "Copy manager ROD " "device type specific descriptor", ab_pdt); - printf(" Maximum Bytes in processor ROD: %" PRIu64 "\n", - sg_get_unaligned_be64(bp + 8)); + sgj_pr_hr(jsp, " Maximum Bytes in processor ROD: %" PRIu64 "\n", + sg_get_unaligned_be64(bp + 8)); ull = sg_get_unaligned_be64(bp + 16); - printf(" Optimal Bytes in processor ROD transfer: "); + snprintf(b, blen, " Optimal Bytes in processor ROD transfer: "); if (SG_LIB_UNBOUNDED_64BIT == ull) - printf("-1 [no limit]\n"); + sgj_pr_hr(jsp, "%s-1 [no limit]\n", b); else - printf("%" PRIu64 "\n", ull); + sgj_pr_hr(jsp, "%s%" PRIu64 "\n", b, ull); break; default: sgj_js_nv_ihexstr(jsp, jo2p, "peripheral_device_type", |