1SG_READ_BUFFER(8)                  SG3_UTILS                 SG_READ_BUFFER(8)
2
3
4

NAME

6       sg_read_buffer - send SCSI READ BUFFER command
7

SYNOPSIS

9       sg_read_buffer  [--help]  [--hex] [--id=ID] [--inhex=FN] [--length=LEN]
10       [--mode=MO] [--offset=OFF] [--raw] [--readonly] [--specific=MS] [--ver‐
11       bose] [--version] DEVICE
12

DESCRIPTION

14       Sends  a  SCSI  READ  BUFFER  command  to the DEVICE, and if there is a
15       response either decodes it, prints it in hexadecimal  or  sends  it  in
16       binary  to  stdout.  If  a response is received for a "descriptor" mode
17       then, in the absence of --hex and --raw, it is  decoded.  Response  for
18       non-descriptor  modes are output in hexadecimal unless the --raw option
19       is given.
20
21       This utility may be called without  a  DEVICE  but  with  a  --inhex=FN
22       option  instead.  FN  is expected to be a file name (or '-' for stdin).
23       The contents of the file (or stdin stream) is assumed to be hexadecimal
24       (or  binary)  data  that represents a SCSI READ BUFFER command response
25       and is decoded as such.
26

OPTIONS

28       Arguments to long options are mandatory for short options as well.
29
30       -h, --help
31              output the usage message then exit. If used multiple times  also
32              prints the mode names and their acronyms.
33
34       -H, --hex
35              output  the  response  in  hexadecimal.  When  given  twice  the
36              response is output in hex with the corresponding  representation
37              in ASCII to the right of each line.
38
39       -i, --id=ID
40              this  option  sets the buffer id field in the cdb. ID is a value
41              between 0 (default) and 255 inclusive.
42
43       -I, --inhex=FN
44              FN is expected to be a file name (or '-' for stdin)  which  con‐
45              tains  ASCII  hexadecimal  or  binary representing a READ BUFFER
46              response. If known this utility will then decode that  response.
47              It  is preferable to also supply the --mode=MO and --specific=MS
48              options, since these are not present in the response. The  hexa‐
49              decimal  should be arranged as 1 or 2 digits representing a byte
50              each of which is whitespace or comma separated.   Anything  from
51              and  including a hash mark to the end of line is ignored. If the
52              --raw option is also given then FN is treated as binary.
53
54       -l, --length=LEN
55              where LEN is the length, in bytes, that is placed in the  "allo‐
56              cation length" field in the cdb. The default value is 4 (bytes).
57              The device may respond with less bytes.
58
59       -m, --mode=MO
60              this option sets the mode field  in  the  cdb.  MO  is  a  value
61              between 0 (default) and 31 inclusive. Alternatively an abbrevia‐
62              tion can be given.  See the MODES section  below.  To  list  the
63              available   mode   abbreviations   use   an  invalid  one  (e.g.
64              '--mode=xxx'). As an example, to fetch the read buffer  descrip‐
65              tor give '--mode=desc' .
66
67       -o, --offset=OFF
68              this  option  sets  the buffer offset field in the cdb. OFF is a
69              value between 0 (default) and 2**24-1 . It is a byte offset.
70
71       -r, --raw
72              if a response is received then it is sent in binary to stdout.
73
74       -R, --readonly
75              open the DEVICE read-only (e.g. in Unix with the O_RDONLY flag).
76              The default is to open it read-write.
77
78       -S, --specific=MS
79              this  option  sets  the  mode specific field in the cdb. MS is a
80              value between 0 and 7 as this is a 3 bit field.
81
82       -v, --verbose
83              increase the level of verbosity, (i.e. debug output).
84
85       -V, --version
86              print the version string and then exit.
87

MODES

89       Following is a list of READ BUFFER command settings for the MODE field.
90       First  is an acronym accepted by the MO argument of this utility.  Fol‐
91       lowing the acronym in square brackets are the corresponding decimal and
92       hex  values  that may also be given for MO. The following are listed in
93       numerical order.
94
95       hd  [0, 0x0]
96              Combined header and data (obsolete in SPC-4).
97
98       vendor  [1, 0x1]
99              Vendor specific.
100
101       data  [2, 0x2]
102              Data.
103
104       desc  [3, 0x3]
105              Descriptor: yields 4 bytes that contain an offset boundary field
106              (1 byte) and buffer capacity (3 bytes).
107
108       echo  [10, 0xa]
109              Read data from echo buffer (was called "Echo buffer" in SPC-3).
110
111       echo_desc  [11, 0xb]
112              Echo  buffer  descriptor: yields 4 bytes of which the last (low‐
113              est) 13 bits represent the echo  buffer  capacity.  The  maximum
114              echo buffer size is 4096 bytes.
115
116       rd_microc_st  [15, 0xf]
117              Read microcode status. Added in spc5r20 .
118
119       en_ex  [26, 0x1a]
120              Enable  expander  communications  protocol and Echo buffer. Made
121              obsolete in SPC-4.
122
123       err_hist  [28, 0x1c]
124              Error history. Introduced in SPC-4.
125

NOTES

127       All numbers given with options are assumed  to  be  decimal.   Alterna‐
128       tively  numerical values can be given in hexadecimal preceded by either
129       "0x" or "0X" (or has a trailing "h" or "H").
130

EXIT STATUS

132       The exit status of sg_read_buffer is 0 when it is successful. Otherwise
133       see the sg3_utils(8) man page.
134

AUTHORS

136       Written by Luben Tuikov and Douglas Gilbert.
137

REPORTING BUGS

139       Report bugs to <dgilbert at interlog dot com>.
140
142       Copyright © 2006-2019 Luben Tuikov and Douglas Gilbert
143       This  software is distributed under a FreeBSD license. There is NO war‐
144       ranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR  PUR‐
145       POSE.
146

SEE ALSO

148       sg_write_buffer(sg3_utils)
149
150
151
152sg3_utils-1.45                     May 2019                  SG_READ_BUFFER(8)
Impressum