Date: Fri, 17 Jul 2009 21:10:12 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: "Sagara Wijetunga" <sagara@tomahawk.com.sg> Cc: freebsd-current@freebsd.org Subject: Re: Is extra USB event possible in FreeBSD 8? Message-ID: <200907172110.14527.hselasky@c2i.net> In-Reply-To: <20090717121000.4081.qmail@us1.tomahawkonline.net> References: <20090714123509.16504.qmail@us1.tomahawkonline.net> <200907171518.20959.hselasky@c2i.net> <20090717121000.4081.qmail@us1.tomahawkonline.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 17 July 2009 14:10:00 Sagara Wijetunga wrote: > 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] > I'm not in a position to change anything in the CAM layer. You maybe have to ask Scott Long about this. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907172110.14527.hselasky>