~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/Documentation/usb/proc_usb_info.txt

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /proc/bus/usb filesystem output
  2 ===============================
  3 (version 2000.08.15)
  4 
  5 
  6 The /proc filesystem for USB devices generates
  7 /proc/bus/usb/drivers and /proc/bus/usb/devices.
  8 
  9 /proc/bus/usb/drivers lists the registered drivers,
 10 one per line, with each driver's USB minor dev node
 11 number range if applicable.
 12 
 13 **NOTE**: If /proc/bus/usb appears empty, you need
 14           to mount the filesystem, issue the command (as root):
 15 
 16       mount -t usbdevfs none /proc/bus/usb
 17 
 18           An alternative and more permanent method would be to add
 19 
 20       none  /proc/bus/usb  usbdevfs  defaults  0  0
 21 
 22           to /etc/fstab.  This will mount usbdevfs at each reboot.
 23           You can then issue `cat /proc/bus/usb/devices` to extract
 24           USB device information.
 25 
 26 For more information on mounting the usbdevfs file system, see the
 27 "USB Device Filesystem" section of the USB Guide. The latest copy 
 28 of the USB Guide can be found at http://www.linux-usb.org/
 29 
 30 In /proc/bus/usb/devices, each device's output has multiple
 31 lines of ASCII output.
 32 I made it ASCII instead of binary on purpose, so that someone
 33 can obtain some useful data from it without the use of an
 34 auxiliary program.  However, with an auxiliary program, the numbers
 35 in the first 4 columns of each "T:" line (topology info:
 36 Lev, Prnt, Port, Cnt) can be used to build a USB topology diagram.
 37 (I think.  I haven't proved this, but I have tested it with 3
 38 different topo/connections and it looked possible.)
 39 
 40 Each line is tagged with a one-character ID for that line:
 41 
 42 T = Topology (etc.)
 43 B = Bandwidth (applies only to USB host controllers, which are
 44     virtualized as root hubs)
 45 D = Device descriptor info.
 46 P = Product ID info. (from Device descriptor, but they won't fit
 47     together on one line)
 48 S = String descriptors.
 49 C = Configuration descriptor info. (* = active configuration)
 50 I = Interface descriptor info.
 51 E = Endpoint descriptor info.
 52 
 53 =======================================================================
 54 
 55 /proc/bus/usb/devices output format:
 56 
 57 Legend:
 58   d = decimal number (may have leading spaces or 0's)
 59   x = hexadecimal number (may have leading spaces or 0's)
 60   s = string
 61 
 62 
 63 Topology info:
 64 
 65 T:  Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd
 66 |   |      |      |       |       |      |        |       |__MaxChildren
 67 |   |      |      |       |       |      |        |__Device Speed in Mbps
 68 |   |      |      |       |       |      |__DeviceNumber
 69 |   |      |      |       |       |__Count of devices at this level
 70 |   |      |      |       |__Connector/Port on Parent for this device
 71 |   |      |      |__Parent DeviceNumber
 72 |   |      |__Level in topology for this bus
 73 |   |__Bus number
 74 |__Topology info tag
 75 
 76 
 77 Bandwidth info:
 78 B:  Alloc=ddd/ddd us (xx%), #Int=ddd, #Iso=ddd
 79 |   |                       |         |__Number if isochronous requests
 80 |   |                       |__Number of interrupt requests
 81 |   |__Total Bandwidth allocated to this bus
 82 |__Bandwidth info tag
 83 
 84 
 85 Device descriptor info & Product ID info:
 86 
 87 D:  Ver=x.xx Cls=xx(s) Sub=xx Prot=xx MxPS=dd #Cfgs=dd
 88 P:  Vendor=xxxx ProdID=xxxx Rev=xx.xx
 89 
 90 where
 91 D:  Ver=x.xx Cls=xx(sssss) Sub=xx Prot=xx MxPS=dd #Cfgs=dd
 92 |   |        |             |      |       |       |__NumberConfigurations
 93 |   |        |             |      |       |__MaxPacketSize of Default Endpoint
 94 |   |        |             |      |__DeviceProtocol
 95 |   |        |             |__DeviceSubClass
 96 |   |        |__DeviceClass
 97 |   |__Device USB version
 98 |__Device info tag #1
 99 
100 where
101 P:  Vendor=xxxx ProdID=xxxx Rev=xx.xx
102 |   |           |           |__Product revision number
103 |   |           |__Product ID code
104 |   |__Vendor ID code
105 |__Device info tag #2
106 
107 
108 String descriptor info:
109 
110 S:  Manufacturer=ssss
111 |   |__Manufacturer of this device as read from the device.
112 |__String info tag
113 
114 S:  Product=ssss
115 |   |__Product description of this device as read from the device,
116 |      except that it is a generated string for USB host controllers
117 |      (virtual root hubs), in the form "USB *HCI Root Hub".
118 |__String info tag
119 
120 S:  SerialNumber=ssss
121 |   |__Serial Number of this device as read from the device,
122 |      except that it is a generated string for USB host controllers
123 |      (virtual root hubs), and represents the host controller's
124 |      unique identification in the system (currently I/O or
125 |      memory-mapped base address).
126 |__String info tag
127 
128 
129 Configuration descriptor info:
130 
131 C:  #Ifs=dd Cfg#=dd Atr=xx MPwr=dddmA
132 |   |       |       |      |__MaxPower in mA
133 |   |       |       |__Attributes
134 |   |       |__ConfiguratioNumber
135 |   |__NumberOfInterfaces
136 |__Config info tag
137 
138 
139 Interface descriptor info (can be multiple per Config):
140 
141 I:  If#=dd Alt=dd #EPs=dd Cls=xx(sssss) Sub=xx Prot=xx Driver=ssss
142 |   |      |      |       |             |      |       |__Driver name
143 |   |      |      |       |             |      |__InterfaceProtocol
144 |   |      |      |       |             |__InterfaceSubClass
145 |   |      |      |       |__InterfaceClass
146 |   |      |      |__NumberOfEndpoints
147 |   |      |__AlternateSettingNumber
148 |   |__InterfaceNumber
149 |__Interface info tag
150 
151 
152 Endpoint descriptor info (can be multiple per Interface):
153 
154 E:  Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddms
155 E:  Ad=xx(s) Atr=xx(ssss) MxPS=dddd Ivl=dddms
156 |   |        |            |         |__Interval
157 |   |        |            |__EndpointMaxPacketSize
158 |   |        |__Attributes(EndpointType)
159 |   |__EndpointAddress(I=In,O=Out)
160 |__Endpoint info tag
161 
162 =======================================================================
163 
164 
165 If a user or script is interested only in Topology info, for
166 example, use something like "grep ^T: /proc/bus/usb/devices"
167 for only the Topology lines.  A command like
168 "grep -i ^[tdp]: /proc/bus/usb/devices" can be used to list
169 only the lines that begin with the characters in square brackets,
170 where the valid characters are TDPCIE.  With a slightly more able
171 script, it can display any selected lines (for example, only T, D,
172 and P lines) and change their output format.  (The "procusb"
173 Perl script is the beginning of this idea.  It will list only
174 selected lines [selected from TBDPSCIE] or "All" lines from
175 /proc/bus/usb/devices.)
176 
177 The Topology lines can be used to generate a graphic/pictorial
178 of the USB devices on a system's root hub.  (See more below
179 on how to do this.)
180 
181 The Interface lines can be used to determine what driver is
182 being used for each device.
183 
184 The Configuration lines could be used to list maximum power
185 (in milliamps) that a system's USB devices are using.
186 For example, "grep ^C: /proc/bus/usb/devices".
187 
188 
189 Here's an example, from a system which has a UHCI root hub,
190 an external hub connected to the root hub, and a mouse and
191 a serial converter connected to the external hub.
192 
193 T:  Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
194 B:  Alloc= 28/900 us ( 3%), #Int=  2, #Iso=  0
195 D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
196 P:  Vendor=0000 ProdID=0000 Rev= 0.00
197 S:  Product=USB UHCI Root Hub
198 S:  SerialNumber=dce0
199 C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
200 I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
201 E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
202 T:  Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 4
203 D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
204 P:  Vendor=0451 ProdID=1446 Rev= 1.00
205 C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
206 I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
207 E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms
208 T:  Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=1.5 MxCh= 0
209 D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
210 P:  Vendor=04b4 ProdID=0001 Rev= 0.00
211 C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
212 I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=mouse
213 E:  Ad=81(I) Atr=03(Int.) MxPS=   3 Ivl= 10ms
214 T:  Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
215 D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
216 P:  Vendor=0565 ProdID=0001 Rev= 1.08
217 S:  Manufacturer=Peracom Networks, Inc.
218 S:  Product=Peracom USB to Serial Converter
219 C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
220 I:  If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial
221 E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl= 16ms
222 E:  Ad=01(O) Atr=02(Bulk) MxPS=  16 Ivl= 16ms
223 E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=  8ms
224 
225 
226 Selecting only the "T:" and "I:" lines from this (for example, by using
227 "procusb ti"), we have:
228 
229 T:  Bus=00 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
230 T:  Bus=00 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 4
231 I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
232 T:  Bus=00 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=1.5 MxCh= 0
233 I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=mouse
234 T:  Bus=00 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
235 I:  If#= 0 Alt= 0 #EPs= 3 Cls=00(>ifc ) Sub=00 Prot=00 Driver=serial
236 
237 
238 Physically this looks like (or could be converted to):
239 
240                       +------------------+
241                       |  PC/root_hub (12)|   Dev# = 1
242                       +------------------+   (nn) is Mbps.
243     Level 0           |  CN.0   |  CN.1  |   [CN = connector/port #]
244                       +------------------+
245                           /
246                          /
247             +-----------------------+
248   Level 1   | Dev#2: 4-port hub (12)|
249             +-----------------------+
250             |CN.0 |CN.1 |CN.2 |CN.3 |
251             +-----------------------+
252                 \           \____________________
253                  \_____                          \
254                        \                          \
255                +--------------------+      +--------------------+
256   Level 2      | Dev# 3: mouse (1.5)|      | Dev# 4: serial (12)|
257                +--------------------+      +--------------------+
258 
259 
260 
261 Or, in a more tree-like structure (ports [Connectors] without
262 connections could be omitted):
263 
264 PC:  Dev# 1, root hub, 2 ports, 12 Mbps
265 |_ CN.0:  Dev# 2, hub, 4 ports, 12 Mbps
266      |_ CN.0:  Dev #3, mouse, 1.5 Mbps
267      |_ CN.1:
268      |_ CN.2:  Dev #4, serial, 12 Mbps
269      |_ CN.3:
270 |_ CN.1:
271 
272 
273                          ### END ###

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.