On Sun, 26 Mar 2006, Franck Bui-Huu wrote: > sorry the question wasn't accurate, I would have asked: am I sure that > the driver will queue only one request in a response to a SETUP > packet ? that would mean the request queue for ep0 has no more than > one request at any time.
You shouldn't assume that. Although it will almost always be true in practice, it's not a requirement. > > > Is it safe when aborting all requests of an ep's queue to do > > > > > > while (queue is not empty) { > > > request = first request of the queue > > > remove_request_from_queue(request); > > > driver->complete(request, status = -ERROR); > > > } > > > > > > I mean, am I sure that the driver won't queue another request to the > > > queue ? > > > > No, you can't be sure of that. But if the gadget driver does queue > > another request, it has to take the consequences. In these circumstances > > it's not defined whether the new request would also get aborted. > > > > does that mean there is no safe way to nuke all requests which belong > to an ep's queue ? The method outlined above is safe, provided the gadget driver is written properly. If a problem arises it will be the fault of the gadget driver, not your fault. In general, gadget drivers will queue requests in response to requests from the host or successful completions. They won't queue requests in response to a failed completion. And they should be smart enough not to queue requests while the endpoint is disabled or a call to usb_ep_fifo_flush() is in progress. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel