virtio-blk: define VirtIOBlkConf
[qemu/ar7.git] / hw / virtio-pci.h
blob889e59e4210505fdca7d32419357250b56e7d365
1 /*
2 * Virtio PCI Bindings
4 * Copyright IBM, Corp. 2007
5 * Copyright (c) 2009 CodeSourcery
7 * Authors:
8 * Anthony Liguori <aliguori@us.ibm.com>
9 * Paul Brook <paul@codesourcery.com>
11 * This work is licensed under the terms of the GNU GPL, version 2. See
12 * the COPYING file in the top-level directory.
15 #ifndef QEMU_VIRTIO_PCI_H
16 #define QEMU_VIRTIO_PCI_H
18 #include "virtio-blk.h"
19 #include "virtio-net.h"
20 #include "virtio-serial.h"
21 #include "virtio-scsi.h"
23 /* Performance improves when virtqueue kick processing is decoupled from the
24 * vcpu thread using ioeventfd for some devices. */
25 #define VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT 1
26 #define VIRTIO_PCI_FLAG_USE_IOEVENTFD (1 << VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT)
28 typedef struct {
29 PCIDevice pci_dev;
30 VirtIODevice *vdev;
31 MemoryRegion bar;
32 MemoryRegion msix_bar;
33 uint32_t flags;
34 uint32_t class_code;
35 uint32_t nvectors;
36 VirtIOBlkConf blk;
37 NICConf nic;
38 uint32_t host_features;
39 #ifdef CONFIG_LINUX
40 V9fsConf fsconf;
41 #endif
42 virtio_serial_conf serial;
43 virtio_net_conf net;
44 VirtIOSCSIConf scsi;
45 bool ioeventfd_disabled;
46 bool ioeventfd_started;
47 } VirtIOPCIProxy;
49 void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev);
50 void virtio_pci_reset(DeviceState *d);
52 /* Virtio ABI version, if we increment this, we break the guest driver. */
53 #define VIRTIO_PCI_ABI_VERSION 0
55 #endif