From owner-freebsd-current@FreeBSD.ORG Fri Jul 17 19:10:36 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08BD8106566B for ; Fri, 17 Jul 2009 19:10:36 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swipnet.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id 677A28FC14 for ; Fri, 17 Jul 2009 19:10:35 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=ToYnosd5lh0A:10 a=hlIU1J3LQChSjWV/CGRL5g==:17 a=vUegwu44meHTtjAF0eEA:9 a=FLUF13Gs_Oz2EAdNR9QA:7 a=ZllfiG7ZrEh_-5M7XPnmlzAe9C8A:4 a=APBmdVuCTayvGvek:21 a=mAyi_HHBlW9Ha2hR:21 Received: from [193.217.167.6] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1108465198; Fri, 17 Jul 2009 21:10:29 +0200 From: Hans Petter Selasky To: "Sagara Wijetunga" Date: Fri, 17 Jul 2009 21:10:12 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA2; KDE/4.2.4; i386; ; ) References: <20090714123509.16504.qmail@us1.tomahawkonline.net> <200907171518.20959.hselasky@c2i.net> <20090717121000.4081.qmail@us1.tomahawkonline.net> In-Reply-To: <20090717121000.4081.qmail@us1.tomahawkonline.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907172110.14527.hselasky@c2i.net> Cc: freebsd-current@freebsd.org Subject: Re: Is extra USB event possible in FreeBSD 8? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 17 Jul 2009 19:10:36 -0000 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 > at scbus1 target 0 lun 0 (pass0,da0) > at scbus1 target 0 lun 1 (pass1,da1) > at scbus1 target 0 lun 2 (pass2,da2) > 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