On Tue, 20 Feb 2007, Pete Zaitcev wrote:

> On Tue, 20 Feb 2007 11:57:14 -0500 (EST), Alan Stern <[EMAIL PROTECTED]> 
> wrote:
> > On Tue, 20 Feb 2007, Guido Körber wrote:
> 
> > > There is no situation where a USB device sends multiple reports in  
> > > the same packet.
> > 
> > I've never seen it happen myself, but Pete Zaitcev says he has:
> > 
> > http://marc.theaimsgroup.com/?l=linux-usb-devel&m=116545264427365&w=2
> 
> That it true, I have seen it. However, it is not an argument for the use
> of maxPacketSize to size URB-level transfers. In fact, I am yet to see
> a good argument for it. In case of Microsoft Keyboard bubbling, for example,
> there's no telling what the size should be... Maybe 6 bytes, maybe 20,
> maybe 200. But whatever it is, it's not a maxPacketSize.

Here's the argument for using the maxpacket size:

        If we expect a single transfer to be larger than the maxpacket
        size, then by all means, we should request the entire expected 
        amount.  (It might not hurt to round the amount up to a multiple
        of the maxpacket size, but that's a separate matter...)

        However, suppose the single transfer is expected to be smaller
        than the maxpacket size.  In that case, requesting maxpacket
        bytes

            1.  Doesn't ruin anything, since we won't receive more than 
                one packet in any case;

            2.  May prevent us from getting a -EOVERFLOW error and
                losing data, should the device end up sending a
                full-sized packet rather than what we expected.

This argument applies particularly to interrupt-IN transfers, where we
almost never expect to receive more than one packet per transfer.  
However it also can apply to short bulk-IN transfers.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to