Date: Tue, 1 Jan 2002 08:19:11 -0500 (EST) From: "Lawrence S. Lansing" <lansil@rpi.edu> To: "Duane H. Hesser" <dhh@androcles.com> Cc: stable@FreeBSD.ORG, Doug White <dwhite@resnet.uoregon.edu> Subject: Re: Problem with compact flash reader under -stable Message-ID: <Pine.A41.3.96.1020101073345.49208A-100000@vcmr-19.rcs.rpi.edu> In-Reply-To: <200112311937.fBVJbRD89308@androcles.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> The Linux folks seem to spend a lot of time playing with (or looking for) > specialized drivers for USB devices; you may be able to get some clues at > > http://www.qbik.ch/usb/devices/showdev.php?id=536 Thank you very much for the information. I've done a bit of work, and a bit of research, and I've determined a few things: The Simpletech reader I have uses chips manufactured by DataFab. It looks almost exactly like the reader featured in this picture, except it is repainted: http://www.datafab.com/products/DATA/KECF-USB.htm According to the URLs you sent me, the Linux folks have a specialized DataFab driver that handles a significantly large class of USB devices that use DataFab's USB-ATA chips. The Linux DataFab driver writer's page is: http://sackheads.org/~mayfield/usb.html According to that URL, my flash reader (ID: 07c4:b000) is completely different than the rest of the DataFab USB-ATA devices, mostly in that it is not ATA. :) A quote from the page: *** Lately, I've been getting reports of 'b000' devices in the wild. These appear to be quite different from previous readers in that they act like SCSI devices instead of ATA devices. Thus, this driver has no chance of working with these readers. In fact, the usb-storage module detects the reader as a SCSI device and attempts to use the built-in transparent SCSI routines to access the device instead of this driver.. Obviously there are some problems here since b000 readers are essentially non-functional under Linux. Since I don't have access to one of these readers, I'm afraid you're on your own if you have one. :-/ *** So, it looks like Linux currently treats the device the same way FreeBSD does--it tries to treat the device like a umass/SCSI device, and it fails, for some reason...but (at least in FreeBSD) not before correctly determining the geometry of the inserted flash card! Based on the feedback from my original message to the list, I attempted to set up an entry in the SCSI 'quirks' table for my device. I ended up with an entry in /src/sys/cam/scsi/scsi_da.c that looks very similar to Mike E. Matsnev's patch (recently sent to the list in this thread). My entry (reformatted, a bit): { {T_DIRECT, SIP_MEDIA_REMOVABLE, "OEI-Link", "Media Reader", "3.*"}, /*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE } I derived the entry from this dmesg output: da0: <OEI-Link Media Reader 3.06> Removable Direct Access SCSI-0 device I hope I got it right. I decided to try the NO_6_BYTE and NO_SYNC_CACHE quirks because they seem like common quirks for this class of device. I'm afraid I don't have the knowledge/experience to determine that these are the "correct" quirks, based on the debugging of data sent over the USB bus. I thought I'd try a wild-ass guess. Assuming all I need to do after adding the quirk entry is compile/install a new kernel and reboot, the quirk entry did not solve my problem. I'm still stumped--I have a flash reader that appears to be SCSI, and appears to almost work. Reading from the card in any way still generates the same I/O and syslog errors as described in my original message. I'm not sure where to go from here, except for trying the USB and SCSI debug options on in the kernel. I doubt I'd be able to make sense of the debug output, in any case. I'm still open to feedback, especially if I've made a stupid error in my quirk entry. I suppose I could just buy a new reader, too. This problem just seems like a good excuse to learn more about FreeBSD device drivers...and that has been on my 'todo' list for some time. -Larry Lansing RPI Class of 2003 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.A41.3.96.1020101073345.49208A-100000>