lkml.org 
[lkml]   [2003]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.030 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site