Re: USB: Question about usb_write() API

Sundar Subramaniyan

Hi Andrei,

On Wed, Jan 31, 2018 at 1:58 PM, andrei.emeltchenko@... <> wrote:
I think we do not have now this requirement not to block-wait. When
working with sending fragmented packets you would prefer to block until all
fragments are sent.
If block wait is mandated, we can call usb_write() only on one endpoint at a time which will hamper performance.
Although USB bus transactions are sequential we can however queue the write buffers to a fifo and process them
later from a work queue independently after previous completion which might help design the driver in a better way.

w.r.t callbacks, well there are two cases:

Application has:
1. set a valid callback function
2. set callback as NULL

If the callback is NULL then does that implicitly mean we have to block till write is complete?
I would prefer the driver implementation be simple rather complicating with all the synchronization and fragmentation stuff.


Join to automatically receive all group messages.