From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Pilcher Date: Sat, 30 Apr 2005 00:44:56 +0000 Subject: Re: udev: rules using multiple sysfs directories Message-Id: List-Id: References: <200504282041.56905.typo@mcflan.org> In-Reply-To: <200504282041.56905.typo@mcflan.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Greg KH wrote: > On Thu, Apr 28, 2005 at 03:28:31PM -0500, Ian Pilcher wrote: > >>This seems like a significant limitation for USB composite devices. > > > No, all USB devices work like this. If I'm correct about what can't be done, there's no way to write a rule which identifies a device by vendor, product, and interface. It's possible to do vendor and product, so the limitation only affects composite devices. > > I'll try to make a udev rule that would work for this, can you send me > the output of udevinfo for this: > udevinfo -a /sys/class/tty/ttyUSB0 > udevinfo -a /sys/class/tty/ttyUSB1 ttyUSB0 (the modem): 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:1e.0/0000:02:00.0/0000:03:00.0/usb4/4-1/4-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:1e.0/0000:02:00.0/0000:03:00.0/usb4/4-1/4-1:1.0': BUS="usb" ID="4-1:1.0" SYSFS{bAlternateSetting}=" 0" SYSFS{bInterfaceClass}="ff" SYSFS{bInterfaceNumber}="00" SYSFS{bInterfaceProtocol}="ff" SYSFS{bInterfaceSubClass}="ff" SYSFS{bNumEndpoints}="03" SYSFS{detach_state}="0" SYSFS{iInterface}="04" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0/usb4/4-1': BUS="usb" ID="4-1" SYSFS{bConfigurationValue}="1" SYSFS{bDeviceClass}="00" SYSFS{bDeviceProtocol}="00" SYSFS{bDeviceSubClass}="00" SYSFS{bMaxPower}="100mA" SYSFS{bNumConfigurations}="1" SYSFS{bNumInterfaces}=" 2" SYSFS{bcdDevice}="0001" SYSFS{bmAttributes}="c0" SYSFS{detach_state}="0" SYSFS{devnum}="4" SYSFS{idProduct}="0112" SYSFS{idVendor}="0f3d" SYSFS{manufacturer}="AirPrime, Incorporated" SYSFS{maxchild}="0" SYSFS{product}="AirPrime CDMA Wireless PC Card" SYSFS{speed}="12" SYSFS{version}=" 1.10" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0/usb4': BUS="usb" ID="usb4" SYSFS{bConfigurationValue}="1" SYSFS{bDeviceClass}="09" SYSFS{bDeviceProtocol}="00" SYSFS{bDeviceSubClass}="00" SYSFS{bMaxPower}=" 0mA" SYSFS{bNumConfigurations}="1" SYSFS{bNumInterfaces}=" 1" SYSFS{bcdDevice}="0206" SYSFS{bmAttributes}="c0" SYSFS{detach_state}="0" SYSFS{devnum}="1" SYSFS{idProduct}="0000" SYSFS{idVendor}="0000" SYSFS{manufacturer}="Linux 2.6.9-5.EL.root.evdo ohci_hcd" SYSFS{maxchild}="2" SYSFS{product}="OHCI Host Controller" SYSFS{serial}="0000:03:00.0" SYSFS{speed}="12" SYSFS{version}=" 1.10" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0': BUS="pci" ID="0000:03:00.0" SYSFS{class}="0x0c0310" SYSFS{detach_state}="0" SYSFS{device}="0x5802" SYSFS{irq}="11" SYSFS{subsystem_device}="0x5802" SYSFS{subsystem_vendor}="0x11c1" SYSFS{vendor}="0x11c1" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0': BUS="pci" ID="0000:02:00.0" SYSFS{class}="0x060700" SYSFS{detach_state}="0" SYSFS{device}="0xac55" SYSFS{irq}="11" SYSFS{subsystem_device}="0x0512" SYSFS{subsystem_vendor}="0x1014" SYSFS{vendor}="0x104c" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0': BUS="pci" ID="0000:00:1e.0" SYSFS{class}="0x060400" SYSFS{detach_state}="0" SYSFS{device}="0x2448" SYSFS{irq}="0" SYSFS{subsystem_device}="0x0000" SYSFS{subsystem_vendor}="0x0000" SYSFS{vendor}="0x8086" looking at the device chain at '/sys/devices/pci0000:00': BUS="" ID="pci0000:00" SYSFS{detach_state}="0" ttyUSB1 (the "control port"): looking at class device '/sys/class/tty/ttyUSB1': SYSFS{dev}="188:1" follow the class device's "device" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0/usb4/4-1/4-1:1.1/ttyUSB1': BUS="usb-serial" ID="ttyUSB1" SYSFS{detach_state}="0" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0/usb4/4-1/4-1:1.1': BUS="usb" ID="4-1:1.1" SYSFS{bAlternateSetting}=" 0" SYSFS{bInterfaceClass}="ff" SYSFS{bInterfaceNumber}="01" SYSFS{bInterfaceProtocol}="ff" SYSFS{bInterfaceSubClass}="ff" SYSFS{bNumEndpoints}="02" SYSFS{detach_state}="0" SYSFS{iInterface}="04" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0/usb4/4-1': BUS="usb" ID="4-1" SYSFS{bConfigurationValue}="1" SYSFS{bDeviceClass}="00" SYSFS{bDeviceProtocol}="00" SYSFS{bDeviceSubClass}="00" SYSFS{bMaxPower}="100mA" SYSFS{bNumConfigurations}="1" SYSFS{bNumInterfaces}=" 2" SYSFS{bcdDevice}="0001" SYSFS{bmAttributes}="c0" SYSFS{detach_state}="0" SYSFS{devnum}="4" SYSFS{idProduct}="0112" SYSFS{idVendor}="0f3d" SYSFS{manufacturer}="AirPrime, Incorporated" SYSFS{maxchild}="0" SYSFS{product}="AirPrime CDMA Wireless PC Card" SYSFS{speed}="12" SYSFS{version}=" 1.10" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0/usb4': BUS="usb" ID="usb4" SYSFS{bConfigurationValue}="1" SYSFS{bDeviceClass}="09" SYSFS{bDeviceProtocol}="00" SYSFS{bDeviceSubClass}="00" SYSFS{bMaxPower}=" 0mA" SYSFS{bNumConfigurations}="1" SYSFS{bNumInterfaces}=" 1" SYSFS{bcdDevice}="0206" SYSFS{bmAttributes}="c0" SYSFS{detach_state}="0" SYSFS{devnum}="1" SYSFS{idProduct}="0000" SYSFS{idVendor}="0000" SYSFS{manufacturer}="Linux 2.6.9-5.EL.root.evdo ohci_hcd" SYSFS{maxchild}="2" SYSFS{product}="OHCI Host Controller" SYSFS{serial}="0000:03:00.0" SYSFS{speed}="12" SYSFS{version}=" 1.10" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0000:03:00.0': BUS="pci" ID="0000:03:00.0" SYSFS{class}="0x0c0310" SYSFS{detach_state}="0" SYSFS{device}="0x5802" SYSFS{irq}="11" SYSFS{subsystem_device}="0x5802" SYSFS{subsystem_vendor}="0x11c1" SYSFS{vendor}="0x11c1" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:00.0': BUS="pci" ID="0000:02:00.0" SYSFS{class}="0x060700" SYSFS{detach_state}="0" SYSFS{device}="0xac55" SYSFS{irq}="11" SYSFS{subsystem_device}="0x0512" SYSFS{subsystem_vendor}="0x1014" SYSFS{vendor}="0x104c" looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0': BUS="pci" ID="0000:00:1e.0" SYSFS{class}="0x060400" SYSFS{detach_state}="0" SYSFS{device}="0x2448" SYSFS{irq}="0" SYSFS{subsystem_device}="0x0000" SYSFS{subsystem_vendor}="0x0000" SYSFS{vendor}="0x8086" looking at the device chain at '/sys/devices/pci0000:00': BUS="" ID="pci0000:00" SYSFS{detach_state}="0" Thanks! -- ==================================== Ian Pilcher i.pilcher@comcast.net ==================================== ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r _______________________________________________ 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