Alan, Thanks for help. I have connected one hub to my port 2 and plugged two memory keys and one floppy drive in the hub, the below is devices file.
------------------------------------------------ root@(none):~# cat /proc/bus/usb/devices T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6 B: Alloc= 0/800 us ( 0%), #Int= 7, #Iso= 0 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 2.04 S: Manufacturer=Linux 2.4.20 ehci-hcd S: Product=PCI device 8086:24cd S: SerialNumber=00:1d.7 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=256ms T: Bus=04 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#= 28 Spd=480 MxCh= 4 D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0409 ProdID=0058 Rev= 1.00 S: Manufacturer=NEC Corporation S: Product=USB2.0 Hub Controller C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 1 Ivl=256ms T: Bus=04 Lev=02 Prnt=28 Port=00 Cnt=01 Dev#= 29 Spd=12 MxCh= 0 <<DEVICE<< D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=08bd ProdID=1100 Rev= 0.00 S: Manufacturer=CITIZEN S: Product=X1DE-USB C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=04 Prot=00 Driver=(none) E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=83(I) Atr=03(Int.) MxPS= 2 Ivl=255ms T: Bus=04 Lev=02 Prnt=28 Port=02 Cnt=02 Dev#= 33 Spd=480 MxCh= 0 <<DEVICE<< D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=08ec ProdID=0015 Rev= 2.00 S: Manufacturer=IBM S: Product=USB 2.0 Memory Key S: SerialNumber=0791C15003B37A39 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 96mA I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms T: Bus=04 Lev=02 Prnt=28 Port=03 Cnt=03 Dev#= 32 Spd=480 MxCh= 0 <<DEVICE<< D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=05dc ProdID=a410 Rev=30.00 S: Manufacturer=LEXAR MEDIA S: Product=JUMPDRIVE SPORT S: SerialNumber=106A1D03113208291104 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=31875us T: Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI Root Hub S: SerialNumber=1860 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI Root Hub S: SerialNumber=1840 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 17/900 us ( 2%), #Int= 1, #Iso= 0 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=0000 ProdID=0000 Rev= 0.00 S: Product=USB UHCI Root Hub S: SerialNumber=1820 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=6666 ProdID=3150 Rev= 2.41 S: Product= printer, firmware version 2.41 S: SerialNumber=serial number yyyyyyy C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA I: If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=01 Prot=02 Driver=printer E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=07(O) Atr=03(Int.) MxPS= 64 Ivl=50ms E: Ad=85(I) Atr=03(Int.) MxPS= 8 Ivl=50ms ------------------------------------------------ The above device file does not clearly lists of port, I was expecting the port = 2 of all three device marked as "<<<< DEVICE <<<" Thanks, -----Original Message----- From: Alan Stern [mailto:[EMAIL PROTECTED] Sent: Friday, August 26, 2005 4:41 PM To: Singh, Brijeshkumar Cc: [email protected] Subject: Re: [linux-usb-devel] how to get usb port number 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
