On Mon, 28 Nov 2005, David Brownell wrote:

> On Monday 21 November 2005 6:00 am, Olav Kongas wrote:
> 
> > Suppose, HC requests N bytes of data from device. Suppose, 
> > device sends M bytes as a response. The following happens:
> > 
> > 1) if M == N; then no zero length packet is sent by device 
> > regardless of whether N is multiple of MaxPacketSize or not. 
> > That's because the HCD, which requested N bytes of the data, 
> > has got all of it.
> 
> That "regardless" is incorrect.  It's appropriate for the data
> stage of control transfers, but for e.g. bulk or interrupt
> transfers the peripheral's protocol may say otherwise.

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.

> Same thing ... this is specific to the protocol.  Sometimes
> protocols specify that ALL transfers are terminated by a
> short packet.  When that's the case, and M is an integral
> multiple of the packet size, that means a zero length packet
> must be sent.

Such protocols would appear to be in violation of the USB specification.  
These things do happen, of course.  And there are devices that violate 
both the spec and their class protocol.

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