Is extra USB event possible in FreeBSD 8?
Sagara Wijetunga
sagara at tomahawk.com.sg
Fri Jul 17 15:28:27 UTC 2009
Hans Petter Selasky writes:
> On Friday 17 July 2009 10:55:56 Sagara Wijetunga wrote:
>> If it is, this option is out. Almost all of the USB mass storage devices,
>> eg. USB flash disks, cameras, audio players, etc. are already formatted. We
>> cannot ask users to format first (ie. in FreeBSD terms create disk lables,
>> create files systems, etc) before use as it make no sense at all. Eg. One
>> buy a camera at the airport, take photos on a tour, after the tour wants to
>> transfer photos to the computer. Now its too late to create labels.
>>
>> Therefore, your first option sounds interesting. I'm not sure is it the
>> correct way forward. As you are the USB expert, could you recommend the
>> correct solution?
>
> Hi,
>
> Seems to me like this is not an USB problem, at first. USB does not have any
> place to put the information. The CAM API needs to be extended first, to be
> able to pass along the kind of information you want, that is my
> recommendation.
>
This is the solution in general we also thought of, to pass a list of
name/value pairs to CAM.
> What is your solution for multi-card-readers, where multiple hardware units will get the same vendor ID, product ID and serial number?
>
It is very good you mentioned this issue.
Here is how it work (aka udev rules) on Linux for a 5-in-1 multi-card
reader:
BUS="scsi", SYSFS{model}="USB Storage-SMC", KERNEL="sd*", NAME="%k",
SYMLINK="smcard%n"
BUS="scsi", SYSFS{model}="USB Storage-CFC", KERNEL="sd*", NAME="%k",
SYMLINK="cfcard%n"
BUS="scsi", SYSFS{model}="USB Storage-MMC", KERNEL="sd*", NAME="%k",
SYMLINK="mmcard%n"
BUS="scsi", SYSFS{model}="USB Storage-SDC", KERNEL="sd*", NAME="%k",
SYMLINK="sdcard%n"
BUS="scsi", SYSFS{model}="USB Storage-MSC", KERNEL="sd*", NAME="%k",
SYMLINK="mscard%n"
For the very same 5-in-1 multi-card reader on FreeBSD 8:
sysctl -a | grep dev.umass
dev.umass.0.%desc: Generic USB Storage Device, class 0/0, rev 2.00/1.00,
addr 2
dev.umass.0.%driver: umass
dev.umass.0.%location: port=5 interface=0
dev.umass.0.%pnpinfo: vendor=0x07c4 product=0x3260 devclass=0x00
devsubclass=0x00 sernum="20040331152452980" intclass=0x08 intsubclass=0x06
dev.umass.0.%parent: uhub3
For the very same 5-in-1 multi-card reader on FreeBSD 8:
camcontrol devlist
<GENERIC USB Storage-SMC 010D> at scbus1 target 0 lun 0 (pass0,da0)
<GENERIC USB Storage-CFC 010D> at scbus1 target 0 lun 1 (pass1,da1)
<GENERIC USB Storage-MMC 010D> at scbus1 target 0 lun 2 (pass2,da2)
<GENERIC USB Storage-MSC 010D> at scbus1 target 0 lun 3 (pass3,da3)
Though the 5-in-1 multi-card reader is one unit for FreeBSD 8, its also
shows different names on different LUNs.
On Linux, it appear as 5 different units with multiple model names, so that,
different cards can be matched individually without an issue.
What we could do is send following for USB events:
1. Vendor name string (vendor-name) [eg. Lexar]
2. Vendor ID in hex (vendor-id) [eg. 0x1234]
3. Product name string (product-name) [eg. Multi-Card USB 2.0 Card Reader]
4. Product ID in hex (product-id) [eg. 0x5678]
5. LUN name string (lun-name) [eg. USB Storage-SMC]
6. LUN number (lun) [eg. 0]
Best regards
Sagara
More information about the freebsd-current
mailing list