SCSI Request Sense Command
Encyclopedia
The SCSI Request Sense command is used to obtain sense data (error information) from a target device.

The CDB
SCSI CDB
In SCSI computer storage, commands are sent in a Command Descriptor Block .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.A...

 structure is:
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


The response is a set of SCSI sense data which is structured as follows:
bit→
↓byte
7 6 5 4 3 2 1 0
0 Valid Response Code
1 Segment number (obsolete)
2 Filemark EOM ILI Reserved Sense key
3–6 Information
7 Additional sense length (n-7)
8–11 Command-specific information
12 Additional sense code
13 Additional sense code qualifier
14 Field replaceable unit code
15 SKSV Sense-key specific
16 Sense-key specific
17 Sense-key specific
18 Additional sense bytes (variable number of bytes)


The special control fields in the sense data have the following meaning:
  • Valid -
    • 0 - sense data are not SCSI compliant
    • 1 - sense data are SCSI compliant
  • Response Code -
    • 70h - current errors, Fixed Format
    • 71h - deferred errors, Fixed Format
    • 72h - Current error, Descriptor Format
    • 73h - Deferred error, Descriptor Format
  • Segment number - valid only if the current command is COPY, COMPARE, or COPY AND VERIFY
  • Filemark - 1 = the current command has reached a filemark or setmark (sequential-access devices only)
  • EOM - 1 = end-of-medium (sequential-access devices) OR out-of-paper (printers)
  • ILI - incorrect length indicator - 1 = requested logical block length did not match the logical block length of the data on the medium
  • The Sense Key, Additional Sense Code, and Additional Sense Code Qualifier fields are usually considered in aggregate to be a 20 bit field called the KCQ. A composite value of 00000h indicates no error, all other values describe specific error conditions. See the main KCQ article for a complete list.
  • SKSV - Sense Key Specific Valid -
    • 0 - sense key specific data are not SCSI compliant
    • 1 - sense key specific data are SCSI compliant
  • Additional sense bytes - can contain vendor-specific data
    • Bytes 20-21 can be used for a Unit Error Code (UEC)



Sense Key Name Description
0h No Sense Indicates there is no specific Sense Key information to be reported for the disc drive. This would be the case for a successful command or when the ILI bit is one.
1h Recovered Error Indicates the last command completed successfully with some recovery action performed by the disc drive. When multiple recovered errors occur, the last error that occurred is reported by the additional sense bytes. Note: For some Mode settings, the last command may have terminated before completing.
2h Not Ready Indicates the logical unit addressed cannot be accessed. Operator intervention may be required to correct this condition.
3h Medium Error Indicates the command terminated with a non-recovered error condition, probably caused by a flaw in the medium or an error in the recorded data.
4h Hardware Error Indicates the disc drive detected a nonrecoverable hardware failure while performing the command or during a self test. This includes SCSI interface parity error, controller failure or device failure.
5h Illegal Request Indicates an illegal parameter in the command descriptor block or in the additional parameters supplied as data for some commands (Format Unit, Mode Select, and so forth). If the disc drive detects an invalid parameter in the Command Descriptor Block, it shall terminate the command without altering the medium. If the disc drive detects an invalid parameter in the additional parameters supplied as data, the disc drive may have already altered the medium. This sense key may also indicate that an invalid IDENTIFY message was received. This could also indicate an attempt to write past the last logical block.
6h Unit Attention Indicates the disc drive may have been reset.
7h Data Protect Indicates that a command that reads or writes the medium was attempted on a block that is protected from this operation. The read or write operation is not performed.
9h Firmware Error Vendor specific sense key.
Bh Aborted Command Indicates the disc drive aborted the command. The initiator may be able to recover by trying the command again.
Ch Equal Indicates a SEARCH DATA command has satisfied an equal comparison.
Dh Volume Overflow Indicates a buffered peripheral device has reached the end of medium partition and data remains in the buffer that has not been written to the medium.
Eh Miscompare Indicates that the source data did not match the data read from the medium.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK