aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_iommu.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2006-06-10 09:04:39 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-15 05:31:26 -0400
commitdf310656c7552ae7b8252e4b3d8e300cff164b16 (patch)
tree89644b8725237c755422853d749acfb0c7a49c57 /arch/powerpc/kernel/pci_iommu.c
parentca1588e71b70534e18368a46a3aad9b25dff941d (diff)
[POWERPC] cleanup dma_mapping_ops
For pseries IOMMU bypass I want to be able to fall back to the regular IOMMU ops. Do this by creating a dma_mapping_ops struct, and convert the others while at it. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_iommu.c')
-rw-r--r--arch/powerpc/kernel/pci_iommu.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/pci_iommu.c b/arch/powerpc/kernel/pci_iommu.c
index 7fb4cca021be..0688b2534acb 100644
--- a/arch/powerpc/kernel/pci_iommu.c
+++ b/arch/powerpc/kernel/pci_iommu.c
@@ -148,13 +148,17 @@ static int pci_iommu_dma_supported(struct device *dev, u64 mask)
148 return 1; 148 return 1;
149} 149}
150 150
151struct dma_mapping_ops pci_iommu_ops = {
152 .alloc_coherent = pci_iommu_alloc_coherent,
153 .free_coherent = pci_iommu_free_coherent,
154 .map_single = pci_iommu_map_single,
155 .unmap_single = pci_iommu_unmap_single,
156 .map_sg = pci_iommu_map_sg,
157 .unmap_sg = pci_iommu_unmap_sg,
158 .dma_supported = pci_iommu_dma_supported,
159};
160
151void pci_iommu_init(void) 161void pci_iommu_init(void)
152{ 162{
153 pci_dma_ops.alloc_coherent = pci_iommu_alloc_coherent; 163 pci_dma_ops = pci_iommu_ops;
154 pci_dma_ops.free_coherent = pci_iommu_free_coherent;
155 pci_dma_ops.map_single = pci_iommu_map_single;
156 pci_dma_ops.unmap_single = pci_iommu_unmap_single;
157 pci_dma_ops.map_sg = pci_iommu_map_sg;
158 pci_dma_ops.unmap_sg = pci_iommu_unmap_sg;
159 pci_dma_ops.dma_supported = pci_iommu_dma_supported;
160} 164}