Naming persistence of USB devices
I'm currently working on a design for a Linux based mobile. In my design I am using a number of optical USB mice (all the same manufacture and model) for linear displacement sensors as well as more then a couple USB or 1394 cameras (also all the same manufacture and model) for machine vision. One thing I am concerned about is the persistence device naming.
I assume there is no danger of the devices exchanging names through reboots as long as they stay plugged into the same ports on the same hub on the same root hub. What if I change any of this? What if I move the tree (I don't know the official USB term) of devices (hubs and peripherals) from one root hub to another? Upon reenumeration will the /dev names change? What if I have a device plugged into a hub, power down and for whatever reason when I reattach the device I plug it into a different port, what if that port is on a different hub or root hub?
If anyone can point me to a document explaining the fundamentals of USB and 1394 enumeration I would appreciate it. My single biggest question is how does a device get it's /dev name, is it based off some world unique device number (like Ethernet MAC addresses) or maybe the Linux scans the first USB adapter/bridge it comes across on the PCI bus then follows some convention for the devices connected to hubs downstream.
--adam
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 3 lines
I assume there is no danger of the devices exchanging names through reboots as long as they stay plugged into the same ports on the same hub on the same root
Probing order on boot is deterministic. But nevertheless, device numbers may still change if a device fails to enumerate.
Quoted 2 lines
hub. What if I change any of this? What if I move the tree (I don't know the official USB term) of devices (hubs and peripherals) from one root hub to
Should be safe.
Quoted 7 lines
another? Upon reenumeration will the /dev names change? What if I have a device plugged into a hub, power down and for whatever reason when I reattach the device I plug it into a different port, what if that port is on a different hub or root hub?
If anyone can point me to a document explaining the fundamentals of USB and 1394 enumeration I would appreciate it. My single biggest question is how does a
The kernel hands out device numbers strictly in order of discovery.
Quoted 4 lines
device get it's /dev name, is it based off some world unique device number (like Ethernet MAC addresses) or maybe the Linux scans the first USB adapter/bridge it comes across on the PCI bus then follows some convention for the devices connected to hubs downstream.
The latter. USB devices in most cases lack any unique identifier. You have a choice between naming based on topology or naming in discovery order. You can use udev to implement either policy.
HTH
Oliver
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel