On Mon, Jun 18, 2012 at 4:56 PM, Peter Stuge <pe...@stuge.se> wrote:

> Peter Stuge wrote:
> > Is there a reason why we would ever not want to set AUTO_CLEAR_STALL?
> >
> > It's done unconditionally now, which seems to be the right way to go
> > so that the 31 error happens for one less reason.
>
> On the other hand, do other backends automatically clear stalls? If
> no then Windows also shouldn't. If that means that transfers will
> complete with LIBUSB_ERROR_IO instead of LIBUSB_ERROR_NO_DEVICE
> then I think that's OK. It's impossible to report what Windows
> doesn't tell us.
>


It should be harmless to complete with LIBUSB_ERROR_IO if the device is
removed.  I don't know what error WinUSB returns if you try to clear a
'stall' on a device that has been removed.  That would need research, but
hopefully you get the 22 error.  Certainly, if a read is resubmitted to
WinUSB with the device disconnected, you get the 22 error which as far as I
know, can be translated into LIBUSB_ERROR_NO_DEVICE.

My current WinUSB code has a benign bug in that it doesn't notice a 31
error on a read completion.  It immediately resubmits the read, gets the 22
error and handles things correctly at that point.

There was an old thread on AUTO_CLEAR_STALL which google will bring up and
the consensus then was to always set it.

Orin.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to