David:

This question is somewhat theoretical; I don't expect it to come up.  But
I'm curious.

Do the slave controller drivers maintain message boundaries for bulk-out 
endpoints, even if the gadget's request size doesn't match the host's 
packet size?  Or do they simply wait until enough data is available to 
completely fill a request buffer?

Here's an example to clarify the question.  Suppose the host sends a 
100-byte message, divided into a 64-byte (maxlen) packet X and a short 
36-byte packet Y.  Suppose the gadget driver queues a request A for 36 
bytes, a request B for 64 bytes, and a request C for 64 bytes.

Presumably A will be returned with the first 36 bytes from X.  At this
point a host controller would report a babble error, since the actual
packet length is > the expected length.  Does the gadget API include an
equivalent notion?  Or does the remainder of X stay in the FIFO, to be
returned in B?

If yes, then B returns with the last 28 bytes of X plus the 36 bytes of Y.  
Since Y is short, it marks a message boundary.  Does the controller then
return C containing 0 bytes to mark the end of the message?  Or does C
wait until the host sends more data, so the gadget driver is unaware of
the message boundary?

Here's another example.  Suppose the host does the same as before, but now
the gadget driver queues A for 40 bytes and B for 64.  Then A gets the
first 40 bytes of X and B gets the last 24 plus the 36 bytes of Y.  Since
Y marks a message boundary, does B then return as a short request with
only 60 bytes?  Or does it wait until the host sends more data?

Alan Stern



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to