On Mon, 11 Dec 2006, Ajay Jain wrote: > Hello, > > I have a question regarding USB Gadget Implementation. The question is > regarding the zero byte packets that are sent/recvd during USB > Transfers. Assuming that I have my own peripheral driver, and am using > a mass storage functionality on it. 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? > > 1. For a Control transaction, which is of the form > Control->Data->Status.
You mean "a Control transfer". A transaction is something else; the Setup and Status stage each consist of a single transaction and the Data stage may consist of multiple transactions. > When the Data is 'In', there will be a Status > stage which will be 'OUT', which is to receive zero byte from host. > Will the gadget layer queue such a request, or is it the > responsibility of the peripheral > driver? The peripheral driver will handle the status stage. > 2. Similarly, for a Control transaction, which is of the form > Control->Data->Status. When the Data is 'OUT', there will be a Status > stage which will be 'IN', which is to send zero byte to host. Will the > gadget layer queue such a request, or is it the responsibility of the > peripheral driver? The peripheral driver will handle the status stage. > 3. Lastly, for a Control transaction of the form Control->Status, > where the host will need a zero byte packet. Again, will the upper > layer queue such a request? When there is no data stage the gadget layer must queue a 0-length request to signal that the transfer has been completed. Alan Stern ------------------------------------------------------------------------- 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