diff options
Diffstat (limited to 'arch/powerpc/kernel/dma-iommu.c')
-rw-r--r-- | arch/powerpc/kernel/dma-iommu.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 49248f89ce23..14183af1b3fb 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c | |||
@@ -30,28 +30,26 @@ static void dma_iommu_free_coherent(struct device *dev, size_t size, | |||
30 | } | 30 | } |
31 | 31 | ||
32 | /* Creates TCEs for a user provided buffer. The user buffer must be | 32 | /* Creates TCEs for a user provided buffer. The user buffer must be |
33 | * contiguous real kernel storage (not vmalloc). The address of the buffer | 33 | * contiguous real kernel storage (not vmalloc). The address passed here |
34 | * passed here is the kernel (virtual) address of the buffer. The buffer | 34 | * comprises a page address and offset into that page. The dma_addr_t |
35 | * need not be page aligned, the dma_addr_t returned will point to the same | 35 | * returned will point to the same byte within the page as was passed in. |
36 | * byte within the page as vaddr. | ||
37 | */ | 36 | */ |
38 | static dma_addr_t dma_iommu_map_single(struct device *dev, void *vaddr, | 37 | static dma_addr_t dma_iommu_map_page(struct device *dev, struct page *page, |
39 | size_t size, | 38 | unsigned long offset, size_t size, |
40 | enum dma_data_direction direction, | 39 | enum dma_data_direction direction, |
41 | struct dma_attrs *attrs) | 40 | struct dma_attrs *attrs) |
42 | { | 41 | { |
43 | return iommu_map_single(dev, dev->archdata.dma_data, vaddr, size, | 42 | return iommu_map_page(dev, dev->archdata.dma_data, page, offset, size, |
44 | device_to_mask(dev), direction, attrs); | 43 | device_to_mask(dev), direction, attrs); |
45 | } | 44 | } |
46 | 45 | ||
47 | 46 | ||
48 | static void dma_iommu_unmap_single(struct device *dev, dma_addr_t dma_handle, | 47 | static void dma_iommu_unmap_page(struct device *dev, dma_addr_t dma_handle, |
49 | size_t size, | 48 | size_t size, enum dma_data_direction direction, |
50 | enum dma_data_direction direction, | 49 | struct dma_attrs *attrs) |
51 | struct dma_attrs *attrs) | ||
52 | { | 50 | { |
53 | iommu_unmap_single(dev->archdata.dma_data, dma_handle, size, direction, | 51 | iommu_unmap_page(dev->archdata.dma_data, dma_handle, size, direction, |
54 | attrs); | 52 | attrs); |
55 | } | 53 | } |
56 | 54 | ||
57 | 55 | ||
@@ -94,10 +92,10 @@ static int dma_iommu_dma_supported(struct device *dev, u64 mask) | |||
94 | struct dma_mapping_ops dma_iommu_ops = { | 92 | struct dma_mapping_ops dma_iommu_ops = { |
95 | .alloc_coherent = dma_iommu_alloc_coherent, | 93 | .alloc_coherent = dma_iommu_alloc_coherent, |
96 | .free_coherent = dma_iommu_free_coherent, | 94 | .free_coherent = dma_iommu_free_coherent, |
97 | .map_single = dma_iommu_map_single, | ||
98 | .unmap_single = dma_iommu_unmap_single, | ||
99 | .map_sg = dma_iommu_map_sg, | 95 | .map_sg = dma_iommu_map_sg, |
100 | .unmap_sg = dma_iommu_unmap_sg, | 96 | .unmap_sg = dma_iommu_unmap_sg, |
101 | .dma_supported = dma_iommu_dma_supported, | 97 | .dma_supported = dma_iommu_dma_supported, |
98 | .map_page = dma_iommu_map_page, | ||
99 | .unmap_page = dma_iommu_unmap_page, | ||
102 | }; | 100 | }; |
103 | EXPORT_SYMBOL(dma_iommu_ops); | 101 | EXPORT_SYMBOL(dma_iommu_ops); |