Hi, >> Yes, the kagen2_ep_queue() calls req->req.complete directly. I thought >> this is necessary to pass the packets to gadget driver for processing? > > It is necessary to call req.complete when the request has _completed_! > That's why the callback is named "complete"! > >> req->req.complete is mapped to bulk_out_complete() or >> bulk_in_complete(). > > A bulk-out request isn't complete until the data has been received from > the host. A bulk-in request isn't complete until the data has been > sent to the host (or at least copied into a hardware buffer). > > kagen2_ep_queue() gets called when the bulk-out request is submitted, > right? So the request is not complete at that time. It isn't complete > until the host has sent the data. After all, if you haven't received > the packets from the host yet, how can you pass the packets to the > gadget driver for processing? > > Alan Stern > For bulk out endpoint, I code the kagen2_ep_queue() to read the packets from the USB hardware, then call bulk_out_complete() via req->req.complete. Is this the correct way? Or i should only read the bulk out endpoint when bulk-out endpoint interrupt is received? thanks, victor -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html