From 5e2b930b0784a30c98dee8e9d79c1f84c31f7209 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Fri, 30 Mar 2012 11:47:05 -0700 Subject: 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 Acked-by: Yinghai Lu Cc: David Woodhouse Cc: Alex Williamson Signed-off-by: Suresh Siddha Signed-off-by: Joerg Roedel --- arch/x86/include/asm/intr_remapping.h | 26 ++++++++++++++++++++++++++ arch/x86/include/asm/irq_remapping.h | 23 ----------------------- 2 files changed, 26 insertions(+), 23 deletions(-) (limited to 'arch/x86/include/asm') 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; -- cgit v1.2.3