aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/amd-iommu.h
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-12-07 06:01:36 -0500
committerJoerg Roedel <joerg.roedel@amd.com>2011-12-15 05:15:29 -0500
commit52efdb89d60a0f19949129a08af3437a7aab70be (patch)
treef2925a431bd88e68532b205b173ee293b174df84 /include/linux/amd-iommu.h
parent46277b75da1b6c57159496d536acc2e9352a7ee0 (diff)
iommu/amd: Add amd_iommu_device_info() function
This function can be used to find out which features necessary for IOMMUv2 usage are available on a given device. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'include/linux/amd-iommu.h')
-rw-r--r--include/linux/amd-iommu.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h
index 06688c42167..c03c281ae6e 100644
--- a/include/linux/amd-iommu.h
+++ b/include/linux/amd-iommu.h
@@ -119,6 +119,32 @@ typedef int (*amd_iommu_invalid_ppr_cb)(struct pci_dev *pdev,
119extern int amd_iommu_set_invalid_ppr_cb(struct pci_dev *pdev, 119extern int amd_iommu_set_invalid_ppr_cb(struct pci_dev *pdev,
120 amd_iommu_invalid_ppr_cb cb); 120 amd_iommu_invalid_ppr_cb cb);
121 121
122/**
123 * amd_iommu_device_info() - Get information about IOMMUv2 support of a
124 * PCI device
125 * @pdev: PCI device to query information from
126 * @info: A pointer to an amd_iommu_device_info structure which will contain
127 * the information about the PCI device
128 *
129 * Returns 0 on success, negative value on error
130 */
131
132#define AMD_IOMMU_DEVICE_FLAG_ATS_SUP 0x1 /* ATS feature supported */
133#define AMD_IOMMU_DEVICE_FLAG_PRI_SUP 0x2 /* PRI feature supported */
134#define AMD_IOMMU_DEVICE_FLAG_PASID_SUP 0x4 /* PASID context supported */
135#define AMD_IOMMU_DEVICE_FLAG_EXEC_SUP 0x8 /* Device may request execution
136 on memory pages */
137#define AMD_IOMMU_DEVICE_FLAG_PRIV_SUP 0x10 /* Device may request
138 super-user privileges */
139
140struct amd_iommu_device_info {
141 int max_pasids;
142 u32 flags;
143};
144
145extern int amd_iommu_device_info(struct pci_dev *pdev,
146 struct amd_iommu_device_info *info);
147
122#else 148#else
123 149
124static inline int amd_iommu_detect(void) { return -ENODEV; } 150static inline int amd_iommu_detect(void) { return -ENODEV; }