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 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
);