diff options
author | Anton Blanchard <anton@samba.org> | 2006-06-10 09:04:39 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-15 05:31:26 -0400 |
commit | df310656c7552ae7b8252e4b3d8e300cff164b16 (patch) | |
tree | 89644b8725237c755422853d749acfb0c7a49c57 /arch/powerpc/kernel | |
parent | ca1588e71b70534e18368a46a3aad9b25dff941d (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')
-rw-r--r-- | arch/powerpc/kernel/pci_direct_iommu.c | 18 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_iommu.c | 18 |
2 files changed, 22 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/pci_direct_iommu.c b/arch/powerpc/kernel/pci_direct_iommu.c index e1a32f802c0..72ce082ce73 100644 --- a/arch/powerpc/kernel/pci_direct_iommu.c +++ b/arch/powerpc/kernel/pci_direct_iommu.c | |||
@@ -82,13 +82,17 @@ static int pci_direct_dma_supported(struct device *dev, u64 mask) | |||
82 | return mask < 0x100000000ull; | 82 | return mask < 0x100000000ull; |
83 | } | 83 | } |
84 | 84 | ||
85 | static struct dma_mapping_ops pci_direct_ops = { | ||
86 | .alloc_coherent = pci_direct_alloc_coherent, | ||
87 | .free_coherent = pci_direct_free_coherent, | ||
88 | .map_single = pci_direct_map_single, | ||
89 | .unmap_single = pci_direct_unmap_single, | ||
90 | .map_sg = pci_direct_map_sg, | ||
91 | .unmap_sg = pci_direct_unmap_sg, | ||
92 | .dma_supported = pci_direct_dma_supported, | ||
93 | }; | ||
94 | |||
85 | void __init pci_direct_iommu_init(void) | 95 | void __init pci_direct_iommu_init(void) |
86 | { | 96 | { |
87 | pci_dma_ops.alloc_coherent = pci_direct_alloc_coherent; | 97 | pci_dma_ops = pci_direct_ops; |
88 | pci_dma_ops.free_coherent = pci_direct_free_coherent; | ||
89 | pci_dma_ops.map_single = pci_direct_map_single; | ||
90 | pci_dma_ops.unmap_single = pci_direct_unmap_single; | ||
91 | pci_dma_ops.map_sg = pci_direct_map_sg; | ||
92 | pci_dma_ops.unmap_sg = pci_direct_unmap_sg; | ||
93 | pci_dma_ops.dma_supported = pci_direct_dma_supported; | ||
94 | } | 98 | } |
diff --git a/arch/powerpc/kernel/pci_iommu.c b/arch/powerpc/kernel/pci_iommu.c index 7fb4cca021b..0688b2534ac 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 | ||
151 | struct 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 | |||
151 | void pci_iommu_init(void) | 161 | void 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 | } |