From owner-freebsd-current@FreeBSD.ORG Sun Aug 10 07:15:20 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4D1237B401; Sun, 10 Aug 2003 07:15:20 -0700 (PDT) Received: from ns0.binep.ac.ru (serv2.binep.ac.ru [193.233.44.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id E07FD43F93; Sun, 10 Aug 2003 07:15:18 -0700 (PDT) (envelope-from goshik@binep.ac.ru) Received: from byfi (byfi.binep.ac.ru [193.233.44.234]) by ns0.binep.ac.ru (8.11.6/8.11.6) with SMTP id h7AEL3i29700; Sun, 10 Aug 2003 18:21:03 +0400 (MSD) (envelope-from goshik@binep.ac.ru) Message-ID: <055101c35f49$d2ecee20$ea2ce9c1@binep.ac.ru> From: "Igor B. Bykhalo" To: "FreeBSD Questions" Date: Sun, 10 Aug 2003 18:15:15 +0400 Organization: BINEPCP RAS MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-current@FreeBSD.ORG Subject: A-DATA flash drive: some oddities and how to add USB quirks X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Aug 2003 14:15:21 -0000 [i don't see -usb list, so CC'ed to -current hoping someone will be interested] Recently i bought the A-DATA USB 2.0 SpeedDrive (256 MB flash drive). I tried it on my system, which is now: FreeBSD goshik.binep.ac.ru 4.8-STABLE FreeBSD 4.8-STABLE #29: Sun Aug 10 16:50:19 MSD 2003 goshik@goshik.binep.ac.ru:/usr/obj/usr/src/sys/GO i386 Device appeared in dmesg as hub+storage combo: > uhci0: port 0xd800-0xd81f irq 12 at device 17.2 on pci0 > usb0: 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 > uhub1: A-DATA Technology Inc. USB Embedded Hub, class 9/0, rev 2.00/0.01, addr 2 > uhub1: 1 port with 0 removable, self powered > umass0: A-DATA Technology Inc. USB Mass Storage Device, rev 2.00/0.01, addr 3 ^^^ There is no class identifier here > umass0:0:0:-1: Attached to scbus0 as device 0 > uhci1: port 0xdc00-0xdc1f irq 12 at device 17.3 on pci0 > using shared irq12. > usb1: on uhci1 > usb1: USB revision 1.0 > uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 > uhub2: 2 ports with 2 removable, self powered But refused to work properly: > Aug 10 17:02:05 goshik /kernel: Creating DISK da0 > Aug 10 17:02:05 goshik /kernel: pass0 at umass-sim0 bus 0 target 0 lun 0 > Aug 10 17:02:05 goshik /kernel: pass0: Removable Direct Access SCSI-0 device > Aug 10 17:02:05 goshik /kernel: pass0: Serial Number . > Aug 10 17:02:05 goshik /kernel: pass0: 650KB/s transfers > Aug 10 17:02:05 goshik /kernel: ad0s1: type 0xa5, start 63, end = 78156224, size 78156162 : OK > Aug 10 17:02:05 goshik /kernel: Mounting root from ufs:/dev/ad0s1a > Aug 10 17:02:05 goshik /kernel: ad0s1: type 0xa5, start 63, end = 78156224, size 78156162 : OK > Aug 10 17:02:05 goshik /kernel: start_init: trying /sbin/init > Aug 10 17:02:05 goshik /kernel: (da0:umass-sim0:0:0:0): READ CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 > Aug 10 17:02:05 goshik /kernel: (da0:umass-sim0:0:0:0): NOT READY asc:3a,0 > Aug 10 17:02:05 goshik /kernel: (da0:umass-sim0:0:0:0): Medium not present > Aug 10 17:02:05 goshik /kernel: da0 at umass-sim0 bus 0 target 0 lun 0 > Aug 10 17:02:05 goshik /kernel: da0: Removable Direct Access SCSI-0 device > Aug 10 17:02:05 goshik /kernel: da0: Serial Number . > Aug 10 17:02:05 goshik /kernel: da0: 650KB/s transfers > Aug 10 17:02:05 goshik /kernel: da0: Attempt to query device size failed: NOT READY, Medium not present I tried to add quirks to sys/cam/scsi_da.c with no success. As was advised by Nate Lawson in recent threads on DA and USB quirks, i was going to try some USB quirks, but then i noticed a couple of strange things. First, marked above lack of class identifier for mass storage part. Then, from the output of the usbd -v: > goshik# usbd -v > usbd: opened /dev/usb0 > usbd: reading configuration file /etc/usbd.conf > usbd: opened /dev/usb > usbd: device-attach event at 0.012095000, UHCI root hub, VIA: > vndr=0x0000 prdct=0x0000 rlse=0x0100 clss=0x0009 subclss=0x0000 prtcl=0x0000 > device names: uhub0 > usbd: Found action 'USB device' for UHCI root hub, VIA at uhub0 > usbd: device-attach event at 0.016337000, USB Embedded Hub, A-DATA Technology Inc.: > vndr=0x067b prdct=0x2515 rlse=0x0001 clss=0x0009 subclss=0x0000 prtcl=0x0000 > device names: uhub1 > usbd: Found action 'USB device' for USB Embedded Hub, A-DATA Technology Inc. at uhub1 > usbd: device-attach event at 0.019387000, USB Mass Storage Device, A-DATA Technology Inc.: > vndr=0x067b prdct=0x2517 rlse=0x0001 clss=0x0000 subclss=0x0000 prtcl=0x0000 > device names: umass0 > usbd: Found action 'USB device' for USB Mass Storage Device, A-DATA Technology Inc. at umass0 > usbd: device-attach event at 0.025632000, UHCI root hub, VIA: > vndr=0x0000 prdct=0x0000 rlse=0x0100 clss=0x0009 subclss=0x0000 prtcl=0x0000 > device names: uhub2 > usbd: Found action 'USB device' for UHCI root hub, VIA at uhub2 Here we have: 1) vendor ID 0x067b - according to sys/dev/usb/usbdevs this is Prolific Technology... hmmm Am i right that to make proper quirk, i need to put product IDs into sys/dev/usb/usbdevs? If yes, how it can be done in this situation? System always shows A-DATA Technology Inc. as vendor, but it is unknown in the usbdevs. 2) product 0x2515 (not in usbdevs) class 0x0009 (hub) - well, it is identified as hub (UICLASS_HUB in usb.h) product 0x2517 (not in usbdevs) class 0x0000 - shouldn't this be 0x0008 (UICLASS_MASS in usb.h)? So: usbd reports vndr=0x067b but prints A-DATA - is this harmless? usbd reports clss=0x0000 for mass-storage part - i think this is bad? products identifiers are not in usbdevs - ? What can i do to make the thing work? TIA, Igor