diff options
Diffstat (limited to 'Documentation/usb/dma.txt')
-rw-r--r-- | Documentation/usb/dma.txt | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Documentation/usb/dma.txt b/Documentation/usb/dma.txt index cfdcd16e3abf..84ef865237db 100644 --- a/Documentation/usb/dma.txt +++ b/Documentation/usb/dma.txt | |||
@@ -16,11 +16,11 @@ OR: they can now be DMA-aware. | |||
16 | manage dma mappings for existing dma-ready buffers (see below). | 16 | manage dma mappings for existing dma-ready buffers (see below). |
17 | 17 | ||
18 | - URBs have an additional "transfer_dma" field, as well as a transfer_flags | 18 | - URBs have an additional "transfer_dma" field, as well as a transfer_flags |
19 | bit saying if it's valid. (Control requests also have "setup_dma" and a | 19 | bit saying if it's valid. (Control requests also have "setup_dma", but |
20 | corresponding transfer_flags bit.) | 20 | drivers must not use it.) |
21 | 21 | ||
22 | - "usbcore" will map those DMA addresses, if a DMA-aware driver didn't do | 22 | - "usbcore" will map this DMA address, if a DMA-aware driver didn't do |
23 | it first and set URB_NO_TRANSFER_DMA_MAP or URB_NO_SETUP_DMA_MAP. HCDs | 23 | it first and set URB_NO_TRANSFER_DMA_MAP. HCDs |
24 | don't manage dma mappings for URBs. | 24 | don't manage dma mappings for URBs. |
25 | 25 | ||
26 | - There's a new "generic DMA API", parts of which are usable by USB device | 26 | - There's a new "generic DMA API", parts of which are usable by USB device |
@@ -43,22 +43,16 @@ and effects like cache-trashing can impose subtle penalties. | |||
43 | kind of addresses to store in urb->transfer_buffer and urb->transfer_dma. | 43 | kind of addresses to store in urb->transfer_buffer and urb->transfer_dma. |
44 | You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags: | 44 | You'd also set URB_NO_TRANSFER_DMA_MAP in urb->transfer_flags: |
45 | 45 | ||
46 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 46 | void *usb_alloc_coherent (struct usb_device *dev, size_t size, |
47 | int mem_flags, dma_addr_t *dma); | 47 | int mem_flags, dma_addr_t *dma); |
48 | 48 | ||
49 | void usb_buffer_free (struct usb_device *dev, size_t size, | 49 | void usb_free_coherent (struct usb_device *dev, size_t size, |
50 | void *addr, dma_addr_t dma); | 50 | void *addr, dma_addr_t dma); |
51 | 51 | ||
52 | Most drivers should *NOT* be using these primitives; they don't need | 52 | Most drivers should *NOT* be using these primitives; they don't need |
53 | to use this type of memory ("dma-coherent"), and memory returned from | 53 | to use this type of memory ("dma-coherent"), and memory returned from |
54 | kmalloc() will work just fine. | 54 | kmalloc() will work just fine. |
55 | 55 | ||
56 | For control transfers you can use the buffer primitives or not for each | ||
57 | of the transfer buffer and setup buffer independently. Set the flag bits | ||
58 | URB_NO_TRANSFER_DMA_MAP and URB_NO_SETUP_DMA_MAP to indicate which | ||
59 | buffers you have prepared. For non-control transfers URB_NO_SETUP_DMA_MAP | ||
60 | is ignored. | ||
61 | |||
62 | The memory buffer returned is "dma-coherent"; sometimes you might need to | 56 | The memory buffer returned is "dma-coherent"; sometimes you might need to |
63 | force a consistent memory access ordering by using memory barriers. It's | 57 | force a consistent memory access ordering by using memory barriers. It's |
64 | not using a streaming DMA mapping, so it's good for small transfers on | 58 | not using a streaming DMA mapping, so it's good for small transfers on |
@@ -130,8 +124,8 @@ of Documentation/PCI/PCI-DMA-mapping.txt, titled "What memory is DMA-able?") | |||
130 | void usb_buffer_unmap (struct urb *urb); | 124 | void usb_buffer_unmap (struct urb *urb); |
131 | 125 | ||
132 | The calls manage urb->transfer_dma for you, and set URB_NO_TRANSFER_DMA_MAP | 126 | The calls manage urb->transfer_dma for you, and set URB_NO_TRANSFER_DMA_MAP |
133 | so that usbcore won't map or unmap the buffer. The same goes for | 127 | so that usbcore won't map or unmap the buffer. They cannot be used for |
134 | urb->setup_dma and URB_NO_SETUP_DMA_MAP for control requests. | 128 | setup_packet buffers in control requests. |
135 | 129 | ||
136 | Note that several of those interfaces are currently commented out, since | 130 | Note that several of those interfaces are currently commented out, since |
137 | they don't have current users. See the source code. Other than the dmasync | 131 | they don't have current users. See the source code. Other than the dmasync |