On Mon, 3 Nov 2014, Breton M. Saunders wrote:

> Hi Alan,
> 
>    Thanks again for your help.
> 
>    I think my understanding of the bulk transfer protocol was 
> incorrectly confused with my previous work on control transfers.  It 
> looks like there is no concept of "transfer" vs "transaction" in bulk 
> like there is in control.

There _is_ a concept of bulk transfers, but it exists only at a higher
level of abstraction, whereas control transfers are represented 
directly within the USB bus protocol.

>  In bulk, the state machine consists of a 
> single token->data->handshake transition - the only way a "write" system 
> call is terminated is by writing a short packet.

I'm not entirely sure what you mean here, but you seem to have the
right basic idea.  A host and a device agree (somehow) on how long a
bulk transfer ought to be, and if the transfer needs to be shorter than
the agreed-on length then it must be terminated by a short packet.  
Which will have to be a zero-length packet in the case where the actual
length is a multiple of the maxpacket size.

> Therefore, a short 
> packet being 0 bytes is perfectly legitimate - and therefore, performing 
> a write from userland of zero bytes should also be permitted.

Yes.

>    I reckon its off I go debugging MUSB.  (Note: I'm stuck using 2.6.37; 
> so the bug I've encountered may not be occurring on newer kernels).

Good luck.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to