11

What does the lsusb output mean?

dodohjk@dodohjk-PC:~$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0c45:62c0 Microdia Sonix USB 2.0 Camera

Especially:

  • Bus ###
  • Device ###
  • Linux Foundation #.#
  • "root hub"

And how about lsusb -t?

dodohjk@dodohjk-Compaq-Presario-CQ60-Notebook-PC:~$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/4p, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci_hcd/3p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/4p, 480M
    |__ Port 1: Dev 3, If 0, Class=stor., Driver=usb-storage, 480M
    |__ Port 2: Dev 2, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
    |__ Port 2: Dev 2, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/3p, 480M

Here I'm curious about:

  • Driver=blabla/4p
  • 12M/480M

2 Answers 2

5

I will only answer some specifics of your question. I started answering more, but it took so long to explain in a good way.

Generally interpreting the output:

Here is the best single source I found for interpreting the output: Interpreting the output of lsusb - Diego Assencio.

Driver= blabla /2p, 3p, 4p, etc.

Note that this text is only there for the nodes in the USB device tree, that have classes either root_hub or hub. It denotes the number of ports that this hub has.

I don't know why this information is printed next to the driver, IMO it belongs next to hub or root_hub, but I guess there is a good reason for that.

12M, 480M, etc.

This is the negotiated speed in Mbits/s. Fx USB 1.0 supports 12Mbit/s and USB 2.0 supports 480Mbit/s. However, when a device is connected, the operating system negotiates a speed with the device. Fx a computer mouse often supports USB 2.0, but still gets the negotiated speed 12Mbit/s.

1

Lets start with lspci | grep USB:

00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 04)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 04)

This shows that my chipset provides 3 USB host controllers as PCI devices, two EHCI compatible and one xHCI. It is not important if they come as PCI or how many there are, it will just clear up what you see with lsusb later.

Now lsusb -tv:

/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/6p, 480M
        ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/10p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 002: Dev 027, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 05e3:0610 Genesys Logic, Inc. Hub
        |__ Port 001: Dev 028, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 046a:0023 CHERRY Keyboard
        |__ Port 001: Dev 028, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 046a:0023 CHERRY Keyboard
    |__ Port 003: Dev 005, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        ID 0bda:0157 Realtek Semiconductor Corp. Mass Storage Device
    |__ Port 010: Dev 029, If 0, Class=Hub, Driver=hub/4p, 480M
        ID 05e3:0610 Genesys Logic, Inc. Hub
        |__ Port 002: Dev 030, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 046d:c077 Logitech, Inc. Mouse
/:  Bus 004.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 002: Dev 007, If 0, Class=Hub, Driver=hub/4p, 5000M
        ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
        |__ Port 004: Dev 010, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            ID 0930:6545 Toshiba Corp. Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick

With the -v option every entry on the USB tree gets an ID line printed below the normal line. Lets focus on the bus lines, taking bus 3 as an example:

/:  Bus 003.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/10p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub

The bus lines are the most confusing, because they contain mostly phony, misleading and some invariant information: On the bus line, you can ignore "Port 001: Dev 001, Class=root_hub", because it is the same for every USB root hub root. Ignore especially the "Port 001"-thing, because a root hub is by definition not in any port itself nor is that related to its own "Port 001" it creates. Also irrelevant is "ID 1d6b:???? Linux Foundation x.x root hub": The driver reports the fake manufacturer ID 0x1d6b (and product ID), because PCI devices (the USB host controller; on my system) do not have USB IDs...

That leaves Driver=xhci_hcd/10p, 480M as relevant information. The /10p means that the hardware supports/reports having 10 ports. The 480M refers to the USB version the bus supports. On root hubs, the USB version is parroted by the fake device ID i.e. "Linux Foundation 2.0 root hub". They will always match, like so:

  • 1.1 is 12M
  • 2.0 is 480M
  • 3.0 is 5000M

The bus number itself comes from driver startup (boot time) iteration (starting with 1). If I remember correctly: there are no real guarantees about which host controller will come first...

Lets see the relation between my USB host controllers and their USB buses:

stat -c%N /sys/bus/usb/devices/usb*

'/sys/bus/usb/devices/usb1' -> '../../../devices/pci0000:00/0000:00:1a.0/usb1'
'/sys/bus/usb/devices/usb2' -> '../../../devices/pci0000:00/0000:00:1d.0/usb2'
'/sys/bus/usb/devices/usb3' -> '../../../devices/pci0000:00/0000:00:14.0/usb3'
'/sys/bus/usb/devices/usb4' -> '../../../devices/pci0000:00/0000:00:14.0/usb4'

Here you can see:

  • the first bus ("usb1") is actually PCI device 0000:00:1a.0, which is reported as "USB EHCI #2", i.e. the host controller considered the second EHCI controller of the chipset
  • the PCI device 0000:00:14.0, the xHCI, created two buses, 3 and 4
    • allow me to add at this stage: xHCI USB 3.0 controllers internally always have a 480M bus for USB 1.1 and USB 2.0 and a bus for USB 3.x (which can not handle devices < 3.0)
    • these two buses also exist physically on all USB plugs/cables capable of 3.0+ (they have additional pins for just that)
    • bus 3, the slower one (480M), is reported with 10 ports, 6 are actually accessible, 1 is used internally for an incorporated memory card reader
    • bus 4, the fast one (5000M), only reports 2 ports, which is why only 2 of the 10 ports can be overlain with USB 3.0 wires (and two of my six visible ports actually do support USB 3.0)

Lets finally come to the "real" USB entries in lsusb -tv. Example:

    |__ Port 002: Dev 007, If 0, Class=Hub, Driver=hub/4p, 5000M
        ID 05e3:0620 Genesys Logic, Inc. GL3523 Hub
        |__ Port 004: Dev 010, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
            ID 0930:6545 Toshiba Corp. Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick

On port 2 (of bus 4) is a real USB hub. This is one of my (legacy) monitors with integrated (non-Type-C) USB hub. The hub-chip is from Genesys Logic, and it actually has 4 accessible ports (the driver reports /4p).

You will regularly encounter real, but internal/integrated USB hubs via lsusb. For example, my bus 1 and 2 (from the two EHCI controllers), even though both have 2 ports each, both have different integrated hubs connected to each port 1. One with 4 ports, one with 6. None of these (4 + 1) + (6 + 1) = 12 ports seem internally used or externally available in my case.

Back to my monitor: on port 4 of its hub is a USB stick. usb-storage driver claimed the device. And it runs on USB 3.0 (5000M). The port numbers are stable unless the driver's source is changed. I.e. no matter what and when something is plugged into that port, it will be port 4. The Dev number, though, a) is local to each bus and b) will be increased by one each time a device is bound. In theory, free numbers could be recycled for the next device to be (re-)registered on that bus, but the USB subsystem doesn't do it that way.

Last thing to mention: if a Dev is listed twice in lsusb -t, like my keyboard, it registers with two interfaces If 0 and If 1 on USB. Still only one device.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .