diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2012-03-30 22:47:05 +0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-05-07 16:35:00 +0400 |
commit | 5e2b930b0784a30c98dee8e9d79c1f84c31f7209 (patch) | |
tree | fae90c6dd23adf8d154ddd20492bf2efb61e1c29 /arch/x86/include/asm | |
parent | 9d619f65722236e0e0c35467d1528caed206e439 (diff) | |
download | linux-5e2b930b0784a30c98dee8e9d79c1f84c31f7209.tar.xz |
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 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/intr_remapping.h | 26 | ||||
-rw-r--r-- | arch/x86/include/asm/irq_remapping.h | 23 |
2 files changed, 26 insertions, 23 deletions
diff --git a/arch/x86/include/asm/intr_remapping.h b/arch/x86/include/asm/intr_remapping.h index a195b7d6995c..a6afd6efa6c6 100644 --- a/arch/x86/include/asm/intr_remapping.h +++ b/arch/x86/include/asm/intr_remapping.h @@ -26,6 +26,7 @@ struct IO_APIC_route_entry; struct io_apic_irq_attr; +struct pci_dev; extern int intr_remapping_enabled; @@ -44,6 +45,13 @@ extern int intr_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force); extern void intr_free_irq(int irq); +extern void intr_compose_msi_msg(struct pci_dev *pdev, + unsigned int irq, unsigned int dest, + struct msi_msg *msg, u8 hpet_id); +extern int intr_msi_alloc_irq(struct pci_dev *pdev, int irq, int nvec); +extern int intr_msi_setup_irq(struct pci_dev *pdev, unsigned int irq, + int index, int sub_handle); +extern int intr_setup_hpet_msi(unsigned int irq, unsigned int id); #else /* CONFIG_IRQ_REMAP */ @@ -70,6 +78,24 @@ static inline int intr_set_affinity(struct irq_data *data, return 0; } static inline void intr_free_irq(int irq) { } +static inline void intr_compose_msi_msg(struct pci_dev *pdev, + unsigned int irq, unsigned int dest, + struct msi_msg *msg, u8 hpet_id) +{ +} +static inline int intr_msi_alloc_irq(struct pci_dev *pdev, int irq, int nvec) +{ + return -ENODEV; +} +static inline int intr_msi_setup_irq(struct pci_dev *pdev, unsigned int irq, + int index, int sub_handle) +{ + return -ENODEV; +} +static inline int intr_setup_hpet_msi(unsigned int irq, unsigned int id) +{ + return -ENODEV; +} #endif /* CONFIG_IRQ_REMAP */ #endif /* __X86_INTR_REMAPPING_H */ diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h index 47d99934580f..0ddfc0b90adb 100644 --- a/arch/x86/include/asm/irq_remapping.h +++ b/arch/x86/include/asm/irq_remapping.h @@ -5,34 +5,11 @@ #ifdef CONFIG_IRQ_REMAP static void irq_remap_modify_chip_defaults(struct irq_chip *chip); -static inline void prepare_irte(struct irte *irte, int vector, - unsigned int dest) -{ - memset(irte, 0, sizeof(*irte)); - - irte->present = 1; - irte->dst_mode = apic->irq_dest_mode; - /* - * Trigger mode in the IRTE will always be edge, and for IO-APIC, the - * actual level or edge trigger will be setup in the IO-APIC - * RTE. This will help simplify level triggered irq migration. - * For more details, see the comments (in io_apic.c) explainig IO-APIC - * irq migration in the presence of interrupt-remapping. - */ - irte->trigger_mode = 0; - irte->dlvry_mode = apic->irq_delivery_mode; - irte->vector = vector; - irte->dest_id = IRTE_DEST(dest); - irte->redir_hint = 1; -} static inline bool irq_remapped(struct irq_cfg *cfg) { return cfg->irq_2_iommu.iommu != NULL; } #else -static void prepare_irte(struct irte *irte, int vector, unsigned int dest) -{ -} static inline bool irq_remapped(struct irq_cfg *cfg) { return false; |