diff options
Diffstat (limited to 'arch/ia64/kernel/pci-swiotlb.c')
-rw-r--r-- | arch/ia64/kernel/pci-swiotlb.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c index 16c50516dbc1..573f02c39a00 100644 --- a/arch/ia64/kernel/pci-swiotlb.c +++ b/arch/ia64/kernel/pci-swiotlb.c | |||
@@ -13,23 +13,37 @@ | |||
13 | int swiotlb __read_mostly; | 13 | int swiotlb __read_mostly; |
14 | EXPORT_SYMBOL(swiotlb); | 14 | EXPORT_SYMBOL(swiotlb); |
15 | 15 | ||
16 | struct dma_mapping_ops swiotlb_dma_ops = { | 16 | static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size, |
17 | .mapping_error = swiotlb_dma_mapping_error, | 17 | dma_addr_t *dma_handle, gfp_t gfp) |
18 | .alloc_coherent = swiotlb_alloc_coherent, | 18 | { |
19 | if (dev->coherent_dma_mask != DMA_64BIT_MASK) | ||
20 | gfp |= GFP_DMA; | ||
21 | return swiotlb_alloc_coherent(dev, size, dma_handle, gfp); | ||
22 | } | ||
23 | |||
24 | struct dma_map_ops swiotlb_dma_ops = { | ||
25 | .alloc_coherent = ia64_swiotlb_alloc_coherent, | ||
19 | .free_coherent = swiotlb_free_coherent, | 26 | .free_coherent = swiotlb_free_coherent, |
20 | .map_single = swiotlb_map_single, | 27 | .map_page = swiotlb_map_page, |
21 | .unmap_single = swiotlb_unmap_single, | 28 | .unmap_page = swiotlb_unmap_page, |
29 | .map_sg = swiotlb_map_sg_attrs, | ||
30 | .unmap_sg = swiotlb_unmap_sg_attrs, | ||
22 | .sync_single_for_cpu = swiotlb_sync_single_for_cpu, | 31 | .sync_single_for_cpu = swiotlb_sync_single_for_cpu, |
23 | .sync_single_for_device = swiotlb_sync_single_for_device, | 32 | .sync_single_for_device = swiotlb_sync_single_for_device, |
24 | .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, | 33 | .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu, |
25 | .sync_single_range_for_device = swiotlb_sync_single_range_for_device, | 34 | .sync_single_range_for_device = swiotlb_sync_single_range_for_device, |
26 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, | 35 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, |
27 | .sync_sg_for_device = swiotlb_sync_sg_for_device, | 36 | .sync_sg_for_device = swiotlb_sync_sg_for_device, |
28 | .map_sg = swiotlb_map_sg, | 37 | .dma_supported = swiotlb_dma_supported, |
29 | .unmap_sg = swiotlb_unmap_sg, | 38 | .mapping_error = swiotlb_dma_mapping_error, |
30 | .dma_supported_op = swiotlb_dma_supported, | ||
31 | }; | 39 | }; |
32 | 40 | ||
41 | void __init swiotlb_dma_init(void) | ||
42 | { | ||
43 | dma_ops = &swiotlb_dma_ops; | ||
44 | swiotlb_init(); | ||
45 | } | ||
46 | |||
33 | void __init pci_swiotlb_init(void) | 47 | void __init pci_swiotlb_init(void) |
34 | { | 48 | { |
35 | if (!iommu_detected) { | 49 | if (!iommu_detected) { |