linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Pilcher <i.pilcher@comcast.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: udev: rules using multiple sysfs directories
Date: Sat, 30 Apr 2005 00:44:56 +0000	[thread overview]
Message-ID: <d4uk3d$nos$1@sea.gmane.org> (raw)
In-Reply-To: <200504282041.56905.typo@mcflan.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

      parent reply	other threads:[~2005-04-30  0:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-28 19:41 udev: rules using multiple sysfs directories James Macfarlane
2005-04-28 20:28 ` Ian Pilcher
2005-04-28 21:44 ` Kay Sievers
2005-04-29  0:59 ` James Macfarlane
2005-04-29 12:55 ` Ian Pilcher
2005-04-29 17:13 ` James Macfarlane
2005-04-29 18:15 ` Kay Sievers
2005-04-29 20:09 ` Greg KH
2005-04-30  0:44 ` Ian Pilcher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='d4uk3d$nos$1@sea.gmane.org' \
    --to=i.pilcher@comcast.net \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).