1 | #ifndef _ASM_SWIOTLB_H |
---|
2 | #define _ASM_SWIOTLB_H 1 |
---|
3 | |
---|
4 | /* SWIOTLB interface */ |
---|
5 | |
---|
6 | extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, size_t size, |
---|
7 | int dir); |
---|
8 | extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, |
---|
9 | size_t size, int dir); |
---|
10 | extern void swiotlb_sync_single_for_cpu(struct device *hwdev, |
---|
11 | dma_addr_t dev_addr, |
---|
12 | size_t size, int dir); |
---|
13 | extern void swiotlb_sync_single_for_device(struct device *hwdev, |
---|
14 | dma_addr_t dev_addr, |
---|
15 | size_t size, int dir); |
---|
16 | extern void swiotlb_sync_sg_for_cpu(struct device *hwdev, |
---|
17 | struct scatterlist *sg, int nelems, |
---|
18 | int dir); |
---|
19 | extern void swiotlb_sync_sg_for_device(struct device *hwdev, |
---|
20 | struct scatterlist *sg, int nelems, |
---|
21 | int dir); |
---|
22 | extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, |
---|
23 | int nents, int direction); |
---|
24 | extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, |
---|
25 | int nents, int direction); |
---|
26 | extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr); |
---|
27 | #ifdef CONFIG_HIGHMEM |
---|
28 | extern dma_addr_t swiotlb_map_page(struct device *hwdev, struct page *page, |
---|
29 | unsigned long offset, size_t size, |
---|
30 | enum dma_data_direction direction); |
---|
31 | extern void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dma_address, |
---|
32 | size_t size, enum dma_data_direction direction); |
---|
33 | #endif |
---|
34 | extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); |
---|
35 | extern void swiotlb_init(void); |
---|
36 | |
---|
37 | #ifdef CONFIG_SWIOTLB |
---|
38 | extern int swiotlb; |
---|
39 | #else |
---|
40 | #define swiotlb 0 |
---|
41 | #endif |
---|
42 | |
---|
43 | #endif |
---|