linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* uDev - multiple of same device
@ 2008-07-31 16:43 Chris O'Malley
  2008-07-31 17:13 ` Jim Paris
  0 siblings, 1 reply; 2+ messages in thread
From: Chris O'Malley @ 2008-07-31 16:43 UTC (permalink / raw)
  To: linux-hotplug

Hi,

I've searched through the hotplug archives and have not found the
answer I am looking for. However, I have a hard time believing that no
one has done what I am trying to do before. My application requires
that 6 of the same USB to PS2 converters appear in /dev/input/ as
mouse[0-5]. I want to use uDev rules to make this happen.

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. 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.

I've also read that HAL might be a better route for accomplishing what
I am trying to do, but it seems like uDev would work just fine with
the right directives.

Thanks in advance for the assistance,
Chris O'Malley

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: uDev - multiple of same device
  2008-07-31 16:43 uDev - multiple of same device Chris O'Malley
@ 2008-07-31 17:13 ` Jim Paris
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Paris @ 2008-07-31 17:13 UTC (permalink / raw)
  To: linux-hotplug

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-31 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-31 16:43 uDev - multiple of same device Chris O'Malley
2008-07-31 17:13 ` Jim Paris

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).