Joerg Roedel | 1648993 | 2008-10-15 22:01:03 -0700 | [diff] [blame] | 1 | #ifndef __LINUX_SWIOTLB_H |
| 2 | #define __LINUX_SWIOTLB_H |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | |
| 6 | struct device; |
| 7 | struct dma_attrs; |
| 8 | struct scatterlist; |
| 9 | |
| 10 | extern void |
| 11 | swiotlb_init(void); |
| 12 | |
Jeremy Fitzhardinge | 8c5df16 | 2008-12-16 12:17:26 -0800 | [diff] [blame^] | 13 | extern void *swiotlb_alloc_boot(size_t bytes, unsigned long nslabs); |
| 14 | extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); |
| 15 | |
Joerg Roedel | 1648993 | 2008-10-15 22:01:03 -0700 | [diff] [blame] | 16 | extern void |
| 17 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
| 18 | dma_addr_t *dma_handle, gfp_t flags); |
| 19 | |
| 20 | extern void |
| 21 | swiotlb_free_coherent(struct device *hwdev, size_t size, |
| 22 | void *vaddr, dma_addr_t dma_handle); |
| 23 | |
| 24 | extern dma_addr_t |
| 25 | swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, int dir); |
| 26 | |
| 27 | extern void |
| 28 | swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, |
| 29 | size_t size, int dir); |
| 30 | |
| 31 | extern dma_addr_t |
| 32 | swiotlb_map_single_attrs(struct device *hwdev, void *ptr, size_t size, |
| 33 | int dir, struct dma_attrs *attrs); |
| 34 | |
| 35 | extern void |
| 36 | swiotlb_unmap_single_attrs(struct device *hwdev, dma_addr_t dev_addr, |
| 37 | size_t size, int dir, struct dma_attrs *attrs); |
| 38 | |
| 39 | extern int |
| 40 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
| 41 | int direction); |
| 42 | |
| 43 | extern void |
| 44 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
| 45 | int direction); |
| 46 | |
| 47 | extern int |
| 48 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, |
| 49 | int dir, struct dma_attrs *attrs); |
| 50 | |
| 51 | extern void |
| 52 | swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, |
| 53 | int nelems, int dir, struct dma_attrs *attrs); |
| 54 | |
| 55 | extern void |
| 56 | swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, |
| 57 | size_t size, int dir); |
| 58 | |
| 59 | extern void |
| 60 | swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, |
| 61 | int nelems, int dir); |
| 62 | |
| 63 | extern void |
| 64 | swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, |
| 65 | size_t size, int dir); |
| 66 | |
| 67 | extern void |
| 68 | swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, |
| 69 | int nelems, int dir); |
| 70 | |
| 71 | extern void |
| 72 | swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr, |
| 73 | unsigned long offset, size_t size, int dir); |
| 74 | |
| 75 | extern void |
| 76 | swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr, |
| 77 | unsigned long offset, size_t size, |
| 78 | int dir); |
| 79 | |
| 80 | extern int |
| 81 | swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); |
| 82 | |
| 83 | extern int |
| 84 | swiotlb_dma_supported(struct device *hwdev, u64 mask); |
| 85 | |
| 86 | #endif /* __LINUX_SWIOTLB_H */ |