Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 1 | #ifndef QEMU_MSIX_H |
| 2 | #define QEMU_MSIX_H |
| 3 | |
| 4 | #include "qemu-common.h" |
Isaku Yamahata | 6e355d9 | 2009-10-30 21:21:08 +0900 | [diff] [blame] | 5 | #include "pci.h" |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 6 | |
Alexey Kardashevskiy | 932d4a4 | 2012-07-19 10:35:07 +1000 | [diff] [blame] | 7 | void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg); |
Alex Williamson | 5a2c202 | 2012-06-14 12:16:47 -0600 | [diff] [blame] | 8 | int msix_init(PCIDevice *dev, unsigned short nentries, |
| 9 | MemoryRegion *table_bar, uint8_t table_bar_nr, |
| 10 | unsigned table_offset, MemoryRegion *pba_bar, |
| 11 | uint8_t pba_bar_nr, unsigned pba_offset, uint8_t cap_pos); |
Alex Williamson | 53f9492 | 2012-06-14 12:15:51 -0600 | [diff] [blame] | 12 | int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries, |
| 13 | uint8_t bar_nr); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 14 | |
Alex Williamson | 118f2c2 | 2012-06-13 22:52:06 -0600 | [diff] [blame] | 15 | void msix_write_config(PCIDevice *dev, uint32_t address, uint32_t val, int len); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 16 | |
Alex Williamson | 572992e | 2012-06-14 12:16:57 -0600 | [diff] [blame] | 17 | void msix_uninit(PCIDevice *dev, MemoryRegion *table_bar, |
| 18 | MemoryRegion *pba_bar); |
Alex Williamson | 53f9492 | 2012-06-14 12:15:51 -0600 | [diff] [blame] | 19 | void msix_uninit_exclusive_bar(PCIDevice *dev); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 20 | |
Jan Kiszka | cb697aa | 2012-05-17 10:32:38 -0300 | [diff] [blame] | 21 | unsigned int msix_nr_vectors_allocated(const PCIDevice *dev); |
| 22 | |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 23 | void msix_save(PCIDevice *dev, QEMUFile *f); |
| 24 | void msix_load(PCIDevice *dev, QEMUFile *f); |
| 25 | |
| 26 | int msix_enabled(PCIDevice *dev); |
| 27 | int msix_present(PCIDevice *dev); |
| 28 | |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 29 | int msix_vector_use(PCIDevice *dev, unsigned vector); |
| 30 | void msix_vector_unuse(PCIDevice *dev, unsigned vector); |
Michael S. Tsirkin | b5f28bc | 2009-11-24 16:44:15 +0200 | [diff] [blame] | 31 | void msix_unuse_all_vectors(PCIDevice *dev); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 32 | |
| 33 | void msix_notify(PCIDevice *dev, unsigned vector); |
| 34 | |
| 35 | void msix_reset(PCIDevice *dev); |
| 36 | |
Jan Kiszka | 2cdfe53 | 2012-05-17 10:32:31 -0300 | [diff] [blame] | 37 | int msix_set_vector_notifiers(PCIDevice *dev, |
| 38 | MSIVectorUseNotifier use_notifier, |
| 39 | MSIVectorReleaseNotifier release_notifier); |
| 40 | void msix_unset_vector_notifiers(PCIDevice *dev); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 41 | #endif |