My USB Hardware

May 27, 2013

My machine

My home machine is a Gigabyte socket 1155 motherboard with an i7 processor. This motherboard has an Intel Z77 chipset, which provides the root hubs for all of the USB. The specifications on the Z77 state that it provides 4 USB 3.0 ports and 10 USB 2.0 ports. The motherboard also contains two VAI VL810 chips. These are 4 port USB 3.0 hubs.

This might be how things are done:

I connect a cable to the first of the USB 2.0 headers to bring two ports to front of the case.
I connect a cable to the second of the USB 3.0 headers to bring two ports to the front of the case.

What does linux "dmesg" tell us?

When I scan through the dmesg output on my linux system, I see the following:

[    0.619373] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.619374] ehci-pci: EHCI PCI platform driver
[    0.619417] ehci-pci 0000:00:1a.0: setting latency timer to 64
[    0.619419] ehci-pci 0000:00:1a.0: EHCI Host Controller
[    0.619447] ehci-pci 0000:00:1a.0: new USB bus registered, assigned bus number 1
[    0.619458] ehci-pci 0000:00:1a.0: debug port 2
[    0.623348] ehci-pci 0000:00:1a.0: cache line size of 64 is not supported
[    0.623358] ehci-pci 0000:00:1a.0: irq 16, io mem 0xf7d37000
[    0.629169] ehci-pci 0000:00:1a.0: USB 2.0 started, EHCI 1.00
[    0.629181] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.629182] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.629183] usb usb1: Product: EHCI Host Controller
[    0.629184] usb usb1: Manufacturer: Linux 3.9.2-200.fc18.x86_64 ehci_hcd
[    0.629185] usb usb1: SerialNumber: 0000:00:1a.0
[    0.629240] hub 1-0:1.0: USB hub found
[    0.629242] hub 1-0:1.0: 2 ports detected

[    0.629336] ehci-pci 0000:00:1d.0: setting latency timer to 64
[    0.629339] ehci-pci 0000:00:1d.0: EHCI Host Controller
[    0.629362] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 2
[    0.629372] ehci-pci 0000:00:1d.0: debug port 2
[    0.633259] ehci-pci 0000:00:1d.0: cache line size of 64 is not supported
[    0.633269] ehci-pci 0000:00:1d.0: irq 23, io mem 0xf7d38000
[    0.639161] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00
[    0.639168] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[    0.639169] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.639170] usb usb2: Product: EHCI Host Controller
[    0.639171] usb usb2: Manufacturer: Linux 3.9.2-200.fc18.x86_64 ehci_hcd
[    0.639172] usb usb2: SerialNumber: 0000:00:1d.0
[    0.639217] hub 2-0:1.0: USB hub found
[    0.639219] hub 2-0:1.0: 2 ports detected

[    0.639273] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.639278] uhci_hcd: USB Universal Host Controller Interface driver
[    0.639331] xhci_hcd 0000:00:14.0: setting latency timer to 64
[    0.639333] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    0.639356] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3
[    0.639425] xhci_hcd 0000:00:14.0: cache line size of 64 is not supported
[    0.639459] xhci_hcd 0000:00:14.0: irq 47 for MSI/MSI-X
[    0.639493] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002
[    0.639494] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.639495] usb usb3: Product: xHCI Host Controller
[    0.639496] usb usb3: Manufacturer: Linux 3.9.2-200.fc18.x86_64 xhci_hcd
[    0.639497] usb usb3: SerialNumber: 0000:00:14.0
[    0.639534] xHCI xhci_add_endpoint called for root hub
[    0.639535] xHCI xhci_check_bandwidth called for root hub
[    0.639545] hub 3-0:1.0: USB hub found
[    0.639550] hub 3-0:1.0: 4 ports detected

[    0.639708] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    0.639729] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 4
[    0.639745] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003
[    0.639746] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.639747] usb usb4: Product: xHCI Host Controller
[    0.639748] usb usb4: Manufacturer: Linux 3.9.2-200.fc18.x86_64 xhci_hcd
[    0.639749] usb usb4: SerialNumber: 0000:00:14.0
[    0.639781] xHCI xhci_add_endpoint called for root hub
[    0.639782] xHCI xhci_check_bandwidth called for root hub
[    0.639792] hub 4-0:1.0: USB hub found
[    0.639797] hub 4-0:1.0: 4 ports detected
I am not sure what to make of the above. First it adds up to only 12 ports. The vendor 0x1d6b is "linux". Product 2 is a USB 2.0 root hub. Product 3 is a USB 3.0 root hub. So, as this stands, this gives me 4 usb "busses" as follows:

What does the "lsusb" command tell us?

I fiddled around a while writing python and ruby scripts using libusb before I realized that the "lsusb" command was doing what I wanted and more.
lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 004 Device 002: ID 2109:0810  
Bus 004 Device 003: ID 2109:0810  
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:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 046d:c501 Logitech, Inc. Cordless Mouse Receiver
The devices that show up in the above are: The Logitech device is correct, that is my wireless mouse. Normally it is the only USB device I have plugged into my system. The Prolific PL2303 is a little usb to serial "dongle" that I am using to plug into various ports to try to map out my system. By plugging it into every port and then typing "lsusb" I am able to figure out what bus each port is connected to: This is quite confusing given that the dmesg scan showed both VIA 4 port hubs on Bus 4. There are 14 ports total. I have probed 10 of them. 8 of the ports should be on the VIA hubs, so something is mixed up somewhere. Perhaps it doesn't matter.

The "lsusb" command has some nice tricks! With the "-t" switch, it gives a nice tree formatted output. There is also a "-v" switch, but it produces a lot more output than I want to insert here.

 lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 3: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
    |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
        |__ Port 5: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

With the -v switch, we get lots of output, and even more if we run the command as root (which allows it to open connections to USB devices). The following is the output for an atmega32u4 device, programmed with a slightly modified version of the LUFA Generic HID Demo. Note that the interface and endpoint descriptors are fully displayed.

Bus 002 Device 006: ID 03eb:204f Atmel Corp. LUFA Generic HID Demo Application
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x03eb Atmel Corp.
  idProduct          0x204f LUFA Generic HID Demo Application
  bcdDevice            0.01
  iManufacturer           1 Tom Trebisky ([email protected])
  iProduct                2 Zap
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      32
          Report Descriptor: (length is 32)
            Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
                            (null)
            Item(Local ): Usage, data= [ 0x01 ] 1
                            (null)
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x03 ] 3
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               5
Device Status:     0x0000
  (Bus Powered)

Feedback? Questions? Drop me a line!

Tom's Computer Info / [email protected]