Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Aug 2003 18:15:15 +0400
From:      "Igor B. Bykhalo" <goshik@binep.ac.ru>
To:        "FreeBSD Questions" <freebsd-questions@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   A-DATA flash drive: some oddities and how to add USB quirks
Message-ID:  <055101c35f49$d2ecee20$ea2ce9c1@binep.ac.ru>

next in thread | raw e-mail | index | archive | help
[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: <VIA 83C572 USB controller> port 0xd800-0xd81f irq 12 at device 17.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
> 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: <VIA 83C572 USB controller> port 0xdc00-0xdc1f irq 12 at device 17.3 on pci0
>         using shared irq12.
> usb1: <VIA 83C572 USB controller> 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: <A-DATA Flash 2.0 P1.0> 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: <A-DATA Flash 2.0 P1.0> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?055101c35f49$d2ecee20$ea2ce9c1>