DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Introduction to SCSI drivers

Sense data

If a SCSI command returns CHECK CONDITION status from the peripheral, the host adapter driver is responsible for sending a REQUEST SENSE command to return the sense data from the failed command. (Some adapter boards do this automatically.)

The host adapter driver can use scsi_sense and sense_len members in the request block for the sense data, or can place the sense data in the request block after the SCSI command that caused the error. By default, fourteen bytes of data are returned, with the first byte following the last byte of the command in the SCSI CDB. Host adapters that support extended sense data can return up to 255 bytes.

As an example, the SCSI peripheral driver could access the first byte of the returned sense data with the following expression:

   request.scsi_cmd.raw[request.cmdlen]
Note that some early versions of the SCSI interface did not support the use of the scsi_sense and sense_len members of the request block.
© 2005 The SCO Group, Inc. All rights reserved.