On Monday 11 December 2006 1:29 am, Ajay Jain wrote:
>        Who is responsible to send zero
> byte packets in the following cases? Is it the peripheral controller
> driver or is it the gadget layer's responsibility?

Rule of thumb:  gadget driver only knows about zero length packets
in the case of non-control transfers.

For control transfers, the gadget driver just issues a response, and
the controller driver maps that to the right messages.  Control
responses are of three types:

 - setup() upcall returning negative errno ... maps directly to
   protocol stall.

 - setup() issuing usb_ep_queue() to ep0 ... data and status stages
   progress using that data buffer.  In some cases this will be a
   zero length buffer, indicating no data stage at all.

 - setup() issuing usb_ep_set_halt() ... another way to protocol stall

The setup() upcall can return zero and hand its work off to some
other task, so the first type can't always replace the third.

- Dave


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to