OK... I don't know enough about USB, and there is no documentation out there...

I've removed the reset (which should not be used per the few documents I found).

And found that if I remove the following:
                    ifd_sysdep_usb_set_interface(dev,
                                                    params->usb.interface,
                                                    params->usb.altsetting))

>From usb_set_params, it works correctly, no matter how many times I
run the ifdhandler without removing the device.

Anyone know what does this call do? and why it causes next ifdhandler
run to fail communicating with the device?

I also tried to use USBDEVFS_CLEAR_HALT and USBDEVFS_RESETEP but these
do not release the device as well...

So the only solution is USBDEVFS_RESET, which is bad, or remove the
USBDEVFS_SETINTERFACE call.

I could not find calls to RESET, RESETEP and SETINTERFACE in libusb-1,
so I guess normal applications should not use these?

Alon

On 12/31/08, Alon Bar-Lev <alon.bar...@gmail.com> wrote:
> On 12/31/08, Alon Bar-Lev <alon.bar...@gmail.com> wrote:
>  >  > another GetSlotStatus message. The attached patch catches this specific
>  >  > error and interprets it correctly. (Actually, there are two patches. One
>  >  > takes the IFD_ERROR_NO_CARD error from ccid_command and asserts that 
> means
>  >  > the card is absent. The other ignores the IFD_ERROR_NO_CARD error and 
> parses
>  >  > the result as if no error had been reported. Either should work)
>  >
>
> >  Here is the same without the reset, notice that the GetSlotStatus
>  >  message timed out.
>
>
> I reproduced this issue with trunk, this has nothing to do with any of
>  my changes...
>
>  Here is the log, notice the timeout of the first GetSlotStatus.
>  ---
>  # src/ifd/ifdhandler -dddddd -F -H ccid usb /dev/bus/usb/002/033
>
> Debug: ifd_open: trying to open c...@usb:/dev/bus/usb/002/033
>  Debug: ifd_usb_control: usb req type=x80 req=x06 val=x0100 ind=x0000 len=18
>  Debug: ifd_usb_control: recv  12 01 10 01 00 00 00 08 c3 0d 04 10 05
>  05 01 02 00 01
>  Debug: ifd_usb_control: usb req type=x80 req=x06 val=x0200 ind=x0000 len=8
>  Debug: ifd_usb_control: recv  09 02 5d 00 01 01 06 a0
>  Debug: ifd_usb_control: usb req type=x80 req=x06 val=x0200 ind=x0000 len=93
>  Debug: ifd_usb_control: recv  09 02 5d 00 01 01 06 a0 32 09 04 00 00
>  03 0b 00 00 04 36 21 10 01 00 07 03 00 00 00 a0 0f 00 00 a0 0f 00 00
>  00 00 2a 00 00 15 16 05 00 00 fc 00 00 00 00 00 00 00 00 00 00 00 30
>  03 01 00 0f 01 00 00 00 00 00 00 00 01 07 05 81 03 08 00 ff 07 05 02
>  02 40 00 00 07 05 82 02 40 00 00
>  Debug: skipped 1 class/vendor specific interface descriptors
>  Debug: usb_set_params: called. config xffffffff ifc x00 eps x02/x82
>  Debug: ccid_open_usb: Accepted 0dc3:1004 with features 0x10330 and protocols 
> 0x3
>
> Debug: ccid_activate: called.
>
> Debug: ifd_usb_begin_capture: usb capture type=1 ep=x81 maxpacket=8
>
> Debug: usb_submit_urb: submit urb 0x94daa30
>
> Debug: ifd_usb_capture: called, timeout=100 ms.
>  Debug: ifd_usb_capture: usb capture: Command timed out
>
> Debug: ccid_command: sending: 65 00 00 00 00 00 00 00 00 00
>  Debug: usb_send: usb send to=x02
>  Debug: usb_send: send  65 00 00 00 00 00 00 00 00 00
>  Error: usb_bulk failed: Connection timed out
>
> Debug: ifd_usb_begin_capture: usb capture type=1 ep=x81 maxpacket=8
>
> Debug: usb_submit_urb: submit urb 0x94daa30
>
> Debug: ifd_usb_capture: called, timeout=100 ms.
>
> Debug: ifd_sysdep_usb_capture: usb reapurb: len=2
>  Debug: usb_submit_urb: submit urb 0x94daa30
>  Debug: ifd_usb_capture: usb capture: recv  50 03
>  ---
>
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to