Hi everybody,

I'm trying to debug a userspace device driver (ACR30U Smart Card Reader) which 
uses "simple" control transfers to send data to the device, and an input bulk 
endpoint to read the response.

An error occurs when sending the command to the device, and the kernel log 
reports:

usb 1-1: usbdev_ioctl: CONTROL
usb 1-1: control write: bRequest=00 bRrequestType=40 wValue=0000 wIndex=0000
usb 1-1: control write: data: 02 30 31 30 36 30 31 30 31 30 37 03
uhci_hcd 0000:00:1f.2: uhci_result_control: failed with status 400000
[c317e240] link (0317e1b2) element (0185e080)
 Element != First TD
  0: [c185e040] link (0185e080) e3 LS Length=7 MaxLen=7 DT0 EndPt=0 Dev=2, 
PID=2d(SETUP) (buf=06e318c8)
  1: [c185e080] link (0185e0c0) e3 LS Stalled Length=7 MaxLen=7 DT1 EndPt=0 
Dev=2, PID=e1(OUT) (buf=064bf000)
  2: [c185e0c0] link (0185e100) e3 LS Active Length=0 MaxLen=3 DT0 EndPt=0 
Dev=2, PID=e1(OUT) (buf=064bf008)
  3: [c185e100] link (00000001) e3 LS IOC Active Length=0 MaxLen=7ff DT1 
EndPt=0 Dev=2, PID=69(IN) (buf=00000000)

usb 1-1: usbfs: USBDEVFS_CONTROL failed cmd test rqt 64 rq 0 len 12 ret -32

The request looks right, but I'm having some trouble reading the qh dump. I 
read the USB specifications, and understant that the request is composed of a 
SETUP frame, followed by two OUT frames (12 bytes of data are too much for a 
max packet size of 8 bytes), and an IN frame. The four frames are dumped, and 
it seems that the device reports a Stalled condition.

I don't understand the sequence of events that led to the problem. Has the 
first TD (SETUP) been send ? Is the Stalled condition reported on the second 
TD the result of the first or second TD ? Why is the Length of the SETUP 
frame 7 ? From the USB specifications, SETUP frames consist of a PID, 
followed by an address (7 bits), an endpoint (4 bits) and a CRC (8 bits), so 
what is the length for ?

These are probably newbie questions, but reading the USB specifications and 
Linux USB stack code (I'm using a UHCI host controller, with a 2.6.7 kernel) 
didn't help.

Thanks in advance for all the help you can provide.

Laurent Pinchart

Attachment: pgpDP0WMuAYma.pgp
Description: signature

Reply via email to