diff options
| author | Joerg Roedel <jroedel@suse.de> | 2014-09-03 12:47:25 -0400 |
|---|---|---|
| committer | Joerg Roedel <jroedel@suse.de> | 2014-09-25 09:44:49 -0400 |
| commit | 3c0e0ca0a4e757159d868c4870556515d66b6c97 (patch) | |
| tree | 2edcb98cf5ab39daa4423054870030c81dd399ec /include/linux | |
| parent | 1aed074869a9cbe0a846ea7b254d8fd9a4a4d31f (diff) | |
iommu: Introduce iommu_capable API function
This function will replace the current iommu_domain_has_cap
function and clean up the interface while at it.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/iommu.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 98fc126655ae..d5534d554693 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
| @@ -105,6 +105,7 @@ enum iommu_attr { | |||
| 105 | * @pgsize_bitmap: bitmap of supported page sizes | 105 | * @pgsize_bitmap: bitmap of supported page sizes |
| 106 | */ | 106 | */ |
| 107 | struct iommu_ops { | 107 | struct iommu_ops { |
| 108 | bool (*capable)(enum iommu_cap); | ||
| 108 | int (*domain_init)(struct iommu_domain *domain); | 109 | int (*domain_init)(struct iommu_domain *domain); |
| 109 | void (*domain_destroy)(struct iommu_domain *domain); | 110 | void (*domain_destroy)(struct iommu_domain *domain); |
| 110 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); | 111 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); |
| @@ -145,6 +146,7 @@ struct iommu_ops { | |||
| 145 | 146 | ||
| 146 | extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops); | 147 | extern int bus_set_iommu(struct bus_type *bus, const struct iommu_ops *ops); |
| 147 | extern bool iommu_present(struct bus_type *bus); | 148 | extern bool iommu_present(struct bus_type *bus); |
| 149 | extern bool iommu_capable(struct bus_type *bus, enum iommu_cap cap); | ||
| 148 | extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); | 150 | extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus); |
| 149 | extern struct iommu_group *iommu_group_get_by_id(int id); | 151 | extern struct iommu_group *iommu_group_get_by_id(int id); |
| 150 | extern void iommu_domain_free(struct iommu_domain *domain); | 152 | extern void iommu_domain_free(struct iommu_domain *domain); |
| @@ -253,6 +255,11 @@ static inline bool iommu_present(struct bus_type *bus) | |||
| 253 | return false; | 255 | return false; |
| 254 | } | 256 | } |
| 255 | 257 | ||
| 258 | static inline bool iommu_capable(struct bus_type *bus, enum iommu_cap cap) | ||
| 259 | { | ||
| 260 | return false; | ||
| 261 | } | ||
| 262 | |||
| 256 | static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) | 263 | static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus) |
| 257 | { | 264 | { |
| 258 | return NULL; | 265 | return NULL; |
