]> git.proxmox.com Git - qemu.git/blame - hw/virtio-pci.h
virtio-blk: hide VIRTIO_BLK_F_CONFIG_WCE from old machine types
[qemu.git] / hw / virtio-pci.h
CommitLineData
9fe1ebeb
AK
1/*
2 * Virtio PCI Bindings
3 *
4 * Copyright IBM, Corp. 2007
5 * Copyright (c) 2009 CodeSourcery
6 *
7 * Authors:
8 * Anthony Liguori <aliguori@us.ibm.com>
9 * Paul Brook <paul@codesourcery.com>
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
12c5674b 18#include "virtio-blk.h"
9fe1ebeb
AK
19#include "virtio-net.h"
20#include "virtio-serial.h"
973abc7f 21#include "virtio-scsi.h"
9fe1ebeb 22
5745e38a
AK
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)
27
7d37d351
JK
28typedef struct {
29 int virq;
30 unsigned int users;
31} VirtIOIRQFD;
32
9fe1ebeb
AK
33typedef struct {
34 PCIDevice pci_dev;
35 VirtIODevice *vdev;
da146d0a 36 MemoryRegion bar;
9fe1ebeb 37 uint32_t flags;
9fe1ebeb
AK
38 uint32_t class_code;
39 uint32_t nvectors;
12c5674b 40 VirtIOBlkConf blk;
9fe1ebeb
AK
41 NICConf nic;
42 uint32_t host_features;
43#ifdef CONFIG_LINUX
44 V9fsConf fsconf;
45#endif
46 virtio_serial_conf serial;
47 virtio_net_conf net;
973abc7f 48 VirtIOSCSIConf scsi;
9fe1ebeb
AK
49 bool ioeventfd_disabled;
50 bool ioeventfd_started;
7d37d351 51 VirtIOIRQFD *vector_irqfd;
9fe1ebeb
AK
52} VirtIOPCIProxy;
53
befeac45 54void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev);
8798d6c9 55void virtio_pci_reset(DeviceState *d);
befeac45
MT
56
57/* Virtio ABI version, if we increment this, we break the guest driver. */
58#define VIRTIO_PCI_ABI_VERSION 0
59
9fe1ebeb 60#endif