diff options
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r-- | include/linux/iommu.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index d937580417ba..450293f6d68b 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -35,12 +35,13 @@ struct iommu_domain; | |||
35 | #define IOMMU_FAULT_WRITE 0x1 | 35 | #define IOMMU_FAULT_WRITE 0x1 |
36 | 36 | ||
37 | typedef int (*iommu_fault_handler_t)(struct iommu_domain *, | 37 | typedef int (*iommu_fault_handler_t)(struct iommu_domain *, |
38 | struct device *, unsigned long, int); | 38 | struct device *, unsigned long, int, void *); |
39 | 39 | ||
40 | struct iommu_domain { | 40 | struct iommu_domain { |
41 | struct iommu_ops *ops; | 41 | struct iommu_ops *ops; |
42 | void *priv; | 42 | void *priv; |
43 | iommu_fault_handler_t handler; | 43 | iommu_fault_handler_t handler; |
44 | void *handler_token; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 | 47 | #define IOMMU_CAP_CACHE_COHERENCY 0x1 |
@@ -95,7 +96,7 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | |||
95 | extern int iommu_domain_has_cap(struct iommu_domain *domain, | 96 | extern int iommu_domain_has_cap(struct iommu_domain *domain, |
96 | unsigned long cap); | 97 | unsigned long cap); |
97 | extern void iommu_set_fault_handler(struct iommu_domain *domain, | 98 | extern void iommu_set_fault_handler(struct iommu_domain *domain, |
98 | iommu_fault_handler_t handler); | 99 | iommu_fault_handler_t handler, void *token); |
99 | extern int iommu_device_group(struct device *dev, unsigned int *groupid); | 100 | extern int iommu_device_group(struct device *dev, unsigned int *groupid); |
100 | 101 | ||
101 | /** | 102 | /** |
@@ -132,7 +133,8 @@ static inline int report_iommu_fault(struct iommu_domain *domain, | |||
132 | * invoke it. | 133 | * invoke it. |
133 | */ | 134 | */ |
134 | if (domain->handler) | 135 | if (domain->handler) |
135 | ret = domain->handler(domain, dev, iova, flags); | 136 | ret = domain->handler(domain, dev, iova, flags, |
137 | domain->handler_token); | ||
136 | 138 | ||
137 | return ret; | 139 | return ret; |
138 | } | 140 | } |
@@ -191,7 +193,7 @@ static inline int domain_has_cap(struct iommu_domain *domain, | |||
191 | } | 193 | } |
192 | 194 | ||
193 | static inline void iommu_set_fault_handler(struct iommu_domain *domain, | 195 | static inline void iommu_set_fault_handler(struct iommu_domain *domain, |
194 | iommu_fault_handler_t handler) | 196 | iommu_fault_handler_t handler, void *token) |
195 | { | 197 | { |
196 | } | 198 | } |
197 | 199 | ||