[libhid-discuss] Broken pipe error in hid_prepare_hid_descriptor

Wesley wrevens at aminocom.com
Wed Nov 1 12:03:01 CET 2006


Hi,

I am currently trying to get libhid running on my machine and keep 
hitting a broken pipe error when trying to retrieve the HID descriptor 
of my USB device.

the lsusb -vvv output for my device is as follows:

Bus 003 Device 007: ID 0885:5753
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0885
  idProduct          0x5753
  bcdDevice            0.01
  iManufacturer           1
  iProduct                2
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           73
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              3 Keyboard
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          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            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              10
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              10
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              4 Control
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      32
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval             100
      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              10
Device Status:     0x0001
  Self Powered

I have blacklisted the HID device from the kernel driver and then run 
test_libhid. When hid_force_open calls hid_prepare_hid_descriptor, the 
usb_control_msg call in hid_prepare_hid_descriptor returns a broken pipe 
error an extract from the output when test_libhid is run is as follows:

NOTICE: hid_find_usb_device(): found a matching USB device 001/002[0].

  TRACE: hid_open(): claiming USB device 001/002[0].

 NOTICE: hid_open(): successfully claimed USB device 001/002[0].

  TRACE: hid_init_parser(): initialising the HID parser for USB Device 
001/002[0]...

  TRACE: hid_init_parser(): allocating space for HIDData structure...
  TRACE: hid_init_parser(): successfully allocated memory for HIDData 
strcture.
  TRACE: hid_init_parser(): allocating space for HIDParser structure...
  TRACE: hid_init_parser(): successfully allocated memory for HIDParser 
strcture.
 NOTICE: hid_init_parser(): successfully initialised the HID parser for 
USB Device 001/002[0].

  TRACE: hid_prepare_hid_descriptor(): initialising the HID descriptor 
for USB device 001/002[0]...
  TRACE: hid_prepare_hid_descriptor(): retrieving HID descriptor for USB 
device 001/002[0]...
USB error: error sending control message: Broken pipe
WARNING: hid_prepare_hid_descriptor(): failed to get HID descriptor for 
USB device 001/002[0] len was -32
  TRACE: hid_close(): closing USB device 001/002[0]...

  TRACE: hid_close(): closing handle of USB device 001/002[0]...

 NOTICE: hid_close(): successfully closed USB device 001/002[0].

  TRACE: hid_reset_parser(): resetting the HID parser for USB device 
001/002[0]...

  TRACE: hid_close(): freeing memory allocated for HID parser...
  TRACE: hid_close(): resetting HIDInterface...
hid_force_open failed with return code 13

Any ideas?

Thanks in advance

Wesley Revens









More information about the libhid-discuss mailing list