ppc/pnv: Add support for POWER8+ LPC Controller
[qemu.git] / tests / libqos / virtio-pci.h
1 /*
2 * libqos virtio PCI definitions
3 *
4 * Copyright (c) 2014 Marc MarĂ­
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
9
10 #ifndef LIBQOS_VIRTIO_PCI_H
11 #define LIBQOS_VIRTIO_PCI_H
12
13 #include "libqos/virtio.h"
14 #include "libqos/pci.h"
15
16 typedef struct QVirtioPCIDevice {
17 QVirtioDevice vdev;
18 QPCIDevice *pdev;
19 QPCIBar bar;
20 uint16_t config_msix_entry;
21 uint64_t config_msix_addr;
22 uint32_t config_msix_data;
23 } QVirtioPCIDevice;
24
25 typedef struct QVirtQueuePCI {
26 QVirtQueue vq;
27 uint16_t msix_entry;
28 uint64_t msix_addr;
29 uint32_t msix_data;
30 } QVirtQueuePCI;
31
32 extern const QVirtioBus qvirtio_pci;
33
34 QVirtioPCIDevice *qvirtio_pci_device_find(QPCIBus *bus, uint16_t device_type);
35 QVirtioPCIDevice *qvirtio_pci_device_find_slot(QPCIBus *bus,
36 uint16_t device_type, int slot);
37 void qvirtio_pci_device_free(QVirtioPCIDevice *dev);
38
39 void qvirtio_pci_device_enable(QVirtioPCIDevice *d);
40 void qvirtio_pci_device_disable(QVirtioPCIDevice *d);
41
42 void qvirtio_pci_set_msix_configuration_vector(QVirtioPCIDevice *d,
43 QGuestAllocator *alloc, uint16_t entry);
44 void qvirtqueue_pci_msix_setup(QVirtioPCIDevice *d, QVirtQueuePCI *vqpci,
45 QGuestAllocator *alloc, uint16_t entry);
46 #endif