blob: 15211cb592740cf4ed8595631310632502428705 [file] [log] [blame]
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +03001#ifndef QEMU_MSIX_H
2#define QEMU_MSIX_H
3
4#include "qemu-common.h"
Isaku Yamahata6e355d92009-10-30 21:21:08 +09005#include "pci.h"
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +03006
Alexey Kardashevskiy932d4a42012-07-19 10:35:07 +10007void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg);
Alex Williamson5a2c2022012-06-14 12:16:47 -06008int 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 Williamson53f94922012-06-14 12:15:51 -060012int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries,
13 uint8_t bar_nr);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030014
Alex Williamson118f2c22012-06-13 22:52:06 -060015void msix_write_config(PCIDevice *dev, uint32_t address, uint32_t val, int len);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030016
Alex Williamson572992e2012-06-14 12:16:57 -060017void msix_uninit(PCIDevice *dev, MemoryRegion *table_bar,
18 MemoryRegion *pba_bar);
Alex Williamson53f94922012-06-14 12:15:51 -060019void msix_uninit_exclusive_bar(PCIDevice *dev);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030020
Jan Kiszkacb697aa2012-05-17 10:32:38 -030021unsigned int msix_nr_vectors_allocated(const PCIDevice *dev);
22
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030023void msix_save(PCIDevice *dev, QEMUFile *f);
24void msix_load(PCIDevice *dev, QEMUFile *f);
25
26int msix_enabled(PCIDevice *dev);
27int msix_present(PCIDevice *dev);
28
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030029int msix_vector_use(PCIDevice *dev, unsigned vector);
30void msix_vector_unuse(PCIDevice *dev, unsigned vector);
Michael S. Tsirkinb5f28bc2009-11-24 16:44:15 +020031void msix_unuse_all_vectors(PCIDevice *dev);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030032
33void msix_notify(PCIDevice *dev, unsigned vector);
34
35void msix_reset(PCIDevice *dev);
36
Jan Kiszka2cdfe532012-05-17 10:32:31 -030037int msix_set_vector_notifiers(PCIDevice *dev,
38 MSIVectorUseNotifier use_notifier,
39 MSIVectorReleaseNotifier release_notifier);
40void msix_unset_vector_notifiers(PCIDevice *dev);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030041#endif