From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Paris Date: Thu, 31 Jul 2008 17:13:23 +0000 Subject: Re: uDev - multiple of same device Message-Id: <20080731171323.GA22057@jim.sh> List-Id: References: <5652842e0807310943s2666ada8h5202232847a42481@mail.gmail.com> In-Reply-To: <5652842e0807310943s2666ada8h5202232847a42481@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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