Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2001 01:46:10 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        scsi@FreeBSD.org
Subject:   Need some help with CAM and UMASS
Message-ID:  <XFMail.011211014610.jhb@FreeBSD.org>

next in thread | raw e-mail | index | archive | help

I have a simple task I need to perform, but the surface reading of the code has
me convinced that I need to ask some experts for advice. :)  Basically, I need
a way to have the umass driver inform the da driver of quirks.  USB mass
storage devices use several different protocols to communicate.  Two of those
protocols are UFI and it's limited ATAPI support.  The way that umass works is
to take SCSI commands from da(4) and translate those as appropriate before
sending them out to the USB device.  Neither the UFI or ATAPI commands support
6 byte commands or the Synchronize cache commands.  What we have done so far is
to add a quirk entry for _every_ single USB device that uses UFI or ATAPI to
turn these off.  Obviously, this doesn't scale.  However, it just got worse. 
I've got a neat little MP3 player here that uses a USB2IDE interface that takes
any laptop IDE hard drive.  da(4) gets the name of the actual drive, so to get
it to work I have to use a bogus quirk on the ATA drive name!

umass0: SL IDE SL IDE, rev 1.10/2.6c, addr 2
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <IBM-DARA -206000 AR2H> Fixed Direct Access SCSI-CCS device 
da0: 650KB/s transfers
da0: 4887MB (10009441 512 byte sectors: 64H 32S/T 4887C)
umass0: Unsupported UFI command 0x08, 6 byte command should have been converted
da0: reading primary partition table: error reading fsbn 0
umass0: Unsupported UFI command 0x35
(da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x6, scsi status == 
0x0

Obviously this is less than desirable.  Now there are a few ways of fixing
this.  One way would be to teach the USB code how to transform a 6 byte command
into a 10 byte command.  This still doesn't address the syncache problem
however.  What I would like to do is be able to have the umass driver pass in a
flag to daregister() somehow that instructs it to turn on the NO_6_BYTE and
NO_SYNCACHE quirks for this device.  This would eliminate all the USB quirks in
da.c I think and really fix this problem in a central location.  However, here
is where I have a problem: trying to figure out how we get from a USB device in
umass to a da device under the umass sim bus, and how to pass the quirks in
across that boundary.  So, what are your ideas cam wizards?  Creating quirks
for each USB device just doesn't scale and this problem really should be fixed
the right way IMO.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.011211014610.jhb>