qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 08/22] virtio: create vp_cap struct for legacy ba


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH v2 08/22] virtio: create vp_cap struct for legacy bar
Date: Tue, 30 Jun 2015 10:38:59 +0200

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 src/hw/virtio-pci.c | 5 ++++-
 src/hw/virtio-pci.h | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c
index 0acf65f..3badb15 100644
--- a/src/hw/virtio-pci.c
+++ b/src/hw/virtio-pci.c
@@ -144,8 +144,11 @@ struct vp_device *vp_init_simple(struct pci_device *pci)
                 pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf));
     }
 
-    vp->ioaddr = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0) &
+    vp->legacy.bar = 0;
+    vp->legacy.addr = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0) &
         PCI_BASE_ADDRESS_IO_MASK;
+    vp->legacy.is_io = 1;
+    vp->ioaddr = vp->legacy.addr; /* temporary */
 
     vp_reset(vp);
     pci_config_maskw(pci->bdf, PCI_COMMAND, 0, PCI_COMMAND_MASTER);
diff --git a/src/hw/virtio-pci.h b/src/hw/virtio-pci.h
index 0f57ca8..29cd969 100644
--- a/src/hw/virtio-pci.h
+++ b/src/hw/virtio-pci.h
@@ -124,7 +124,7 @@ struct vp_cap {
 
 struct vp_device {
     unsigned int ioaddr;
-    struct vp_cap common, notify, isr, device;
+    struct vp_cap common, notify, isr, device, legacy;
 };
 
 static inline u32 vp_get_features(struct vp_device *vp)
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]