diff options
Diffstat (limited to 'include/linux/swiotlb.h')
-rw-r--r-- | include/linux/swiotlb.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 81a4e213c6cf..8c0e349f4a6c 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -23,6 +23,29 @@ extern int swiotlb_force; | |||
23 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
24 | 24 | ||
25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | ||
27 | |||
28 | /* | ||
29 | * Enumeration for sync targets | ||
30 | */ | ||
31 | enum dma_sync_target { | ||
32 | SYNC_FOR_CPU = 0, | ||
33 | SYNC_FOR_DEVICE = 1, | ||
34 | }; | ||
35 | extern void *swiotlb_tbl_map_single(struct device *hwdev, dma_addr_t tbl_dma_addr, | ||
36 | phys_addr_t phys, size_t size, | ||
37 | enum dma_data_direction dir); | ||
38 | |||
39 | extern void swiotlb_tbl_unmap_single(struct device *hwdev, char *dma_addr, | ||
40 | size_t size, enum dma_data_direction dir); | ||
41 | |||
42 | extern void swiotlb_tbl_sync_single(struct device *hwdev, char *dma_addr, | ||
43 | size_t size, enum dma_data_direction dir, | ||
44 | enum dma_sync_target target); | ||
45 | |||
46 | /* Accessory functions. */ | ||
47 | extern void swiotlb_bounce(phys_addr_t phys, char *dma_addr, size_t size, | ||
48 | enum dma_data_direction dir); | ||
26 | 49 | ||
27 | extern void | 50 | extern void |
28 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 51 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
@@ -42,11 +65,11 @@ extern void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, | |||
42 | 65 | ||
43 | extern int | 66 | extern int |
44 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 67 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
45 | int direction); | 68 | enum dma_data_direction dir); |
46 | 69 | ||
47 | extern void | 70 | extern void |
48 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 71 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
49 | int direction); | 72 | enum dma_data_direction dir); |
50 | 73 | ||
51 | extern int | 74 | extern int |
52 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, | 75 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, |