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 | |
Michael S. Tsirkin | 5a1fc5e | 2009-09-29 18:53:26 +0200 | [diff] [blame] | 7 | int msix_init(PCIDevice *pdev, unsigned short nentries, |
Avi Kivity | 95524ae | 2011-08-08 16:09:26 +0300 | [diff] [blame] | 8 | MemoryRegion *bar, |
Michael S. Tsirkin | 5a1fc5e | 2009-09-29 18:53:26 +0200 | [diff] [blame] | 9 | unsigned bar_nr, unsigned bar_size); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 10 | |
| 11 | void msix_write_config(PCIDevice *pci_dev, uint32_t address, |
| 12 | uint32_t val, int len); |
| 13 | |
Avi Kivity | 95524ae | 2011-08-08 16:09:26 +0300 | [diff] [blame] | 14 | int msix_uninit(PCIDevice *d, MemoryRegion *bar); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 15 | |
Jan Kiszka | cb697aa | 2012-05-17 10:32:38 -0300 | [diff] [blame] | 16 | unsigned int msix_nr_vectors_allocated(const PCIDevice *dev); |
| 17 | |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 18 | void msix_save(PCIDevice *dev, QEMUFile *f); |
| 19 | void msix_load(PCIDevice *dev, QEMUFile *f); |
| 20 | |
| 21 | int msix_enabled(PCIDevice *dev); |
| 22 | int msix_present(PCIDevice *dev); |
| 23 | |
| 24 | uint32_t msix_bar_size(PCIDevice *dev); |
| 25 | |
| 26 | int msix_vector_use(PCIDevice *dev, unsigned vector); |
| 27 | void msix_vector_unuse(PCIDevice *dev, unsigned vector); |
Michael S. Tsirkin | b5f28bc | 2009-11-24 16:44:15 +0200 | [diff] [blame] | 28 | void msix_unuse_all_vectors(PCIDevice *dev); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 29 | |
| 30 | void msix_notify(PCIDevice *dev, unsigned vector); |
| 31 | |
| 32 | void msix_reset(PCIDevice *dev); |
| 33 | |
Jan Kiszka | 2cdfe53 | 2012-05-17 10:32:31 -0300 | [diff] [blame] | 34 | int msix_set_vector_notifiers(PCIDevice *dev, |
| 35 | MSIVectorUseNotifier use_notifier, |
| 36 | MSIVectorReleaseNotifier release_notifier); |
| 37 | void msix_unset_vector_notifiers(PCIDevice *dev); |
Michael S. Tsirkin | 02eb84d | 2009-06-21 19:49:54 +0300 | [diff] [blame] | 38 | #endif |