Information Technology Reference
In-Depth Information
7.7 SCSI commands
A command is sent from the initiator to the target. The first byte of all SCSI commands con-
tains an operation code, followed by a command descriptor block and finally the control
byte.
The format of the command descriptor block for 6-byte commands is:
•
Byte 0 - operation code.
•
Byte 1 - logical unit number (MSB, if required).
•
Byte 2 - logical bock address.
•
Byte 3 - logical bock address (LSB, if required).
•
Byte 4 - transfer length (if required) / Parameter list length (if required) / allocation
length (if required).
•
Byte 5 - control.
7.7.1 Operation code
Figure 7.2 shows the operation code of the command descriptor block. It has a group code
field and a command code field. The 3-bit group code field provides for eight groups of com-
mand codes and the 5-bit command code field provides for 32 command codes in each
group.
The group code specifies one of the following groups:
•
Group 0 - 6-byte commands.
•
Group 1/2 - 10-byte commands.
•
Group ¾ - reserved.
•
Group 5 - 12-byte commands.
•
Group 6/7 - vendor-specific.
b
7
b
6
b
5
b
4
b
3
b
2
b
1
b
0
Group code
Command code
Figure 7.2
Operation code
7.7.2 Logical unit number
The logical unit number (LUN) is defined in the identify message. The target ignores the
LUN specified within the command descriptor block if an identify message was received
(normally the logical unit number in the command descriptor block to be set to zero).
7.7.3 Logical block address
The logical block address (LBA) on logical units or within a partition on device volumes
begins with block zero and is contiguous up to the last logical block on that logical unit or
within that partition.
A 10-byte and a 12-byte command descriptor blocks contain 32-bit logical block ad-
dresses, whereas a 6-byte command descriptor block contains a 21-bit logical block address.