diff options
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r-- | include/linux/iommu.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 8a7bfb1b6ca0..3af4ffd591b9 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #define IOMMU_READ (1) | 22 | #define IOMMU_READ (1) |
23 | #define IOMMU_WRITE (2) | 23 | #define IOMMU_WRITE (2) |
24 | #define IOMMU_CACHE (4) /* DMA cache coherency */ | ||
24 | 25 | ||
25 | struct device; | 26 | struct device; |
26 | 27 | ||
@@ -28,6 +29,8 @@ struct iommu_domain { | |||
28 | void *priv; | 29 | void *priv; |
29 | }; | 30 | }; |
30 | 31 | ||
32 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 | ||
33 | |||
31 | struct iommu_ops { | 34 | struct iommu_ops { |
32 | int (*domain_init)(struct iommu_domain *domain); | 35 | int (*domain_init)(struct iommu_domain *domain); |
33 | void (*domain_destroy)(struct iommu_domain *domain); | 36 | void (*domain_destroy)(struct iommu_domain *domain); |
@@ -39,6 +42,8 @@ struct iommu_ops { | |||
39 | size_t size); | 42 | size_t size); |
40 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, | 43 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, |
41 | unsigned long iova); | 44 | unsigned long iova); |
45 | int (*domain_has_cap)(struct iommu_domain *domain, | ||
46 | unsigned long cap); | ||
42 | }; | 47 | }; |
43 | 48 | ||
44 | #ifdef CONFIG_IOMMU_API | 49 | #ifdef CONFIG_IOMMU_API |
@@ -57,6 +62,8 @@ extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova, | |||
57 | size_t size); | 62 | size_t size); |
58 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 63 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
59 | unsigned long iova); | 64 | unsigned long iova); |
65 | extern int iommu_domain_has_cap(struct iommu_domain *domain, | ||
66 | unsigned long cap); | ||
60 | 67 | ||
61 | #else /* CONFIG_IOMMU_API */ | 68 | #else /* CONFIG_IOMMU_API */ |
62 | 69 | ||
@@ -107,6 +114,12 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | |||
107 | return 0; | 114 | return 0; |
108 | } | 115 | } |
109 | 116 | ||
117 | static inline int domain_has_cap(struct iommu_domain *domain, | ||
118 | unsigned long cap) | ||
119 | { | ||
120 | return 0; | ||
121 | } | ||
122 | |||
110 | #endif /* CONFIG_IOMMU_API */ | 123 | #endif /* CONFIG_IOMMU_API */ |
111 | 124 | ||
112 | #endif /* __LINUX_IOMMU_H */ | 125 | #endif /* __LINUX_IOMMU_H */ |