summaryrefslogtreecommitdiff
path: root/drivers/virtio/virtio_pci_common.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2015-01-15 16:06:26 +0200
committerRusty Russell <rusty@rustcorp.com.au>2015-01-21 16:28:59 +1030
commit46506da5f365efe7fe3e4c9da73ab679c0382fac (patch)
treee8f11e77b344a635815b60968f4f694d3f60af93 /drivers/virtio/virtio_pci_common.h
parent0327642337fee1dba50fa4d9a45d3a8b8fb2d1c3 (diff)
downloadlinux-rpi-46506da5f365efe7fe3e4c9da73ab679c0382fac.tar.gz
linux-rpi-46506da5f365efe7fe3e4c9da73ab679c0382fac.tar.bz2
linux-rpi-46506da5f365efe7fe3e4c9da73ab679c0382fac.zip
virtio_pci: add an option to disable legacy driver
Useful for testing device virtio 1 compatibility. Based on patch by Rusty - couldn't resist putting that flying car joke in there! Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio/virtio_pci_common.h')
-rw-r--r--drivers/virtio/virtio_pci_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h
index d39180512761..28ee4e56badf 100644
--- a/drivers/virtio/virtio_pci_common.h
+++ b/drivers/virtio/virtio_pci_common.h
@@ -147,8 +147,18 @@ const char *vp_bus_name(struct virtio_device *vdev);
*/
int vp_set_vq_affinity(struct virtqueue *vq, int cpu);
+#if IS_ENABLED(CONFIG_VIRTIO_PCI_LEGACY)
int virtio_pci_legacy_probe(struct virtio_pci_device *);
void virtio_pci_legacy_remove(struct virtio_pci_device *);
+#else
+static inline int virtio_pci_legacy_probe(struct virtio_pci_device *vp_dev)
+{
+ return -ENODEV;
+}
+static inline void virtio_pci_legacy_remove(struct virtio_pci_device *vp_dev)
+{
+}
+#endif
int virtio_pci_modern_probe(struct virtio_pci_device *);
void virtio_pci_modern_remove(struct virtio_pci_device *);