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.
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
{
20 uint16_t config_msix_entry
;
21 uint64_t config_msix_addr
;
22 uint32_t config_msix_data
;
25 typedef struct QVirtQueuePCI
{
32 extern const QVirtioBus qvirtio_pci
;
34 void qvirtio_pci_foreach(QPCIBus
*bus
, uint16_t device_type
,
35 void (*func
)(QVirtioDevice
*d
, void *data
), void *data
);
36 QVirtioPCIDevice
*qvirtio_pci_device_find(QPCIBus
*bus
, uint16_t device_type
);
37 void qvirtio_pci_device_enable(QVirtioPCIDevice
*d
);
38 void qvirtio_pci_device_disable(QVirtioPCIDevice
*d
);
40 void qvirtio_pci_set_msix_configuration_vector(QVirtioPCIDevice
*d
,
41 QGuestAllocator
*alloc
, uint16_t entry
);
42 void qvirtqueue_pci_msix_setup(QVirtioPCIDevice
*d
, QVirtQueuePCI
*vqpci
,
43 QGuestAllocator
*alloc
, uint16_t entry
);