From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Steinert Date: Mon, 01 Mar 2004 06:08:47 +0000 Subject: How can I specify a specific 'sub-device' of a device for udev naming? Message-Id: <4042D36F.9020909@kuiki.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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" 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. 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? 2) How can I write a rule to match the usb-serial interface of a usb device with a particular serial number? I have no idea what to call this act, apart from 'walking' the sysfs tree when checking the rules, so after reading all the documentation with udev that I noticed, and all of the messages on the list that I thought might be related I've come up with nothing. Can anyone fill me in on this, possibly telling me what this is called, and what I am getting wrong? Thanks much, Jonathan Steinert root@yuumi:/dev# udevinfo -a -p /sys/class/tty/ttyUSB0 device '/sys/class/tty/ttyUSB0' has major:minor 188:0 looking at class device '/sys/class/tty/ttyUSB0': SYSFS{dev}="188:0" follow the class device's "device" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb2/2-1/2-1:1.0/ttyUSB0': BUS="usb-serial" ID="ttyUSB0" SYSFS{detach_state}="0" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb2/2-1/2-1:1.0': BUS="usb" ID="2-1:1.0" SYSFS{detach_state}="0" SYSFS{bInterfaceNumber}="00" SYSFS{bAlternateSetting}=" 0" SYSFS{bNumEndpoints}="03" SYSFS{bInterfaceClass}="ff" SYSFS{bInterfaceSubClass}="ff" SYSFS{bInterfaceProtocol}="ff" SYSFS{iInterface}="00" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb2/2-1': BUS="usb" ID="2-1" SYSFS{detach_state}="0" SYSFS{bNumConfigurations}="1" SYSFS{bNumInterfaces}=" 1" SYSFS{bConfigurationValue}="1" SYSFS{bmAttributes}="a0" SYSFS{bMaxPower}="100mA" SYSFS{idVendor}="050d" SYSFS{idProduct}="0109" SYSFS{bcdDevice}="0102" SYSFS{bDeviceClass}="00" SYSFS{bDeviceSubClass}="00" SYSFS{bDeviceProtocol}="00" SYSFS{speed}="12" SYSFS{manufacturer}="Belkin USB PDA Adapter" SYSFS{product}="Belkin Components" SYSFS{serial}="304087" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2/usb2': BUS="usb" ID="usb2" SYSFS{detach_state}="0" SYSFS{bNumInterfaces}=" 1" SYSFS{bConfigurationValue}="1" SYSFS{bmAttributes}="40" SYSFS{bMaxPower}=" 0mA" SYSFS{idVendor}="0000" SYSFS{idProduct}="0000" SYSFS{bcdDevice}="0206" SYSFS{bDeviceClass}="09" SYSFS{bDeviceSubClass}="00" SYSFS{bDeviceProtocol}="00" SYSFS{bNumConfigurations}="1" SYSFS{speed}="12" SYSFS{manufacturer}="Linux 2.6.3 uhci_hcd" SYSFS{product}="UHCI Host Controller" SYSFS{serial}="0000:00:1d.2" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.2': BUS="pci" ID="0000:00:1d.2" SYSFS{detach_state}="0" SYSFS{vendor}="0x8086" SYSFS{device}="0x2487" SYSFS{subsystem_vendor}="0x8086" SYSFS{subsystem_device}="0x4541" SYSFS{class}="0x0c0300" SYSFS{irq}="11" looking at the device chain at '/sys/devices/pci0000:00': BUS="" ID="pci0000:00" SYSFS{detach_state}="0" ------------------------------------------------------- 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