Skip to content

Commit

Permalink
g_logs: correct tape Device statisitics lpage [0x14] serial number pa…
Browse files Browse the repository at this point in the history
…rameters [0x40 and 0x41] per #45

git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@1058 6180dd3e-e324-4e3e-922d-17de1ae2f315
  • Loading branch information
doug-gilbert committed Oct 26, 2023
1 parent 0e955c4 commit a4427b5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
5 changes: 4 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.

Changelog for pre-release sg3_utils-1.49 [20231020] [svn: r1057]
Changelog for pre-release sg3_utils-1.49 [20231026] [svn: r1058]
- JSON: make output more consistent so most command
responses have a *_paramter_data or similar sub-object
- apply https://github.com/doug-gilbert/sg3_utils/pull/39
Expand All @@ -16,6 +16,9 @@ Changelog for pre-release sg3_utils-1.49 [20231020] [svn: r1057]
- add RSCS field to Block limits ext. vpage [sbc5r5]
- sg_turs: fix missing CDB on several codepaths
- sg_requests: improve buffer truncation
- sg_logs: correct tape Device statisitics lpage [0x14]
serial number parameters [0x40 and 0x41] per
https://github.com/doug-gilbert/sg3_utils/issues/45
- sg_get_elem_status: various improvements
- sg_stream_ctl: add --hex, --inhex=, --json= and --raw
options; additions in sbc5r05
Expand Down
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sg3-utils (1.49-0.1) unstable; urgency=low

* New upstream version

-- Douglas Gilbert <[email protected]> Fri, 20 Oct 2023 13:00:00 -0400
-- Douglas Gilbert <[email protected]> Thu, 26 Oct 2023 19:00:00 -0400

sg3-utils (1.48-0.1) unstable; urgency=low

Expand Down
2 changes: 1 addition & 1 deletion sg3_utils.spec
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fi
%{_libdir}/*.a

%changelog
* Fri Oct 20 2023 - dgilbert at interlog dot com
* Thu Oct 26 2023 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.49

Expand Down
17 changes: 15 additions & 2 deletions src/sg_logs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#include "sg_logs.h"

static const char * version_str = "2.36 20231015"; /* spc6r10 + sbc5r05 */
static const char * version_str = "2.37 20231026"; /* spc6r10 + sbc5r05 */

#define MY_NAME "sg_logs"

Expand Down Expand Up @@ -7888,7 +7888,7 @@ show_sequential_access_page(const uint8_t * resp, int len,
return true;
}

/* Device statistics 0x14 <ds> for tape and ADC */
/* DEVICE_STATS_LPAGE [0x14] Device statistics lpage for tape and ADC */
static bool
show_device_stats_page(const uint8_t * resp, int len,
struct opts_t * op, sgj_opaque_p jop)
Expand All @@ -7908,6 +7908,7 @@ show_device_stats_page(const uint8_t * resp, int len,
char b[196];
static const int blen = sizeof(b);
static const char * const ds_lp = "Device statistics log page";
static const char * const sn_sn = "serial_number";

if (op->verbose || ((0 == op->do_raw) &&
((0 == op->do_hex) || (op->do_hex > 3)))) {
Expand Down Expand Up @@ -8036,10 +8037,22 @@ show_device_stats_page(const uint8_t * resp, int len,
"sample time";
break;
case 0x40:
vl_num = false;
ccp = "Drive manufacturer's serial number";
sgj_pr_hr(jsp, " %s: %.*s\n", ccp, pl - 4, bp + 4);
if (jsp->pr_as_json) {
sgj_js_nv_ihexstr(jsp, jo3p, param_c_sn, pc, NULL, ccp);
sgj_js_nv_s_len_chk(jsp, jo3p, sn_sn, bp + 4, pl - 4);
}
break;
case 0x41:
vl_num = false;
ccp = "Drive serial number";
sgj_pr_hr(jsp, " %s: %.*s\n", ccp, pl - 4, bp + 4);
if (jsp->pr_as_json) {
sgj_js_nv_ihexstr(jsp, jo3p, param_c_sn, pc, NULL, ccp);
sgj_js_nv_s_len_chk(jsp, jo3p, sn_sn, bp + 4, pl - 4);
}
break;
case 0x42: /* added ssc5r02b */
vl_num = false;
Expand Down

0 comments on commit a4427b5

Please sign in to comment.