USB: ci13xxx_udc: Add support for large requests
Spanning large request into multiple dTDs will fail with short
packets. Instead queue one dTD at a time. This patch has
the following limitations.
1. Large requests are supported only on Bulk OUT endpoints. This
feature is mainly required for MTP driver to achieve better write
throughputs. The VFS performs well with larger buffers.
2. To keep it simple, don't allow queuing while processing large
request. Don't allow larger request queuing while the queue is
busy.
CRs-Fixed: 449733
Change-Id: I262a62af3316d673a97f11842290609092c6e7df
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
diff --git a/drivers/usb/gadget/ci13xxx_udc.h b/drivers/usb/gadget/ci13xxx_udc.h
index 48789af..76028b2 100644
--- a/drivers/usb/gadget/ci13xxx_udc.h
+++ b/drivers/usb/gadget/ci13xxx_udc.h
@@ -77,6 +77,13 @@
struct usb_ctrlrequest setup;
} __attribute__ ((packed));
+/* cache of larger request's original attributes */
+struct ci13xxx_multi_req {
+ unsigned len;
+ unsigned actual;
+ void *buf;
+};
+
/* Extension of usb_request */
struct ci13xxx_req {
struct usb_request req;
@@ -86,6 +93,7 @@
dma_addr_t dma;
struct ci13xxx_td *zptr;
dma_addr_t zdma;
+ struct ci13xxx_multi_req multi;
};
/* Extension of usb_ep */
@@ -111,6 +119,8 @@
unsigned long prime_fail_count;
int prime_timer_count;
struct timer_list prime_timer;
+
+ bool multi_req;
};
struct ci13xxx;