aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2009-03-18 03:33:06 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-03-24 05:42:51 -0400
commitdbb9fd8630e95b6155aff658a2b5f80e95ca2bc6 (patch)
treeb24caff50e1c5bfb428cb7422608bfef95d916e8 /include
parent58c610bd1a3f50820e45a7c09ec0e44d2cda15dd (diff)
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')
-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 8a7bfb1b6ca0..0cf3a4e43f23 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -28,6 +28,8 @@ struct iommu_domain {
28 void *priv; 28 void *priv;
29}; 29};
30 30
31#define IOMMU_CAP_CACHE_COHERENCY 0x1
32
31struct iommu_ops { 33struct iommu_ops {
32 int (*domain_init)(struct iommu_domain *domain); 34 int (*domain_init)(struct iommu_domain *domain);
33 void (*domain_destroy)(struct iommu_domain *domain); 35 void (*domain_destroy)(struct iommu_domain *domain);
@@ -39,6 +41,8 @@ struct iommu_ops {
39 size_t size); 41 size_t size);
40 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, 42 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
41 unsigned long iova); 43 unsigned long iova);
44 int (*domain_has_cap)(struct iommu_domain *domain,
45 unsigned long cap);
42}; 46};
43 47
44#ifdef CONFIG_IOMMU_API 48#ifdef CONFIG_IOMMU_API
@@ -57,6 +61,8 @@ extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova,
57 size_t size); 61 size_t size);
58extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, 62extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
59 unsigned long iova); 63 unsigned long iova);
64extern int iommu_domain_has_cap(struct iommu_domain *domain,
65 unsigned long cap);
60 66
61#else /* CONFIG_IOMMU_API */ 67#else /* CONFIG_IOMMU_API */
62 68
@@ -107,6 +113,12 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
107 return 0; 113 return 0;
108} 114}
109 115
116static inline int domain_has_cap(struct iommu_domain *domain,
117 unsigned long cap)
118{
119 return 0;
120}
121
110#endif /* CONFIG_IOMMU_API */ 122#endif /* CONFIG_IOMMU_API */
111 123
112#endif /* __LINUX_IOMMU_H */ 124#endif /* __LINUX_IOMMU_H */