On Sat, 7 Jan 2006 [EMAIL PROTECTED] wrote: > How can I exactly know to what physical port I have > connected my device ?, I want something like this if I connect to port 1 I > want to register as /dev/device1...and so on.... > > > > devpath[i] did give me a value but its not consistant, for example, > when device uses EHCI... it gives (1-8) in my 8 port PC, but when it > uses UHCI... it is detected as 1-2, 1-2 and so...on, what should I do ?
The numbers you see in devpath refer not to the physical ports in the PC case, but to electronic connector pins on the USB controller chips. The kernel has no way to know which physical ports are wired to which controller pins (it has no way to refer to the physical ports at all). And in fact, one physcial port can be connected to two different controller pins -- one on the EHCI controller and one on a UHCI controller, as you saw. The first number in the devpath string indicates which USB controller a device is attached to. Unfortunately the controller numbers themselves aren't consistent over time; they will vary according to the order in which the USB host controller drivers are loaded. How you should cope with this depends on what you want to accomplish. The kernel does not store the information telling which UHCI pins and which EHCI pins are wired to the same ports, so you'll have to find out yourself by experimenting. Alan Stern ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
