[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 20/22] virtio: use version 1.0 if available (flip
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH v2 20/22] virtio: use version 1.0 if available (flip the big switch) |
Date: |
Tue, 30 Jun 2015 10:39:11 +0200 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
src/hw/virtio-pci.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c
index f8f9c4e..1186603 100644
--- a/src/hw/virtio-pci.c
+++ b/src/hw/virtio-pci.c
@@ -261,16 +261,19 @@ struct vp_device *vp_init_simple(struct pci_device *pci)
}
if (vp->common.cap && vp->notify.cap && vp->isr.cap && vp->device.cap) {
- dprintf(1, "pci dev %x:%x supports virtio 1.0\n",
+ dprintf(1, "pci dev %x:%x using modern (1.0) virtio mode\n",
pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf));
+ vp->use_modern = 1;
+ } else {
+ dprintf(1, "pci dev %x:%x using legacy (0.9.5) virtio mode\n",
+ pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf));
+ 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->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);
vp_set_status(vp, VIRTIO_CONFIG_S_ACKNOWLEDGE |
--
1.8.3.1
- [Qemu-devel] [PATCH v2 04/22] virtio: pass struct pci_device to vp_init_simple, (continued)
- [Qemu-devel] [PATCH v2 04/22] virtio: pass struct pci_device to vp_init_simple, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 09/22] virtio: add version 0.9.5 struct [fixup], Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 12/22] virtio: add version 1.0 support to vp_{get, set}_status, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 13/22] virtio: add version 1.0 support to vp_get_isr, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 16/22] virtio: remove unused vp_del_vq, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 14/22] virtio: add version 1.0 support to vp_reset, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 11/22] virtio: make features 64bit, support version 1.0 features, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 18/22] virtio-scsi: fix initialization for version 1.0, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 21/22] virtio: also probe version 1.0 pci ids, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 05/22] virtio: add version 1.0 structs and #defines, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 20/22] virtio: use version 1.0 if available (flip the big switch),
Gerd Hoffmann <=
- [Qemu-devel] [PATCH v2 03/22] virtio: add struct vp_device, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 17/22] virtio: add version 1.0 support to vp_find_vq, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 22/22] virtio: legacy cleanup, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 15/22] virtio: add version 1.0 support to vp_notify, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 07/22] virtio: find version 1.0 virtio capabilities, Gerd Hoffmann, 2015/06/30
- [Qemu-devel] [PATCH v2 19/22] virtio-blk: fix initialization for version 1.0, Gerd Hoffmann, 2015/06/30