From owner-freebsd-hardware Wed May 29 9:15:22 2002 Delivered-To: freebsd-hardware@freebsd.org Received: from homemail.bjt.net (homemail.bjt.net [209.237.6.18]) by hub.freebsd.org (Postfix) with ESMTP id 0B22237B40A for ; Wed, 29 May 2002 09:15:01 -0700 (PDT) Received: from foo.fake.primenet.com [209.237.31.190] by homemail.bjt.net with ESMTP (SMTPD32-7.07) id ACB7409028A; Wed, 29 May 2002 09:07:19 -0700 Received: from baz.fake.primenet.com (baz [10.0.0.3]) by foo.fake.primenet.com (8.9.3/8.8.8) with ESMTP id JAA26775; Wed, 29 May 2002 09:14:52 -0700 (PDT) (envelope-from bko@idiom.com) Received: from baz.fake.primenet.com (localhost [127.0.0.1]) by baz.fake.primenet.com (8.12.2/8.12.2) with ESMTP id g4TGEqFN050453; Wed, 29 May 2002 09:14:52 -0700 (PDT) (envelope-from bkogawa@baz.fake.primenet.com) Received: (from bkogawa@localhost) by baz.fake.primenet.com (8.12.2/8.12.2/Submit) id g4TGEpgo050450; Wed, 29 May 2002 09:14:51 -0700 (PDT) From: "Bryan K. Ogawa" Message-Id: <200205291614.g4TGEpgo050450@baz.fake.primenet.com> To: "Stephane D'Alu" , hardware@freebsd.org Subject: Re: ARCHOS Recorder 20 failes accesing da2:umas-sim device In-Reply-To: <20020510201917.C6694@loria.fr> References: <20020510201917.C6694@loria.fr> Date: Wed, 29 May 2002 09:14:51 -0700 Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 1. You might get more help with the bsd-usb list, which is usb-bsd@eleetbsd.org . 2. it looks like the error which is indicative of the device not allowing 10-byte reads. daryl okahata wrote up a nice document on fixing this, here's a quote from that: Chances are, the above command will fail (assuming that you used the correct parameters), with messages like the following appearing in the syslog/console: (da0:umass-sim0:0:0:0): READ(06). CDB: 8 0 0 0 4 0 (da0:umass-sim0:0:0:0): ILLEGAL REQUEST asc:21,0 (da0:umass-sim0:0:0:0): Logical block address out of range If you see this, don't worry; it just means that you have to tweak the kernel sources. In the above, note that the failing command is, "READ(06)"; if you see anything else, stop now, as something else is going wrong, and the rest of these instructions will probably not help you. If, by some miracle, the above command actually succeeds, rejoice. It means that you do not have to tweak the kernel sources, and that the USB disk should already be fully functional under FreeBSD. You can skip the rest of these steps, and start using the disk normally (but see the cautions below on disconnecting the disk from the USB bus!). * If the above mount failed, it means that you probably need to apply some kernel tweaks. What's happening is that FreeBSD treats an IDE USB disk as a SCSI disk, and tries to send it 6-byte SCSI commands, but the USB disk probably understands only 10-byte SCSI commands, and gives errors when 6-byte commands are used. [ Yes, it may seem strange, treating an IDE USB disk as a SCSI one, but it's actually a pretty good idea. This simplifies driver writing, because the USB driver only has to worry about low-level details, and the higher-level SCSI driver can handle a lot of the upper-level details. ] Fortunately, FreeBSD allows you to mark certain SCSI devices as being incapable of understanding 6-byte SCSI commands, which is a passable workaround for this problem. Ideally, the driver should fall back to using 10-byte commands if 6-byte one fails, but this does not (yet?) exist in FreeBSD-STABLE (I believe it does exist in FreeBSD-CURRENT, though). This is where the drive identification string comes in (you did make a note of it, above, right?). Here's a tricky part: you have to break up this drive identification string into a manufacturer name, a model name, and a revision. Hopefully, you're familiar with disk drive manufacturers; if you're not, ask around. In the above example, the drive identification string is (and this will almost certainly be different for you): TOSHIBA MK2016GAP U0.3 Here, the manufacturer name is "TOSHIBA", and the model name is "MK2016GAP", and the revision is "U0.3". Note that this one's easy; other drive identification strings may have additional spaces. The two key parts you'll need are the manufacturer and model names. Make a note of them. * As root, go to /usr/src/sys/cam/scsi, and edit the file, "scsi_da.c". Search for the variable, "da_quirk_table"; you want to locate where it is defined. The variable, "da_quirk_table", contains a list of all SCSI devices that need to be specially handled, and it is here where we need to add an entry for our USB disk. Basically, to this variable, you want to add an entry like: { {T_DIRECT, SIP_MEDIA_FIXED, "TOSHIBA", "MK2016GAP", "*"}, /*quirks*/ DA_Q_NO_6_BYTE }, Replace "TOSHIBA" with the manufacturer name of your disk, and replace "MK2016GAP" with the model name. This will tell FreeBSD to specially handle your USB disk -- to not use 6-byte SCSI commands. Rebuild your kernel (don't forget to do a "make depend"), and reboot. The USB disk should be functional. >From here, you should be able to use the disk normally. However, before physically disconnecting the USB disk from the USB bus, do not forget to unmount any mounted filesystems that come off the USB disk. Bad Things Will Happen if you disconnect the disk before unmounting any such filesystems (you may lose data, or FreeBSD might crash). If part or all of the disk is going to be used for FreeBSD, just follow the instructions in the handbook. I hope this helps. In localhost.freebsd.hardware, you wrote: > Hello, > > I've bought a ARCHOS Recorder 20 (not the Studio, which used a > different chipset), and when plugged it is correctly > recognised by the USB subsystem as a umass device: >| umass0: ARCHOS ARCHOS USB2.0 (P4a), rev 2.00/11.01, addr 3 >| da2 at umass-sim0 bus 0 target 0 lun 0 >| da2: Fixed Direct Access SCSI-0 device >| da2: 650KB/s transfers >| da2: 19077MB (39070080 512 byte sectors: 64H 32S/T 19077C) > > now my problem is that when trying to access it, it failes: >| (da2:umass-sim0:0:0:0): READ(06). CDB: 8 0 0 0 1 0 >| (da2:umass-sim0:0:0:0): ILLEGAL REQUEST asc:21,0 >| (da2:umass-sim0:0:0:0): Logical block address out of range > > Does someone have an idea (and suggestions)? > > For information here is the result of 'usbdevs': > bash# usbdevs -v > Controller /dev/usb0: > addr 1: self powered, config 1, UHCI root hub(0x0000), VIA(0x0000), rev 0x0100 > port 1 addr 2: low speed, power 50 mA, config 1, USB Receiver(0xc501), Logitech(0x046d), rev 0x0910 > port 2 addr 3: self powered, config 2, ARCHOS USB2.0 (P4a)(0x0060), ARCHOS (0x05ab), rev 0x1101 > > > Thanks > > -- > Stephane D'Alu > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hardware" in the body of the message > -- bryan k ogawa http://www.idiom.com/~bko/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message