James Bottomley wrote: > If you're doing this: > > On Thu, 2003-05-15 at 18:50, Douglas Gilbert wrote: > >>+#define scsi_status(result) ((result) & 0x7e) > > > because bit0 is reserved in SCSI-2, then it should be 0x3e because bits > 6 and 7 are also reserved. Of course, this would clash with the SCSI-3 > definition of TASK ABORTED, sigh. > > Perhaps it's better just not to bother with the mask? James, The macro still gets rid of the upper bytes in scsi_cmnd::result so in needs to be at least a mask of 0xff. With a mask of 0x7e it is correct for SCSI-3, bit 6 is reserved ** in SCSI-2 and "vendor unique" in SCSI-1 and SCSI_1_CCS. I dug up a SCSI 1 draft and the Status byte table is attached. So as far as I can see our only exposure is to SCSI 1 and CCS devices. A possible source of confusion with this proposed patch is that 'scsi_status' is probably one of the most common variable names in the SCSI subsystem. As a macro it shouldn't clash but it may confuse. Alternate patch using get_scsi_status() attached. ** SCSI-2 defines reserved as "set aside for future standardization" but SPC-3 (spc3r12) nails it down: "A reserved bit, byte, word or field shall be set to zero, ...". Doug Gilbert