Re: Devices not supporting read-6....

From: Kenneth D. Merry (ken@kdm.org)
Date: Wed Feb 02 2000 - 03:02:04 EST


On Tue, Feb 01, 2000 at 22:40:26 -0700, Drew Eckhardt wrote:
> In The Beginning (late 1991), Linux developers were chronically broke college
> students running whatever obsolete hardware we managed to scrounge up.
>
> In the SCSI-1 spec that some of this conformed to, Read-6 was required.
> Read-10 was suggested as a good idea. Since some devices Wedged until
> power cycled when fed a command they didn't support, I figured that
> using Read-6 until we absolutely positively had to use Read-10 was a
> fine idea.
>
> In the 00's, it's probably a better idea to always use Read-10 unless
> we're talking to a SCSI-1 device with READ CAPACITY returning a size
> that can be accessed with Read-6 commands.

FWIW, even in the SCSI-1 spec, 10-byte reads were mandatory for CDROM and
WORM devices, and 6-byte reads were optional. (It is that way in the
SCSI-2 spec, and I think in the MMC specs as well.)

The way we handle this in FreeBSD is to specify a minimum command size in
the function that builds read and write CCBs. The function will then
select the smallest read/write command size that will satisfy the minimum
command size, and that will also hold the block number and transfer size.

In the CD driver, we just set the minimum command size to 10, since CDROM
and WORM drives don't have to support 6 byte reads. (The minimum command
size is set to 6 in the disk driver, unless the drive is quirked
otherwise, since 6 byte reads are still mandatory for disks.)

Ken

-- 
Kenneth Merry
ken@kdm.org

- 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/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:07 EST