aboutsummaryrefslogtreecommitdiff
path: root/lib/sg_cmds_basic.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2014-02-23 03:59:50 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2014-02-23 03:59:50 +0000
commit0426b1b996cb256f7e799c139574927ba5142c5b (patch)
tree97ecd9793657c50ba21319916205933f1ff88305 /lib/sg_cmds_basic.c
parent64583176e57abbf45609d7432375771fbc769131 (diff)
downloadsg3_utils-0426b1b996cb256f7e799c139574927ba5142c5b.tar.gz
sg_inq: improve unit serial number display (VPD page 0x80)
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@556 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'lib/sg_cmds_basic.c')
-rw-r--r--lib/sg_cmds_basic.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/sg_cmds_basic.c b/lib/sg_cmds_basic.c
index 417448b5..736f18fe 100644
--- a/lib/sg_cmds_basic.c
+++ b/lib/sg_cmds_basic.c
@@ -27,7 +27,7 @@
#endif
-static const char * version_str = "1.65 20140217";
+static const char * version_str = "1.66 20140222";
#define SENSE_BUFF_LEN 64 /* Arbitrary, could be larger */
@@ -122,13 +122,15 @@ sg_cmds_process_helper(const char * leadin, int mx_di_len, int resid,
return -2;
}
-/* This is a helper function used by sg_cmds_* implementations after
- * the call to the pass-through. pt_res is returned from do_scsi_pt().
- * If valid sense data is found it is decoded and output to sg_warnings_strm
- * (def: stderr); depending on the 'noisy' and 'verbose' settings.
- * Returns -2 for sense data (may not be fatal), -1 for failed, or the
- * number of data in bytes received. For data out (to device) or no data,
- * set 'mx_di_len' to 0 or less. If -2 returned then sense category
+/* This is a helper function used by sg_cmds_* implementations after the
+ * call to the pass-through. pt_res is returned from do_scsi_pt(). If valid
+ * sense data is found it is decoded and output to sg_warnings_strm (def:
+ * stderr); depending on the 'noisy' and 'verbose' settings. Returns -2 for
+ * sense data (may not be fatal), -1 for failed, 0, or a positive number. If
+ * 'mx_di_len > 0' then asks pass-through for resid and returns
+ * (mx_di_len - resid); otherwise returns 0. So for data-in it should return
+ * the actual number of bytes received. For data-out (to device) or no data
+ * call with 'mx_di_len' set to 0 or less. If -2 returned then sense category
* output via 'o_sense_cat' pointer (if not NULL). Note that several sense
* categories also have data in bytes received; -2 is still returned. */
int