[libhid-discuss] libhid USB error: error sending control message: Protocol error

Charles Lepple clepple at ghz.cc
Sun Mar 11 16:32:20 CET 2007


On Mar 11, 2007, at 11:36 AM, hatmakers wrote:

> My code (this run) had hid_set_usb_debug(4);  but I set it to 5...
> I have also exported: USB_DEBUG=6 which I think is over writing
> this anyway... The results are the same.  (I just didnt paste the
> top information before).

I can't remember which overrides which, but you're right, USB_DEBUG  
and hid_set_usb_debug() are setting the same variable in libusb.

> I did see in the USB Snoop log from the windows system, (that works)
> there was a reference to an illegal descriptor type, but the usb
> system seems to ignore and continue on windows.
> From the windows box:
>
> [41 ms] UsbSnoop - DispatchAny(f0b90610) :  
> IRP_MJ_INTERNAL_DEVICE_CONTROL
> [41 ms] UsbSnoop - MyDispatchInternalIOCTL(f0b91e80) : fdo=8558fde8,
> Irp=862e0a10, IRQL=0
> [41 ms]  >>>  URB 6 going down  >>>
> -- URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE:
>   TransferBufferLength = 0000006f
>   TransferBuffer       = 85d158d8
>   TransferBufferMDL    = 00000000
>   Index                = 00000000
>   DescriptorType       = 00000022 (<illegal descriptor type!>)

Maybe an older version of usbsnoop? 0x22 = 34, which is the correct  
number for a HID report descriptor.

>> Can you send the relevant
>> portion of /proc/bus/usb/devices, and try re-running 'lsusb -vvv' as
>> root?
>
> T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 23 Spd=12  MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs=  1
> P:  Vendor=0925 ProdID=1299 Rev= 0.01
> S:  Manufacturer=Microchip Technology Inc.
> S:  Product=USB Comlete Generic HID
> C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)

With "Driver=(none)" as seen above, "lsusb -vvv" should try to  
retrieve the report descriptor. There is usually an error specific to  
the report descriptor retrieval process, but maybe it is masked by  
the other two errors from lsusb.

> This lsusb -vvv was done as root but I reran again
> to make sure, this produced the same results...
>
> root at localhost input]# id
> uid=0(root) gid=0(root)
> groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
> context=root:system_r:unconfined_t
> [root at localhost input]# /sbin/lsusb -d 0x0925:0x1299 -vvv
>
> Bus 001 Device 023: ID 0925:1299 Lakeview Research
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               2.00
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0        16
>   idVendor           0x0925 Lakeview Research
>   idProduct          0x1299
>   bcdDevice            0.01
>   iManufacturer           1
>   iProduct                2
>   iSerial                 0
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           41
>     bNumInterfaces          1
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0xa0
>       Remote Wakeup
>     MaxPower              100mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass         3 Human Interface Devices
>       bInterfaceSubClass      0 No Subclass
>       bInterfaceProtocol      0 None
>       iInterface              0
>         HID Device Descriptor:
>           bLength                 9
>           bDescriptorType        33
>           bcdHID               1.01
>           bCountryCode            0 Not supported
>           bNumDescriptors         1
>           bDescriptorType        34 Report
>           wDescriptorLength      47

This is the point where the report descriptor should be retrieved, e.g.:

         HID Device Descriptor:
           bLength                 9
           bDescriptorType        33
           bcdHID               1.00
           bCountryCode            0 Not supported
           bNumDescriptors         1
           bDescriptorType        34 Report
           wDescriptorLength     197
           Report Descriptor: (length is 197)
             Item(Global): Usage Page, data= [ 0x80 ] 128
                             USB Monitor

The "protocol error" means that no response was received from your  
device.

-- 
Charles Lepple
clepple at ghz.cc





More information about the libhid-discuss mailing list