> Especially if the sense code is NO SENSE.  Logically that should
> indicate the driver needed to find out whether or not there was error,
> and it learned that there wasn't.

For tape drives, sense key == NO SENSE is not equivalent to no error to
report.  Often a tape drive returns a sense key of NO SENSE but with one
of the other bits (EOM, FILEMARK, ILI) set in the same byte as the sense
key.  There are also some ASC/ASCQ combinations that go with a sense key
of NO SENSE but without any of the EOM, FILEMARK, or ILI bits set.

On the other hand, some tape drives set the EOM bit in unsolicited
request sense data just to report the position of the tape, so the EOM
bit being set isn't necessarily an indicator that there was an error.
However, ASC/ASCQ should be nonzero when the EOM bit is set because of
an error.

I recommend defining "no error" to be:

(sense_data[2] & 0xaf) == 0x00 && /* Filemark 0, ignore EOM, ILI 0, NO
SENSE */
sense_data[12]  == 0x00 && /* ASC */
sense_data[13] == 0x00 /* ASCQ */

This should work for most devices that I have encountered.

Anthony J. Battersby
Cybernetics



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to