[lkml]   [2000]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Indeed, my copy of the SCSI 3 SPC-1
( dated 21-Mar-1997) and SPC-2
( dated 21-May-2000) show them
differently. SPC-3 isn't available for download. Anyone have the "final"
copy (if indeed it's not still in draft state)?

SCSI1 - byte 1 bits 5-7 are the LUN address
SCSI2 - byte 1 bits 5-7 are the LUN address
SCSI3 SPC-1 - byte 1 bits 5-7 are marked "reserved" for all commands
SCSI3 SPC-2 - byte 1 bits 5-7 are now used for self test codes for the SEND
DIAGNOSTIC command, "reserved" for all other commands that I could see.

Maybe the proper logic would be to switch ioctl_send_command() functions
based on the version field in the INQUIRY data as you suggest, and then in
the SCSI3 case, handle SEND_DIAGNOSTIC separately?

I hereby retract my patch until a better solution is agreed upon that
doesn't break SCSI backward compatability.

-----Original Message-----
From: Guest section DW []
Sent: Monday, September 18, 2000 3:57 PM
Subject: Re: [PATCH] scsi_ioctl_send_command() shouldn't write SEND
DIAGNOSTIC S reserved bits

On Mon, Sep 18, 2000 at 11:31:09AM -0500, wrote:

> This patch prevents scsi_ioctl_send_command() from overwriting the SEND
> DIAGNOSTICS (Drive Self Test) reserved bits in cmd[1], as found in SCSI-3.
> Code provided by Michael Landrus of Dell.
> Comments are requested. If there are no objections, Linus and Alan please
> apply.
> Below are patches to kernels 2.2.18-pre8 and 2.4.0-test9-pre1.

> - cmd[1] = ( cmd[1] & 0x1f ) | (dev->lun << 5);
> + if ( cmd[0] != 0x1d ) // don't overwrite the SCSI-3 SEND DIAGNOSTICS
> reserved bits
> + cmd[1] = (cmd[1] & 0x1f) | (dev->lun << 5);

I am a bit surprised: why only SEND DIAGNOSTICS?

If I am not mistaken SCSI-1 used this 3-bit LUN field in all commands,
and SCSI-2 still does, but the standard says:

7.2.2 Logical unit number
NOTICE: The logical unit number field is included in the command
block for compatibility with some SCSI-1 devices. This field may be
reclaimed in SCSI-3.

and SCSI-3 calls these bits "reserved", for all commands, also for

(i) I don't see what is special with SEND DIAGNOSTICS. Maybe for SCSI-3
the lun should never be inserted.
(ii) On the other hand, for SCSI-1 the lun should always be inserted.

Once these bits really get used again
(are there already examples of a new use?)
I suppose we should introduce a new SCSI3_IOCTL_SEND_COMMAND
instead of changing SCSI_IOCTL_SEND_COMMAND.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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