diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-01-05 09:59:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-06 08:06:57 -0500 |
commit | 160c1d8e40866edfeae7d68816b7005d70acf391 (patch) | |
tree | 37dd78b2ea28a3953a46d401bd9657005eb444d7 /drivers/pci/intel-iommu.c | |
parent | f0402a262e1a4c03fc66b83659823bdcaac3c41a (diff) |
x86, ia64: convert to use generic dma_map_ops struct
This converts X86 and IA64 to use include/linux/dma-mapping.h.
It's a bit large but pretty boring. The major change for X86 is
converting 'int dir' to 'enum dma_data_direction dir' in DMA mapping
operations. The major changes for IA64 is using map_page and
unmap_page instead of map_single and unmap_single.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r-- | drivers/pci/intel-iommu.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index da273e4ef66..b9a56293390 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -2441,7 +2441,8 @@ void intel_free_coherent(struct device *hwdev, size_t size, void *vaddr, | |||
2441 | #define SG_ENT_VIRT_ADDRESS(sg) (sg_virt((sg))) | 2441 | #define SG_ENT_VIRT_ADDRESS(sg) (sg_virt((sg))) |
2442 | 2442 | ||
2443 | void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist, | 2443 | void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist, |
2444 | int nelems, int dir) | 2444 | int nelems, enum dma_data_direction dir, |
2445 | struct dma_attrs *attrs) | ||
2445 | { | 2446 | { |
2446 | int i; | 2447 | int i; |
2447 | struct pci_dev *pdev = to_pci_dev(hwdev); | 2448 | struct pci_dev *pdev = to_pci_dev(hwdev); |
@@ -2499,7 +2500,7 @@ static int intel_nontranslate_map_sg(struct device *hddev, | |||
2499 | } | 2500 | } |
2500 | 2501 | ||
2501 | int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int nelems, | 2502 | int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int nelems, |
2502 | int dir) | 2503 | enum dma_data_direction dir, struct dma_attrs *attrs) |
2503 | { | 2504 | { |
2504 | void *addr; | 2505 | void *addr; |
2505 | int i; | 2506 | int i; |
@@ -2579,15 +2580,13 @@ int intel_map_sg(struct device *hwdev, struct scatterlist *sglist, int nelems, | |||
2579 | return nelems; | 2580 | return nelems; |
2580 | } | 2581 | } |
2581 | 2582 | ||
2582 | static struct dma_mapping_ops intel_dma_ops = { | 2583 | struct dma_map_ops intel_dma_ops = { |
2583 | .alloc_coherent = intel_alloc_coherent, | 2584 | .alloc_coherent = intel_alloc_coherent, |
2584 | .free_coherent = intel_free_coherent, | 2585 | .free_coherent = intel_free_coherent, |
2585 | .map_sg = intel_map_sg, | 2586 | .map_sg = intel_map_sg, |
2586 | .unmap_sg = intel_unmap_sg, | 2587 | .unmap_sg = intel_unmap_sg, |
2587 | #ifdef CONFIG_X86_64 | ||
2588 | .map_page = intel_map_page, | 2588 | .map_page = intel_map_page, |
2589 | .unmap_page = intel_unmap_page, | 2589 | .unmap_page = intel_unmap_page, |
2590 | #endif | ||
2591 | }; | 2590 | }; |
2592 | 2591 | ||
2593 | static inline int iommu_domain_cache_init(void) | 2592 | static inline int iommu_domain_cache_init(void) |