aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/pci-swiotlb.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-01-05 09:59:02 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-06 08:06:57 -0500
commit160c1d8e40866edfeae7d68816b7005d70acf391 (patch)
tree37dd78b2ea28a3953a46d401bd9657005eb444d7 /arch/ia64/kernel/pci-swiotlb.c
parentf0402a262e1a4c03fc66b83659823bdcaac3c41a (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 'arch/ia64/kernel/pci-swiotlb.c')
-rw-r--r--arch/ia64/kernel/pci-swiotlb.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c
index 9f172c864377..6bf8f66786bd 100644
--- a/arch/ia64/kernel/pci-swiotlb.c
+++ b/arch/ia64/kernel/pci-swiotlb.c
@@ -16,24 +16,36 @@ EXPORT_SYMBOL(swiotlb);
16/* Set this to 1 if there is a HW IOMMU in the system */ 16/* Set this to 1 if there is a HW IOMMU in the system */
17int iommu_detected __read_mostly; 17int iommu_detected __read_mostly;
18 18
19struct dma_mapping_ops swiotlb_dma_ops = { 19static dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
20 unsigned long offset, size_t size,
21 enum dma_data_direction dir,
22 struct dma_attrs *attrs)
23{
24 return swiotlb_map_single_attrs(dev, page_address(page) + offset, size,
25 dir, attrs);
26}
27
28static void swiotlb_unmap_page(struct device *dev, dma_addr_t dma_handle,
29 size_t size, enum dma_data_direction dir,
30 struct dma_attrs *attrs)
31{
32 swiotlb_unmap_single_attrs(dev, dma_handle, size, dir, attrs);
33}
34
35struct dma_map_ops swiotlb_dma_ops = {
20 .alloc_coherent = swiotlb_alloc_coherent, 36 .alloc_coherent = swiotlb_alloc_coherent,
21 .free_coherent = swiotlb_free_coherent, 37 .free_coherent = swiotlb_free_coherent,
22 .map_single = swiotlb_map_single, 38 .map_page = swiotlb_map_page,
23 .unmap_single = swiotlb_unmap_single, 39 .unmap_page = swiotlb_unmap_page,
24 .map_single_attrs = swiotlb_map_single_attrs, 40 .map_sg = swiotlb_map_sg_attrs,
25 .unmap_single_attrs = swiotlb_unmap_single_attrs, 41 .unmap_sg = swiotlb_unmap_sg_attrs,
26 .map_sg_attrs = swiotlb_map_sg_attrs,
27 .unmap_sg_attrs = swiotlb_unmap_sg_attrs,
28 .sync_single_for_cpu = swiotlb_sync_single_for_cpu, 42 .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
29 .sync_single_for_device = swiotlb_sync_single_for_device, 43 .sync_single_for_device = swiotlb_sync_single_for_device,
30 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, 44 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
31 .sync_single_range_for_device = swiotlb_sync_single_range_for_device, 45 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
32 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, 46 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
33 .sync_sg_for_device = swiotlb_sync_sg_for_device, 47 .sync_sg_for_device = swiotlb_sync_sg_for_device,
34 .map_sg = swiotlb_map_sg, 48 .dma_supported = swiotlb_dma_supported,
35 .unmap_sg = swiotlb_unmap_sg,
36 .dma_supported_op = swiotlb_dma_supported,
37 .mapping_error = swiotlb_dma_mapping_error, 49 .mapping_error = swiotlb_dma_mapping_error,
38}; 50};
39 51