[ale] USB port identification

Alex Carver agcarver+ale at acarver.net
Thu Nov 19 12:26:06 EST 2015


On 2015-11-19 09:17, Chris Fowler wrote:
>> From: "Alex Carver" <agcarver+ale at acarver.net>
>> To: ale at ale.org
>> Sent: Thursday, November 19, 2015 11:51:03 AM
>> Subject: Re: [ale] USB port identification
> 
>> Ok, then use lsusb or the system log to find the serial number for each
>> device and add that as an additional uniqueness parameter in a udev
>> rule. Barring that, look at the kernel device tree which will show the
>> physical layout as something like:
> 
>> /devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4.5
> 
>> Which would be port five on a hub attached to bus 1, port 4.
> 
> Beyond the USB->Serial adapters, I have 200 USB modems in my garage all with the serial 1234567. :) 
> 
> I need to investigate the tree. Does port 4 = the device # 

No, the port is the port regardless of the sequential device number.
Pull it out and plug it back in and the device number might increment
but the port will stay the same.

> 
> I think one thing causing me issue is the Hub. This "hub" does not exist outside this device. 
> 
> [root at localhost]# lsusb -t 
> Bus# 4 
> `-Dev# 1 Vendor 0x1d6b Product 0x0002 
> Bus# 3 
> `-Dev# 1 Vendor 0x1d6b Product 0x0003 
> |-Dev# 2 Vendor 0x15d9 Product 0x0a37 
> `-Dev# 3 Vendor 0x0572 Product 0x1340 
> Bus# 2 
> `-Dev# 1 Vendor 0x1d6b Product 0x0003 
> Bus# 1 
> `-Dev# 1 Vendor 0x1d6b Product 0x0002 
> `-Dev# 2 Vendor 0x8087 Product 0x07e6 
> `-Dev# 3 Vendor 0x1a40 Product 0x0101 
> `-Dev# 5 Vendor 0x148f Product 0x5370 
> 
> This device: 
> Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter 
> 
> Is here: 
> /sys/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.4/1-1.4.2 
> 
> 1-1: Intel device 
> 1-1.4: Terminus Hub 
> 1-1.4.2: The Ralink 
> 
> Intel is the controller. Manufacturer is using a hub to provide 4 USB ports to one controller. usb1 is the Linux controller. 


1-1 is the root hub on bus 1.
1-1.4  is the fourth physical port on the root hub.  Your Terminus is
plugged in there.

1-1.4.2 is the second physical port on the Terminus hub.  The Ralink is
plugged in there.



More information about the Ale mailing list