Re: usbfs, claiming entire usb devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 4 May 2009, Hal Murray wrote:

> Would somebody please say a bit more about this area.  What "number" space 
> are we discussing?
> 
> Do ports get renumbered on booting because of timing issues (race 
> conditions)?  I guess I would expect that if a system had 2 USB host 
> controllers./hubs on a PCI bus with one type X gizmo on each USB bus.

Ports on a particular hub don't get renumbered.  The same port will
always be number 1, for example.

However the hub's name ultimately derives from the bus it is attached 
to, and buses _can_ get renumbered.  The numbering depends on when the 
controllers are discovered and registered, and that in turns depends on 
the order in which drivers are loaded.

Even when you don't rely on bus numbers but instead use the name of the
bus's controller, you aren't guaranteed that everything will remain
constant.  As Greg mentioned, on some machines the PCI identifiers for
USB controllers can change from one boot to another.

> Another possibility is that things get assigned numbers in the order they are 
> plugged in and then get a new set of numbers based on probe order when the 
> system is rebooted.

USB devices do get assigned numbers in the order they are plugged in.  
If you are trying to be safe you will avoid using those numbers as much 
as possible and instead use an inherent characteristic of the device 
for identification, such as its serial number string.

> I have a box with several serial (GPS) things.  I had troubles until I added 
> things like the following to udev rules:
>   KERNEL=="ttyUSB*", KERNELS=="5-2:1.0",    MODE="0666", SYMLINK+="gps4"

That's sort of okay, but the "5" in "5-2:1.0" is subject to change.  
So is the "2", if you plug the GPS thing into a different port.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux