Re: Location of HUB USB Report Descriptors?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, February 14, 2019 9:42 am, Greg KH wrote:

> That's because Android is using toybox's version of 'lsusb'.  I
> recommend using the real version if you need this information.

I would if I could, I do not control the BSP for this hardware :-(

>> I have found the 'descriptors' file for the USB device under the '/sys'
>>  interface, however this does not appear to contain the HUB specific
>> details.
>
> Really?  It should, why does it not contain that information?  That's a
> binary file that lists the USB descriptor information.  You are going to
> have to "parse it by hand".

Attached is a snap-shot of a (random) hub on Desktop linux.

The 'HUB descriptor' is not contained within the 'descriptors' file from
the '/sys' interface, although I suspect that it can be accessed via
_another_ file within '/sys'.... hopefully someone can point me at it.

Decoding is not hard with the power of the interwebs:
https://eleccelerator.com/usbdescreqparser/


The 'descriptors' file from my suspect device (on Android) was attached to
original post.

Thanks,
Simon.
root@smart:/sys/bus/usb/devices/usb1/1-1/1-1.1# cat idProduct 
0605

root@smart:/sys/bus/usb/devices/usb1/1-1/1-1.1# lsusb
Bus 002 Device 003: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub <-------------- this device
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 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 003 Device 002: ID 046d:c31c Logitech, Inc. Keyboard K120
Bus 003 Device 004: ID 18a5:0302 Verbatim, Ltd Flash Drive
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@smart:/sys/bus/usb/devices/usb1/1-1/1-1.1# hexdump -C descriptors 
00000000  12 01 00 02 09 00 01 40  e3 05 05 06 0b 06 00 01  |.......@........|
00000010  00 01 09 02 19 00 01 01  00 e0 32 09 04 00 00 01  |..........2.....|
00000020  09 00 00 00 07 05 81 03  01 00 0c                 |...........|
0000002b
root@smart:/sys/bus/usb/devices/usb1/1-1/1-1.1# lsusb -vv
...
Bus 001 Device 004: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub
Device Descriptor: <----------------------------- this is in the 'descriptors' file
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x05e3 Genesys Logic, Inc.
  idProduct          0x0605 USB 2.0 Hub
  bcdDevice            6.0b
  iManufacturer           0 
  iProduct                1 USB2.0 Hub
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:		<--------------------------- this does NOT appear in 'descriptors'.
  bLength               9
  bDescriptorType      41
  nNbrPorts             4
  wHubCharacteristic 0x00e0
    Ganged power switching
    Ganged overcurrent protection
    TT think time 32 FS bits
    Port indicators
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered
...


Decode 'descriptors' via the interwebs...
https://eleccelerator.com/usbdescreqparser/


0x12,        // bLength
0x01,        // bDescriptorType (Device)
0x00, 0x02,  // bcdUSB 2.00
0x09,        // bDeviceClass (Hub)
0x00,        // bDeviceSubClass 
0x01,        // bDeviceProtocol (High Speed Hub with single TT)
0x40,        // bMaxPacketSize0 64
0xE3, 0x05,  // idVendor 0x05E3
0x05, 0x06,  // idProduct 0x0605
0x0B, 0x06,  // bcdDevice 12.11
0x00,        // iManufacturer (String Index)
0x01,        // iProduct (String Index)
0x00,        // iSerialNumber (String Index)
0x01,        // bNumConfigurations 1

0x09,        // bLength
0x02,        // bDescriptorType (Configuration)
0x19, 0x00,  // wTotalLength 25
0x01,        // bNumInterfaces 1
0x01,        // bConfigurationValue
0x00,        // iConfiguration (String Index)
0xE0,        // bmAttributes Remote Wakeup, Self Powered
0x32,        // bMaxPower 100mA

0x09,        // bLength
0x04,        // bDescriptorType (Interface)
0x00,        // bInterfaceNumber 0
0x00,        // bAlternateSetting
0x01,        // bNumEndpoints 1
0x09,        // bInterfaceClass
0x00,        // bInterfaceSubClass
0x00,        // bInterfaceProtocol
0x00,        // iInterface (String Index)

0x07,        // bLength
0x05,        // bDescriptorType (Endpoint)
0x81,        // bEndpointAddress (IN/D2H)
0x03,        // bmAttributes (Interrupt)
0x01, 0x00,  // wMaxPacketSize 1
0x0C,        // bInterval 12 (unit depends on device speed)

// 43 bytes

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux