blob: 50aee8221a9b73b25080434dc8f9b5733d6d7e0f [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
Michael S. Tsirkin5a1fc5e2009-09-29 18:53:26 +02007int msix_init(PCIDevice *pdev, unsigned short nentries,
Avi Kivity95524ae2011-08-08 16:09:26 +03008 MemoryRegion *bar,
Michael S. Tsirkin5a1fc5e2009-09-29 18:53:26 +02009 unsigned bar_nr, unsigned bar_size);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030010
11void msix_write_config(PCIDevice *pci_dev, uint32_t address,
12 uint32_t val, int len);
13
Avi Kivity95524ae2011-08-08 16:09:26 +030014int msix_uninit(PCIDevice *d, MemoryRegion *bar);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030015
Jan Kiszkacb697aa2012-05-17 10:32:38 -030016unsigned int msix_nr_vectors_allocated(const PCIDevice *dev);
17
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030018void msix_save(PCIDevice *dev, QEMUFile *f);
19void msix_load(PCIDevice *dev, QEMUFile *f);
20
21int msix_enabled(PCIDevice *dev);
22int msix_present(PCIDevice *dev);
23
24uint32_t msix_bar_size(PCIDevice *dev);
25
26int msix_vector_use(PCIDevice *dev, unsigned vector);
27void msix_vector_unuse(PCIDevice *dev, unsigned vector);
Michael S. Tsirkinb5f28bc2009-11-24 16:44:15 +020028void msix_unuse_all_vectors(PCIDevice *dev);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030029
30void msix_notify(PCIDevice *dev, unsigned vector);
31
32void msix_reset(PCIDevice *dev);
33
Jan Kiszka2cdfe532012-05-17 10:32:31 -030034int msix_set_vector_notifiers(PCIDevice *dev,
35 MSIVectorUseNotifier use_notifier,
36 MSIVectorReleaseNotifier release_notifier);
37void msix_unset_vector_notifiers(PCIDevice *dev);
Michael S. Tsirkin02eb84d2009-06-21 19:49:54 +030038#endif