Hello,
Should the SCSI driver cap Sense data at 8 bytes for SCSI-2, when
'additional sense length field' = 0 ?
In 1985's ECMA-111, the default sense data length seems to be 8 bytes,
but in the 1993's spec of SCSI-2 it seems to be 18 bytes.
What I found related to that the SCSI-2 specs:
"Targets shall be capable of returning eighteen bytes of data in
response to a REQUEST SENSE command."
"The additional sense length field indicates the number of additional
sense bytes to follow."
Context:
I'm trying to make old (non-mainstream) SCSI-2 hardware from 1995 work
with Linux, with Adaptec 2940 / 2940AU host adapters.
This device uses the sense data fields "Additional sense code" and
"Additional sense code qualifier" a lot to check the current state of
the device.
Under Windows, I have no problems.
Under Linux, it does not work, because the sense data that is returned
is capped at 8 bytes, and those 2 fields are located after that.
Example 16 bytes of CDB, followed by 14 or 8 bytes of Sense data I
intercepted:
Windows: requestor asked for 14 bytes of sense data
SC_EXEC_SCSI_CMD READ_BUFFER (0x3C)
3C 01 11 00 00 00 00 00 10 00 00 00 00 00 00 00
F0 00 09 00 00 00 00 00 00 00 00 00 02 04
Linux: requestor asked for 14 bytes of sense data, sg returned 8 bytes
(checked via sb_len_wr returned by ioctl() with interface_id = 'S')
SC_EXEC_SCSI_CMD READ_BUFFER (0x3C)
3C 01 11 00 00 00 00 00 10 00 00 00 00 00 00 00
F0 00 09 00 00 00 00 00
Thanks in advance,
T.