Re: lsusb USB descriptor fields byteswapped on BE

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

 



On Tuesday 27 October 2009 22:20:05 Greg KH wrote:
> On Tue, Oct 27, 2009 at 10:00:21PM +0100, Michael Buesch wrote:
> > Hi Greg,
> > 
> > The following fields are byteswapped in lsusb on BigEndian machines:
> > 
> > wTotalLength		(Config descriptor)
> > wMaxPacketSize		(EP descriptor)
> 
> How so?  Can you provide the output of 'lsusb -v' so I can see it?


Here's an example prototype device for which I know what the values must look like.
Other devices look similiar.

wTotalLength 12288 is 0x30 swapped.
wMaxPacketSize 0x4000 is 0x40 swapped.
0x30 and 0x40 would be the correct values. So it certainly is a byteorder issue.

This is lsusb version 0.73 (Debian Lenny stable). I didn't try a newer upstream version.


Bus 003 Device 035: ID 6666:1337 Prototype product Vendor ID 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        16
  idVendor           0x6666 Prototype product Vendor ID
  idProduct          0x1337 
  bcdDevice            0.01
  iManufacturer           1 Michael Buesch
  iProduct                2 PDIUSB test device
  iSerial                 3 1
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength        12288
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 Configuration 1
    bmAttributes         0xc0
      Self Powered
    MaxPower               50mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              5 Interface 1
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      65
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x4000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x4000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x4000  1x 0 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)

-- 
Greetings, Michael.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

  Powered by Linux