项目上发现, 板子如果接hub, hub上挂两个手柄的话, 会发现只有一个手柄能用. 但是同样的hub和手柄在PC上是能正常使用的.
由于手柄是低速设备, 因此需要涉及到 SPLIT INTERRUPT IN 的传输, 这部分需要host的软件对TT以及SSPLIT/CSPLIT进行恰当的处理.
估计是什么地方代码有问题. 检查代码后发现, tt_no_collision 这个函数居然是一个空的return 1. 真是坑人啊.
没有对iTD, SiTD进行处理.
顺便再阅读了usb 2.0 spec中hub那一节里面对TT和SPLIT TRANSACTION的描述. 摘要在这里, 方便随时查阅.
8.4.2.1split transaction
USB defines a special token for split transactions: SPLIT. This is a4 byte token packet compared to other normal 3 byte token packets.
There are two split transactions defined that use the SPLIT special token: a start-split transaction (SSPLIT) and a complete-split transaction(CSPLIT).
A high-speed split transaction is used only between the host controller and a hub when the hub has full-/low-speed devices attached to it.
Split transactions are only defined to be used between the host controller and a hub.
Start split transactions can consist of 2, 3, or 4 packets as determined by the specific transfer type and data direction.
Complete split transactions can consist of 2 or 3 packets as determined by the specific transfer type and data direction.
Figure 8-8 shows an interrupt IN example. Note that in the example,the hub provided the full-/low-speed handshake (ACK in this example) to the
device endpoint before the complete-split, and the complete-split did not provide a high-speed handshake to the hub.
Figure 8-9 shows an interrupt OUT example.