Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASM_SWIOTLB_H |
| 2 | #define _ASM_SWTIOLB_H 1 |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | |
Muli Ben-Yehuda | 17a941d | 2006-01-11 22:44:42 +0100 | [diff] [blame] | 5 | #include <asm/dma-mapping.h> |
| 6 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | /* SWIOTLB interface */ |
| 8 | |
Muli Ben-Yehuda | 17a941d | 2006-01-11 22:44:42 +0100 | [diff] [blame] | 9 | extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, |
| 10 | size_t size, int dir); |
| 11 | extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
| 12 | dma_addr_t *dma_handle, gfp_t flags); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, |
| 14 | size_t size, int dir); |
| 15 | extern void swiotlb_sync_single_for_cpu(struct device *hwdev, |
| 16 | dma_addr_t dev_addr, |
| 17 | size_t size, int dir); |
| 18 | extern void swiotlb_sync_single_for_device(struct device *hwdev, |
| 19 | dma_addr_t dev_addr, |
| 20 | size_t size, int dir); |
John W. Linville | 878a97c | 2005-09-29 14:44:23 -0700 | [diff] [blame] | 21 | extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev, |
| 22 | dma_addr_t dev_addr, |
| 23 | unsigned long offset, |
| 24 | size_t size, int dir); |
| 25 | extern void swiotlb_sync_single_range_for_device(struct device *hwdev, |
| 26 | dma_addr_t dev_addr, |
| 27 | unsigned long offset, |
| 28 | size_t size, int dir); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | extern void swiotlb_sync_sg_for_cpu(struct device *hwdev, |
| 30 | struct scatterlist *sg, int nelems, |
| 31 | int dir); |
| 32 | extern void swiotlb_sync_sg_for_device(struct device *hwdev, |
| 33 | struct scatterlist *sg, int nelems, |
| 34 | int dir); |
| 35 | extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, |
| 36 | int nents, int direction); |
| 37 | extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, |
| 38 | int nents, int direction); |
| 39 | extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | extern void swiotlb_free_coherent (struct device *hwdev, size_t size, |
| 41 | void *vaddr, dma_addr_t dma_handle); |
Muli Ben-Yehuda | 17a941d | 2006-01-11 22:44:42 +0100 | [diff] [blame] | 42 | extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); |
| 43 | extern void swiotlb_init(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
Andi Kleen | 65f87d8 | 2006-07-29 21:42:49 +0200 | [diff] [blame] | 45 | extern int swiotlb_force; |
| 46 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | #ifdef CONFIG_SWIOTLB |
| 48 | extern int swiotlb; |
| 49 | #else |
| 50 | #define swiotlb 0 |
| 51 | #endif |
| 52 | |
Muli Ben-Yehuda | 17a941d | 2006-01-11 22:44:42 +0100 | [diff] [blame] | 53 | extern void pci_swiotlb_init(void); |
| 54 | |
| 55 | #endif /* _ASM_SWTIOLB_H */ |