aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/msi.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-12-06 23:51:10 +0100
committerThomas Gleixner <tglx@linutronix.de>2021-12-16 22:22:17 +0100
commit602905253607ba892336f7bba8bb45b5be819d87 (patch)
treeb6339c6549c6b6da96d99fae229cadb2c7363e1a /include/linux/msi.h
parentgenirq/msi: Provide a set of advanced MSI accessors and iterators (diff)
downloadlinux-dev-602905253607ba892336f7bba8bb45b5be819d87.tar.xz
linux-dev-602905253607ba892336f7bba8bb45b5be819d87.zip
genirq/msi: Provide msi_alloc_msi_desc() and a simple allocator
Provide msi_alloc_msi_desc() which takes a template MSI descriptor for initializing a newly allocated descriptor. This allows to simplify various usage sites of alloc_msi_entry() and moves the storage handling into the core code. For simple cases where only a linear vector space is required provide msi_add_simple_msi_descs() which just allocates a linear range of MSI descriptors and fills msi_desc::msi_index accordingly. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Michael Kelley <mikelley@microsoft.com> Tested-by: Nishanth Menon <nm@ti.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20211206210747.873833567@linutronix.de
Diffstat (limited to 'include/linux/msi.h')
-rw-r--r--include/linux/msi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 703221f7e9ea..bbb8c1e2c18b 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -247,6 +247,8 @@ static inline void pci_write_msi_msg(unsigned int irq, struct msi_msg *msg)
}
#endif /* CONFIG_PCI_MSI */
+int msi_add_msi_desc(struct device *dev, struct msi_desc *init_desc);
+
struct msi_desc *alloc_msi_entry(struct device *dev, int nvec,
const struct irq_affinity_desc *affinity);
void free_msi_entry(struct msi_desc *entry);