[Linux-usb-users] Error 84 during reads

2007-11-08 Thread Brad Schick
I have a usb device (lsusb -v below) running custom firmware based on
example code from Atmel . There are two interfaces: 0 is a mass storage
interface with two endpoints, 1 is a custom vendor interface with one
interrupt IN endpoint. The custom interface is used to send data to an
app on the host based on libusb (Ubuntu 2.6.22-14-generic kernel).
Custom commands are sent to the device on the default control endpoint.

When I remove interface 0 (mass storage) in the firmware, the custom
interface works as expected. I can send commands on the default endpoint
and successfully read resulting data on the interrupt IN endpoint.

But when I enable the mass storage IF I can no longer read from the
interrupt endpoint. Each read request returns almost immediately with no
data. This is what reads look like in usbmon's output:

cd5c10c0 2870377317 S Ii:107:03 -115 32 
cd5c10c0 2870424737 C Ii:107:03 -84 0

Error 84 is EILSEQ, and looking around the kernel source seems to mean
protocol error or unplug (although it has various uses). Any ideas why
this might be happening? I've been digging around the firmware code, but
I was hoping someone might have some suggestions.

Bus 002 Device 107: ID 03eb:201e Atmel Corp.
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x03eb Atmel Corp.
  idProduct  0x201e
  bcdDevice   10.00
  iManufacturer   1 ATMEL
  iProduct2 AVR USB HID DEMO
  iSerial 3 1.0.0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   48
bNumInterfaces  2
bConfigurationValue 1
iConfiguration  0
bmAttributes 0x80
  (Bus Powered)
MaxPower  100mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass 8 Mass Storage
  bInterfaceSubClass  6 SCSI
  bInterfaceProtocol 80 Bulk (Zip)
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02  EP 2 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass  0
  bInterfaceProtocol  0
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0020  1x 32 bytes
bInterval  20
Device Status: 0x
  (Bus Powered)


-Brad

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] Error 84 during reads

2007-11-08 Thread Alan Stern
On Thu, 8 Nov 2007, Brad Schick wrote:

 I have a usb device (lsusb -v below) running custom firmware based on
 example code from Atmel . There are two interfaces: 0 is a mass storage
 interface with two endpoints, 1 is a custom vendor interface with one
 interrupt IN endpoint. The custom interface is used to send data to an
 app on the host based on libusb (Ubuntu 2.6.22-14-generic kernel).
 Custom commands are sent to the device on the default control endpoint.
 
 When I remove interface 0 (mass storage) in the firmware, the custom
 interface works as expected. I can send commands on the default endpoint
 and successfully read resulting data on the interrupt IN endpoint.
 
 But when I enable the mass storage IF I can no longer read from the
 interrupt endpoint. Each read request returns almost immediately with no
 data. This is what reads look like in usbmon's output:
 
 cd5c10c0 2870377317 S Ii:107:03 -115 32 
 cd5c10c0 2870424737 C Ii:107:03 -84 0
 
 Error 84 is EILSEQ, and looking around the kernel source seems to mean
 protocol error or unplug (although it has various uses). Any ideas why
 this might be happening? I've been digging around the firmware code, but
 I was hoping someone might have some suggestions.

Perhaps the device doesn't transmit any packets in response to the IN 
packet for the interrupt endpoint.  It should reply with either NAK or 
DATAx, and if it doesn't send anything at all the host will report a 
protocol error.

Alan Stern


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/
___
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users