• 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 ###

  • 相关阅读:
    【野生程序员】:优先招聘
    C#-面向对象:争议TDD(测试驱动开发)
    培训班的同学,拜托不要把用人单位想得那么傻,好不好?!
    为什么要讲数据结构和算法?以及如何学习数据结构和算法
    关于办技术线下社区的一些思考
    做了十年的程序员,为什么我没有加班
    编程新手如何理解“面向对象”
    .NET程序员不加班——写在《华为工程师猝死,36岁,22月无休》之后
    “6年的程序员还不会写委托”,问题在哪?
    现身说法:37岁老码农找工作
  • 原文地址:https://www.cnblogs.com/cute/p/2024718.html
Copyright © 2020-2023  润新知