linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Paris <jim@jtan.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: uDev - multiple of same device
Date: Thu, 31 Jul 2008 17:13:23 +0000	[thread overview]
Message-ID: <20080731171323.GA22057@jim.sh> (raw)
In-Reply-To: <5652842e0807310943s2666ada8h5202232847a42481@mail.gmail.com>

Hi Chris,

> I've noted that the 7-port hub I am using to connect everything is
> simply 2 4-port hubs chained together. As such, I am able to use the
> LEVEL= directive to distinguish between the ports on the first hub vs.
> the second hub. However, using udevinfo, I have not found a unique and
> constant SYSFS attribute that allows further granularity.

$ udevinfo --attribute-walk --name=/dev/input/mouse1  | grep phys
    ATTRS{phys}="usb-0000:00:1a.7-3.2.4/input0"

That's the physical address for the device.  The 3.2.4 indicates
that you're on port 3 of the root hub, then port 2 of the first hub,
and port 4 of the second hub.

You could also just use the existing /dev/input/by-path links, which
are similar.

> I know that
> I can get port information from /proc/bus/usb/devices, but I still run
> into the problem of not having
> a SYSFS attribute (or some other uDev directive) to cross reference
> with that information.

If you want info from /proc/bus/usb/devices, you could have udev run a
script and have that script output variables that udev can use for
matching.

-jim

      reply	other threads:[~2008-07-31 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 16:43 uDev - multiple of same device Chris O'Malley
2008-07-31 17:13 ` Jim Paris [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=20080731171323.GA22057@jim.sh \
    --to=jim@jtan.com \
    --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).