1- .TH SG_DECODE_SENSE "8" "August 2014 " "sg3_utils\- 1.40 " SG3_UTILS
1+ .TH SG_DECODE_SENSE "8" "April 2016 " "sg3_utils\- 1.43 " SG3_UTILS
22.SH NAME
33sg_decode_sense \- decode SCSI sense data
44.SH SYNOPSIS
55.B sg_decode_sense
6- [\fI \-\- binary=FN \fR ] [\fI \-\- file=FN \fR ] [\fI \-\- help \fR ]
6+ [\fI \-\- binary=FN \fR ] [\fI \-\- cdb \fR ] [ \fI \-\- file=FN \fR ] [\fI \-\- help \fR ]
77[\fI \-\- hex \fR ] [\fI \-\- nospace \fR ] [\fI \-\- status=SS \fR ]
88[\fI \-\- verbose \fR ] [\fI \-\- version \fR ] [\fI \-\- write=WFN \fR ]
99[H1 H2 H3 ...]
1010.SH DESCRIPTION
1111.\" Add any additional description here
1212This utility takes SCSI sense data in binary or as a sequence of
1313ASCII hexadecimal bytes and decodes it. The primary reference for the
14- decoding is SPC\- 3 ANSI INCITS 408-2005 and the most recent draft
15- SPC\- 4 revision 37 which can be found at http://www.t10.org and other
14+ decoding is SPC\- 4 ANSI INCITS 513-2015 and the most recent draft
15+ SPC\- 5 revision 8 which can be found at http://www.t10.org and other
1616locations on the internet.
1717.PP
1818SCSI sense data is often found in kernel log files as a result of
@@ -22,20 +22,29 @@ Sense data could be up to 252 bytes long but typically is much shorter
2222than that, 18 bytes long is often seen and is usually associated with
2323the older "fixed" format sense data.
2424.PP
25- The sense data can be provided on the command line or in a file. If
26- given on the command line the sense data should be a sequence of
27- hexadecimal bytes separated by space. Alternatively a file can be
28- given with the contents in binary or ASCII hexadecimal bytes. The
29- latter form can contain several lines each with none, one or more
30- ASCII hexadecimal bytes separated by space (comma or tab). The
31- hash symbol may appear and it and the rest of the line is ignored
32- making it useful for comments.
25+ The sense data can be provided on the command line or in a file. If given
26+ on the command line the sense data should be a sequence of hexadecimal bytes
27+ separated by space. Alternatively a file can be given with the contents in
28+ binary or ASCII hexadecimal bytes. The latter form can contain several lines
29+ each with none, one or more ASCII hexadecimal bytes separated by
30+ space (comma or tab). The hash symbol may appear and it and the rest of the
31+ line is ignored making it useful for comments.
32+ .PP
33+ If the \fI \-\- cdb \fR option is given then rather than viewing the given hex
34+ arguments as sense data, it is viewed as a SCSI command descriptor
35+ block (CDB). In this case the command name is printed out. That name is
36+ based on the first hex byte given (know as the opcode) and optionally on
37+ another field called the "service action".
3338.SH OPTIONS
3439Arguments to long options are mandatory for short options as well.
3540.TP
3641\fB \- b \fR , \fB \-\- binary \fR =\fI FN \fR
3742the sense data is read in binary from a file called \fI FN \fR .
3843.TP
44+ \fB \- c \fR , \fB \-\- cdb \fR
45+ treat the given string of hex arguments as bytes in a SCSI CDB and
46+ decode the command name.
47+ .TP
3948\fB \- h \fR , \fB \-\- help \fR
4049output the usage message then exit.
4150.TP
@@ -123,7 +132,7 @@ Written by Douglas Gilbert.
123132.SH "REPORTING BUGS"
124133Report bugs to <dgilbert at interlog dot com>.
125134.SH COPYRIGHT
126- Copyright \(co 2010\- 2014 Douglas Gilbert
135+ Copyright \(co 2010\- 2016 Douglas Gilbert
127136.br
128137This software is distributed under a FreeBSD license. There is NO
129138warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0 commit comments