Konrad Rzeszutek Wilk | b097186 | 2010-05-11 10:05:49 -0400 | [diff] [blame] | 1 | #ifndef __LINUX_SWIOTLB_XEN_H |
| 2 | #define __LINUX_SWIOTLB_XEN_H |
| 3 | |
Stefano Stabellini | 6fe1927 | 2013-11-04 17:54:27 +0000 | [diff] [blame] | 4 | #include <linux/dma-direction.h> |
Konrad Rzeszutek Wilk | b097186 | 2010-05-11 10:05:49 -0400 | [diff] [blame] | 5 | #include <linux/swiotlb.h> |
| 6 | |
Konrad Rzeszutek Wilk | b827760 | 2012-08-23 14:36:15 -0400 | [diff] [blame] | 7 | extern int xen_swiotlb_init(int verbose, bool early); |
Konrad Rzeszutek Wilk | b097186 | 2010-05-11 10:05:49 -0400 | [diff] [blame] | 8 | |
| 9 | extern void |
| 10 | *xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
Andrzej Pietrasiewicz | baa676f | 2012-03-27 14:28:18 +0200 | [diff] [blame] | 11 | dma_addr_t *dma_handle, gfp_t flags, |
| 12 | struct dma_attrs *attrs); |
Konrad Rzeszutek Wilk | b097186 | 2010-05-11 10:05:49 -0400 | [diff] [blame] | 13 | |
| 14 | extern void |
| 15 | xen_swiotlb_free_coherent(struct device *hwdev, size_t size, |
Andrzej Pietrasiewicz | baa676f | 2012-03-27 14:28:18 +0200 | [diff] [blame] | 16 | void *vaddr, dma_addr_t dma_handle, |
| 17 | struct dma_attrs *attrs); |
Konrad Rzeszutek Wilk | b097186 | 2010-05-11 10:05:49 -0400 | [diff] [blame] | 18 | |
| 19 | extern dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, |
| 20 | unsigned long offset, size_t size, |
| 21 | enum dma_data_direction dir, |
| 22 | struct dma_attrs *attrs); |
| 23 | |
| 24 | extern void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, |
| 25 | size_t size, enum dma_data_direction dir, |
| 26 | struct dma_attrs *attrs); |
Konrad Rzeszutek Wilk | b097186 | 2010-05-11 10:05:49 -0400 | [diff] [blame] | 27 | extern int |
| 28 | xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, |
| 29 | int nelems, enum dma_data_direction dir, |
| 30 | struct dma_attrs *attrs); |
| 31 | |
| 32 | extern void |
| 33 | xen_swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, |
| 34 | int nelems, enum dma_data_direction dir, |
| 35 | struct dma_attrs *attrs); |
| 36 | |
| 37 | extern void |
| 38 | xen_swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, |
| 39 | size_t size, enum dma_data_direction dir); |
| 40 | |
| 41 | extern void |
| 42 | xen_swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, |
| 43 | int nelems, enum dma_data_direction dir); |
| 44 | |
| 45 | extern void |
| 46 | xen_swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, |
| 47 | size_t size, enum dma_data_direction dir); |
| 48 | |
| 49 | extern void |
| 50 | xen_swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, |
| 51 | int nelems, enum dma_data_direction dir); |
| 52 | |
| 53 | extern int |
| 54 | xen_swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); |
| 55 | |
| 56 | extern int |
| 57 | xen_swiotlb_dma_supported(struct device *hwdev, u64 mask); |
| 58 | |
Stefano Stabellini | eb1ddc0 | 2013-10-09 16:56:33 +0000 | [diff] [blame] | 59 | extern int |
| 60 | xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask); |
Konrad Rzeszutek Wilk | b097186 | 2010-05-11 10:05:49 -0400 | [diff] [blame] | 61 | #endif /* __LINUX_SWIOTLB_XEN_H */ |