1SG_READ_BUFFER(8) SG3_UTILS SG_READ_BUFFER(8)
2
3
4
6 sg_read_buffer - send SCSI READ BUFFER command
7
9 sg_read_buffer [--help] [--hex] [--id=ID] [--length=LEN] [--mode=MO]
10 [--offset=OFF] [--raw] [--readonly] [--verbose] [--version] DEVICE
11
13 Sends a SCSI READ BUFFER command to the DEVICE, and if there is a
14 response either decodes it, prints it in hexadecimal or sends it in
15 binary to stdout. If a response is received for a "descriptor" mode
16 then, in the absence of --hex and --raw, it is decoded. Response for
17 non-descriptor modes are output in hexadecimal unless the --raw option
18 is given.
19
21 Arguments to long options are mandatory for short options as well.
22
23 -h, --help
24 output the usage message then exit. If used multiple times also
25 prints the mode names and their acronyms.
26
27 -H, --hex
28 output the response in hexadecimal. When given twice the
29 response is output in hex with the corresponding representation
30 in ASCII to the right of each line.
31
32 -i, --id=ID
33 this option sets the buffer id field in the cdb. ID is a value
34 between 0 (default) and 255 inclusive.
35
36 -l, --length=LEN
37 where LEN is the length, in bytes, that is placed in the "allo‐
38 cation length" field in the cdb. The default value is 4 (bytes).
39 The device may respond with less bytes.
40
41 -m, --mode=MO
42 this option sets the mode field in the cdb. MO is a value
43 between 0 (default) and 31 inclusive. Alternatively an abbrevia‐
44 tion can be given. See the MODES section below. To list the
45 available mode abbreviations use an invalid one (e.g.
46 '--mode=xxx'). As an example, to fetch the read buffer descrip‐
47 tor give '--mode=desc' .
48
49 -o, --offset=OFF
50 this option sets the buffer offset field in the cdb. OFF is a
51 value between 0 (default) and 2**24-1 . It is a byte offset.
52
53 -r, --raw
54 if a response is received then it is sent in binary to stdout.
55
56 -R, --readonly
57 open the DEVICE read-only (e.g. in Unix with the O_RDONLY flag).
58 The default is to open it read-write.
59
60 -v, --verbose
61 increase the level of verbosity, (i.e. debug output).
62
63 -V, --version
64 print the version string and then exit.
65
67 Following is a list of READ BUFFER command settings for the MODE field.
68 First is an acronym accepted by the MO argument of this utility. Fol‐
69 lowing the acronym in square brackets are the corresponding decimal and
70 hex values that may also be given for MO. The following are listed in
71 numerical order.
72
73 hd [0, 0x0]
74 Combined header and data (obsolete in SPC-4).
75
76 vendor [1, 0x1]
77 Vendor specific.
78
79 data [2, 0x2]
80 Data.
81
82 desc [3, 0x3]
83 Descriptor: yields 4 bytes that contain an offset boundary field
84 (1 byte) and buffer capacity (3 bytes).
85
86 echo [10, 0xa]
87 Read data from echo buffer (was called "Echo buffer" in SPC-3).
88
89 echo_desc [11, 0xb]
90 Echo buffer descriptor: yields 4 bytes of which the last (low‐
91 est) 13 bits represent the echo buffer capacity. The maximum
92 echo buffer size is 4096 bytes.
93
94 en_ex [26, 0x1a]
95 Enable expander communications protocol and Echo buffer. Made
96 obsolete in SPC-4.
97
98 err_hist [28, 0x1c]
99 Error history. Introduced in SPC-4.
100
102 All numbers given with options are assumed to be decimal. Alterna‐
103 tively numerical values can be given in hexadecimal preceded by either
104 "0x" or "0X" (or has a trailing "h" or "H").
105
107 The exit status of sg_read_buffer is 0 when it is successful. Otherwise
108 see the sg3_utils(8) man page.
109
111 Written by Luben Tuikov and Douglas Gilbert.
112
114 Report bugs to <dgilbert at interlog dot com>.
115
117 Copyright © 2006-2014 Luben Tuikov and Douglas Gilbert
118 This software is distributed under a FreeBSD license. There is NO war‐
119 ranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
120 POSE.
121
123 sg_write_buffer(sg3_utils)
124
125
126
127sg3_utils-1.39 May 2014 SG_READ_BUFFER(8)