此 xHCI 主机支持的最大设备数量为 32

此 xHCI 主机支持的最大设备数量为 32

我有一台笔记本电脑 E5470,它只有 1 个 USB 控制器。我的用例是添加 USB 外部驱动器。截至目前,我能够在单个控制器上支持超过 32 个设备。

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 5000M
    |__ Port 1: Dev 8, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 2: Dev 10, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 4: Dev 26, If 0, Class=Hub, Driver=hub/4p, 5000M
                |__ Port 3: Dev 35, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 4: Dev 39, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 2: Dev 15, If 0, Class=Hub, Driver=hub/4p, 5000M
                |__ Port 4: Dev 36, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 2: Dev 23, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 3: Dev 29, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 3: Dev 20, If 0, Class=Hub, Driver=hub/4p, 5000M
                |__ Port 3: Dev 38, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 1: Dev 28, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 4: Dev 41, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 2: Dev 34, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 1: Dev 12, If 0, Class=Hub, Driver=hub/4p, 5000M
                |__ Port 1: Dev 17, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 4: Dev 33, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 2: Dev 22, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 3: Dev 27, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 1: Dev 9, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 1: Dev 11, If 0, Class=Hub, Driver=hub/4p, 5000M
                |__ Port 4: Dev 32, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 2: Dev 19, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 3: Dev 25, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 1: Dev 14, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 4: Dev 21, If 0, Class=Hub, Driver=hub/4p, 5000M
                |__ Port 4: Dev 42, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 2: Dev 37, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 3: Dev 40, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 1: Dev 30, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 2: Dev 13, If 0, Class=Hub, Driver=hub/4p, 5000M
                |__ Port 3: Dev 24, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 4: Dev 31, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
                |__ Port 2: Dev 18, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 3: Dev 16, If 0, Class=Hub, Driver=hub/4p, 5000M
    |__ Port 3: Dev 50, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 51, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
        |__ Port 2: Dev 52, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
    |__ Port 4: Dev 53, If 0, Class=Mass Storage, Driver=uas, 5000M

现在,当我通过(更换我的 wifi 卡并放入 m2 至迷你 PCI 适配器,然后添加我自己的迷你 PCI 适配器)添加新的 USB 控制器时,它被分配到总线 4。我得到以下信息(我能够添加一些设备)

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 3: Dev 6, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 4: Dev 19, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 2: Dev 13, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 3: Dev 17, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 1: Dev 10, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 2: Dev 8, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 3: Dev 12, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 1: Dev 5, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 4: Dev 16, If 0, Class=Mass Storage, Driver=uas, 5000M
        |__ Port 4: Dev 9, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 4: Dev 20, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 3: Dev 18, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 1: Dev 15, If 0, Class=Mass Storage, Driver=uas, 5000M
        |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 3: Dev 14, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            |__ Port 1: Dev 7, If 0, Class=Mass Storage, Driver=uas, 5000M
            |__ Port 2: Dev 11, If 0, Class=Mass Storage, Driver=uas, 5000M
    |__ Port 2: Dev 21, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 22, If 0, Class=Hub, Driver=hub/4p, 5000M
            |__ Port 4: Dev 24, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        |__ Port 2: Dev 23, If 0, Class=Hub, Driver=hub/4p, 5000M

现在,当我尝试向总线 4 添加更多 USB 设备时,出现错误。我不明白.. 我的总线 2 USB 控制器比我的总线 4 有更多的设备.. 然而总线 4 抱怨它无法添加更多设备?怎么会?

我期望总线 4 能够容纳与总线 2 相同数量的设备,但它出错了

[  733.095066] xhci_hcd 0000:01:00.0: Error while assigning device slot ID
[  733.095081] xhci_hcd 0000:01:00.0: Max number of devices this xHCI host supports is 32.
[  733.095092] usb 4-2.1-port3: couldn't allocate usb_device

如何找出 Unix 不允许我向控制器添加更多设备的原因?lsusb没有提供更多信息,例如特定控制器的限制是什么。

答案1

你的期望是不正确的。尽管所有 USB XHCI 控制器都提供类似的标准化编程接口,但并非所有 USB XHCI 控制器都是相同的。

您可以在互联网上轻松找到基本的 XHCI 规范。

在第 5.3 章中,从第 380 页开始,描述了主机控制器功能寄存器,它告诉驱动程序 XHCI 控制器的特定实现的功能是什么。 5.3.3 节描述了只读结构参数1寄存器,其中包含该特定控制器可以处理的设备插槽、中断器和端口的最大数量。

您的总线 4 控制器与总线 2 具有不同的 XHCI 硬件实现,因此它们可以处理的最大设备数量显然不同。

命令

lspci -nnvd ::0c03

应打印出足够的信息,以便您识别所使用的确切 XHCI 控制器芯片。如果您不相信我,您可以通过谷歌搜索他们的数据表来确认他们的功能。

相关内容