From aeeb59657c35da64068336c20068da237f41ab76 Mon Sep 17 00:00:00 2001 From: Jiang Liu Date: Sat, 15 Nov 2014 22:24:05 +0800 Subject: genirq: Provide default callbacks for msi_domain_ops Extend struct msi_domain_info and provide default callbacks for msi_domain_ops. Signed-off-by: Jiang Liu Cc: Tony Luck Cc: linux-arm-kernel@lists.infradead.org Cc: Bjorn Helgaas Cc: Grant Likely Cc: Marc Zyngier Cc: Yijing Wang Cc: Yingjoe Chen Cc: Borislav Petkov Cc: Matthias Brugger Cc: Alexander Gordeev Link: http://lkml.kernel.org/r/1416061447-9472-8-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'include/linux/msi.h') diff --git a/include/linux/msi.h b/include/linux/msi.h index 7a93a988dce8..0098e2c8fd42 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -116,6 +116,7 @@ struct msi_controller { #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN +#include #include struct irq_domain; @@ -142,11 +143,12 @@ struct msi_domain_info; * interfaces which are based on msi_desc. */ struct msi_domain_ops { - irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, void *arg); + irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, + msi_alloc_info_t *arg); int (*msi_init)(struct irq_domain *domain, struct msi_domain_info *info, unsigned int virq, irq_hw_number_t hwirq, - void *arg); + msi_alloc_info_t *arg); void (*msi_free)(struct irq_domain *domain, struct msi_domain_info *info, unsigned int virq); @@ -165,16 +167,46 @@ struct msi_domain_ops { /** * struct msi_domain_info - MSI interrupt domain data - * @ops: The callback data structure - * @chip: The associated interrupt chip - * @data: Domain specific data + * @flags: Flags to decribe features and capabilities + * @ops: The callback data structure + * @chip: Optional: associated interrupt chip + * @chip_data: Optional: associated interrupt chip data + * @handler: Optional: associated interrupt flow handler + * @handler_data: Optional: associated interrupt flow handler data + * @handler_name: Optional: associated interrupt flow handler name + * @data: Optional: domain specific data */ struct msi_domain_info { + u32 flags; struct msi_domain_ops *ops; struct irq_chip *chip; + void *chip_data; + irq_flow_handler_t handler; + void *handler_data; + const char *handler_name; void *data; }; +/* Flags for msi_domain_info */ +enum { + /* + * Init non implemented ops callbacks with default MSI domain + * callbacks. + */ + MSI_FLAG_USE_DEF_DOM_OPS = (1 << 0), + /* + * Init non implemented chip callbacks with default MSI chip + * callbacks. + */ + MSI_FLAG_USE_DEF_CHIP_OPS = (1 << 1), + /* Build identity map between hwirq and irq */ + MSI_FLAG_IDENTITY_MAP = (1 << 2), + /* Support multiple PCI MSI interrupts */ + MSI_FLAG_MULTI_PCI_MSI = (1 << 3), + /* Support PCI MSIX interrupts */ + MSI_FLAG_PCI_MSIX = (1 << 4), +}; + int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force); -- cgit v1.2.3-59-g8ed1b