Proc file system USB part information output

Source: Internet
Author: User

Http://blog.csdn.net/workingon/archive/2005/08/31/468684.aspx

 

/Proc/bus/USB file system output
====================================
(Version 200000008.15)

/USB devices in the proc file system
/Proc/bus/USB/drivers and/proc/bus/USB/devices.

/Proc/bus/USB/drivers list registered drivers,
One driver per line. If possible, the range of the node number of each driver's USB sub-device is given.

** Note **: If/proc/bus/USB is empty, mount the file system as a root user:
Mount-T usbdevfs NONE/proc/bus/USB

Or add
None/proc/bus/USB usbdevfs defaults 0 0
This will automatically mount USB devfs upon each restart.
You can use 'cat/proc/bus/USB/devices' to view the USB device information.

For more information about mounting USB, see section "USB device filesystem" in the USB guide.
Latest copy see http://www.linux-usb.org/

In/proc/bus/USB/devices, each device has multiple lines of ASCII output.
If the Helper Program is used, the first four columns of the "T:" line can be used to create a USB topology (topology information:
Ev, prnt, port, CNT)

Each line is identified by a character ID:

T = topology (etc .)
B = bandwidth (used only for the USB host controller, which is virtualized as root hubs)
D = device description.
P = product ID.
S = string description.
C = configuration description (* = activity configuration)
I = interface description.
E = endpoint description.

========================================================== ====================================

/Proc/bus/USB/devices output format:

