usb: gadget: gr_udc: Add bounce buffer to handle odd sized OUT requests
This adds a bounce buffer that handles the end of OUT requests where req.length is not divisible by ep->ep.maxpacket. Before this, such requests were rejected as the DMA engine cannot restrict itself to buffers that are smaller than ep->ep.maxpacket. Signed-off-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
@@ -156,6 +156,10 @@ struct gr_ep {
|
||||
struct list_head queue;
|
||||
|
||||
struct list_head ep_list;
|
||||
|
||||
/* Bounce buffer for end of "odd" sized OUT requests */
|
||||
void *tailbuf;
|
||||
dma_addr_t tailbuf_paddr;
|
||||
};
|
||||
|
||||
struct gr_request {
|
||||
@@ -167,6 +171,9 @@ struct gr_request {
|
||||
struct gr_dma_desc *curr_desc; /* Current descriptor */
|
||||
struct gr_dma_desc *last_desc; /* Last in the chain */
|
||||
|
||||
u16 evenlen; /* Size of even length head (if oddlen != 0) */
|
||||
u16 oddlen; /* Size of odd length tail if buffer length is "odd" */
|
||||
|
||||
u8 setup; /* Setup packet */
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user