diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/amd-iommu.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h index 23e21e15dfab..06688c42167d 100644 --- a/include/linux/amd-iommu.h +++ b/include/linux/amd-iommu.h | |||
@@ -28,9 +28,6 @@ struct task_struct; | |||
28 | struct pci_dev; | 28 | struct pci_dev; |
29 | 29 | ||
30 | extern int amd_iommu_detect(void); | 30 | extern int amd_iommu_detect(void); |
31 | extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid, | ||
32 | struct task_struct *task); | ||
33 | extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid); | ||
34 | 31 | ||
35 | 32 | ||
36 | /** | 33 | /** |
@@ -91,6 +88,37 @@ extern int amd_iommu_bind_pasid(struct pci_dev *pdev, int pasid, | |||
91 | */ | 88 | */ |
92 | extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid); | 89 | extern void amd_iommu_unbind_pasid(struct pci_dev *pdev, int pasid); |
93 | 90 | ||
91 | /** | ||
92 | * amd_iommu_set_invalid_ppr_cb() - Register a call-back for failed | ||
93 | * PRI requests | ||
94 | * @pdev: The PCI device the call-back should be registered for | ||
95 | * @cb: The call-back function | ||
96 | * | ||
97 | * The IOMMUv2 driver invokes this call-back when it is unable to | ||
98 | * successfully handle a PRI request. The device driver can then decide | ||
99 | * which PRI response the device should see. Possible return values for | ||
100 | * the call-back are: | ||
101 | * | ||
102 | * - AMD_IOMMU_INV_PRI_RSP_SUCCESS - Send SUCCESS back to the device | ||
103 | * - AMD_IOMMU_INV_PRI_RSP_INVALID - Send INVALID back to the device | ||
104 | * - AMD_IOMMU_INV_PRI_RSP_FAIL - Send Failure back to the device, | ||
105 | * the device is required to disable | ||
106 | * PRI when it receives this response | ||
107 | * | ||
108 | * The function returns 0 on success or negative value on error. | ||
109 | */ | ||
110 | #define AMD_IOMMU_INV_PRI_RSP_SUCCESS 0 | ||
111 | #define AMD_IOMMU_INV_PRI_RSP_INVALID 1 | ||
112 | #define AMD_IOMMU_INV_PRI_RSP_FAIL 2 | ||
113 | |||
114 | typedef int (*amd_iommu_invalid_ppr_cb)(struct pci_dev *pdev, | ||
115 | int pasid, | ||
116 | unsigned long address, | ||
117 | u16); | ||
118 | |||
119 | extern int amd_iommu_set_invalid_ppr_cb(struct pci_dev *pdev, | ||
120 | amd_iommu_invalid_ppr_cb cb); | ||
121 | |||
94 | #else | 122 | #else |
95 | 123 | ||
96 | static inline int amd_iommu_detect(void) { return -ENODEV; } | 124 | static inline int amd_iommu_detect(void) { return -ENODEV; } |