From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 01 Mar 2004 12:36:10 +0000 Subject: Re: How can I specify a specific 'sub-device' of a device for udev Message-Id: <1078144569.1312.41.camel@pim> List-Id: References: <4042D36F.9020909@kuiki.net> In-Reply-To: <4042D36F.9020909@kuiki.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, 2004-03-01 at 07:08, Jonathan Steinert wrote: > Morning everybody, > > I'm trying to find how I can write a rule which allows me to say "The > usb-serial bus interface inside the usb device with a sysfs serial of > "304087" should be named "foo" > > I'll paste my udevinfo output for the device in question (A Belkin USB > to serial dongle) at the bottom, but I am running into a similar issue > with my Griffin Powermate. > > The rule I came up with, which does not work nor seem correct in the > first place is: > > BUS="usb-serial", SYSFS{serial}="304087", NAME="foo" Yes, the rule is incorrect. It's not on the same device. > Since this does not work, I am asuming that the sysfs attributes to not > trickle down a driver chain for matching in more specific devices. It walks down, just like udevinfo does. But you can only match attributes of _one_ device not combine attributes from different devices on the chain. > This does leave me puzzled about two things: > > 1) Why does udev have a flag to crawl up the sysfs tree (Asuming my > observations of udev are correct) but no flag to show the attributes of > only the device I specify? or only 'n' layers down for that matter? Do you really need this? Why? > 2) How can I write a rule to match the usb-serial interface of a usb > device with a particular serial number? > looking at the device chain at > '/sys/devices/pci0000:00/0000:00:1d.2/usb2/2-1': > BUS="usb" ... > SYSFS{serial}="304087" Your serial number belongs the "usb"-device and not the virtual "usb-serial"-device. A match for the "hardware" behind your serial device should work fine: BUS="usb", SYSFS{serial}="304087", NAME="foo" If you really need to match this particular device interface, you may use its bus-id: BUS="usb", ID="2-1:1.0", NAME="foo" hope that helps, Kay ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel