lkml.org 
[lkml]   [2008]   [Sep]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromJoerg Roedel <>
Subject[PATCH 8/9] x86/iommu: change Intel IOMMU to use dma_ops register interface
DateMon, 22 Sep 2008 20:21:20 +0200
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 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



\
 
 \ /
  Last update: 2008-09-22 20:27    [from the cache]
©2003-2008