diff options
Diffstat (limited to 'arch/ia64/hp/common/hwsw_iommu.c')
-rw-r--r-- | arch/ia64/hp/common/hwsw_iommu.c | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/arch/ia64/hp/common/hwsw_iommu.c b/arch/ia64/hp/common/hwsw_iommu.c index 8f6bcfe1da..1c44ec2a1d 100644 --- a/arch/ia64/hp/common/hwsw_iommu.c +++ b/arch/ia64/hp/common/hwsw_iommu.c | |||
@@ -20,10 +20,10 @@ | |||
20 | extern int swiotlb_late_init_with_default_size (size_t size); | 20 | extern int swiotlb_late_init_with_default_size (size_t size); |
21 | extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent; | 21 | extern ia64_mv_dma_alloc_coherent swiotlb_alloc_coherent; |
22 | extern ia64_mv_dma_free_coherent swiotlb_free_coherent; | 22 | extern ia64_mv_dma_free_coherent swiotlb_free_coherent; |
23 | extern ia64_mv_dma_map_single swiotlb_map_single; | 23 | extern ia64_mv_dma_map_single_attrs swiotlb_map_single_attrs; |
24 | extern ia64_mv_dma_unmap_single swiotlb_unmap_single; | 24 | extern ia64_mv_dma_unmap_single_attrs swiotlb_unmap_single_attrs; |
25 | extern ia64_mv_dma_map_sg swiotlb_map_sg; | 25 | extern ia64_mv_dma_map_sg_attrs swiotlb_map_sg_attrs; |
26 | extern ia64_mv_dma_unmap_sg swiotlb_unmap_sg; | 26 | extern ia64_mv_dma_unmap_sg_attrs swiotlb_unmap_sg_attrs; |
27 | extern ia64_mv_dma_supported swiotlb_dma_supported; | 27 | extern ia64_mv_dma_supported swiotlb_dma_supported; |
28 | extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error; | 28 | extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error; |
29 | 29 | ||
@@ -31,19 +31,19 @@ extern ia64_mv_dma_mapping_error swiotlb_dma_mapping_error; | |||
31 | 31 | ||
32 | extern ia64_mv_dma_alloc_coherent sba_alloc_coherent; | 32 | extern ia64_mv_dma_alloc_coherent sba_alloc_coherent; |
33 | extern ia64_mv_dma_free_coherent sba_free_coherent; | 33 | extern ia64_mv_dma_free_coherent sba_free_coherent; |
34 | extern ia64_mv_dma_map_single sba_map_single; | 34 | extern ia64_mv_dma_map_single_attrs sba_map_single_attrs; |
35 | extern ia64_mv_dma_unmap_single sba_unmap_single; | 35 | extern ia64_mv_dma_unmap_single_attrs sba_unmap_single_attrs; |
36 | extern ia64_mv_dma_map_sg sba_map_sg; | 36 | extern ia64_mv_dma_map_sg_attrs sba_map_sg_attrs; |
37 | extern ia64_mv_dma_unmap_sg sba_unmap_sg; | 37 | extern ia64_mv_dma_unmap_sg_attrs sba_unmap_sg_attrs; |
38 | extern ia64_mv_dma_supported sba_dma_supported; | 38 | extern ia64_mv_dma_supported sba_dma_supported; |
39 | extern ia64_mv_dma_mapping_error sba_dma_mapping_error; | 39 | extern ia64_mv_dma_mapping_error sba_dma_mapping_error; |
40 | 40 | ||
41 | #define hwiommu_alloc_coherent sba_alloc_coherent | 41 | #define hwiommu_alloc_coherent sba_alloc_coherent |
42 | #define hwiommu_free_coherent sba_free_coherent | 42 | #define hwiommu_free_coherent sba_free_coherent |
43 | #define hwiommu_map_single sba_map_single | 43 | #define hwiommu_map_single_attrs sba_map_single_attrs |
44 | #define hwiommu_unmap_single sba_unmap_single | 44 | #define hwiommu_unmap_single_attrs sba_unmap_single_attrs |
45 | #define hwiommu_map_sg sba_map_sg | 45 | #define hwiommu_map_sg_attrs sba_map_sg_attrs |
46 | #define hwiommu_unmap_sg sba_unmap_sg | 46 | #define hwiommu_unmap_sg_attrs sba_unmap_sg_attrs |
47 | #define hwiommu_dma_supported sba_dma_supported | 47 | #define hwiommu_dma_supported sba_dma_supported |
48 | #define hwiommu_dma_mapping_error sba_dma_mapping_error | 48 | #define hwiommu_dma_mapping_error sba_dma_mapping_error |
49 | #define hwiommu_sync_single_for_cpu machvec_dma_sync_single | 49 | #define hwiommu_sync_single_for_cpu machvec_dma_sync_single |
@@ -98,41 +98,48 @@ hwsw_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma | |||
98 | } | 98 | } |
99 | 99 | ||
100 | dma_addr_t | 100 | dma_addr_t |
101 | hwsw_map_single (struct device *dev, void *addr, size_t size, int dir) | 101 | hwsw_map_single_attrs(struct device *dev, void *addr, size_t size, int dir, |
102 | struct dma_attrs *attrs) | ||
102 | { | 103 | { |
103 | if (use_swiotlb(dev)) | 104 | if (use_swiotlb(dev)) |
104 | return swiotlb_map_single(dev, addr, size, dir); | 105 | return swiotlb_map_single_attrs(dev, addr, size, dir, attrs); |
105 | else | 106 | else |
106 | return hwiommu_map_single(dev, addr, size, dir); | 107 | return hwiommu_map_single_attrs(dev, addr, size, dir, attrs); |
107 | } | 108 | } |
109 | EXPORT_SYMBOL(hwsw_map_single_attrs); | ||
108 | 110 | ||
109 | void | 111 | void |
110 | hwsw_unmap_single (struct device *dev, dma_addr_t iova, size_t size, int dir) | 112 | hwsw_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size, |
113 | int dir, struct dma_attrs *attrs) | ||
111 | { | 114 | { |
112 | if (use_swiotlb(dev)) | 115 | if (use_swiotlb(dev)) |
113 | return swiotlb_unmap_single(dev, iova, size, dir); | 116 | return swiotlb_unmap_single_attrs(dev, iova, size, dir, attrs); |
114 | else | 117 | else |
115 | return hwiommu_unmap_single(dev, iova, size, dir); | 118 | return hwiommu_unmap_single_attrs(dev, iova, size, dir, attrs); |
116 | } | 119 | } |
117 | 120 | EXPORT_SYMBOL(hwsw_unmap_single_attrs); | |
118 | 121 | ||
119 | int | 122 | int |
120 | hwsw_map_sg (struct device *dev, struct scatterlist *sglist, int nents, int dir) | 123 | hwsw_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents, |
124 | int dir, struct dma_attrs *attrs) | ||
121 | { | 125 | { |
122 | if (use_swiotlb(dev)) | 126 | if (use_swiotlb(dev)) |
123 | return swiotlb_map_sg(dev, sglist, nents, dir); | 127 | return swiotlb_map_sg_attrs(dev, sglist, nents, dir, attrs); |
124 | else | 128 | else |
125 | return hwiommu_map_sg(dev, sglist, nents, dir); | 129 | return hwiommu_map_sg_attrs(dev, sglist, nents, dir, attrs); |
126 | } | 130 | } |
131 | EXPORT_SYMBOL(hwsw_map_sg_attrs); | ||
127 | 132 | ||
128 | void | 133 | void |
129 | hwsw_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, int dir) | 134 | hwsw_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents, |
135 | int dir, struct dma_attrs *attrs) | ||
130 | { | 136 | { |
131 | if (use_swiotlb(dev)) | 137 | if (use_swiotlb(dev)) |
132 | return swiotlb_unmap_sg(dev, sglist, nents, dir); | 138 | return swiotlb_unmap_sg_attrs(dev, sglist, nents, dir, attrs); |
133 | else | 139 | else |
134 | return hwiommu_unmap_sg(dev, sglist, nents, dir); | 140 | return hwiommu_unmap_sg_attrs(dev, sglist, nents, dir, attrs); |
135 | } | 141 | } |
142 | EXPORT_SYMBOL(hwsw_unmap_sg_attrs); | ||
136 | 143 | ||
137 | void | 144 | void |
138 | hwsw_sync_single_for_cpu (struct device *dev, dma_addr_t addr, size_t size, int dir) | 145 | hwsw_sync_single_for_cpu (struct device *dev, dma_addr_t addr, size_t size, int dir) |
@@ -185,10 +192,6 @@ hwsw_dma_mapping_error (dma_addr_t dma_addr) | |||
185 | } | 192 | } |
186 | 193 | ||
187 | EXPORT_SYMBOL(hwsw_dma_mapping_error); | 194 | EXPORT_SYMBOL(hwsw_dma_mapping_error); |
188 | EXPORT_SYMBOL(hwsw_map_single); | ||
189 | EXPORT_SYMBOL(hwsw_unmap_single); | ||
190 | EXPORT_SYMBOL(hwsw_map_sg); | ||
191 | EXPORT_SYMBOL(hwsw_unmap_sg); | ||
192 | EXPORT_SYMBOL(hwsw_dma_supported); | 195 | EXPORT_SYMBOL(hwsw_dma_supported); |
193 | EXPORT_SYMBOL(hwsw_alloc_coherent); | 196 | EXPORT_SYMBOL(hwsw_alloc_coherent); |
194 | EXPORT_SYMBOL(hwsw_free_coherent); | 197 | EXPORT_SYMBOL(hwsw_free_coherent); |