From 060b80f220497ec52a0f400d54087e9bd42e3f56 Mon Sep 17 00:00:00 2001 From: Danny Segal Date: Tue, 8 Apr 2014 10:49:55 +0300 Subject: usb: gadget: Add support for DMA mapping optimization of request buffers In order to improve performance, this patch enabled mapping of USB request buffers in advance, before queueing them to the HW. This can be used when there is a pool or pre-mapped request buffers so we don't need to map it again every time the request gets queued. Change-Id: Ic3a6db749343ef1345e0816210517755aee055b3 Signed-off-by: Danny Segal Signed-off-by: Mayank Rana --- include/linux/usb/gadget.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux') diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 3f572d5dc16d..ab06d2988505 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -118,6 +118,11 @@ struct gsi_channel_info { * by adding a zero length packet as needed; * @short_not_ok: When reading data, makes short packets be * treated as errors (queue stops advancing till cleanup). + * @dma_pre_mapped: Tells the USB core driver whether this request should be + * DMA-mapped before it is queued to the USB HW. When set to true, it means + * that the request has already been mapped in advance and therefore the + * USB core driver does NOT need to do DMA-mapping when the request is + * queued to the USB HW. * @complete: Function called when request completes, so this request and * its buffer may be re-used. The function will always be called with * interrupts disabled, and it must not sleep. @@ -174,6 +179,7 @@ struct usb_request { unsigned no_interrupt:1; unsigned zero:1; unsigned short_not_ok:1; + unsigned dma_pre_mapped:1; void (*complete)(struct usb_ep *ep, struct usb_request *req); -- cgit v1.2.3