diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2011-10-21 15:56:18 -0400 |
---|---|---|
committer | Hiroshi DOYU <hdoyu@nvidia.com> | 2012-01-23 11:11:38 +0200 |
commit | feba22d51d38598182191c36bdf9fc2f2ebbe481 (patch) | |
tree | 01020661211094eb2e97ea7e313d6117bd563082 /drivers/iommu/amd_iommu.c | |
parent | 999342f46cfaf0d5175f1db8c532276cddb70fa2 (diff) |
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>
Conflicts:
drivers/iommu/amd_iommu.c
Change-Id: I3aaeb78a1359e1ad8f4a37ba07fb1d404daa8d83
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 341573821864..e9c6233045eb 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2788,6 +2788,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, @@ -2798,6 +2810,7 @@ static struct iommu_ops amd_iommu_ops = { .iova_to_phys = amd_iommu_iova_to_phys, .domain_has_cap = amd_iommu_domain_has_cap, .pgsize_bitmap = AMD_IOMMU_PGSIZES, + .device_group = amd_iommu_device_group, }; /***************************************************************************** |