This is a shortcut and not essential for "working". This "shortcut" requires for the gadget driver to drop its locks which are taken in the complete callback. I'm mainly for the removal because it needs fixing for the upcomming stream implementation. Since there is no stream_id matching it would need an additional exception (I don't think additional stream_number * FIFO_SIZE buffer is a good idea). Once we add sg support for the gadget side it would need additional fixup here. I don't see the benefit of this "early" completion so I'm removing it. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> --- drivers/usb/gadget/dummy_hcd.c | 31 +------------------------------ 1 files changed, 1 insertions(+), 30 deletions(-) diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 2600d1f..e3c382c 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -143,8 +143,6 @@ static const char *const ep_name [] = { /*-------------------------------------------------------------------------*/ -#define FIFO_SIZE 64 - struct urbp { struct urb *urb; struct list_head urbp_list; @@ -185,8 +183,6 @@ struct dummy { int address; struct usb_gadget gadget; struct usb_gadget_driver *driver; - struct dummy_request fifo_req; - u8 fifo_buf [FIFO_SIZE]; u16 devstatus; unsigned udc_suspended:1; unsigned pullup:1; @@ -599,11 +595,6 @@ dummy_free_request (struct usb_ep *_ep, struct usb_request *_req) kfree (req); } -static void -fifo_complete (struct usb_ep *ep, struct usb_request *req) -{ -} - static int dummy_queue (struct usb_ep *_ep, struct usb_request *_req, gfp_t mem_flags) @@ -636,26 +627,7 @@ dummy_queue (struct usb_ep *_ep, struct usb_request *_req, _req->actual = 0; spin_lock_irqsave (&dum->lock, flags); - /* implement an emulated single-request FIFO */ - if (ep->desc && (ep->desc->bEndpointAddress & USB_DIR_IN) && - list_empty (&dum->fifo_req.queue) && - list_empty (&ep->queue) && - _req->length <= FIFO_SIZE) { - req = &dum->fifo_req; - req->req = *_req; - req->req.buf = dum->fifo_buf; - memcpy (dum->fifo_buf, _req->buf, _req->length); - req->req.context = dum; - req->req.complete = fifo_complete; - - list_add_tail(&req->queue, &ep->queue); - spin_unlock (&dum->lock); - _req->actual = _req->length; - _req->status = 0; - _req->complete (_ep, _req); - spin_lock (&dum->lock); - } else - list_add_tail(&req->queue, &ep->queue); + list_add_tail(&req->queue, &ep->queue); spin_unlock_irqrestore (&dum->lock, flags); /* real hardware would likely enable transfers here, in case @@ -960,7 +932,6 @@ static void init_dummy_udc_hw(struct dummy *dum) dum->gadget.ep0 = &dum->ep[0].ep; list_del_init(&dum->ep[0].ep.ep_list); - INIT_LIST_HEAD(&dum->fifo_req.queue); #ifdef CONFIG_USB_OTG dum->gadget.is_otg = 1; -- 1.7.7.3 -- 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