[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 28/42] virtio-pci: move cap type to VirtIOPCIRegion
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 28/42] virtio-pci: move cap type to VirtIOPCIRegion |
Date: |
Thu, 11 Jun 2015 14:00:04 +0200 |
From: Gerd Hoffmann <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/virtio-pci.h | 1 +
hw/virtio/virtio-pci.c | 9 +++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index f5829b0..ea1343d 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -94,6 +94,7 @@ typedef struct VirtioPCIClass {
typedef struct VirtIOPCIRegion {
MemoryRegion mr;
uint32_t offset;
+ uint32_t type;
} VirtIOPCIRegion;
struct VirtIOPCIProxy {
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index f4bdd1c..440db10 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1252,18 +1252,21 @@ static void
virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy)
proxy,
"virtio-pci-common", 0x1000);
proxy->common.offset = 0x0;
+ proxy->common.type = VIRTIO_PCI_CAP_COMMON_CFG;
memory_region_init_io(&proxy->isr.mr, OBJECT(proxy),
&isr_ops,
proxy,
"virtio-pci-isr", 0x1000);
proxy->isr.offset = 0x1000;
+ proxy->isr.type = VIRTIO_PCI_CAP_ISR_CFG;
memory_region_init_io(&proxy->device.mr, OBJECT(proxy),
&device_ops,
virtio_bus_get_device(&proxy->bus),
"virtio-pci-device", 0x1000);
proxy->device.offset = 0x2000;
+ proxy->device.type = VIRTIO_PCI_CAP_DEVICE_CFG;
memory_region_init_io(&proxy->notify.mr, OBJECT(proxy),
¬ify_ops,
@@ -1272,6 +1275,7 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy
*proxy)
QEMU_VIRTIO_PCI_QUEUE_MEM_MULT *
VIRTIO_QUEUE_MAX);
proxy->notify.offset = 0x3000;
+ proxy->notify.type = VIRTIO_PCI_CAP_NOTIFY_CFG;
}
static void virtio_pci_modern_region_map(VirtIOPCIProxy *proxy,
@@ -1282,6 +1286,7 @@ static void virtio_pci_modern_region_map(VirtIOPCIProxy
*proxy,
region->offset,
®ion->mr);
+ cap->cfg_type = region->type;
cap->offset = cpu_to_le32(region->offset);
cap->length = cpu_to_le32(memory_region_size(®ion->mr));
virtio_pci_add_mem_cap(proxy, cap);
@@ -1337,22 +1342,18 @@ static void virtio_pci_device_plugged(DeviceState *d,
Error **errp)
if (modern) {
struct virtio_pci_cap common = {
- .cfg_type = VIRTIO_PCI_CAP_COMMON_CFG,
.cap_len = sizeof common,
.bar = modern_mem_bar,
};
struct virtio_pci_cap isr = {
- .cfg_type = VIRTIO_PCI_CAP_ISR_CFG,
.cap_len = sizeof isr,
.bar = modern_mem_bar,
};
struct virtio_pci_cap device = {
- .cfg_type = VIRTIO_PCI_CAP_DEVICE_CFG,
.cap_len = sizeof device,
.bar = modern_mem_bar,
};
struct virtio_pci_notify_cap notify = {
- .cap.cfg_type = VIRTIO_PCI_CAP_NOTIFY_CFG,
.cap.cap_len = sizeof notify,
.cap.bar = modern_mem_bar,
.notify_off_multiplier =
--
MST
- [Qemu-devel] [PULL 15/42] virtio: add modern config accessors, (continued)
- [Qemu-devel] [PULL 15/42] virtio: add modern config accessors, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 16/42] virtio-pci: switch to modern accessors for 1.0, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 17/42] virtio-pci: add flags to enable/disable legacy/modern, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 22/42] virtio_balloon: header update, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 23/42] virtio-balloon: switch to virtio_add_feature, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 24/42] virtio-pci: add struct VirtIOPCIRegion for virtio-1 regions, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 25/42] virtio-pci: add virtio_pci_modern_regions_init(), Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 26/42] virtio-pci: add virtio_pci_modern_region_map(), Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 27/42] virtio-pci: move virtio_pci_add_mem_cap call to virtio_pci_modern_region_map, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 29/42] virtio-pci: drop identical virtio_pci_cap, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 28/42] virtio-pci: move cap type to VirtIOPCIRegion,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 31/42] pci: add PCI_CLASS_INPUT_*, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 30/42] virtio-pci: fill VirtIOPCIRegions early., Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 32/42] virtio-input: core code & base class [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 34/42] virtio-net: move qdev properties into virtio-net.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 33/42] virtio-input: emulated devices [pci], Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 35/42] virtio-net.h: Remove unsed DEFINE_VIRTIO_NET_PROPERTIES, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 36/42] virtio-scsi: move qdev properties into virtio-scsi.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 37/42] virtio-rng: move qdev properties into virtio-rng.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 39/42] virtio-9p-device: move qdev properties into virtio-9p-device.c, Michael S. Tsirkin, 2015/06/11
- [Qemu-devel] [PULL 38/42] virtio-serial-bus: move qdev properties into virtio-serial-bus.c, Michael S. Tsirkin, 2015/06/11