Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Thomas Gleixner | 926ff9a | 2014-11-17 18:09:34 +0100 | [diff] [blame] | 2 | #ifndef __ASM_GENERIC_MSI_H |
| 3 | #define __ASM_GENERIC_MSI_H |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | |
Thomas Gleixner | 8073c1a | 2020-10-24 22:35:11 +0100 | [diff] [blame] | 7 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN |
| 8 | |
Thomas Gleixner | 926ff9a | 2014-11-17 18:09:34 +0100 | [diff] [blame] | 9 | #ifndef NUM_MSI_ALLOC_SCRATCHPAD_REGS |
| 10 | # define NUM_MSI_ALLOC_SCRATCHPAD_REGS 2 |
| 11 | #endif |
| 12 | |
| 13 | struct msi_desc; |
| 14 | |
| 15 | /** |
| 16 | * struct msi_alloc_info - Default structure for MSI interrupt allocation. |
| 17 | * @desc: Pointer to msi descriptor |
| 18 | * @hwirq: Associated hw interrupt number in the domain |
| 19 | * @scratchpad: Storage for implementation specific scratch data |
| 20 | * |
| 21 | * Architectures can provide their own implementation by not including |
| 22 | * asm-generic/msi.h into their arch specific header file. |
| 23 | */ |
| 24 | typedef struct msi_alloc_info { |
| 25 | struct msi_desc *desc; |
| 26 | irq_hw_number_t hwirq; |
Marc Zyngier | 91f90da | 2020-11-29 13:52:06 +0000 | [diff] [blame] | 27 | unsigned long flags; |
Thomas Gleixner | 926ff9a | 2014-11-17 18:09:34 +0100 | [diff] [blame] | 28 | union { |
| 29 | unsigned long ul; |
| 30 | void *ptr; |
| 31 | } scratchpad[NUM_MSI_ALLOC_SCRATCHPAD_REGS]; |
| 32 | } msi_alloc_info_t; |
| 33 | |
Marc Zyngier | 91f90da | 2020-11-29 13:52:06 +0000 | [diff] [blame] | 34 | /* Device generating MSIs is proxying for another device */ |
| 35 | #define MSI_ALLOC_FLAGS_PROXY_DEVICE (1UL << 0) |
| 36 | |
Thomas Gleixner | 926ff9a | 2014-11-17 18:09:34 +0100 | [diff] [blame] | 37 | #define GENERIC_MSI_DOMAIN_OPS 1 |
| 38 | |
Thomas Gleixner | 8073c1a | 2020-10-24 22:35:11 +0100 | [diff] [blame] | 39 | #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */ |
| 40 | |
Thomas Gleixner | 926ff9a | 2014-11-17 18:09:34 +0100 | [diff] [blame] | 41 | #endif |