]> Git Repo - qemu.git/blob - hw/virtio-pci.h
Merge remote-tracking branch 'afaerber/memory-ioport' into staging
[qemu.git] / hw / virtio-pci.h
1 /*
2  * Virtio PCI Bindings
3  *
4  * Copyright IBM, Corp. 2007
5  * Copyright (c) 2009 CodeSourcery
6  *
7  * Authors:
8  *  Anthony Liguori   <[email protected]>
9  *  Paul Brook        <[email protected]>
10  *
11  * This work is licensed under the terms of the GNU GPL, version 2.  See
12  * the COPYING file in the top-level directory.
13  */
14
15 #ifndef QEMU_VIRTIO_PCI_H
16 #define QEMU_VIRTIO_PCI_H
17
18 #include "hw/pci/msi.h"
19 #include "virtio-blk.h"
20 #include "virtio-net.h"
21 #include "virtio-rng.h"
22 #include "virtio-serial.h"
23 #include "virtio-scsi.h"
24
25 /* Performance improves when virtqueue kick processing is decoupled from the
26  * vcpu thread using ioeventfd for some devices. */
27 #define VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT 1
28 #define VIRTIO_PCI_FLAG_USE_IOEVENTFD   (1 << VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT)
29
30 typedef struct {
31     MSIMessage msg;
32     int virq;
33     unsigned int users;
34 } VirtIOIRQFD;
35
36 typedef struct {
37     PCIDevice pci_dev;
38     VirtIODevice *vdev;
39     MemoryRegion bar;
40     uint32_t flags;
41     uint32_t class_code;
42     uint32_t nvectors;
43     VirtIOBlkConf blk;
44     NICConf nic;
45     uint32_t host_features;
46 #ifdef CONFIG_LINUX
47     V9fsConf fsconf;
48 #endif
49     virtio_serial_conf serial;
50     virtio_net_conf net;
51     VirtIOSCSIConf scsi;
52     VirtIORNGConf rng;
53     bool ioeventfd_disabled;
54     bool ioeventfd_started;
55     VirtIOIRQFD *vector_irqfd;
56     int nvqs_with_notifiers;
57 } VirtIOPCIProxy;
58
59 void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev);
60 void virtio_pci_reset(DeviceState *d);
61
62 /* Virtio ABI version, if we increment this, we break the guest driver. */
63 #define VIRTIO_PCI_ABI_VERSION          0
64
65 #endif
This page took 0.028445 seconds and 4 git commands to generate.