162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef __ASM_GENERIC_MSI_H
362306a36Sopenharmony_ci#define __ASM_GENERIC_MSI_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <linux/types.h>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#ifdef CONFIG_GENERIC_MSI_IRQ
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef NUM_MSI_ALLOC_SCRATCHPAD_REGS
1062306a36Sopenharmony_ci# define NUM_MSI_ALLOC_SCRATCHPAD_REGS	2
1162306a36Sopenharmony_ci#endif
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_cistruct msi_desc;
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/**
1662306a36Sopenharmony_ci * struct msi_alloc_info - Default structure for MSI interrupt allocation.
1762306a36Sopenharmony_ci * @desc:	Pointer to msi descriptor
1862306a36Sopenharmony_ci * @hwirq:	Associated hw interrupt number in the domain
1962306a36Sopenharmony_ci * @scratchpad:	Storage for implementation specific scratch data
2062306a36Sopenharmony_ci *
2162306a36Sopenharmony_ci * Architectures can provide their own implementation by not including
2262306a36Sopenharmony_ci * asm-generic/msi.h into their arch specific header file.
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_citypedef struct msi_alloc_info {
2562306a36Sopenharmony_ci	struct msi_desc			*desc;
2662306a36Sopenharmony_ci	irq_hw_number_t			hwirq;
2762306a36Sopenharmony_ci	unsigned long			flags;
2862306a36Sopenharmony_ci	union {
2962306a36Sopenharmony_ci		unsigned long		ul;
3062306a36Sopenharmony_ci		void			*ptr;
3162306a36Sopenharmony_ci	} scratchpad[NUM_MSI_ALLOC_SCRATCHPAD_REGS];
3262306a36Sopenharmony_ci} msi_alloc_info_t;
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci/* Device generating MSIs is proxying for another device */
3562306a36Sopenharmony_ci#define MSI_ALLOC_FLAGS_PROXY_DEVICE	(1UL << 0)
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#define GENERIC_MSI_DOMAIN_OPS		1
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci#endif /* CONFIG_GENERIC_MSI_IRQ */
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#endif
42