blob: 354f367215d8d72d1c802dde751e68b2fd2c4bb2 [file] [log] [blame]
Douglas Gilbert75026472007-06-27 03:51:21 +00001.TH SG_READ_BUFFER "8" "January 2007" "sg3_utils\-1.23" SG3_UTILS
2.SH NAME
3sg_read_buffer \- send a SCSI READ BUFFER command
4.SH SYNOPSIS
5.B sg_read_buffer
6[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-id=ID\fR] [\fI\-\-length=LEN\fR]
7[\fI\-\-mode=MO\fR] [\fI\-\-offset=OFF\fR] [\fI\-\-raw\fR]
8[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
9.SH DESCRIPTION
10.\" Add any additional description here
11.PP
12Sends a SCSI READ BUFFER command to the \fIDEVICE\fR, and if there
13is a response either decodes it, prints it in hexadecimal or sends
14it in binary to stdout. If a response is received for a "descriptor"
15mode then, in the absence of \fI\-\-hex\fR and \fI\-\-raw\fR, it is
Douglas Gilbert0938f9e2007-10-16 15:00:15 +000016decoded. Response for non\-descriptor modes are output in hexadecimal
Douglas Gilbert75026472007-06-27 03:51:21 +000017unless the \fI\-\-raw\fR option is given.
18.SH OPTIONS
19Arguments to long options are mandatory for short options as well.
20.TP
21\fB\-h\fR, \fB\-\-help\fR
22output the usage message then exit. If used multiple times also prints
23the mode names and their acronyms.
24.TP
25\fB\-H\fR, \fB\-\-hex\fR
26output the response in hexadecimal.
27.TP
28\fB\-i\fR, \fB\-\-id\fR=\fIID\fR
29this option sets the buffer id field in the cdb. \fIID\fR is a value between
300 (default) and 255 inclusive.
31.TP
32\fB\-l\fR, \fB\-\-length\fR=\fILEN\fR
33where \fILEN\fR is the length, in bytes, that is placed in the "allocation
34length" field in the cdb. The default value is 4 (bytes). The device may
35respond with less bytes.
36.TP
37\fB\-m\fR, \fB\-\-mode\fR=\fIMO\fR
38this option sets the mode field in the cdb. \fIMO\fR is a value between
390 (default) and 31 inclusive. Alternatively an abbreviation can be given.
40To list the available mode abbreviations given an invalid
41one (e.g. '\-\-mode=xxx').
42.TP
43\fB\-o\fR, \fB\-\-offset\fR=\fIOFF\fR
44this option sets the buffer offset field in the cdb. \fIOFF\fR is a value
45between 0 (default) and 2**24\-1 . It is a byte offset.
46.TP
47\fB\-r\fR, \fB\-\-raw\fR
48if a response is received then it is sent in binary to stdout.
49.TP
50\fB\-v\fR, \fB\-\-verbose\fR
51increase the level of verbosity, (i.e. debug output).
52.TP
53\fB\-V\fR, \fB\-\-version\fR
54print the version string and then exit.
55.SH NOTES
56All numbers given with options are assumed to be decimal.
57Alternatively numerical values can be given in hexadecimal preceded by
58either "0x" or "0X" (or has a trailing "h" or "H").
59.SH EXIT STATUS
60The exit status of sg_read_buffer is 0 when it is successful. Otherwise
61see the sg3_utils(8) man page.
62.SH AUTHORS
63Written by Luben Tuikov and Douglas Gilbert.
64.SH "REPORTING BUGS"
65Report bugs to <dgilbert at interlog dot com>.
66.SH COPYRIGHT
67Copyright \(co 2006\-2007 Luben Tuikov and Douglas Gilbert
68.br
69This software is distributed under a FreeBSD license. There is NO
70warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
71.SH "SEE ALSO"
72.B sg_write_buffer(sg3_utils)