bits allocated differently for different commands
|
m →References: Update broken link (deleted old revision) to point to a latest revision.
|
||
(10 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{Unreferenced stub|auto=yes|date=December 2009}} |
|||
In [[SCSI]] standards for transferring data between computers and [[peripheral devices]], often [[computer storage]], [[SCSI command|commands]] are sent in a '''Command Descriptor Block''' (CDB). |
In [[SCSI]] standards for transferring data between computers and [[peripheral devices]], often [[computer storage]], [[SCSI command|commands]] are sent in a '''Command Descriptor Block''' (CDB). |
||
Each CDB can be a total of 6, 10, 12, or 16 bytes, but later versions of the SCSI standard also allow for variable-length CDBs. The CDB consists of a one byte operation code followed by some command-specific parameters. The parameters need not be a full byte long, and the parameter length varies from one command to another. The available commands, with links to articles describing the detailed structure of many of them, are listed in the article section [[SCSI command#List of SCSI commands]]. |
Each CDB can be a total of 6, 10, 12, or 16 bytes, but later versions of the SCSI standard also allow for variable-length CDBs. The CDB consists of a one byte operation code followed by some command-specific parameters. The parameters need not be a full byte long, and the parameter length varies from one command to another. The available commands, with links to articles describing the detailed structure of many of them, are listed in the article section [[SCSI command#List of SCSI commands|List of SCSI commands]]. |
||
Typical CDB structures |
Typical CDB structures, for the 6- and 16-byte [[SCSI Request Sense Command]], opcode 3, are: |
||
6-byte CDB: |
6-byte CDB: |
||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
! {{diagonal split header|Byte|Bit}} |
|||
! bit→<br />↓byte |
|||
! width=50 | 7 |
! width=50 | 7 |
||
! width=50 | 6 |
! width=50 | 6 |
||
Line 39: | Line 38: | ||
|} |
|} |
||
|
16-byte CDB: |
||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
! {{diagonal split header|Byte|Bit}} |
|||
! bit→<br />↓byte |
|||
! width=50 | 7 |
! width=50 | 7 |
||
! width=50 | 6 |
! width=50 | 6 |
||
Line 66: | Line 65: | ||
|- |
|- |
||
! 4 |
! 4 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | |
||
|- |
|- |
||
! 5 |
! 5 |
||
| colspan=8 align="center" | Logical Block (LSB) |
| colspan=8 align="center" | Logical Block (LSB) |
||
|- |
|- |
||
! 6 |
! 6 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | Addition CBP information |
||
|- |
|- |
||
! 7 |
! 7 |
||
| colspan=8 align="center" | Addition CBP information |
|||
|- |
|||
! 8 |
|||
| colspan=8 align="center" | Addition CBP information |
|||
|- |
|||
! 9 |
|||
| colspan=8 align="center" | Addition CBP information |
|||
|- |
|||
! 10 |
|||
| colspan=8 align="center" | Allocation length (MSB) |
| colspan=8 align="center" | Allocation length (MSB) |
||
|- |
|- |
||
! |
!11 |
||
| colspan=8 align="center" | |
|||
|- |
|||
! 12 |
|||
| colspan=8 align="center" | |
|||
|- |
|||
! 13 |
|||
| colspan=8 align="center" | Allocation length (LSB) |
| colspan=8 align="center" | Allocation length (LSB) |
||
|- |
|- |
||
! |
!14 |
||
| colspan=8 align="center" | Misc. CDB data |
|||
|- |
|||
! 15 |
|||
| colspan=8 align="center" | Control |
| colspan=8 align="center" | Control |
||
|} |
|} |
||
An example with different allocation of bits to parameters is the 6-byte [[SCSI Mode Sense Command]]:<ref>[[#refScsiMan|SCSI Command Reference]], pp.97-100.</ref> |
|||
12-byte CDB; |
|||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
! {{diagonal split header|Byte|Bit}} |
|||
! bit→<br />↓byte |
|||
! width=50 | 7 |
! width=50 | 7 |
||
! width=50 | 6 |
! width=50 | 6 |
||
Line 98: | Line 116: | ||
|- |
|- |
||
! 0 |
! 0 |
||
| colspan=8 align="center" | Operation code = |
| colspan=8 align="center" | Operation code = 1Ah |
||
|- |
|- |
||
! 1 |
! 1 |
||
| colspan=3 align="center" | LUN |
| colspan=3 align="center" | LUN |
||
| |
| align="center" | Reserved |
||
| align="center" | DBD |
|||
| colspan=3 align="center" | Reserved |
|||
|- |
|- |
||
! 2 |
! 2 |
||
| colspan= |
| colspan=2 align="center" | PC |
||
| colspan=6 align="center" | Page code |
|||
|- |
|- |
||
! 3 |
! 3 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | Reserved |
||
|- |
|- |
||
! 4 |
! 4 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | Allocation length |
||
|- |
|- |
||
! 5 |
! 5 |
||
| colspan=8 align="center" | Logical Block (LSB) |
|||
|- |
|||
! 6 |
|||
| colspan=8 align="center" | Allocation length (MSB) |
|||
|- |
|||
! 7 |
|||
| colspan=8 align="center" | |
|||
|- |
|||
! 8 |
|||
| colspan=8 align="center" | |
|||
|- |
|||
! 9 |
|||
| colspan=8 align="center" | Allocation length (LSB) |
|||
|- |
|||
! 10 |
|||
| colspan=8 align="center" | Misc. CDB data |
|||
|- |
|||
! 11 |
|||
| colspan=8 align="center" | Control |
| colspan=8 align="center" | Control |
||
|} |
|} |
||
|
The generic form of the 12-byte CDBis: |
||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
! {{diagonal split header|Byte|Bit}} |
|||
! bit→<br />↓byte |
|||
! width=50 | 7 |
! width=50 | 7 |
||
! width=50 | 6 |
! width=50 | 6 |
||
Line 149: | Line 152: | ||
|- |
|- |
||
! 0 |
! 0 |
||
| colspan=8 align="center" | Operation code |
| colspan=8 align="center" | Operation code |
||
|- |
|- |
||
! 1 |
! 1 |
||
| colspan=3 align="center" | |
| colspan=3 align="center" | miscellaneous CDB information |
||
| colspan=5 align="center" | |
| colspan=5 align="center" | SERVICE ACTION (if required) |
||
|- |
|- |
||
! 2 |
! 2 |
||
Line 165: | Line 168: | ||
|- |
|- |
||
! 5 |
! 5 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | |
||
|- |
|- |
||
! 6 |
! 6 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | TRANSFER LENGTH (if required) |
||
|- |
|- |
||
! 7 |
! 7 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | PARAMETER LIST LENGTH (if required) |
||
|- |
|- |
||
! 8 |
! 8 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | ALLOCATION LENGTH (if required) |
||
|- |
|- |
||
! 9 |
! 9 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | |
||
|- |
|- |
||
! 10 |
! 10 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | miscellaneous CDB information |
||
|- |
|- |
||
! 11 |
! 11 |
||
| colspan=8 align="center" | |
| colspan=8 align="center" | CONTROL |
||
|- |
|||
! 12 |
|||
| colspan=8 align="center" | |
|||
|- |
|||
! 13 |
|||
| colspan=8 align="center" | Allocation length (LSB) |
|||
|- |
|||
! 14 |
|||
| colspan=8 align="center" | Misc. CDB data |
|||
|- |
|||
! 15 |
|||
| colspan=8 align="center" | Control |
|||
|} |
|} |
||
See SPC-4 (http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc4r34.pdf, free registration required) for more information. |
|||
An example with different allocation of bits to parameters is the 6-byte [[SCSI Mode Sense Command]]:<ref>[[#refScsiMan|SCSI Command Reference]], pp.97-100.</ref> |
|||
== Notes == |
|||
{| class="wikitable" |
|||
{{reflist|3}} |
|||
|- |
|||
! bit→<br>↓byte |
|||
! width=50 | 7 |
|||
! width=50 | 6 |
|||
! width=50 | 5 |
|||
! width=50 | 4 |
|||
! width=50 | 3 |
|||
! width=50 | 2 |
|||
! width=50 | 1 |
|||
! width=50 | 0 |
|||
|- |
|||
! 0 |
|||
| colspan=8 align="center" | Operation code = 1Ah |
|||
|- |
|||
! 1 |
|||
| colspan=3 align="center" | LUN |
|||
| align="center" | Reserved |
|||
| align="center" | DBD |
|||
| colspan=3 align="center" | Reserved |
|||
|- |
|||
! 2 |
|||
| colspan=2 align="center" | PC |
|||
| colspan=6 align="center" | Page code |
|||
|- |
|||
! 3 |
|||
| colspan=8 align="center" | Reserved |
|||
|- |
|||
! 4 |
|||
| colspan=8 align="center" | Allocation length |
|||
|- |
|||
! 5 |
|||
| colspan=8 align="center" | Control |
|||
|} |
|||
See SPC-4 (http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc4r34.pdf, free registration required) for more information. |
|||
==See also== |
==See also== |
||
Line 241: | Line 198: | ||
==References== |
==References== |
||
{{refbegin}} |
|||
<references/> |
|||
* {{wikicite |ref=refScsiMan|reference=''[https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf SCSI Command Reference Manual]'', Seagate Corp, October 2016.}} |
|||
{{refend}} |
|||
{{DEFAULTSORT:Scsi Cdb}} |
{{DEFAULTSORT:Scsi Cdb}} |
InSCSI standards for transferring data between computers and peripheral devices, often computer storage, commands are sent in a Command Descriptor Block (CDB).
Each CDB can be a total of 6, 10, 12, or 16 bytes, but later versions of the SCSI standard also allow for variable-length CDBs. The CDB consists of a one byte operation code followed by some command-specific parameters. The parameters need not be a full byte long, and the parameter length varies from one command to another. The available commands, with links to articles describing the detailed structure of many of them, are listed in the article section List of SCSI commands.
Typical CDB structures, for the 6- and 16-byte SCSI Request Sense Command, opcode 3, are:
6-byte CDB:
Bit Byte |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
0 | Operation code = 03h | |||||||
1 | LUN | Reserved | ||||||
2 | Reserved | |||||||
3 | Reserved | |||||||
4 | Allocation length | |||||||
5 | Control |
16-byte CDB:
Bit Byte |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
0 | Operation code = 03h | |||||||
1 | LUN | Service Action | ||||||
2 | Logical Block (MSB) | |||||||
3 | ||||||||
4 | ||||||||
5 | Logical Block (LSB) | |||||||
6 | Addition CBP information | |||||||
7 | Addition CBP information | |||||||
8 | Addition CBP information | |||||||
9 | Addition CBP information | |||||||
10 | Allocation length (MSB) | |||||||
11 | ||||||||
12 | ||||||||
13 | Allocation length (LSB) | |||||||
14 | Misc. CDB data | |||||||
15 | Control |
An example with different allocation of bits to parameters is the 6-byte SCSI Mode Sense Command:[1]
Bit Byte |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
0 | Operation code = 1Ah | |||||||
1 | LUN | Reserved | DBD | Reserved | ||||
2 | PC | Page code | ||||||
3 | Reserved | |||||||
4 | Allocation length | |||||||
5 | Control |
The generic form of the 12-byte CDB is:
Bit Byte |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
0 | Operation code | |||||||
1 | miscellaneous CDB information | SERVICE ACTION (if required) | ||||||
2 | Logical Block (MSB) | |||||||
3 | ||||||||
4 | ||||||||
5 | ||||||||
6 | TRANSFER LENGTH (if required) | |||||||
7 | PARAMETER LIST LENGTH (if required) | |||||||
8 | ALLOCATION LENGTH (if required) | |||||||
9 | ||||||||
10 | miscellaneous CDB information | |||||||
11 | CONTROL |
See SPC-4 (http://www.t10.org/cgi-bin/ac.pl?t=f&f=spc4r34.pdf, free registration required) for more information.
This computer hardware article is a stub. You can help Wikipedia by expanding it. |