aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swiotlb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/swiotlb.h')
-rw-r--r--include/linux/swiotlb.h27
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
25extern void swiotlb_init(int verbose); 25extern void swiotlb_init(int verbose);
26extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
27
28/*
29 * Enumeration for sync targets
30 */
31enum dma_sync_target {
32 SYNC_FOR_CPU = 0,
33 SYNC_FOR_DEVICE = 1,
34};
35extern 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
39extern void swiotlb_tbl_unmap_single(struct device *hwdev, char *dma_addr,
40 size_t size, enum dma_data_direction dir);
41
42extern 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. */
47extern void swiotlb_bounce(phys_addr_t phys, char *dma_addr, size_t size,
48 enum dma_data_direction dir);
26 49
27extern void 50extern 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
43extern int 66extern int
44swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, 67swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
45 int direction); 68 enum dma_data_direction dir);
46 69
47extern void 70extern void
48swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, 71swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
49 int direction); 72 enum dma_data_direction dir);
50 73
51extern int 74extern int
52swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, 75swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,