On Wed, 4 Feb 2004, David Brownell wrote:
BTW, I think it would be a good idea for all IN urb to round the requested transfer_length up to the next multiple of maxpacket size. ...
I tend to agree with a generalization: make that all READs. On the host side that's IN transfers. Within a gadget, it's OUT transfers. (Net2280, in particular, has a rude hardware failure mode you can avoid by not issuing short reads.)
Interesting, with the Cypress mcu OUT ep are always prepared to accept maxpacket data. I'm wondering why anybody would ever design an OUT ep on the device side with buffers smaller than the maximum possible size...
Because they use a regular FIFO with bits allowing each word to have an end-of-packet bit ... 1 KByte of buffer can handle a variable number of packets. (And the 2 KByte/endpoint mode is important when streaming high bandwidth packets, with fast-enough hosts.) When the packet that arrives is less than maxpacket, the NAK_OUT_PACKETS mode kicks in.
But if the read was less than maxpacket and the packet that arrives is exactly maxpacket, the endpoint will keep accepting packets. It's messy to sort out all the fault cases ... especially when DMA chaining is in use, since software won't have a chance to patch things up between transfers unless the NAK_OUT_PACKETS mode kicked in.
- Dave
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel