blob: 4f4d449f00f6b98644be40b85f108667c4cb1642 [file] [log] [blame]
Konrad Rzeszutek Wilkb0971862010-05-11 10:05:49 -04001#ifndef __LINUX_SWIOTLB_XEN_H
2#define __LINUX_SWIOTLB_XEN_H
3
4#include <linux/swiotlb.h>
5
6extern void xen_swiotlb_init(int verbose);
7
8extern void
9*xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
Andrzej Pietrasiewiczbaa676f2012-03-27 14:28:18 +020010 dma_addr_t *dma_handle, gfp_t flags,
11 struct dma_attrs *attrs);
Konrad Rzeszutek Wilkb0971862010-05-11 10:05:49 -040012
13extern void
14xen_swiotlb_free_coherent(struct device *hwdev, size_t size,
Andrzej Pietrasiewiczbaa676f2012-03-27 14:28:18 +020015 void *vaddr, dma_addr_t dma_handle,
16 struct dma_attrs *attrs);
Konrad Rzeszutek Wilkb0971862010-05-11 10:05:49 -040017
18extern dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
19 unsigned long offset, size_t size,
20 enum dma_data_direction dir,
21 struct dma_attrs *attrs);
22
23extern void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr,
24 size_t size, enum dma_data_direction dir,
25 struct dma_attrs *attrs);
26/*
27extern int
28xen_swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
29 enum dma_data_direction dir);
30
31extern void
32xen_swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
33 enum dma_data_direction dir);
34*/
35extern int
36xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
37 int nelems, enum dma_data_direction dir,
38 struct dma_attrs *attrs);
39
40extern void
41xen_swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
42 int nelems, enum dma_data_direction dir,
43 struct dma_attrs *attrs);
44
45extern void
46xen_swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
47 size_t size, enum dma_data_direction dir);
48
49extern void
50xen_swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
51 int nelems, enum dma_data_direction dir);
52
53extern void
54xen_swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
55 size_t size, enum dma_data_direction dir);
56
57extern void
58xen_swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
59 int nelems, enum dma_data_direction dir);
60
61extern int
62xen_swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
63
64extern int
65xen_swiotlb_dma_supported(struct device *hwdev, u64 mask);
66
67#endif /* __LINUX_SWIOTLB_XEN_H */