On Fri, 26 Aug 2005, Singh, Brijeshkumar wrote: > Hi, > > My system has three external USB ports and one internal which is always > connected with printer. How I can detected whether the device is > connected on which of the three ports. > > # lsusb > Bus 004 Device 001: ID 0000:0000 > Bus 003 Device 001: ID 0000:0000 > Bus 002 Device 001: ID 0000:0000 > Bus 001 Device 001: ID 0000:0000 > Bus 001 Device 003: ID 6666:3150 Prototype product Vendor ID > > I thought the topology field in /proc/bus/usb/devices file will contain > the port number or the bus number is equivalent to the port number, but > a simple test proves me wrongs. > > Please give me some pointers on how I can retrieve the port number of > connected device.
The port number is indeed reported in the Topology line in /proc/bus/usb/devices. However the value in the "Port=" field is misleading because it is one less than the actual port number. For instance, I have a USB device plugged into port 1 on my computer, and /proc/bus/usb/devices gives a port number of 0: T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 BTW, the bus number is _not_ equivalent to the port number. Alan Stern ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
