On Sun, Sep 2, 2012 at 2:15 PM, Alan Stern <st...@rowland.harvard.edu>wrote:

> On Sun, 2 Sep 2012, Orin Eman wrote:
>
> > > Then as said that is a pretty useless feature, since apps can already
> > > find out as much by comparing the amount actually read versus the
> amount
> > > they requested...
> > >
> >
> >
> > Not quite.  Without allow partial reads, if your buffer length isn't a
> > multiple of the maximum packet size for the endpoint and the device
> returns
> > more than your buffer length, you can lose data.  With allow partial
> reads,
> > if less than your buffer length is returned by the device, the excess
> data
> > is buffered by WinUSB or discarded, depending on the AUTO_FLUSH setting.
> >
> > See:
> >
> http://msdn.microsoft.com/en-us/library/windows/hardware/ff728833%28v=vs.85%29.aspx
>
> The description implies that ALLOW_PARTIAL_READS and AUTO_FLUSH are
> higher-level options meant to make life easier for driver authors.
> RAW_IO is closer to what libusb wants, but it's not an exact match: It
> requires the transfer size to be a multiple of the maxpacket value and
> it has a limitation on transfer size.  Do you know what a typical value
> for MAXIMUM_TRANSFER_SIZE is?
>


I don't, but comments on the OSR ntdev forum indicate in the order of MB
for high speed devices, hundreds of KB for low and full speed devices and
4KB for control endpoints (any speed).

Next time I'm working with our USB device, I'll put the relevant call in
and find out.  I use 32KB buffers, so the point is moot for me.

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