diff options
| author | Jiang Liu <[email protected]> | 2014-11-15 22:24:05 +0800 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2014-11-23 13:01:47 +0100 |
| commit | aeeb59657c35da64068336c20068da237f41ab76 (patch) | |
| tree | c3571d9d742586e40a89893410ef1ce9caddd00e /include | |
| parent | d9109698be6e7439e6082aa00d79d4556114739b (diff) | |
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 <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: [email protected]
Cc: Bjorn Helgaas <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Yijing Wang <[email protected]>
Cc: Yingjoe Chen <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: Alexander Gordeev <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/msi.h | 42 |
1 files changed, 37 insertions, 5 deletions
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 <linux/irqhandler.h> #include <asm/msi.h> 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); |