usb hub区分端口 USB 子系统拓扑浅析
USB ID Database VendorID and ProductID
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: xHCI Host Controller
usb usb1: Manufacturer: Linux 4.19.157 xhci-hcd
usb usb1: SerialNumber: xhci-hcd.0.auto
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usb 1-1: New USB device found, idVendor=0451, idProduct=8142, bcdDevice= 1.00
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=1
usb 1-1: SerialNumber: 3E000079C0A6
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.1: New USB device found, idVendor=0451, idProduct=8027, bcdDevice= 1.10
usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=1
usb 1-1.1: SerialNumber: F30100617AAF
hub 1-1.1:1.0: USB hub found
hub 1-1.1:1.0: 2 ports detected
usb 1-1.2: New USB device found, idVendor=0424, idProduct=9e00, bcdDevice= 2.00
usb 1-1.2: Product: USB 2.0 Fast Ethernet Adapter
usb1 是 USB Host Controller 直接控制的 roothub, roothub 是 1 起序的,所以这是第一个 hub;其中 “1-0:1.0”中的 “1-0”表示的是第 1 个 hub(即usb1)的第 0 号端口,但实际上 hub 的 port 编号是从 1 开始, 0 号 port 就是指 hub 自身。而 “:” 后面的 “1.0” 对应的语法格式是 “configID:interfaceID”,当检测到连在 roothub(usb1) 上的另一个新设备 “1-1”。 它连在 roothub 的第 2 个 port 上,编号从 1 开始。
idVendor(vid): 厂商ID
idProduct(pid): 产品ID
bcdDevice: 设备版本号
iManufacturer: 描述厂商的字符串索引
iProduct: 描述产品的字符串索引
iSerialNumber: 产品序列号字符串的索引
usb拓扑图
---------------------------------------+------------------------------ platform bus
|
/-----------------
| Host Controller | (usb1), which contains a roothub (1-0)
-----------------/ the roothub has only one downstream port
|
---------------------------------------+------------------------------ usb bus (level 1)
|
/---------
| 1-1 | hub (1-1), has 4 ports
---------/
|
-----------------+----------------+---------------------+-------+----- usb bus (level 2)
| | | |
/--------- | | |
| 1-1.1 | Fast Ethernet Adapter(1-1.2) 1-1.3 1.1.4
---------/
|
----------+-------------+------------------------------------------- usb bus (level 3)
| |
| |
那其实我们注意到hub的root必须是Host,之前在项目上就遇到过识别到client的情况下,我们的usb3803进入hub mode而导致usb口在电脑上无法识别于工作,正常应该是要bypass mode
hub的root需要usb Host Controller,常见的就是
(1)UHCI: Universal Host Controller Interface (通用主机控制接口, USB1.0/1.1),主要是因特尔自家芯片组
(2)OHCI: Open Host Controller Interface (开放主机控制接口,USB1.0/1.1),其他厂商的nvidia等使用
(3)EHCI: Enhanced Host Controller Interface (用于USB2.0高速设备的“增强主机控制接口”)
(4)XHCI: EXtensible Host Controller Interface,(用于USB3.0的接口标准), xHCI支持所有种类速度的USB设备(USB 3.0 SuperSpeed, USB 2.0 Low-, Full-, and High-speed, USB 1.1 Low- and Full-speed)。xHCI的目的是为了替换前面3中(UHCI/OHCI/EHCI)