summaryrefslogtreecommitdiff
path: root/drivers/virtio/virtio_pci_common.h
diff options
context:
space:
mode:
authorWu Zongyong <wuzongyong@linux.alibaba.com>2021-10-29 12:14:42 +0300
committerMichael S. Tsirkin <mst@redhat.com>2021-11-01 11:30:34 +0300
commitd89c8169bd7052c78731137da4c4c06986409c62 (patch)
tree38cc07d5748f9c14e7dadc94d9545e0c4f043f57 /drivers/virtio/virtio_pci_common.h
parent0989c41bed96e5dcf7939c6303e3759f02c4c16f (diff)
downloadlinux-d89c8169bd7052c78731137da4c4c06986409c62.tar.xz
virtio-pci: introduce legacy device module
Split common codes from virtio-pci-legacy so vDPA driver can reuse it later. Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/71605acde5e97fcb2760a6973e406279fb1bbd33.1635493219.git.wuzongyong@linux.alibaba.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio/virtio_pci_common.h')
-rw-r--r--drivers/virtio/virtio_pci_common.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/virtio/virtio_pci_common.h b/drivers/virtio/virtio_pci_common.h
index beec047a8f8d..eb17a29fc7ef 100644
--- a/drivers/virtio/virtio_pci_common.h
+++ b/drivers/virtio/virtio_pci_common.h
@@ -25,6 +25,7 @@
#include <linux/virtio_config.h>
#include <linux/virtio_ring.h>
#include <linux/virtio_pci.h>
+#include <linux/virtio_pci_legacy.h>
#include <linux/virtio_pci_modern.h>
#include <linux/highmem.h>
#include <linux/spinlock.h>
@@ -44,16 +45,14 @@ struct virtio_pci_vq_info {
struct virtio_pci_device {
struct virtio_device vdev;
struct pci_dev *pci_dev;
+ struct virtio_pci_legacy_device ldev;
struct virtio_pci_modern_device mdev;
- /* In legacy mode, these two point to within ->legacy. */
+ bool is_legacy;
+
/* Where to read and clear interrupt */
u8 __iomem *isr;
- /* Legacy only field */
- /* the IO mapping for the PCI config space */
- void __iomem *ioaddr;
-
/* a list of queues so we can dispatch IRQs */
spinlock_t lock;
struct list_head virtqueues;