diff options
author | Joerg Roedel <jroedel@suse.de> | 2014-09-05 04:50:45 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-09-25 09:47:37 -0400 |
commit | 5d587b8de56eec6c6a31b452a177cd8c066b267e (patch) | |
tree | cfc9e320916c746112941d86053a0630866636a4 /drivers/iommu/intel-iommu.c | |
parent | b7eb67858562c053c314dee264c425e8214c2bfb (diff) |
iommu/vt-d: Convert to iommu_capable() API function
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 5619f264862d..bc1a20395445 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -4415,17 +4415,14 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain, | |||
4415 | return phys; | 4415 | return phys; |
4416 | } | 4416 | } |
4417 | 4417 | ||
4418 | static int intel_iommu_domain_has_cap(struct iommu_domain *domain, | 4418 | static bool intel_iommu_capable(enum iommu_cap cap) |
4419 | unsigned long cap) | ||
4420 | { | 4419 | { |
4421 | struct dmar_domain *dmar_domain = domain->priv; | ||
4422 | |||
4423 | if (cap == IOMMU_CAP_CACHE_COHERENCY) | 4420 | if (cap == IOMMU_CAP_CACHE_COHERENCY) |
4424 | return dmar_domain->iommu_snooping; | 4421 | return domain_update_iommu_snooping(NULL) == 1; |
4425 | if (cap == IOMMU_CAP_INTR_REMAP) | 4422 | if (cap == IOMMU_CAP_INTR_REMAP) |
4426 | return irq_remapping_enabled; | 4423 | return irq_remapping_enabled == 1; |
4427 | 4424 | ||
4428 | return 0; | 4425 | return false; |
4429 | } | 4426 | } |
4430 | 4427 | ||
4431 | static int intel_iommu_add_device(struct device *dev) | 4428 | static int intel_iommu_add_device(struct device *dev) |
@@ -4464,6 +4461,7 @@ static void intel_iommu_remove_device(struct device *dev) | |||
4464 | } | 4461 | } |
4465 | 4462 | ||
4466 | static const struct iommu_ops intel_iommu_ops = { | 4463 | static const struct iommu_ops intel_iommu_ops = { |
4464 | .capable = intel_iommu_capable, | ||
4467 | .domain_init = intel_iommu_domain_init, | 4465 | .domain_init = intel_iommu_domain_init, |
4468 | .domain_destroy = intel_iommu_domain_destroy, | 4466 | .domain_destroy = intel_iommu_domain_destroy, |
4469 | .attach_dev = intel_iommu_attach_device, | 4467 | .attach_dev = intel_iommu_attach_device, |
@@ -4471,7 +4469,6 @@ static const struct iommu_ops intel_iommu_ops = { | |||
4471 | .map = intel_iommu_map, | 4469 | .map = intel_iommu_map, |
4472 | .unmap = intel_iommu_unmap, | 4470 | .unmap = intel_iommu_unmap, |
4473 | .iova_to_phys = intel_iommu_iova_to_phys, | 4471 | .iova_to_phys = intel_iommu_iova_to_phys, |
4474 | .domain_has_cap = intel_iommu_domain_has_cap, | ||
4475 | .add_device = intel_iommu_add_device, | 4472 | .add_device = intel_iommu_add_device, |
4476 | .remove_device = intel_iommu_remove_device, | 4473 | .remove_device = intel_iommu_remove_device, |
4477 | .pgsize_bitmap = INTEL_IOMMU_PGSIZES, | 4474 | .pgsize_bitmap = INTEL_IOMMU_PGSIZES, |