summaryrefslogtreecommitdiffstats
path: root/include/linux/iommu.h
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2009-03-18 15:33:06 +0800
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-03-24 09:42:51 +0000
commitdbb9fd8630e95b6155aff658a2b5f80e95ca2bc6 (patch)
treeb24caff50e1c5bfb428cb7422608bfef95d916e8 /include/linux/iommu.h
parent58c610bd1a3f50820e45a7c09ec0e44d2cda15dd (diff)
downloadop-kernel-dev-dbb9fd8630e95b6155aff658a2b5f80e95ca2bc6.zip
op-kernel-dev-dbb9fd8630e95b6155aff658a2b5f80e95ca2bc6.tar.gz
iommu: Add domain_has_cap iommu_ops
This iommu_op can tell if domain have a specific capability, like snooping control for Intel IOMMU, which can be used by other components of kernel to adjust the behaviour. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r--include/linux/iommu.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 8a7bfb1..0cf3a4e 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -28,6 +28,8 @@ struct iommu_domain {
void *priv;
};
+#define IOMMU_CAP_CACHE_COHERENCY 0x1
+
struct iommu_ops {
int (*domain_init)(struct iommu_domain *domain);
void (*domain_destroy)(struct iommu_domain *domain);
@@ -39,6 +41,8 @@ struct iommu_ops {
size_t size);
phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
unsigned long iova);
+ int (*domain_has_cap)(struct iommu_domain *domain,
+ unsigned long cap);
};
#ifdef CONFIG_IOMMU_API
@@ -57,6 +61,8 @@ extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova,
size_t size);
extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
unsigned long iova);
+extern int iommu_domain_has_cap(struct iommu_domain *domain,
+ unsigned long cap);
#else /* CONFIG_IOMMU_API */
@@ -107,6 +113,12 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
return 0;
}
+static inline int domain_has_cap(struct iommu_domain *domain,
+ unsigned long cap)
+{
+ return 0;
+}
+
#endif /* CONFIG_IOMMU_API */
#endif /* __LINUX_IOMMU_H */
OpenPOWER on IntegriCloud