blob: e850f5c1607bd154aaef614cb724d3bbb50df453 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef ASMARM_DMA_MAPPING_H
2#define ASMARM_DMA_MAPPING_H
3
4#ifdef __KERNEL__
5
Russell King98ed7d42008-08-10 12:10:49 +01006#include <linux/mm_types.h>
Jens Axboedee9ba82007-10-23 12:37:59 +02007#include <linux/scatterlist.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Dmitry Baryshkov1fe53262008-07-18 13:30:14 +04009#include <asm-generic/dma-coherent.h>
Russell King98ed7d42008-08-10 12:10:49 +010010#include <asm/memory.h>
11
12/*
13 * page_to_dma/dma_to_virt/virt_to_dma are architecture private functions
14 * used internally by the DMA-mapping API to provide DMA addresses. They
15 * must not be used by drivers.
16 */
17#ifndef __arch_page_to_dma
Nicolas Pitre58edb512008-09-09 15:54:13 -040018static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
19{
20 return (dma_addr_t)__pfn_to_bus(page_to_pfn(page));
21}
Russell King98ed7d42008-08-10 12:10:49 +010022
Russell Kingef1baed2009-10-31 16:07:16 +000023static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
24{
25 return pfn_to_page(__bus_to_pfn(addr));
26}
27
Russell King98ed7d42008-08-10 12:10:49 +010028static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
29{
30 return (void *)__bus_to_virt(addr);
31}
32
33static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
34{
35 return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
36}
37#else
38static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
39{
40 return __arch_page_to_dma(dev, page);
41}
42
Russell Kingef1baed2009-10-31 16:07:16 +000043static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
44{
45 return __arch_dma_to_page(dev, addr);
46}
47
Russell King98ed7d42008-08-10 12:10:49 +010048static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
49{
50 return __arch_dma_to_virt(dev, addr);
51}
52
53static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
54{
55 return __arch_virt_to_dma(dev, addr);
56}
57#endif
Dmitry Baryshkov1fe53262008-07-18 13:30:14 +040058
Linus Torvalds1da177e2005-04-16 15:20:36 -070059/*
Russell King18eabe22009-10-31 16:52:16 +000060 * Private support functions: these are not part of the API and are
61 * liable to change. Drivers must not use these.
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 */
Russell King84aa4622007-10-09 14:17:01 +010063extern void dma_cache_maint(const void *kaddr, size_t size, int rw);
Nicolas Pitre43377452009-03-12 22:52:09 -040064extern void dma_cache_maint_page(struct page *page, unsigned long offset,
65 size_t size, int rw);
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
67/*
Russell King18eabe22009-10-31 16:52:16 +000068 * The DMA API is built upon the notion of "buffer ownership". A buffer
69 * is either exclusively owned by the CPU (and therefore may be accessed
70 * by it) or exclusively owned by the DMA device. These helper functions
71 * represent the transitions between these two ownership states.
72 *
73 * As above, these are private support functions and not part of the API.
74 * Drivers must not use these.
75 */
76static inline void __dma_single_cpu_to_dev(const void *kaddr, size_t size,
77 enum dma_data_direction dir)
78{
79 if (!arch_is_coherent())
80 dma_cache_maint(kaddr, size, dir);
81}
82
83static inline void __dma_single_dev_to_cpu(const void *kaddr, size_t size,
84 enum dma_data_direction dir)
85{
86 /* nothing to do */
87}
88
89static inline void __dma_page_cpu_to_dev(struct page *page, unsigned long off,
90 size_t size, enum dma_data_direction dir)
91{
92 if (!arch_is_coherent())
93 dma_cache_maint_page(page, off, size, dir);
94}
95
96static inline void __dma_page_dev_to_cpu(struct page *page, unsigned long off,
97 size_t size, enum dma_data_direction dir)
98{
99 /* nothing to do */
100}
101
102/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 * Return whether the given device DMA address mask can be supported
104 * properly. For example, if your device can only drive the low 24-bits
105 * during bus mastering, then you would pass 0x00ffffff as the mask
106 * to this function.
akpm@osdl.org7a228aa2005-04-16 15:23:57 -0700107 *
108 * FIXME: This should really be a platform specific issue - we should
109 * return false if GFP_DMA allocations may not satisfy the supplied 'mask'.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 */
111static inline int dma_supported(struct device *dev, u64 mask)
112{
Russell King1124d6d2008-10-20 11:18:40 +0100113 if (mask < ISA_DMA_THRESHOLD)
114 return 0;
115 return 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116}
117
118static inline int dma_set_mask(struct device *dev, u64 dma_mask)
119{
120 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
121 return -EIO;
122
123 *dev->dma_mask = dma_mask;
124
125 return 0;
126}
127
128static inline int dma_get_cache_alignment(void)
129{
130 return 32;
131}
132
Ralf Baechlef67637e2006-12-06 20:38:54 -0800133static inline int dma_is_consistent(struct device *dev, dma_addr_t handle)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134{
Lennert Buytenhek23759dc2006-04-02 00:07:39 +0100135 return !!arch_is_coherent();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136}
137
138/*
139 * DMA errors are defined by all-bits-set in the DMA address.
140 */
FUJITA Tomonori8d8bb392008-07-25 19:44:49 -0700141static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142{
143 return dma_addr == ~0;
144}
145
Russell Kingf454aa62007-02-12 19:26:05 +0000146/*
147 * Dummy noncoherent implementation. We don't provide a dma_cache_sync
148 * function so drivers using this API are highlighted with build warnings.
149 */
Russell King3216a972008-09-25 22:23:31 +0100150static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
151 dma_addr_t *handle, gfp_t gfp)
Russell Kingf454aa62007-02-12 19:26:05 +0000152{
153 return NULL;
154}
155
Russell King3216a972008-09-25 22:23:31 +0100156static inline void dma_free_noncoherent(struct device *dev, size_t size,
157 void *cpu_addr, dma_addr_t handle)
Russell Kingf454aa62007-02-12 19:26:05 +0000158{
159}
160
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161/**
162 * dma_alloc_coherent - allocate consistent memory for DMA
163 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
164 * @size: required memory size
165 * @handle: bus-specific DMA address
166 *
167 * Allocate some uncached, unbuffered memory for a device for
168 * performing DMA. This function allocates pages, and will
169 * return the CPU-viewed address, and sets @handle to be the
170 * device-viewed address.
171 */
Russell King3216a972008-09-25 22:23:31 +0100172extern void *dma_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
174/**
175 * dma_free_coherent - free memory allocated by dma_alloc_coherent
176 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
177 * @size: size of memory originally requested in dma_alloc_coherent
178 * @cpu_addr: CPU-view address returned from dma_alloc_coherent
179 * @handle: device-view address returned from dma_alloc_coherent
180 *
181 * Free (and unmap) a DMA buffer previously allocated by
182 * dma_alloc_coherent().
183 *
184 * References to memory and mappings associated with cpu_addr/handle
185 * during and after this call executing are illegal.
186 */
Russell King3216a972008-09-25 22:23:31 +0100187extern void dma_free_coherent(struct device *, size_t, void *, dma_addr_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188
189/**
190 * dma_mmap_coherent - map a coherent DMA allocation into user space
191 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
192 * @vma: vm_area_struct describing requested user mapping
193 * @cpu_addr: kernel CPU-view address returned from dma_alloc_coherent
194 * @handle: device-view address returned from dma_alloc_coherent
195 * @size: size of memory originally requested in dma_alloc_coherent
196 *
197 * Map a coherent DMA buffer previously allocated by dma_alloc_coherent
198 * into user space. The coherent DMA buffer must not be freed by the
199 * driver until the user space mapping has been released.
200 */
Russell King3216a972008-09-25 22:23:31 +0100201int dma_mmap_coherent(struct device *, struct vm_area_struct *,
202 void *, dma_addr_t, size_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203
204
205/**
206 * dma_alloc_writecombine - allocate writecombining memory for DMA
207 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
208 * @size: required memory size
209 * @handle: bus-specific DMA address
210 *
211 * Allocate some uncached, buffered memory for a device for
212 * performing DMA. This function allocates pages, and will
213 * return the CPU-viewed address, and sets @handle to be the
214 * device-viewed address.
215 */
Russell King3216a972008-09-25 22:23:31 +0100216extern void *dma_alloc_writecombine(struct device *, size_t, dma_addr_t *,
217 gfp_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218
219#define dma_free_writecombine(dev,size,cpu_addr,handle) \
220 dma_free_coherent(dev,size,cpu_addr,handle)
221
Russell King3216a972008-09-25 22:23:31 +0100222int dma_mmap_writecombine(struct device *, struct vm_area_struct *,
223 void *, dma_addr_t, size_t);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224
225
Russell King8c8a0ec2008-09-25 21:52:49 +0100226#ifdef CONFIG_DMABOUNCE
227/*
228 * For SA-1111, IXP425, and ADI systems the dma-mapping functions are "magic"
229 * and utilize bounce buffers as needed to work around limited DMA windows.
230 *
231 * On the SA-1111, a bug limits DMA to only certain regions of RAM.
232 * On the IXP425, the PCI inbound window is 64MB (256MB total RAM)
233 * On some ADI engineering systems, PCI inbound window is 32MB (12MB total RAM)
234 *
235 * The following are helper functions used by the dmabounce subystem
236 *
237 */
238
239/**
240 * dmabounce_register_dev
241 *
242 * @dev: valid struct device pointer
243 * @small_buf_size: size of buffers to use with small buffer pool
244 * @large_buf_size: size of buffers to use with large buffer pool (can be 0)
245 *
246 * This function should be called by low-level platform code to register
247 * a device as requireing DMA buffer bouncing. The function will allocate
248 * appropriate DMA pools for the device.
249 *
250 */
Russell King3216a972008-09-25 22:23:31 +0100251extern int dmabounce_register_dev(struct device *, unsigned long,
252 unsigned long);
Russell King8c8a0ec2008-09-25 21:52:49 +0100253
254/**
255 * dmabounce_unregister_dev
256 *
257 * @dev: valid struct device pointer
258 *
259 * This function should be called by low-level platform code when device
260 * that was previously registered with dmabounce_register_dev is removed
261 * from the system.
262 *
263 */
264extern void dmabounce_unregister_dev(struct device *);
265
266/**
267 * dma_needs_bounce
268 *
269 * @dev: valid struct device pointer
270 * @dma_handle: dma_handle of unbounced buffer
271 * @size: size of region being mapped
272 *
273 * Platforms that utilize the dmabounce mechanism must implement
274 * this function.
275 *
276 * The dmabounce routines call this function whenever a dma-mapping
277 * is requested to determine whether a given buffer needs to be bounced
278 * or not. The function must return 0 if the buffer is OK for
279 * DMA access and 1 if the buffer needs to be bounced.
280 *
281 */
282extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
283
284/*
Russell King125ab122008-09-25 22:16:22 +0100285 * The DMA API, implemented by dmabounce.c. See below for descriptions.
286 */
Russell King3216a972008-09-25 22:23:31 +0100287extern dma_addr_t dma_map_single(struct device *, void *, size_t,
288 enum dma_data_direction);
Russell King29cb8d02009-10-31 16:10:10 +0000289extern void dma_unmap_single(struct device *, dma_addr_t, size_t,
290 enum dma_data_direction);
Russell King3216a972008-09-25 22:23:31 +0100291extern dma_addr_t dma_map_page(struct device *, struct page *,
292 unsigned long, size_t, enum dma_data_direction);
Russell King29cb8d02009-10-31 16:10:10 +0000293extern void dma_unmap_page(struct device *, dma_addr_t, size_t,
Russell King3216a972008-09-25 22:23:31 +0100294 enum dma_data_direction);
Russell King125ab122008-09-25 22:16:22 +0100295
296/*
Russell King8c8a0ec2008-09-25 21:52:49 +0100297 * Private functions
298 */
299int dmabounce_sync_for_cpu(struct device *, dma_addr_t, unsigned long,
Russell King3216a972008-09-25 22:23:31 +0100300 size_t, enum dma_data_direction);
Russell King8c8a0ec2008-09-25 21:52:49 +0100301int dmabounce_sync_for_device(struct device *, dma_addr_t, unsigned long,
Russell King3216a972008-09-25 22:23:31 +0100302 size_t, enum dma_data_direction);
Russell King8c8a0ec2008-09-25 21:52:49 +0100303#else
Russell King9fa76792008-11-13 14:33:51 +0000304static inline int dmabounce_sync_for_cpu(struct device *d, dma_addr_t addr,
305 unsigned long offset, size_t size, enum dma_data_direction dir)
306{
307 return 1;
308}
309
310static inline int dmabounce_sync_for_device(struct device *d, dma_addr_t addr,
311 unsigned long offset, size_t size, enum dma_data_direction dir)
312{
313 return 1;
314}
Russell King8c8a0ec2008-09-25 21:52:49 +0100315
316
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317/**
318 * dma_map_single - map a single buffer for streaming DMA
319 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
320 * @cpu_addr: CPU direct mapped address of buffer
321 * @size: size of buffer to map
322 * @dir: DMA transfer direction
323 *
324 * Ensure that any data held in the cache is appropriately discarded
325 * or written back.
326 *
327 * The device owns this memory once this call has completed. The CPU
328 * can regain ownership by calling dma_unmap_single() or
329 * dma_sync_single_for_cpu().
330 */
Russell King3216a972008-09-25 22:23:31 +0100331static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
332 size_t size, enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333{
Russell King0e18b5d2008-09-29 13:48:17 +0100334 BUG_ON(!valid_dma_direction(dir));
335
Russell King18eabe22009-10-31 16:52:16 +0000336 __dma_single_cpu_to_dev(cpu_addr, size, dir);
Lennert Buytenhek23759dc2006-04-02 00:07:39 +0100337
Russell King98ed7d42008-08-10 12:10:49 +0100338 return virt_to_dma(dev, cpu_addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339}
Russell King125ab122008-09-25 22:16:22 +0100340
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341/**
342 * dma_map_page - map a portion of a page for streaming DMA
343 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
344 * @page: page that buffer resides in
345 * @offset: offset into page for start of buffer
346 * @size: size of buffer to map
347 * @dir: DMA transfer direction
348 *
349 * Ensure that any data held in the cache is appropriately discarded
350 * or written back.
351 *
352 * The device owns this memory once this call has completed. The CPU
Russell King7807c602008-09-30 11:30:24 +0100353 * can regain ownership by calling dma_unmap_page().
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354 */
Russell King3216a972008-09-25 22:23:31 +0100355static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
356 unsigned long offset, size_t size, enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357{
Russell King0e18b5d2008-09-29 13:48:17 +0100358 BUG_ON(!valid_dma_direction(dir));
359
Russell King18eabe22009-10-31 16:52:16 +0000360 __dma_page_cpu_to_dev(page, offset, size, dir);
Russell King56f55f82008-09-25 20:59:12 +0100361
362 return page_to_dma(dev, page) + offset;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363}
364
365/**
366 * dma_unmap_single - unmap a single buffer previously mapped
367 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
368 * @handle: DMA address of buffer
Russell King7807c602008-09-30 11:30:24 +0100369 * @size: size of buffer (same as passed to dma_map_single)
370 * @dir: DMA transfer direction (same as passed to dma_map_single)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371 *
372 * Unmap a single streaming mode DMA translation. The handle and size
373 * must match what was provided in the previous dma_map_single() call.
374 * All other usages are undefined.
375 *
376 * After this call, reads by the CPU to the buffer are guaranteed to see
377 * whatever the device wrote there.
378 */
Russell King3216a972008-09-25 22:23:31 +0100379static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
380 size_t size, enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381{
Russell King18eabe22009-10-31 16:52:16 +0000382 __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384
385/**
386 * dma_unmap_page - unmap a buffer previously mapped through dma_map_page()
387 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
388 * @handle: DMA address of buffer
Russell King7807c602008-09-30 11:30:24 +0100389 * @size: size of buffer (same as passed to dma_map_page)
390 * @dir: DMA transfer direction (same as passed to dma_map_page)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391 *
Russell King7807c602008-09-30 11:30:24 +0100392 * Unmap a page streaming mode DMA translation. The handle and size
393 * must match what was provided in the previous dma_map_page() call.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 * All other usages are undefined.
395 *
396 * After this call, reads by the CPU to the buffer are guaranteed to see
397 * whatever the device wrote there.
398 */
Russell King3216a972008-09-25 22:23:31 +0100399static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
400 size_t size, enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401{
Russell King18eabe22009-10-31 16:52:16 +0000402 __dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK,
403 size, dir);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404}
Russell King29cb8d02009-10-31 16:10:10 +0000405#endif /* CONFIG_DMABOUNCE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406
407/**
Russell King9dd42862008-08-10 12:18:26 +0100408 * dma_sync_single_range_for_cpu
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409 * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
410 * @handle: DMA address of buffer
Russell King9dd42862008-08-10 12:18:26 +0100411 * @offset: offset of region to start sync
412 * @size: size of region to sync
413 * @dir: DMA transfer direction (same as passed to dma_map_single)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414 *
415 * Make physical memory consistent for a single streaming mode DMA
416 * translation after a transfer.
417 *
418 * If you perform a dma_map_single() but wish to interrogate the
419 * buffer using the cpu, yet do not wish to teardown the PCI dma
420 * mapping, you must call this function before doing so. At the
421 * next point you give the PCI dma address back to the card, you
422 * must first the perform a dma_sync_for_device, and then the
423 * device again owns the buffer.
424 */
Russell King3216a972008-09-25 22:23:31 +0100425static inline void dma_sync_single_range_for_cpu(struct device *dev,
426 dma_addr_t handle, unsigned long offset, size_t size,
427 enum dma_data_direction dir)
Russell King9dd42862008-08-10 12:18:26 +0100428{
Russell King0e18b5d2008-09-29 13:48:17 +0100429 BUG_ON(!valid_dma_direction(dir));
430
Russell King18eabe22009-10-31 16:52:16 +0000431 if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir))
432 return;
433
434 __dma_single_dev_to_cpu(dma_to_virt(dev, handle) + offset, size, dir);
Russell King9dd42862008-08-10 12:18:26 +0100435}
436
Russell King3216a972008-09-25 22:23:31 +0100437static inline void dma_sync_single_range_for_device(struct device *dev,
438 dma_addr_t handle, unsigned long offset, size_t size,
439 enum dma_data_direction dir)
Russell King9dd42862008-08-10 12:18:26 +0100440{
Russell King0e18b5d2008-09-29 13:48:17 +0100441 BUG_ON(!valid_dma_direction(dir));
442
Russell King8c8a0ec2008-09-25 21:52:49 +0100443 if (!dmabounce_sync_for_device(dev, handle, offset, size, dir))
444 return;
445
Russell King18eabe22009-10-31 16:52:16 +0000446 __dma_single_cpu_to_dev(dma_to_virt(dev, handle) + offset, size, dir);
Russell King9dd42862008-08-10 12:18:26 +0100447}
Russell King9dd42862008-08-10 12:18:26 +0100448
Russell King3216a972008-09-25 22:23:31 +0100449static inline void dma_sync_single_for_cpu(struct device *dev,
450 dma_addr_t handle, size_t size, enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451{
Russell King9dd42862008-08-10 12:18:26 +0100452 dma_sync_single_range_for_cpu(dev, handle, 0, size, dir);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453}
454
Russell King3216a972008-09-25 22:23:31 +0100455static inline void dma_sync_single_for_device(struct device *dev,
456 dma_addr_t handle, size_t size, enum dma_data_direction dir)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457{
Russell King9dd42862008-08-10 12:18:26 +0100458 dma_sync_single_range_for_device(dev, handle, 0, size, dir);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460
Russell Kingafd1a322008-09-25 16:30:57 +0100461/*
462 * The scatter list versions of the above methods.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463 */
Russell King3216a972008-09-25 22:23:31 +0100464extern int dma_map_sg(struct device *, struct scatterlist *, int,
465 enum dma_data_direction);
466extern void dma_unmap_sg(struct device *, struct scatterlist *, int,
467 enum dma_data_direction);
468extern void dma_sync_sg_for_cpu(struct device *, struct scatterlist *, int,
469 enum dma_data_direction);
470extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
471 enum dma_data_direction);
Russell Kingafd1a322008-09-25 16:30:57 +0100472
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474#endif /* __KERNEL__ */
475#endif