summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2011-10-21 15:56:18 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-11-15 12:22:30 +0100
commit8fbdce659549d93dfb257ec4eabacf63a188e506 (patch)
tree7a6e9762593e77775ce47e387d006337b9615db3 /drivers/iommu
parent70ae6f0d55bd216b2f773fa5fa5018c0490a9e50 (diff)
downloadlinux-3.10-8fbdce659549d93dfb257ec4eabacf63a188e506.tar.gz
linux-3.10-8fbdce659549d93dfb257ec4eabacf63a188e506.tar.bz2
linux-3.10-8fbdce659549d93dfb257ec4eabacf63a188e506.zip
iommu/amd: Implement iommu_device_group
Just use the amd_iommu_alias_table directly. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 4ee277a8521..1d82b631d09 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2773,6 +2773,18 @@ static int amd_iommu_domain_has_cap(struct iommu_domain *domain,
return 0;
}
+static int amd_iommu_device_group(struct device *dev, unsigned int *groupid)
+{
+ struct iommu_dev_data *dev_data = dev->archdata.iommu;
+
+ if (!dev_data)
+ return -ENODEV;
+
+ *groupid = amd_iommu_alias_table[dev_data->devid];
+
+ return 0;
+}
+
static struct iommu_ops amd_iommu_ops = {
.domain_init = amd_iommu_domain_init,
.domain_destroy = amd_iommu_domain_destroy,
@@ -2782,6 +2794,7 @@ static struct iommu_ops amd_iommu_ops = {
.unmap = amd_iommu_unmap,
.iova_to_phys = amd_iommu_iova_to_phys,
.domain_has_cap = amd_iommu_domain_has_cap,
+ .device_group = amd_iommu_device_group,
};
/*****************************************************************************