[PATCH 8/9] x86/iommu: change Intel IOMMU to use dma_ops register interface

From: Joerg Roedel
Date: Mon Sep 22 2008 - 14:24:40 EST


Signed-off-by: Joerg Roedel <joerg.roedel@xxxxxxx>
---
drivers/pci/intel-iommu.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 6c4c1c3..283e65f 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2255,6 +2255,12 @@ static int intel_map_sg(struct device *hwdev, struct scatterlist *sglist,
return nelems;
}

+static int intel_device_supported(struct device *dev)
+{
+ /* FIXME: is this correct? */
+ return dev && dev->bus == &pci_bus_type;
+}
+
static struct dma_mapping_ops intel_dma_ops = {
.alloc_coherent = intel_alloc_coherent,
.free_coherent = intel_free_coherent,
@@ -2262,6 +2268,7 @@ static struct dma_mapping_ops intel_dma_ops = {
.unmap_single = intel_unmap_single,
.map_sg = intel_map_sg,
.unmap_sg = intel_unmap_sg,
+ .device_supported = intel_device_supported,
};

static inline int iommu_domain_cache_init(void)
@@ -2449,6 +2456,7 @@ int __init intel_iommu_init(void)

init_timer(&unmap_timer);
force_iommu = 1;
+ x86_register_dma_ops(&intel_dma_ops, DMA_OPS_TYPE_HW);
dma_ops = &intel_dma_ops;
return 0;
}
--
1.5.6.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/