Date: Wed, 10 Apr 2002 21:50:33 +0200 (CEST) From: Nick Hibma <n_hibma@van-laarhoven.org> To: "Eugene M. Kim" <gene@nttmcl.com> Cc: Oliver Fromme <olli@secnetix.de>, FreeBSD Hardware Mailing List <hardware@freebsd.org>, FreeBSD Hackers Mailing List <hackers@freebsd.org> Subject: Re: USB "Memorybird" quirks Message-ID: <20020410213414.P27956-100000@heather.van-laarhoven.org> In-Reply-To: <20020207125449.A9620@alicia.nttmcl.com>
next in thread | previous in thread | raw e-mail | index | archive | help
The problem is that we emulate ATAPI and UFI command sets through converting SCSI commands. These command sets both do not have 6 byte commands. The solution is to have the umass driver pass a quirk back to the CAM layer dynamically for these devices. Any takers for an implementation that doesn't cause a large memory overhead? The solution that doesn't require memory consuming storing of quirks would be to have the da peripheral driver ask the SIM (umass in this case) for the quirks. The umass driver does not know about the attachment of the da driver to the SCSI device we have created (nor should it), so it is difficult to find a way to push the quirk info up to the driver. I'm all ears to good ideas. A second piece of work would be to convert all the other 6 byte commands it produces to their 10 byte equivalents, in the same way it is done in scsi_da.c: Pass softc->minimum_cmd_size into scsi_mode_sense and scsi_mode_select and make those functions use the 10 byte commands where necessary. And then the third one would be to have a look at for example scsi_cd.c and friends and make similar changes there. Don't forget the testing and finishing touches that I haven't described here. That makes it more than the evening's amount of work I could spend on it. And it is not difficult. So, who's going to do it? Send me patches when your done. Nick On Thu, 7 Feb 2002, Eugene M. Kim wrote: > This is a common problem of most umass devices that implements BBB > protocol, and arises from the fact that those devices don't understand > the 6-byte SCSI READ command. You can add a quirk entry to > src/sys/cam/scsi_da.c (refer to quirk entries that have DA_Q_NO_6_BYTE). > > IIRC this problem is being addressed at a more fundamental level on > -current, by adding a 6-byte-to-10-byte READ command translator > somewhere in the abstraction layer. > > Eugene > > On Thu, Feb 07, 2002 at 09:46:28PM +0100, Oliver Fromme wrote: > > > > > > Hi, > > > > I've got a small problem with a nice little thing called > > "USB Memorybird" (Fujitsu-Siemens) ... > > > > It is bascially a 64 MB Flash chip in a small plastic pen > > that you can carry with your keys. It doesn't need any > > battery and you can plug it directly into a USB socket. > > Very neat. > > > > Works without any drivers on WinME and Win2k, so I assume > > it should be some standard USB mass storage device. > > > > FreeBSD 4.5 recognizes it out of the box and attaches it as > > a SCSI disk, but I cannot access it. This is what happens: > > > > >From the boot log: > > > > uhci0: <VIA 83C572 USB controller> port 0xd400-0xd41f irq 10 at device = 7.2 on pci0 > > usb0: <VIA 83C572 USB controller> on uhci0 > > usb0: USB revision 1.0 > > uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 > > uhub0: 2 ports with 2 removable, self powered > > > > This appears when I connect the Memorybird: > > > > umass0: Fujitsu Memorybird, rev 1.00/1.00, addr 2 > > da2 at umass-sim0 bus 0 target 0 lun 0 > > da2: <Fujitsu Memorybird 1.04> Removable Direct Access SCSI-0 device > > da2: 650KB/s transfers > > da2: 62MB (128000 512 byte sectors: 64H 32S/T 62C) > > > > This is the output from "usbdevs -v" (note that there is a > > ~10 seconds delay!): > > > > Controller /dev/usb0: > > addr 1: self powered, config 1, UHCI root hub(0x0000), VIA(0x0000), rev= 0x0100 > > port 1 powered > > < ~10 seconds delay > > > port 2 addr 2: power 100 mA, config 1, product 0x0100(0x0100), vendor = 0x0d7d(0x0d7d), rev 0x0100 > > > > When I type "fdisk da2", it hangs for a while, then prints: > > > > fdisk: can't open device /dev/da2 > > fdisk: cannot open disk /dev/da2: Input/output error > > > > At the same time, the kernel logs this: > > > > Feb 7 20:00:31 lurza /kernel: umass0: BBB reset failed, TIMEOUT > > Feb 7 20:00:36 lurza /kernel: umass0: BBB bulk-in clear stall failed, = TIMEOUT > > Feb 7 20:00:41 lurza /kernel: umass0: BBB bulk-out clear stall failed,= TIMEOUT > > Feb 7 20:00:51 lurza /kernel: umass0: BBB reset failed, TIMEOUT > > Feb 7 20:00:56 lurza /kernel: umass0: BBB bulk-in clear stall failed, = TIMEOUT > > Feb 7 20:01:01 lurza /kernel: umass0: BBB bulk-out clear stall failed,= TIMEOUT > > > > The same happens when I try to dd some block from the > > device to /dev/null. During my experiments I also got > > these messages (I don't know if they're important): > > > > Feb 7 19:54:46 lurza /kernel: da2: reading primary partition table: er= ror reading fsbn 0 > > Feb 7 19:54:56 lurza /kernel: umass0: BBB reset failed, TIMEOUT > > Feb 7 19:55:01 lurza /kernel: umass0: BBB bulk-in clear stall failed, = TIMEOUT > > Feb 7 19:55:06 lurza /kernel: umass0: BBB bulk-out clear stall failed,= TIMEOUT > > Feb 7 19:55:06 lurza /kernel: (da2:umass-sim0:0:0:0): Synchronize cach= e failed, status =3D=3D 0x4, scsi status =3D=3D 0x0 > > > > Is there a chance to get this to run? Clearly the umass > > driver recognizes it and attaches it as a SCSI disk, so > > I assume that it can't be _that_ hard to convince it to > > work with FreeBSD. :) > > > > Are there any quirks that I should try? I'm not extremely > > familiar with that kind of stuff, but I'm willing to > > experiment. > > > > Thanks in advance for any help! I would _really_ love to > > get this thing working. > > > > Regards > > Oliver > > > > BTW: More information on the Memorybird: > > http://www.fujitsu-siemens.com/rl/peripherals/homeperipherals/memorybir= d.html > > > > -- > > Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 M=FCnchen > > Any opinions expressed in this message may be personal to the author > > and may not necessarily reflect the opinions of secnetix in any way. > > > > "All that we see or seem is just a dream within a dream" (E. A. Poe) > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-hardware" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hardware" in the body of the message > --=20 n_hibma@van-laarhoven.org http://www.van-laarhoven.org/ n_hibma@FreeBSD.org http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020410213414.P27956-100000>