Legend:
D = decimal number (starting with spaces or 0's)
X = hexadecimal number (starting with spaces or 0's)
S = string

Topology Information:

T: Bus = dd lev= dd prnt = DD Port = dd CNT = dd Dev # = ddd spd = DDD mxch = dd
| |__ Maxchildren (most on subnodes)
| |__ Device speed in Mbps (device speed, in Mbps)
| |__ Devicenumber (device number)
| |__ Count of devices at this level (number of devices at this level)
| |__ Connector/port on parent for this device (the interface of this device on the parent node)
| |__ Parent devicenumber (parent device number)
| |__ Level in topology for this bus (the topological hierarchy of this bus)
| |__ Bus number (bus number)
|__ Topology info tag (topology information identifier)

Bandwidth information:
B: alloc = DDD/DDD us (XX %), # Int = DDD, # ISO = ddd
| |__ Number if isochronous requests (synchronous request number)
| |__ Number of Interrupt requests (interrupt request number)
| |__ Total bandwidth allocated to this bus (total bandwidth allocated to this bus)
|__ Bandwidth info tag (bandwidth information identifier)

Device description and product ID:

D: ver = x. xx cls = XX (s) sub = XX prot = XX mxps = dd # cfgs = dd
P: vendor = XXXX prodid = xxxx rev = xx. xx

Where
D: ver = x. xx cls = XX (sssss) sub = XX prot = XX mxps = dd # cfgs = dd
| |__ Numberconfigurations (number of configurations)
| |__ Maxpacketsize of default endpoint (maximum package size of the default endpoint)
| |__ Deviceprotocol (device Protocol)
|||__ Devicesubclass (device subclass)
| |__ Deviceclass (device class)
| |__ Device USB Version (the USB Version of the device)
|__ Device info tag #1 (device ID #1)

Where
P: vendor = XXXX prodid = xxxx rev = xx. xx
| |__ Product revision number (product revision number)
| |__ Product ID code (product ID code)
| |__ Vendor ID code (manufacturer ID code)
|__ Device info tag #2 (device ID #2)

String description:

S: Manufacturer = ssss
| |__ Manufacturer of this device as read from the device. (The producer read from the device)
|__ String info tag (character information identifier)

S: Product = ssss
| |__ The product information read from the device, excluding the strings produced by the USB master controller, in the format of "USB * HCI root Hub ".
|__ String info tag (character information identifier)

S: serialnumber = ssss
| |__ The serial number of the device read from the device, removing the strings produced by the USB master controller, representing the master controller
| Unique identifier in the system (currently I/O or memory-mapped base address ).
|__ String info tag (character information identifier)

Configuration description:

C: # ifs = dd CFG # = dd recognition = XX mpwr = dddma
| |__ Maxpower in Ma (maximum power, Ma)
| |__ Attributes (attribute)
| |__ Configurationumber (number of configurations)
| |__ Numberofinterfaces (number of interfaces)
|__ Config info tag (configuration information identifier)

Interface Description (each configuration can be multiple ):

I: If # = dd alt = dd # EPS = dd CLS = XX (sssss) sub = XX prot = XX driver = ssss
| |__ Driver name (driver name)
| |__ Interfaceprotocol (Interface Protocol)
| |__ Interfacesubclass (interface subclass)
| |__ Interfaceclass (Interface Class)
| |__ Numberofendpoints (endpoint)
| |__ Alternatesettingnumber (interface setting number)
| |__ Interfacenumber (interface number)
|__ Interface info tag (Interface Information identifier)

Endpoint description (each interface can be multiple ):

E: ad = XX (s) ASD = XX (SSSS) mxps = dddd IVL = dddms
E: ad = XX (s) ASD = XX (SSSS) mxps = dddd IVL = dddms
| |__ Interval (interval)
| |__ Endpointmaxpacketsize (maximum package size of the endpoint)
| |__ Attributes (endpointtype) (endpoint attribute)
| |__ Endpointaddress (I = In, O = out) (endpoint address)
|__ Endpoint info tag (endpoint information identifier)

========================================================== ====================================
If you are only interested in the topology information, you can use: "grep ^ t:/proc/bus/USB/devices" to display only the topology lines.
Command line: "grep-I ^ [TDP]:/proc/bus/USB/devices" can be used to display only the rows starting with TDP.

For example, the system has a uhci root hub, an external hub is connected to the root hub, and a mouse and a serial converter are connected to the hub.

T: Bus = 00 lev= 00 prnt = 00 Port = 00 CNT = 00 Dev # = 1 Spd = 12 mxch = 2
B: alloc = 28/900 us (3%), # Int = 2, # 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 = dce0
C: * # ifs = 1 CFG # = 1 ASD = 40 mxpwr = 0mA
I: If # = 0 alt = 0 # EPS = 1 CLS = 09 (hub) sub = 00 prot = 00 driver = Hub
E: ad = 81 (I) ASD = 03 (Int.) mxps = 8 IVL = 255 Ms
T: Bus = 00 lev= 01 prnt = 01 port = 00 CNT = 01 Dev # = 2 SPD = 12 mxch = 4
D: ver = 1.00 CLS = 09 (hub) sub = 00 prot = 00 mxps = 8 # cfgs = 1
P: vendor = 0451 prodid = 1446 REV = 1.00
C: * # ifs = 1 CFG # = 1 ASD = E0 mxpwr = 100mA
I: If # = 0 alt = 0 # EPS = 1 CLS = 09 (hub) sub = 00 prot = 00 driver = Hub
E: ad = 81 (I) ASD = 03 (Int.) mxps = 1 IVL = 255 Ms
T: Bus = 00 lev= 02 prnt = 02 Port = 00 CNT = 01 Dev # = 3 Spd = 1.5 mxch = 0
D: ver = 1.00 CLS = 00 (> IFC) sub = 00 prot = 00 mxps = 8 # cfgs = 1
P: vendor = 04b4 prodid = 0001 REV = 0.00
C: * # ifs = 1 CFG # = 1 ASD = 80 mxpwr = 100mA
I: If # = 0 alt = 0 # EPS = 1 CLS = 03 (HID) sub = 01 prot = 02 driver = mouse
E: ad = 81 (I) ASD = 03 (Int.) mxps = 3 IVL = 10 ms
T: Bus = 00 lev= 02 prnt = 02 Port = 02 CNT = 02 Dev # = 4 SPD = 12 mxch = 0
D: ver = 1.00 CLS = 00 (> IFC) sub = 00 prot = 00 mxps = 8 # cfgs = 1
P: vendor = 0565 prodid = 0001 REV = 1.08
S: Manufacturer = peracom Networks, Inc.
S: Product = peracom USB to serial Converter
C: * # ifs = 1 CFG # = 1 xcode = A0 mxpwr = 100mA
I: If # = 0 alt = 0 # EPS = 3 CLs = 00 (> IFC) sub = 00 prot = 00 driver = serial
E: ad = 81 (I) xcode = 02 (bulk) mxps = 64 IVL = 16 Ms
E: ad = 01 (o) xcode = 02 (bulk) mxps = 16 IVL = 16 Ms
E: ad = 82 (I) ASD = 03 (Int.) mxps = 8 IVL = 8 ms

Select only "T:" and "I:" rows:

T: Bus = 00 lev= 00 prnt = 00 Port = 00 CNT = 00 Dev # = 1 Spd = 12 mxch = 2
T: Bus = 00 lev= 01 prnt = 01 port = 00 CNT = 01 Dev # = 2 SPD = 12 mxch = 4
I: If # = 0 alt = 0 # EPS = 1 CLS = 09 (hub) sub = 00 prot = 00 driver = Hub
T: Bus = 00 lev= 02 prnt = 02 Port = 00 CNT = 01 Dev # = 3 Spd = 1.5 mxch = 0
I: If # = 0 alt = 0 # EPS = 1 CLS = 03 (HID) sub = 01 prot = 02 driver = mouse
T: Bus = 00 lev= 02 prnt = 02 Port = 02 CNT = 02 Dev # = 4 SPD = 12 mxch = 0
I: If # = 0 alt = 0 # EPS = 3 CLs = 00 (> IFC) sub = 00 prot = 00 driver = serial

It should be physically like this (or can be changed ):

+ ------------------ +
| PC/root_hub (12) | Dev # = 1
+ ---------------- + (NN) is Mbps.
Level 0 | cn.0 | CN.1 | [CN = connector/port #]
+ ------------------ +
/
/
+ ----------------------- +
Level 1 | Dev #2: 4-port hub (12) |
+ ----------------------- +
| Cn.0 | CN.1 | CN.2 | CN.3 |
+ ----------------------- +
//____________________
/_____/
//
+ -------------------- + ---------------------- +
Level 2 | Dev #3: mouse (1.5) | Dev #4: Serial (12) |
+ -------------------- + ---------------------- +

 

In a tree structure (ports [connectors] with no actual connection are omitted ):

PC: Dev #1, root hub, 2 ports, 12 Mbps
| _ Cn.0: Dev #2, Hub, 4 ports, 12 Mbps
| _ Cn.0: Dev #3, rat, 1.5 Mbps
| _ CN.1:
| _ CN.2: Dev #4, serial, 12 Mbps
| _ CN.3:
| _ CN.1:

 

In addition, USB devices are classified

The USB slave device category can be obtained from the binterfaceclass corresponding to the USB interface Descriptor (standard interface descriptor.
The typical code of binterfaceclass is 1, 2, 3, 6, 7, 8, 9, 10, and 11,255. 1-audio indicates an audio device. 2-communication device: communication device, such as phone number and moden. 3-hid: A Human-Computer Interaction device, such as a keyboard or mouse. 6-Image devices, such as scanners and cameras, can be classified into digital cameras. 7-printer type. Such as unidirectional and bidirectional printers. 8-Mass Storage massive storage class. All features with certain storage functions can be classified into this category. For example, most digital cameras belong to this category. 9-hub class. 11-chip card/smart card. 255-Vendor Specific. the manufacturer's custom class is mainly used for some special devices. For example, an interface adapter.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.