diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-11-15 09:24:05 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-11-23 07:01:47 -0500 |
commit | aeeb59657c35da64068336c20068da237f41ab76 (patch) | |
tree | c3571d9d742586e40a89893410ef1ce9caddd00e /include/linux/msi.h | |
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 <jiang.liu@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Yijing Wang <wangyijing@huawei.com>
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Alexander Gordeev <agordeev@redhat.com>
Link: http://lkml.kernel.org/r/1416061447-9472-8-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/msi.h')
-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 { | |||
116 | 116 | ||
117 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN | 117 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN |
118 | 118 | ||
119 | #include <linux/irqhandler.h> | ||
119 | #include <asm/msi.h> | 120 | #include <asm/msi.h> |
120 | 121 | ||
121 | struct irq_domain; | 122 | struct irq_domain; |
@@ -142,11 +143,12 @@ struct msi_domain_info; | |||
142 | * interfaces which are based on msi_desc. | 143 | * interfaces which are based on msi_desc. |
143 | */ | 144 | */ |
144 | struct msi_domain_ops { | 145 | struct msi_domain_ops { |
145 | irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, void *arg); | 146 | irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, |
147 | msi_alloc_info_t *arg); | ||
146 | int (*msi_init)(struct irq_domain *domain, | 148 | int (*msi_init)(struct irq_domain *domain, |
147 | struct msi_domain_info *info, | 149 | struct msi_domain_info *info, |
148 | unsigned int virq, irq_hw_number_t hwirq, | 150 | unsigned int virq, irq_hw_number_t hwirq, |
149 | void *arg); | 151 | msi_alloc_info_t *arg); |
150 | void (*msi_free)(struct irq_domain *domain, | 152 | void (*msi_free)(struct irq_domain *domain, |
151 | struct msi_domain_info *info, | 153 | struct msi_domain_info *info, |
152 | unsigned int virq); | 154 | unsigned int virq); |
@@ -165,16 +167,46 @@ struct msi_domain_ops { | |||
165 | 167 | ||
166 | /** | 168 | /** |
167 | * struct msi_domain_info - MSI interrupt domain data | 169 | * struct msi_domain_info - MSI interrupt domain data |
168 | * @ops: The callback data structure | 170 | * @flags: Flags to decribe features and capabilities |
169 | * @chip: The associated interrupt chip | 171 | * @ops: The callback data structure |
170 | * @data: Domain specific data | 172 | * @chip: Optional: associated interrupt chip |
173 | * @chip_data: Optional: associated interrupt chip data | ||
174 | * @handler: Optional: associated interrupt flow handler | ||
175 | * @handler_data: Optional: associated interrupt flow handler data | ||
176 | * @handler_name: Optional: associated interrupt flow handler name | ||
177 | * @data: Optional: domain specific data | ||
171 | */ | 178 | */ |
172 | struct msi_domain_info { | 179 | struct msi_domain_info { |
180 | u32 flags; | ||
173 | struct msi_domain_ops *ops; | 181 | struct msi_domain_ops *ops; |
174 | struct irq_chip *chip; | 182 | struct irq_chip *chip; |
183 | void *chip_data; | ||
184 | irq_flow_handler_t handler; | ||
185 | void *handler_data; | ||
186 | const char *handler_name; | ||
175 | void *data; | 187 | void *data; |
176 | }; | 188 | }; |
177 | 189 | ||
190 | /* Flags for msi_domain_info */ | ||
191 | enum { | ||
192 | /* | ||
193 | * Init non implemented ops callbacks with default MSI domain | ||
194 | * callbacks. | ||
195 | */ | ||
196 | MSI_FLAG_USE_DEF_DOM_OPS = (1 << 0), | ||
197 | /* | ||
198 | * Init non implemented chip callbacks with default MSI chip | ||
199 | * callbacks. | ||
200 | */ | ||
201 | MSI_FLAG_USE_DEF_CHIP_OPS = (1 << 1), | ||
202 | /* Build identity map between hwirq and irq */ | ||
203 | MSI_FLAG_IDENTITY_MAP = (1 << 2), | ||
204 | /* Support multiple PCI MSI interrupts */ | ||
205 | MSI_FLAG_MULTI_PCI_MSI = (1 << 3), | ||
206 | /* Support PCI MSIX interrupts */ | ||
207 | MSI_FLAG_PCI_MSIX = (1 << 4), | ||
208 | }; | ||
209 | |||
178 | int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, | 210 | int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, |
179 | bool force); | 211 | bool force); |
180 | 212 | ||