aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intr_remapping.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2012-03-30 14:47:05 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2012-05-07 08:35:00 -0400
commit5e2b930b0784a30c98dee8e9d79c1f84c31f7209 (patch)
treefae90c6dd23adf8d154ddd20492bf2efb61e1c29 /drivers/iommu/intr_remapping.c
parent9d619f65722236e0e0c35467d1528caed206e439 (diff)
iommu/vt-d: Convert MSI remapping setup to remap_ops
This patch introduces remapping-ops for setting ups MSI interrupts. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu/intr_remapping.c')
-rw-r--r--drivers/iommu/intr_remapping.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/iommu/intr_remapping.c b/drivers/iommu/intr_remapping.c
index a68d304f9729..9dc179316ba1 100644
--- a/drivers/iommu/intr_remapping.c
+++ b/drivers/iommu/intr_remapping.c
@@ -127,3 +127,38 @@ void intr_free_irq(int irq)
127 127
128 remap_ops->free_irq(irq); 128 remap_ops->free_irq(irq);
129} 129}
130
131void intr_compose_msi_msg(struct pci_dev *pdev,
132 unsigned int irq, unsigned int dest,
133 struct msi_msg *msg, u8 hpet_id)
134{
135 if (!remap_ops || !remap_ops->compose_msi_msg)
136 return;
137
138 remap_ops->compose_msi_msg(pdev, irq, dest, msg, hpet_id);
139}
140
141int intr_msi_alloc_irq(struct pci_dev *pdev, int irq, int nvec)
142{
143 if (!remap_ops || !remap_ops->msi_alloc_irq)
144 return -ENODEV;
145
146 return remap_ops->msi_alloc_irq(pdev, irq, nvec);
147}
148
149int intr_msi_setup_irq(struct pci_dev *pdev, unsigned int irq,
150 int index, int sub_handle)
151{
152 if (!remap_ops || !remap_ops->msi_setup_irq)
153 return -ENODEV;
154
155 return remap_ops->msi_setup_irq(pdev, irq, index, sub_handle);
156}
157
158int intr_setup_hpet_msi(unsigned int irq, unsigned int id)
159{
160 if (!remap_ops || !remap_ops->setup_hpet_msi)
161 return -ENODEV;
162
163 return remap_ops->setup_hpet_msi(irq, id);
164}