title: LibUSB driver issues: timeout
body: <p>I am attempting to write a linux driver for a printer. I have run USBSnoop on windows XP and obtained the log. In this log it sets wMaxPacketSize to 1026. After i set the interface i get the response of 75 bytes. If i set it to 64 (in the lsusb output) i obviously only get 64 bytes back. </p>
  
  <p>My issue is on a bulk transfer to/from the device i get timeouts. I think i have the same problem as here: <a href="http://libusb.6.n5.nabble.com/libusb-bulk-transfer-return-timeout-error-and-transferred-set-to-0-td5712761.html" rel="nofollow">http://libusb.6.n5.nabble.com/libusb-bulk-transfer-return-timeout-error-and-transferred-set-to-0-td5712761.html</a></p>
  
  <p>I performed the libusb_clear_halt() and i get a similar result to the linked post above. Down the bottom of it says "split buffer into 64 bytes manually" to solve it. My question is how to split the packets? This is my first time using LibUSB.</p>
  
  <p>Here is the output of lsusb -v</p>
  
  <pre><code>Bus 002 Device 009: ID 07ce:c000  
  Device Descriptor:
    bLength                18
    bDescriptorType         1
    bcdUSB               2.00
    bDeviceClass            7 Printer
    bDeviceSubClass         1 Printer
    bDeviceProtocol         2 Bidirectional
    bMaxPacketSize0        64
    idVendor           0x07ce 
    idProduct          0xc000 
    bcdDevice            1.00
    iManufacturer           1 COPAL
    iProduct                2 COPAL USB Printer
    iSerial                 0 
    bNumConfigurations      1
    Configuration Descriptor:
      bLength                 9
      bDescriptorType         2
      wTotalLength           32
      bNumInterfaces          1
      bConfigurationValue     1
      iConfiguration          0 
      bmAttributes         0xc0
        Self Powered
      MaxPower              200mA
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass         7 Printer
        bInterfaceSubClass      1 Printer
        bInterfaceProtocol      2 Bidirectional
        iInterface              0 
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x01  EP 1 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               0
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x82  EP 2 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               0
  Device Qualifier (for other device speed):
    bLength                10
    bDescriptorType         6
    bcdUSB               0.00
    bDeviceClass            0 (Defined at Interface level)
    bDeviceSubClass         0 
    bDeviceProtocol         0 
    bMaxPacketSize0         0
    bNumConfigurations      0
  Device Status:     0x0001
    Self Powered
  </code></pre>
  
  <p>Edit: this was in the dmesg</p>
  
  <pre><code>usb 2-1.1: new high-speed USB device number 9 using ehci_hcd
  usb 2-1.1: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
  usb 2-1.1: config 1 interface 0 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 64
  </code></pre>
  
  <p>Edit: I think it may be that linux is getting in the way. On wireshark and i can see the packets come back correctly but not calling my callback function. I already removed the usblp driver. Any ideas? </p>