USB集线器类特定描述符-集线器类描述符
除过USB标准的描述符外,USB集线器也定义了一个特别的集线器类描述符。
BUSHOUND抓不到该描述符的请求。
USB集线器类描述符的结构体定义如下:
typedef struct _USB_HUB_DESCRIPTOR {
UCHAR bDescriptorLength;
UCHAR bDescriptorType;
UCHAR bNumberOfPorts;
USHORT wHubCharacteristics;
UCHAR bPowerOnToPowerGood;
UCHAR bHubControlCurrent[bNumberOfPorts];
UCHAR bRemoveAndPowerMask[64];
} USB_HUB_DESCRIPTOR, *PUSB_HUB_DESCRIPTOR;
- bDescriptorLength:描述符的总长度。
- bDescriptorType:描述符为类型,固定为0x29.
- bNumberOfPorts:USB集线器支持的下游端口数量。
- wHubCharacteristics:集线器HUB特性,详见后续。
- bPwrOn2PwrGood:从通电正常工作所需的时间,以2ms为单位。
- bHubControlCurrent:集线器正常工作所需的最大电流,以1mA为单位。
DeviceRemovable:指定了各个端口是否可动态移除。0了可移除,1为不可移除。
- BIT0:保留
- BIT1:下游端口1是否可移除。
- BIT2:下游端口2是否可移除。
… - BITn:下游端口n是否可移除。n最大为255。
PortPwrCtrlMask:为了兼容USB1.0所保留字段。各位应全为1,位数应是8的整数倍。
wHubCharacteristics
D1…D0: Logical Power Switching Mode
00: Ganged power switching (all ports’ power atonce)
01: Individual port power switching
1X: Reserved. Used only on 1.0 compliant hubs that implement no power switching
D2: Identifies a Compound Device
0: Hub is not part of a compound device.
1: Hub is part of a compound device.
D4…D3: Over-current Protection Mode
00: Global Over-current Protection. The hub reports over-current as a summation of all ports’ current draw, without a breakdown of individual port over-current status.
01: Individual Port Over-current Protection. The hub reports over-current on a per-port basis.
Each port has an over-current status.
1X: No Over-current Protection. This option is allowed only for bus-powered hubs that do not implement over-current protection.
D6…D5: TT Think TIme
00: TT requires at most 8 FS bit times of inter transaction gap on a full-/low-speed downstream bus.
01: TT requires at most 16 FS bit times.
10: TT requires at most 24 FS bit times.
11: TT requires at most 32 FS bit times.
D7: Port Indicators Supported
0: Port Indicators are not supported on its downstream facing ports and the PORT_INDICATOR request has no effect.
1: Port Indicators are supported on its downstream facing ports and the PORT_INDICATOR request controls the indicators. See Section 11.5.3.
D15…D8: Reserved
USB集线器类描述符示例
------------------- USB Hub Descriptor -----------------
bDescriptorLength : 0x09 (9 bytes)
bDescriptorType : 0x29 (Hub Descriptor)
bNumberOfPorts : 0x04 (4 Ports) Hint: Ports 0 does not exist
wHubCharacteristics : 0x0000
Power switching : Ganged
Compound device : No
Over-current protection : Global
TT Think Time : At most 8 FS bit times
Port Indicators : Not supported
bPowerOnToPowerGood : 0x32 (100 ms)
bHubControlCurrent : 0x64 (100 mA)
DeviceRemovable : 0x00
Bit 0 : 0 (reserved, any value)
Bit 1 : 0 (Device at Port 1 is removable)
Bit 2 : 0 (Device at Port 2 is removable)
Bit 3 : 0 (Device at Port 3 is removable)
Bit 4 : 0 (Device at Port 4 is removable)
Bit 5 : 0 (unused, must be 0)
Bit 6 : 0 (unused, must be 0)
Bit 7 : 0 (unused, must be 0)
PowerControlMask : 0xFF
Data (HexDump) : 09 29 04 00 00 32 64 00 FF .)...2d..
HubIsBusPowered : 0x00 (Self Powered)