msi.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_GENERIC_MSI_H
  3. #define __ASM_GENERIC_MSI_H
  4. #include <linux/types.h>
  5. #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
  6. #ifndef NUM_MSI_ALLOC_SCRATCHPAD_REGS
  7. # define NUM_MSI_ALLOC_SCRATCHPAD_REGS 2
  8. #endif
  9. struct msi_desc;
  10. /**
  11. * struct msi_alloc_info - Default structure for MSI interrupt allocation.
  12. * @desc: Pointer to msi descriptor
  13. * @hwirq: Associated hw interrupt number in the domain
  14. * @scratchpad: Storage for implementation specific scratch data
  15. *
  16. * Architectures can provide their own implementation by not including
  17. * asm-generic/msi.h into their arch specific header file.
  18. */
  19. typedef struct msi_alloc_info {
  20. struct msi_desc *desc;
  21. irq_hw_number_t hwirq;
  22. unsigned long flags;
  23. union {
  24. unsigned long ul;
  25. void *ptr;
  26. } scratchpad[NUM_MSI_ALLOC_SCRATCHPAD_REGS];
  27. } msi_alloc_info_t;
  28. /* Device generating MSIs is proxying for another device */
  29. #define MSI_ALLOC_FLAGS_PROXY_DEVICE (1UL << 0)
  30. #define GENERIC_MSI_DOMAIN_OPS 1
  31. #endif /* CONFIG_GENERIC_MSI_IRQ_DOMAIN */
  32. #endif