1*53ee8cc1Swenshuai.xi /* 2*53ee8cc1Swenshuai.xi * Virtio PCI driver 3*53ee8cc1Swenshuai.xi * 4*53ee8cc1Swenshuai.xi * This module allows virtio devices to be used over a virtual PCI device. 5*53ee8cc1Swenshuai.xi * This can be used with QEMU based VMMs like KVM or Xen. 6*53ee8cc1Swenshuai.xi * 7*53ee8cc1Swenshuai.xi * Copyright IBM Corp. 2007 8*53ee8cc1Swenshuai.xi * 9*53ee8cc1Swenshuai.xi * Authors: 10*53ee8cc1Swenshuai.xi * Anthony Liguori <aliguori@us.ibm.com> 11*53ee8cc1Swenshuai.xi * 12*53ee8cc1Swenshuai.xi * This work is licensed under the terms of the GNU GPL, version 2 or later. 13*53ee8cc1Swenshuai.xi * See the COPYING file in the top-level directory. 14*53ee8cc1Swenshuai.xi * 15*53ee8cc1Swenshuai.xi */ 16*53ee8cc1Swenshuai.xi 17*53ee8cc1Swenshuai.xi #ifndef _LINUX_VIRTIO_PCI_H 18*53ee8cc1Swenshuai.xi #define _LINUX_VIRTIO_PCI_H 19*53ee8cc1Swenshuai.xi 20*53ee8cc1Swenshuai.xi #include <linux/virtio_config.h> 21*53ee8cc1Swenshuai.xi 22*53ee8cc1Swenshuai.xi /* A 32-bit r/o bitmask of the features supported by the host */ 23*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_HOST_FEATURES 0 24*53ee8cc1Swenshuai.xi 25*53ee8cc1Swenshuai.xi /* A 32-bit r/w bitmask of features activated by the guest */ 26*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_GUEST_FEATURES 4 27*53ee8cc1Swenshuai.xi 28*53ee8cc1Swenshuai.xi /* A 32-bit r/w PFN for the currently selected queue */ 29*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_QUEUE_PFN 8 30*53ee8cc1Swenshuai.xi 31*53ee8cc1Swenshuai.xi /* A 16-bit r/o queue size for the currently selected queue */ 32*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_QUEUE_NUM 12 33*53ee8cc1Swenshuai.xi 34*53ee8cc1Swenshuai.xi /* A 16-bit r/w queue selector */ 35*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_QUEUE_SEL 14 36*53ee8cc1Swenshuai.xi 37*53ee8cc1Swenshuai.xi /* A 16-bit r/w queue notifier */ 38*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_QUEUE_NOTIFY 16 39*53ee8cc1Swenshuai.xi 40*53ee8cc1Swenshuai.xi /* An 8-bit device status register. */ 41*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_STATUS 18 42*53ee8cc1Swenshuai.xi 43*53ee8cc1Swenshuai.xi /* An 8-bit r/o interrupt status register. Reading the value will return the 44*53ee8cc1Swenshuai.xi * current contents of the ISR and will also clear it. This is effectively 45*53ee8cc1Swenshuai.xi * a read-and-acknowledge. */ 46*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_ISR 19 47*53ee8cc1Swenshuai.xi 48*53ee8cc1Swenshuai.xi /* The bit of the ISR which indicates a device configuration change. */ 49*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_ISR_CONFIG 0x2 50*53ee8cc1Swenshuai.xi 51*53ee8cc1Swenshuai.xi /* The remaining space is defined by each driver as the per-driver 52*53ee8cc1Swenshuai.xi * configuration space */ 53*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_CONFIG 20 54*53ee8cc1Swenshuai.xi 55*53ee8cc1Swenshuai.xi /* Virtio ABI version, this must match exactly */ 56*53ee8cc1Swenshuai.xi #define VIRTIO_PCI_ABI_VERSION 0 57*53ee8cc1Swenshuai.xi #endif 58