diff options
author | Martin Fuzzey <mfuzzey@gmail.com> | 2010-09-06 19:09:56 +0530 |
---|---|---|
committer | Ricardo Perez Olivares <x0081762@ti.com> | 2010-09-14 19:27:48 -0500 |
commit | 8fdc9939abc834a9741e037acc003d3c45618b0a (patch) | |
tree | c6c6dde0cca84676996e9707ba0f28862329503f /include | |
parent | a2b2032ccfaf95a69ef8d65838fabe59c6715578 (diff) |
USB: Allow HCDs to specifiy their DMA alignment requirements
If these are not met use a bounce buffer.
This is done by adding a member dma_align_shift to
struct hc_driver. Defaulting to zero causes unmodified
HCDs to be assumed to be byte aligned DMA capable.
[Original patch: http://marc.info/?l=linux-usb&m=128318950614564&w=2]
[Anand G: fixed checkpatch.pl warnings, but this is a temporary
patch. The correct approach is still being discussed on linux-usb]
Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb.h | 1 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index e180ab2f0504..b48069593de8 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -1184,6 +1184,7 @@ struct urb { atomic_t use_count; /* concurrent submissions counter */ atomic_t reject; /* submissions will fail */ int unlinked; /* unlink error code */ + void *bounce_buffer; /* DMA bounce buffer for alignment */ /* public: documented fields in the urb that can be used by drivers */ struct list_head urb_list; /* list head for use by the urb's diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index fe89f7c298aa..226543989651 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h @@ -193,6 +193,8 @@ struct hc_driver { const char *description; /* "ehci-hcd" etc */ const char *product_desc; /* product/vendor string */ size_t hcd_priv_size; /* size of private data */ + unsigned dma_align_shift; /* Aligment requirement for DMA: + 0=byte 1=2 byte, 2=4 byte... */ /* irq handler */ irqreturn_t (*irq) (struct usb_hcd *hcd); |