pci/pcihp: overwrite hotplug handler recursively from the start
[qemu/ar7.git] / tests / libqos / virtio-pci.h
blob6ef19094cb47b2e53f07c297b2c0e17f3fcf4ed2
1 /*
2 * libqos virtio PCI definitions
4 * Copyright (c) 2014 Marc MarĂ­
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 */
10 #ifndef LIBQOS_VIRTIO_PCI_H
11 #define LIBQOS_VIRTIO_PCI_H
13 #include "libqos/virtio.h"
14 #include "libqos/pci.h"
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;
25 typedef struct QVirtQueuePCI {
26 QVirtQueue vq;
27 uint16_t msix_entry;
28 uint64_t msix_addr;
29 uint32_t msix_data;
30 } QVirtQueuePCI;
32 extern const QVirtioBus qvirtio_pci;
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);
39 void qvirtio_pci_device_enable(QVirtioPCIDevice *d);
40 void qvirtio_pci_device_disable(QVirtioPCIDevice *d);
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