diff options
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r-- | include/linux/iommu.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f3b99e1c1042..ba3b8a98a049 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -58,8 +58,10 @@ struct iommu_domain { | |||
58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | 58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ |
59 | 59 | ||
60 | enum iommu_attr { | 60 | enum iommu_attr { |
61 | DOMAIN_ATTR_MAX, | ||
62 | DOMAIN_ATTR_GEOMETRY, | 61 | DOMAIN_ATTR_GEOMETRY, |
62 | DOMAIN_ATTR_PAGING, | ||
63 | DOMAIN_ATTR_WINDOWS, | ||
64 | DOMAIN_ATTR_MAX, | ||
63 | }; | 65 | }; |
64 | 66 | ||
65 | #ifdef CONFIG_IOMMU_API | 67 | #ifdef CONFIG_IOMMU_API |
@@ -100,6 +102,16 @@ struct iommu_ops { | |||
100 | enum iommu_attr attr, void *data); | 102 | enum iommu_attr attr, void *data); |
101 | int (*domain_set_attr)(struct iommu_domain *domain, | 103 | int (*domain_set_attr)(struct iommu_domain *domain, |
102 | enum iommu_attr attr, void *data); | 104 | enum iommu_attr attr, void *data); |
105 | |||
106 | /* Window handling functions */ | ||
107 | int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, | ||
108 | phys_addr_t paddr, u64 size); | ||
109 | void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); | ||
110 | /* Set the numer of window per domain */ | ||
111 | int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); | ||
112 | /* Get the numer of window per domain */ | ||
113 | u32 (*domain_get_windows)(struct iommu_domain *domain); | ||
114 | |||
103 | unsigned long pgsize_bitmap; | 115 | unsigned long pgsize_bitmap; |
104 | }; | 116 | }; |
105 | 117 | ||
@@ -157,6 +169,10 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, | |||
157 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, | 169 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, |
158 | void *data); | 170 | void *data); |
159 | 171 | ||
172 | /* Window handling function prototypes */ | ||
173 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, | ||
174 | phys_addr_t offset, u64 size); | ||
175 | extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr); | ||
160 | /** | 176 | /** |
161 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | 177 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework |
162 | * @domain: the iommu domain where the fault has happened | 178 | * @domain: the iommu domain where the fault has happened |
@@ -239,6 +255,18 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, | |||
239 | return -ENODEV; | 255 | return -ENODEV; |
240 | } | 256 | } |
241 | 257 | ||
258 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, | ||
259 | u32 wnd_nr, phys_addr_t paddr, | ||
260 | u64 size) | ||
261 | { | ||
262 | return -ENODEV; | ||
263 | } | ||
264 | |||
265 | static inline void iommu_domain_window_disable(struct iommu_domain *domain, | ||
266 | u32 wnd_nr) | ||
267 | { | ||
268 | } | ||
269 | |||
242 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 270 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
243 | unsigned long iova) | 271 | unsigned long iova) |
244 | { | 272 | { |