diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-01-26 13:40:52 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-07-11 06:12:14 -0400 |
commit | 0cd76dd13bdd2f7f02a2dc931e808e92b191082f (patch) | |
tree | 210df4b7fda8f81121fd8fb1f89a57e3e358060e /drivers/iommu | |
parent | bd0a521e88aa7a06ae7aabaed7ae196ed4ad867a (diff) |
iommu: Add domain-attribute handlers
This patch introduces an extension to the iommu-api to get
and set attributes for an iommu_domain. Two functions are
introduced for this:
* iommu_domain_get_attr()
* iommu_domain_set_attr()
These functions will be used to make the iommu-api suitable
for GART-like IOMMUs and to implement hardware-specifc
api-extensions.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/iommu.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 8b9ded88e6f5..c39972d8ded3 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c | |||
@@ -344,3 +344,23 @@ int iommu_device_group(struct device *dev, unsigned int *groupid) | |||
344 | return -ENODEV; | 344 | return -ENODEV; |
345 | } | 345 | } |
346 | EXPORT_SYMBOL_GPL(iommu_device_group); | 346 | EXPORT_SYMBOL_GPL(iommu_device_group); |
347 | |||
348 | int iommu_domain_get_attr(struct iommu_domain *domain, | ||
349 | enum iommu_attr attr, void *data) | ||
350 | { | ||
351 | if (!domain->ops->domain_get_attr) | ||
352 | return -EINVAL; | ||
353 | |||
354 | return domain->ops->domain_get_attr(domain, attr, data); | ||
355 | } | ||
356 | EXPORT_SYMBOL_GPL(iommu_domain_get_attr); | ||
357 | |||
358 | int iommu_domain_set_attr(struct iommu_domain *domain, | ||
359 | enum iommu_attr attr, void *data) | ||
360 | { | ||
361 | if (!domain->ops->domain_set_attr) | ||
362 | return -EINVAL; | ||
363 | |||
364 | return domain->ops->domain_set_attr(domain, attr, data); | ||
365 | } | ||
366 | EXPORT_SYMBOL_GPL(iommu_domain_set_attr); | ||