On Mon, 28 Nov 2005, David Brownell wrote:

> > I disagree.  The USB spec isn't as clear on this as it could be, but still 
> > section 5.7.3 says:
> > 
> >     An interrupt transfer is complete when the endpoint does
> >     one of the following:
> > 
> >     . Has transferred exactly the amount of data expected
> > 
> >     . Transfers a packet with a payload size less than wMaxPacketSize
> >       or transfers a zero-length packet

> > Section 5.8.3 says the same thing about bulk transfers.  When M == N the 
> > first case applies; the transfer is complete _before_ a zero-length packet 
> > could be sent.  The spec doesn't make allowances for class-specific 
> > protocol exceptions.
> 
> Neither does it talk about "URB" at all.

Mere sophistry.  Earlier in the same paragraph it mentions "IRP" (I/O
Request Packet), and it's pretty clear that an IRP is intended to be
essentially the same thing as an URB.

>  And the way specs are
> normally interpreted, it would take a "device protocols MUST NOT..."
> statement to disallow the conventional usage of zero length packets.

Now we need a language lawyer to straighten this out.  I guess you're 
right that the spec doesn't rule such things out entirely.  However 
according to a straightforward reading of the text, when M == N the 
arrival of the last full packet would signal the end of an IN URB.  Any 
zero-length packet added on would then be associated with the _next_ URB.

So a driver either has to issue IN requests for more bytes than it expects 
to receive or else has to be prepared to discard 0-length responses and 
retry them.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to