zoukankan      html  css  js  c++  java
  • usb topology分析

    在linux doc的proc_usb_info.txt 中:

    /proc/bus/usb/devices 中T = Topology (etc.)开头的行可以分析拓扑

    Topology info:

    T:  Bus=dd Lev=dd Prnt=dd Port=dd Cnt=dd Dev#=ddd Spd=ddd MxCh=dd
    |   |      |      |       |       |      |        |       |__MaxChildren
    |   |      |      |       |       |      |        |__Device Speed in Mbps
    |   |      |      |       |       |      |__DeviceNumber
    |   |      |      |       |       |__Count of devices at this level
    |   |      |      |       |__Connector/Port on Parent for this device
    |   |      |      |__Parent DeviceNumber
    |   |      |__Level in topology for this bus
    |   |__Bus number
    |__Topology info tag

        Speed may be:
            1.5    Mbit/s for low speed USB
        12    Mbit/s for full speed USB
        480    Mbit/s for high speed USB (added for USB 2.0)

    例子:

    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

    Physically this looks like (or could be converted to):

                          +------------------+
                          |  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)|
                   +--------------------+      +--------------------+

    Or, in a more tree-like structure (ports [Connectors] without
    connections could be omitted):

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

                             ### END ###

  • 相关阅读:
    关于如何使`(a === 1 && a === 2 && a === 3)`返回`true`问题的思考
    选择适合的类型判断方式
    this的指向问题
    MarkDown基础语法记录
    快速掌握vuex状态管理
    自己如何手动实现一个isNaN的方法
    移动端webapp使用flex布局解决底部导航被手机键盘顶起
    swiper文字内容超出一屏的时候如何实现区域滚动不翻页
    css3动画如何实现停止以后停留在最后一帧动画
    检测任意数据类型
  • 原文地址:https://www.cnblogs.com/cute/p/2024718.html
Copyright © 2011-2022 走看看