aboutsummaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2012-01-26 19:40:52 +0100
committerJoerg Roedel <joerg.roedel@amd.com>2012-07-11 12:12:14 +0200
commit0cd76dd13bdd2f7f02a2dc931e808e92b191082f (patch)
tree210df4b7fda8f81121fd8fb1f89a57e3e358060e /drivers/iommu
parentbd0a521e88aa7a06ae7aabaed7ae196ed4ad867a (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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 8b9ded88e6f..c39972d8ded 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)
return -ENODEV;
}
EXPORT_SYMBOL_GPL(iommu_device_group);
+
+int iommu_domain_get_attr(struct iommu_domain *domain,
+ enum iommu_attr attr, void *data)
+{
+ if (!domain->ops->domain_get_attr)
+ return -EINVAL;
+
+ return domain->ops->domain_get_attr(domain, attr, data);
+}
+EXPORT_SYMBOL_GPL(iommu_domain_get_attr);
+
+int iommu_domain_set_attr(struct iommu_domain *domain,
+ enum iommu_attr attr, void *data)
+{
+ if (!domain->ops->domain_set_attr)
+ return -EINVAL;
+
+ return domain->ops->domain_set_attr(domain, attr, data);
+}
+EXPORT_SYMBOL_GPL(iommu_domain_set_attr);