Messages in this thread | ![/](/images/icornerl.gif) | | Date | Fri, 16 May 2003 09:16:25 +1000 | From | Douglas Gilbert <> | Subject | Re: [patch] NCR5380.c fix |
| |
Andries.Brouwer@cwi.nl wrote: > Several SCSI drivers confuse CHECK_CONDITION and CHECK_CONDITION << 1. <snip>
Linux has always had SCSI status values that are masked (reasonable) and shifted one bit right (bizarre) from the equivalent values in the SCSI standards. This has tricked lots of people.
So in lk 2.5 saner defines (with long-winded names) have been introduced: .... #define SAM_STAT_CHECK_CONDITION 0x02 ....
The appropriate mask is now 0x7e since Linux uses the upper bytes and the vendor could (but seldom) use bits 0 and 7. We should have a constant or macro for this mask.
So in lk 2.5 your check could read:
if ((cmd->SCp.Status & 0x7e) == SAM_STAT_CHECK_CONDITION)
Aside: "SAM" stands for SCSI Architecture Model which is the modern standard that defines SCSI status values.
Doug Gilbert
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |