There are 2 ways that I can think of that you did this "pass through":
- using the SCSI_IOCTL_SEND_COMMAND ioctl()
- using the scsi generic (sg) device.
Given the problem that you are reporting my guess is that you
used the first one. There are 2 problems with that, retries
are attempted (that in the worst case can lead to SCSI bus resets)
and that ioctl either gives your data back (in the case of a read
like command) or a sense buffer (in the case of any non-zero
status/error).
The sg device instructs the mid-level not to attempt retries
(which the mid-level ignores in the case of DID_SOFT_ERROR ??)
and if the SCSI command requested returned data then something
will be returned as well as SCSI status/error codes. [The
"something returned" can be useful data in the case of
CHECK CONDITION, RECOVERED ERROR.]
Even though the SCSI_IOCTL_SEND_COMMAND ioctl() is deprecated
it is still supported. Recently I wrote some documentation for
it that appears in front of the
scsi_ioctl::scsi_ioctl_send_command() function definition in
the lk 2.3 tree. It is also discussed in
http://www.torque.net/sg/p/scsi-generic_long.txt .
The megaraid driver obviously should clean up its internal
scsi return value.
Doug Gilbert
P.S. Sorry about this cross post, the original post should have
gone to the linux-scsi group.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/