diff options
| author | Alex Williamson <alex.williamson@redhat.com> | 2011-10-21 15:56:18 -0400 |
|---|---|---|
| committer | Joerg Roedel <joerg.roedel@amd.com> | 2011-11-15 06:22:30 -0500 |
| commit | 8fbdce659549d93dfb257ec4eabacf63a188e506 (patch) | |
| tree | 7a6e9762593e77775ce47e387d006337b9615db3 | |
| parent | 70ae6f0d55bd216b2f773fa5fa5018c0490a9e50 (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>
| -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 4ee277a8521a..1d82b631d09c 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, | |||
| 2773 | return 0; | 2773 | return 0; |
| 2774 | } | 2774 | } |
| 2775 | 2775 | ||
| 2776 | static int amd_iommu_device_group(struct device *dev, unsigned int *groupid) | ||
| 2777 | { | ||
| 2778 | struct iommu_dev_data *dev_data = dev->archdata.iommu; | ||
| 2779 | |||
| 2780 | if (!dev_data) | ||
| 2781 | return -ENODEV; | ||
| 2782 | |||
| 2783 | *groupid = amd_iommu_alias_table[dev_data->devid]; | ||
| 2784 | |||
| 2785 | return 0; | ||
| 2786 | } | ||
| 2787 | |||
| 2776 | static struct iommu_ops amd_iommu_ops = { | 2788 | static struct iommu_ops amd_iommu_ops = { |
| 2777 | .domain_init = amd_iommu_domain_init, | 2789 | .domain_init = amd_iommu_domain_init, |
| 2778 | .domain_destroy = amd_iommu_domain_destroy, | 2790 | .domain_destroy = amd_iommu_domain_destroy, |
| @@ -2782,6 +2794,7 @@ static struct iommu_ops amd_iommu_ops = { | |||
| 2782 | .unmap = amd_iommu_unmap, | 2794 | .unmap = amd_iommu_unmap, |
| 2783 | .iova_to_phys = amd_iommu_iova_to_phys, | 2795 | .iova_to_phys = amd_iommu_iova_to_phys, |
| 2784 | .domain_has_cap = amd_iommu_domain_has_cap, | 2796 | .domain_has_cap = amd_iommu_domain_has_cap, |
| 2797 | .device_group = amd_iommu_device_group, | ||
| 2785 | }; | 2798 | }; |
| 2786 | 2799 | ||
| 2787 | /***************************************************************************** | 2800 | /***************************************************************************** |
