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.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index febedcf67c7e..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,
@@ -73,16 +96,6 @@ extern void
73swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, 96swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
74 int nelems, enum dma_data_direction dir); 97 int nelems, enum dma_data_direction dir);
75 98
76extern void
77swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
78 unsigned long offset, size_t size,
79 enum dma_data_direction dir);
80
81extern void
82swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr,
83 unsigned long offset, size_t size,
84 enum dma_data_direction dir);
85
86extern int 99extern int
87swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); 100swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
88 101