aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/intel-iommu.h3
-rw-r--r--include/linux/iommu.h32
3 files changed, 34 insertions, 3 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index af424acd393d..75f5bcb8930b 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -124,7 +124,7 @@ struct bus_type {
124 124
125 const struct dev_pm_ops *pm; 125 const struct dev_pm_ops *pm;
126 126
127 struct iommu_ops *iommu_ops; 127 const struct iommu_ops *iommu_ops;
128 128
129 struct subsys_private *p; 129 struct subsys_private *p;
130 struct lock_class_key lock_key; 130 struct lock_class_key lock_key;
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 0a2da5188217..a65208a8fe18 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -336,6 +336,7 @@ struct intel_iommu {
336#ifdef CONFIG_IRQ_REMAP 336#ifdef CONFIG_IRQ_REMAP
337 struct ir_table *ir_table; /* Interrupt remapping info */ 337 struct ir_table *ir_table; /* Interrupt remapping info */
338#endif 338#endif
339 struct device *iommu_dev; /* IOMMU-sysfs device */
339 int node; 340 int node;
340}; 341};
341 342
@@ -365,4 +366,6 @@ extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
365 366
366extern int dmar_ir_support(void); 367extern int dmar_ir_support(void);
367 368
369extern const struct attribute_group *intel_iommu_groups[];
370
368#endif 371#endif
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index b96a5b2136e4..20f9a527922a 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -50,7 +50,7 @@ struct iommu_domain_geometry {
50}; 50};
51 51
52struct iommu_domain { 52struct iommu_domain {
53 struct iommu_ops *ops; 53 const struct iommu_ops *ops;
54 void *priv; 54 void *priv;
55 iommu_fault_handler_t handler; 55 iommu_fault_handler_t handler;
56 void *handler_token; 56 void *handler_token;
@@ -140,7 +140,7 @@ struct iommu_ops {
140#define IOMMU_GROUP_NOTIFY_UNBIND_DRIVER 5 /* Pre Driver unbind */ 140#define IOMMU_GROUP_NOTIFY_UNBIND_DRIVER 5 /* Pre Driver unbind */
141#define IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER 6 /* Post Driver unbind */ 141#define IOMMU_GROUP_NOTIFY_UNBOUND_DRIVER 6 /* Post Driver unbind */
142 142
143extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops); 143extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops);
144extern bool iommu_present(struct bus_type *bus); 144extern bool iommu_present(struct bus_type *bus);
145extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); 145extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
146extern struct iommu_group *iommu_group_get_by_id(int id); 146extern struct iommu_group *iommu_group_get_by_id(int id);
@@ -181,11 +181,18 @@ extern int iommu_group_register_notifier(struct iommu_group *group,
181extern int iommu_group_unregister_notifier(struct iommu_group *group, 181extern int iommu_group_unregister_notifier(struct iommu_group *group,
182 struct notifier_block *nb); 182 struct notifier_block *nb);
183extern int iommu_group_id(struct iommu_group *group); 183extern int iommu_group_id(struct iommu_group *group);
184extern struct iommu_group *iommu_group_get_for_dev(struct device *dev);
184 185
185extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, 186extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
186 void *data); 187 void *data);
187extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, 188extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr,
188 void *data); 189 void *data);
190struct device *iommu_device_create(struct device *parent, void *drvdata,
191 const struct attribute_group **groups,
192 const char *fmt, ...);
193void iommu_device_destroy(struct device *dev);
194int iommu_device_link(struct device *dev, struct device *link);
195void iommu_device_unlink(struct device *dev, struct device *link);
189 196
190/* Window handling function prototypes */ 197/* Window handling function prototypes */
191extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, 198extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr,
@@ -396,6 +403,27 @@ static inline int iommu_domain_set_attr(struct iommu_domain *domain,
396 return -EINVAL; 403 return -EINVAL;
397} 404}
398 405
406static inline struct device *iommu_device_create(struct device *parent,
407 void *drvdata,
408 const struct attribute_group **groups,
409 const char *fmt, ...)
410{
411 return ERR_PTR(-ENODEV);
412}
413
414static inline void iommu_device_destroy(struct device *dev)
415{
416}
417
418static inline int iommu_device_link(struct device *dev, struct device *link)
419{
420 return -EINVAL;
421}
422
423static inline void iommu_device_unlink(struct device *dev, struct device *link)
424{
425}
426
399#endif /* CONFIG_IOMMU_API */ 427#endif /* CONFIG_IOMMU_API */
400 428
401#endif /* __LINUX_IOMMU_H */ 429#endif /* __LINUX_IOMMU_H */