]>
Commit | Line | Data |
---|---|---|
b097186f KRW |
1 | #ifndef __LINUX_SWIOTLB_XEN_H |
2 | #define __LINUX_SWIOTLB_XEN_H | |
3 | ||
6fe19278 | 4 | #include <linux/dma-direction.h> |
69369f52 | 5 | #include <linux/scatterlist.h> |
b097186f KRW |
6 | #include <linux/swiotlb.h> |
7 | ||
b8277600 | 8 | extern int xen_swiotlb_init(int verbose, bool early); |
b097186f KRW |
9 | |
10 | extern void | |
11 | *xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |
baa676fc | 12 | dma_addr_t *dma_handle, gfp_t flags, |
00085f1e | 13 | unsigned long attrs); |
b097186f KRW |
14 | |
15 | extern void | |
16 | xen_swiotlb_free_coherent(struct device *hwdev, size_t size, | |
baa676fc | 17 | void *vaddr, dma_addr_t dma_handle, |
00085f1e | 18 | unsigned long attrs); |
b097186f KRW |
19 | |
20 | extern dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, | |
21 | unsigned long offset, size_t size, | |
22 | enum dma_data_direction dir, | |
00085f1e | 23 | unsigned long attrs); |
b097186f KRW |
24 | |
25 | extern void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, | |
26 | size_t size, enum dma_data_direction dir, | |
00085f1e | 27 | unsigned long attrs); |
b097186f KRW |
28 | extern int |
29 | xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, | |
30 | int nelems, enum dma_data_direction dir, | |
00085f1e | 31 | unsigned long attrs); |
b097186f KRW |
32 | |
33 | extern void | |
34 | xen_swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, | |
35 | int nelems, enum dma_data_direction dir, | |
00085f1e | 36 | unsigned long attrs); |
b097186f KRW |
37 | |
38 | extern void | |
39 | xen_swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr, | |
40 | size_t size, enum dma_data_direction dir); | |
41 | ||
42 | extern void | |
43 | xen_swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg, | |
44 | int nelems, enum dma_data_direction dir); | |
45 | ||
46 | extern void | |
47 | xen_swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr, | |
48 | size_t size, enum dma_data_direction dir); | |
49 | ||
50 | extern void | |
51 | xen_swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, | |
52 | int nelems, enum dma_data_direction dir); | |
53 | ||
b097186f KRW |
54 | extern int |
55 | xen_swiotlb_dma_supported(struct device *hwdev, u64 mask); | |
56 | ||
eb1ddc00 SS |
57 | extern int |
58 | xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask); | |
7e91c7df SS |
59 | |
60 | extern int | |
61 | xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, | |
62 | void *cpu_addr, dma_addr_t dma_addr, size_t size, | |
63 | unsigned long attrs); | |
69369f52 AA |
64 | |
65 | extern int | |
66 | xen_swiotlb_get_sgtable(struct device *dev, struct sg_table *sgt, | |
67 | void *cpu_addr, dma_addr_t handle, size_t size, | |
68 | unsigned long attrs); | |
b097186f | 69 | #endif /* __LINUX_SWIOTLB_XEN_H */ |