On Thu, 24 Jan 2013, Xiaofan Chen wrote:

> On Thu, Jan 24, 2013 at 9:42 AM, Pete Batard <p...@akeo.ie> wrote:
> > On 2013.01.23 14:48, Xiaofan Chen wrote:
> >> Again, the above leads to me to think that the  ALLOW_PARTIAL_READS
> >> pipe policy has some linkage to USBD_SHORT_TRANSFER_OK
> >> and I am not so sure if libusbK is really at fault here.
> >
> > The way I see it is currently libusbK does not do what WinUSB does, so
> > at least part of a fix needs to happen in libusbK. I was able to
> > demonstrate that a simple change in libusbK could make transfers behave
> > the same as WinUSB, and since we're initializing both libusbK and WinUSB
> > in the same fashion (due to the common API), I fail to see how the
> > difference in behaviour could not be libusbK's responsibility.
> 
> I was convinced by your explanation last time. I am just getting
> more confused about the real intended behavior and usage of
> ALLOW_PARTIAL_READS.

ALLOW_PARTIAL_READS is Microsoft's way of letting programmers use the 
USB protocol in ways it was not intended to be used.  It specifically 
evades the convention (which is documented in the spec) that bulk 
transfers are complete when either the desired number of bytes have 
been sent or when a short packet is received, whichever comes first.

It does this by allowing clients to ask for a short read (i.e., shorter 
than the maxpacket length), buffering the data sent by the device 
(which can be longer than the requested amount), and then giving the 
remaining data to the client in response to the next read request.

This feature is not available on Linux, or presumably on other
platforms.  I don't see any reason why libusb or libusbx should support
it.

Alan Stern


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to