diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/9pfs/virtio-9p-device.c | 3 | ||||
-rw-r--r-- | hw/es1370.c | 5 | ||||
-rw-r--r-- | hw/ide/cmd646.c | 33 | ||||
-rw-r--r-- | hw/ide/ich.c | 30 | ||||
-rw-r--r-- | hw/ide/piix.c | 70 | ||||
-rw-r--r-- | hw/marvell_88w8618_audio.c | 8 | ||||
-rw-r--r-- | hw/piix4.c | 29 | ||||
-rw-r--r-- | hw/piix_pci.c | 86 | ||||
-rw-r--r-- | hw/qxl.c | 8 | ||||
-rw-r--r-- | hw/spapr_llan.c | 4 | ||||
-rw-r--r-- | hw/spapr_vscsi.c | 4 | ||||
-rw-r--r-- | hw/spapr_vty.c | 6 | ||||
-rw-r--r-- | hw/usb-ehci.c | 49 | ||||
-rw-r--r-- | hw/usb-uhci.c | 107 | ||||
-rw-r--r-- | hw/virtio-pci.c | 174 |
15 files changed, 304 insertions, 312 deletions
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index 642d5e2c46..1325f2fb9d 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -172,8 +172,7 @@ static PCIDeviceInfo virtio_9p_info = { .revision = VIRTIO_PCI_ABI_VERSION, .class_id = 0x2, .qdev.props = (Property[]) { - DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, - VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), + DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), DEFINE_PROP_STRING("mount_tag", VirtIOPCIProxy, fsconf.tag), diff --git a/hw/es1370.c b/hw/es1370.c index 6a3ba55f6f..3527eb6c43 100644 --- a/hw/es1370.c +++ b/hw/es1370.c @@ -1041,13 +1041,8 @@ static PCIDeviceInfo es1370_info = { .vendor_id = PCI_VENDOR_ID_ENSONIQ, .device_id = PCI_DEVICE_ID_ENSONIQ_ES1370, .class_id = PCI_CLASS_MULTIMEDIA_AUDIO, -#if 1 .subsystem_vendor_id = 0x4942, .subsystem_id = 0x4c4c, -#else - .subsystem_vendor_id = 0x1274, - .subsystem_id = 0x1371, -#endif }; static void es1370_register (void) diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 5fe98b1bb3..99e7e6f866 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -325,27 +325,24 @@ void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table, pci_ide_create_devs(dev, hd_table); } -static PCIDeviceInfo cmd646_ide_info[] = { - { - .qdev.name = "cmd646-ide", - .qdev.size = sizeof(PCIIDEState), - .init = pci_cmd646_ide_initfn, - .exit = pci_cmd646_ide_exitfn, - .vendor_id = PCI_VENDOR_ID_CMD, - .device_id = PCI_DEVICE_ID_CMD_646, - .revision = 0x07, // IDE controller revision - .class_id = PCI_CLASS_STORAGE_IDE, - .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("secondary", PCIIDEState, secondary, 0), - DEFINE_PROP_END_OF_LIST(), - }, - },{ - /* end of list */ - } +static PCIDeviceInfo cmd646_ide_info = { + .qdev.name = "cmd646-ide", + .qdev.size = sizeof(PCIIDEState), + .init = pci_cmd646_ide_initfn, + .exit = pci_cmd646_ide_exitfn, + .vendor_id = PCI_VENDOR_ID_CMD, + .device_id = PCI_DEVICE_ID_CMD_646, + /* IDE controller revision */ + .revision = 0x07, + .class_id = PCI_CLASS_STORAGE_IDE, + .qdev.props = (Property[]) { + DEFINE_PROP_UINT32("secondary", PCIIDEState, secondary, 0), + DEFINE_PROP_END_OF_LIST(), + }, }; static void cmd646_ide_register(void) { - pci_qdev_register_many(cmd646_ide_info); + pci_qdev_register(&cmd646_ide_info); } device_init(cmd646_ide_register); diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 3f7510f52e..e6421e2524 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -146,26 +146,22 @@ static void pci_ich9_write_config(PCIDevice *pci, uint32_t addr, msi_write_config(pci, addr, val, len); } -static PCIDeviceInfo ich_ahci_info[] = { - { - .qdev.name = "ich9-ahci", - .qdev.alias = "ahci", - .qdev.size = sizeof(AHCIPCIState), - .qdev.vmsd = &vmstate_ahci, - .init = pci_ich9_ahci_init, - .exit = pci_ich9_uninit, - .config_write = pci_ich9_write_config, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82801IR, - .revision = 0x02, - .class_id = PCI_CLASS_STORAGE_SATA, - },{ - /* end of list */ - } +static PCIDeviceInfo ich_ahci_info = { + .qdev.name = "ich9-ahci", + .qdev.alias = "ahci", + .qdev.size = sizeof(AHCIPCIState), + .qdev.vmsd = &vmstate_ahci, + .init = pci_ich9_ahci_init, + .exit = pci_ich9_uninit, + .config_write = pci_ich9_write_config, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82801IR, + .revision = 0x02, + .class_id = PCI_CLASS_STORAGE_SATA, }; static void ich_ahci_register(void) { - pci_qdev_register_many(ich_ahci_info); + pci_qdev_register(&ich_ahci_info); } device_init(ich_ahci_register); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index c0e345087b..91b77a2026 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -237,43 +237,45 @@ PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) return dev; } -static PCIDeviceInfo piix_ide_info[] = { - { - .qdev.name = "piix3-ide", - .qdev.size = sizeof(PCIIDEState), - .qdev.no_user = 1, - .no_hotplug = 1, - .init = pci_piix_ide_initfn, - .exit = pci_piix_ide_exitfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371SB_1, - .class_id = PCI_CLASS_STORAGE_IDE, - },{ - .qdev.name = "piix3-ide-xen", - .qdev.size = sizeof(PCIIDEState), - .qdev.no_user = 1, - .qdev.unplug = pci_piix3_xen_ide_unplug, - .init = pci_piix_ide_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371SB_1, - .class_id = PCI_CLASS_STORAGE_IDE, - },{ - .qdev.name = "piix4-ide", - .qdev.size = sizeof(PCIIDEState), - .qdev.no_user = 1, - .no_hotplug = 1, - .init = pci_piix_ide_initfn, - .exit = pci_piix_ide_exitfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371AB, - .class_id = PCI_CLASS_STORAGE_IDE, - },{ - /* end of list */ - } +static PCIDeviceInfo piix3_ide_info = { + .qdev.name = "piix3-ide", + .qdev.size = sizeof(PCIIDEState), + .qdev.no_user = 1, + .no_hotplug = 1, + .init = pci_piix_ide_initfn, + .exit = pci_piix_ide_exitfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82371SB_1, + .class_id = PCI_CLASS_STORAGE_IDE, +}; + +static PCIDeviceInfo piix3_ide_xen_info = { + .qdev.name = "piix3-ide-xen", + .qdev.size = sizeof(PCIIDEState), + .qdev.no_user = 1, + .qdev.unplug = pci_piix3_xen_ide_unplug, + .init = pci_piix_ide_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82371SB_1, + .class_id = PCI_CLASS_STORAGE_IDE, +}; + +static PCIDeviceInfo piix4_ide_info = { + .qdev.name = "piix4-ide", + .qdev.size = sizeof(PCIIDEState), + .qdev.no_user = 1, + .no_hotplug = 1, + .init = pci_piix_ide_initfn, + .exit = pci_piix_ide_exitfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82371AB, + .class_id = PCI_CLASS_STORAGE_IDE, }; static void piix_ide_register(void) { - pci_qdev_register_many(piix_ide_info); + pci_qdev_register(&piix3_ide_info); + pci_qdev_register(&piix3_ide_xen_info); + pci_qdev_register(&piix4_ide_info); } device_init(piix_ide_register); diff --git a/hw/marvell_88w8618_audio.c b/hw/marvell_88w8618_audio.c index 0cd8410622..409b1eb19b 100644 --- a/hw/marvell_88w8618_audio.c +++ b/hw/marvell_88w8618_audio.c @@ -50,7 +50,7 @@ typedef struct mv88w8618_audio_state { uint32_t play_pos; uint32_t last_free; uint32_t clock_div; - DeviceState *wm; + void *wm; } mv88w8618_audio_state; static void mv88w8618_audio_callback(void *opaque, int free_out, int free_in) @@ -279,11 +279,7 @@ static SysBusDeviceInfo mv88w8618_audio_info = { .qdev.reset = mv88w8618_audio_reset, .qdev.vmsd = &mv88w8618_audio_vmsd, .qdev.props = (Property[]) { - { - .name = "wm8750", - .info = &qdev_prop_ptr, - .offset = offsetof(mv88w8618_audio_state, wm), - }, + DEFINE_PROP_PTR("wm8750", mv88w8618_audio_state, wm), {/* end of list */} } }; diff --git a/hw/piix4.c b/hw/piix4.c index 51af459073..130dfd1cc5 100644 --- a/hw/piix4.c +++ b/hw/piix4.c @@ -102,25 +102,22 @@ int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn) return d->devfn; } -static PCIDeviceInfo piix4_info[] = { - { - .qdev.name = "PIIX4", - .qdev.desc = "ISA bridge", - .qdev.size = sizeof(PIIX4State), - .qdev.vmsd = &vmstate_piix4, - .qdev.no_user = 1, - .no_hotplug = 1, - .init = piix4_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371AB_0, // 82371AB/EB/MB PIIX4 PCI-to-ISA bridge - .class_id = PCI_CLASS_BRIDGE_ISA, - },{ - /* end of list */ - } +static PCIDeviceInfo piix4_info = { + .qdev.name = "PIIX4", + .qdev.desc = "ISA bridge", + .qdev.size = sizeof(PIIX4State), + .qdev.vmsd = &vmstate_piix4, + .qdev.no_user = 1, + .no_hotplug = 1, + .init = piix4_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + /* 82371AB/EB/MB PIIX4 PCI-to-ISA bridge */ + .device_id = PCI_DEVICE_ID_INTEL_82371AB_0, + .class_id = PCI_CLASS_BRIDGE_ISA, }; static void piix4_register(void) { - pci_qdev_register_many(piix4_info); + pci_qdev_register(&piix4_info); } device_init(piix4_register); diff --git a/hw/piix_pci.c b/hw/piix_pci.c index 3652522e58..5cbeed58c1 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -502,47 +502,47 @@ static int piix3_initfn(PCIDevice *dev) return 0; } -static PCIDeviceInfo i440fx_info[] = { - { - .qdev.name = "i440FX", - .qdev.desc = "Host bridge", - .qdev.size = sizeof(PCII440FXState), - .qdev.vmsd = &vmstate_i440fx, - .qdev.no_user = 1, - .no_hotplug = 1, - .init = i440fx_initfn, - .config_write = i440fx_write_config, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82441, - .revision = 0x02, - .class_id = PCI_CLASS_BRIDGE_HOST, - },{ - .qdev.name = "PIIX3", - .qdev.desc = "ISA bridge", - .qdev.size = sizeof(PIIX3State), - .qdev.vmsd = &vmstate_piix3, - .qdev.no_user = 1, - .no_hotplug = 1, - .init = piix3_initfn, - .config_write = piix3_write_config, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371SB_0, // 82371SB PIIX3 PCI-to-ISA bridge (Step A1) - .class_id = PCI_CLASS_BRIDGE_ISA, - },{ - .qdev.name = "PIIX3-xen", - .qdev.desc = "ISA bridge", - .qdev.size = sizeof(PIIX3State), - .qdev.vmsd = &vmstate_piix3, - .qdev.no_user = 1, - .no_hotplug = 1, - .init = piix3_initfn, - .config_write = piix3_write_config_xen, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82371SB_0, // 82371SB PIIX3 PCI-to-ISA bridge (Step A1) - .class_id = PCI_CLASS_BRIDGE_ISA, - },{ - /* end of list */ - } +static PCIDeviceInfo i440fx_info = { + .qdev.name = "i440FX", + .qdev.desc = "Host bridge", + .qdev.size = sizeof(PCII440FXState), + .qdev.vmsd = &vmstate_i440fx, + .qdev.no_user = 1, + .no_hotplug = 1, + .init = i440fx_initfn, + .config_write = i440fx_write_config, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82441, + .revision = 0x02, + .class_id = PCI_CLASS_BRIDGE_HOST, +}; + +static PCIDeviceInfo piix3_info = { + .qdev.name = "PIIX3", + .qdev.desc = "ISA bridge", + .qdev.size = sizeof(PIIX3State), + .qdev.vmsd = &vmstate_piix3, + .qdev.no_user = 1, + .no_hotplug = 1, + .init = piix3_initfn, + .config_write = piix3_write_config, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82371SB_0, // 82371SB PIIX3 PCI-to-ISA bridge (Step A1) + .class_id = PCI_CLASS_BRIDGE_ISA, +}; + +static PCIDeviceInfo piix3_xen_info = { + .qdev.name = "PIIX3-xen", + .qdev.desc = "ISA bridge", + .qdev.size = sizeof(PIIX3State), + .qdev.vmsd = &vmstate_piix3, + .qdev.no_user = 1, + .no_hotplug = 1, + .init = piix3_initfn, + .config_write = piix3_write_config_xen, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82371SB_0, // 82371SB PIIX3 PCI-to-ISA bridge (Step A1) + .class_id = PCI_CLASS_BRIDGE_ISA, }; static SysBusDeviceInfo i440fx_pcihost_info = { @@ -555,7 +555,9 @@ static SysBusDeviceInfo i440fx_pcihost_info = { static void i440fx_register(void) { + pci_qdev_register(&i440fx_info); + pci_qdev_register(&piix3_info); + pci_qdev_register(&piix3_xen_info); sysbus_register_withprop(&i440fx_pcihost_info); - pci_qdev_register_many(i440fx_info); } device_init(i440fx_register); @@ -1824,7 +1824,7 @@ static Property qxl_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static PCIDeviceInfo qxl_info_primary = { +static PCIDeviceInfo qxl_primary_info = { .qdev.name = "qxl-vga", .qdev.desc = "Spice QXL GPU (primary, vga compatible)", .qdev.size = sizeof(PCIQXLDevice), @@ -1839,7 +1839,7 @@ static PCIDeviceInfo qxl_info_primary = { .qdev.props = qxl_properties, }; -static PCIDeviceInfo qxl_info_secondary = { +static PCIDeviceInfo qxl_secondary_info = { .qdev.name = "qxl", .qdev.desc = "Spice QXL GPU (secondary)", .qdev.size = sizeof(PCIQXLDevice), @@ -1854,8 +1854,8 @@ static PCIDeviceInfo qxl_info_secondary = { static void qxl_register(void) { - pci_qdev_register(&qxl_info_primary); - pci_qdev_register(&qxl_info_secondary); + pci_qdev_register(&qxl_primary_info); + pci_qdev_register(&qxl_secondary_info); } device_init(qxl_register); diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c index 91003cc511..b9a5afccbc 100644 --- a/hw/spapr_llan.c +++ b/hw/spapr_llan.c @@ -474,7 +474,7 @@ static target_ulong h_multicast_ctrl(CPUState *env, sPAPREnvironment *spapr, return H_SUCCESS; } -static VIOsPAPRDeviceInfo spapr_vlan = { +static VIOsPAPRDeviceInfo spapr_vlan_info = { .init = spapr_vlan_init, .devnode = spapr_vlan_devnode, .dt_name = "l-lan", @@ -492,12 +492,12 @@ static VIOsPAPRDeviceInfo spapr_vlan = { static void spapr_vlan_register(void) { - spapr_vio_bus_register_withprop(&spapr_vlan); spapr_register_hypercall(H_REGISTER_LOGICAL_LAN, h_register_logical_lan); spapr_register_hypercall(H_FREE_LOGICAL_LAN, h_free_logical_lan); spapr_register_hypercall(H_SEND_LOGICAL_LAN, h_send_logical_lan); spapr_register_hypercall(H_ADD_LOGICAL_LAN_BUFFER, h_add_logical_lan_buffer); spapr_register_hypercall(H_MULTICAST_CTRL, h_multicast_ctrl); + spapr_vio_bus_register_withprop(&spapr_vlan_info); } device_init(spapr_vlan_register); diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c index 00e2d2d5d3..21d946e2c5 100644 --- a/hw/spapr_vscsi.c +++ b/hw/spapr_vscsi.c @@ -947,7 +947,7 @@ static int spapr_vscsi_devnode(VIOsPAPRDevice *dev, void *fdt, int node_off) return 0; } -static VIOsPAPRDeviceInfo spapr_vscsi = { +static VIOsPAPRDeviceInfo spapr_vscsi_info = { .init = spapr_vscsi_init, .devnode = spapr_vscsi_devnode, .dt_name = "v-scsi", @@ -964,6 +964,6 @@ static VIOsPAPRDeviceInfo spapr_vscsi = { static void spapr_vscsi_register(void) { - spapr_vio_bus_register_withprop(&spapr_vscsi); + spapr_vio_bus_register_withprop(&spapr_vscsi_info); } device_init(spapr_vscsi_register); diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c index 181dd0e52e..3d5c579311 100644 --- a/hw/spapr_vty.c +++ b/hw/spapr_vty.c @@ -135,7 +135,7 @@ void spapr_vty_create(VIOsPAPRBus *bus, uint32_t reg, CharDriverState *chardev) qdev_init_nofail(dev); } -static VIOsPAPRDeviceInfo spapr_vty = { +static VIOsPAPRDeviceInfo spapr_vty_info = { .init = spapr_vty_init, .dt_name = "vty", .dt_type = "serial", @@ -163,7 +163,7 @@ VIOsPAPRDevice *spapr_vty_get_default(VIOsPAPRBus *bus) selected = NULL; QTAILQ_FOREACH(iter, &bus->bus.children, sibling) { /* Only look at VTY devices */ - if (qdev_get_info(iter) != &spapr_vty.qdev) { + if (qdev_get_info(iter) != &spapr_vty_info.qdev) { continue; } @@ -203,8 +203,8 @@ static VIOsPAPRDevice *vty_lookup(sPAPREnvironment *spapr, target_ulong reg) static void spapr_vty_register(void) { - spapr_vio_bus_register_withprop(&spapr_vty); spapr_register_hypercall(H_PUT_TERM_CHAR, h_put_term_char); spapr_register_hypercall(H_GET_TERM_CHAR, h_get_term_char); + spapr_vio_bus_register_withprop(&spapr_vty_info); } device_init(spapr_vty_register); diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index a3056614a6..63fc3c7911 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -2263,30 +2263,28 @@ static Property ehci_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static PCIDeviceInfo ehci_info[] = { - { - .qdev.name = "usb-ehci", - .qdev.size = sizeof(EHCIState), - .qdev.vmsd = &vmstate_ehci, - .init = usb_ehci_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82801D, /* ich4 */ - .revision = 0x10, - .class_id = PCI_CLASS_SERIAL_USB, - .qdev.props = ehci_properties, - },{ - .qdev.name = "ich9-usb-ehci1", - .qdev.size = sizeof(EHCIState), - .qdev.vmsd = &vmstate_ehci, - .init = usb_ehci_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82801I_EHCI1, - .revision = 0x03, - .class_id = PCI_CLASS_SERIAL_USB, - .qdev.props = ehci_properties, - },{ - /* end of list */ - } +static PCIDeviceInfo ehci_info = { + .qdev.name = "usb-ehci", + .qdev.size = sizeof(EHCIState), + .qdev.vmsd = &vmstate_ehci, + .init = usb_ehci_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82801D, /* ich4 */ + .revision = 0x10, + .class_id = PCI_CLASS_SERIAL_USB, + .qdev.props = ehci_properties, +}; + +static PCIDeviceInfo ich9_ehci_info = { + .qdev.name = "ich9-usb-ehci1", + .qdev.size = sizeof(EHCIState), + .qdev.vmsd = &vmstate_ehci, + .init = usb_ehci_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82801I_EHCI1, + .revision = 0x03, + .class_id = PCI_CLASS_SERIAL_USB, + .qdev.props = ehci_properties, }; static int usb_ehci_initfn(PCIDevice *dev) @@ -2362,7 +2360,8 @@ static int usb_ehci_initfn(PCIDevice *dev) static void ehci_register(void) { - pci_qdev_register_many(ehci_info); + pci_qdev_register(&ehci_info); + pci_qdev_register(&ich9_ehci_info); } device_init(ehci_register); diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index 25d4e8c15b..1821063a6c 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -1192,8 +1192,7 @@ static Property uhci_properties[] = { DEFINE_PROP_END_OF_LIST(), }; -static PCIDeviceInfo uhci_info[] = { - { +static PCIDeviceInfo piix3_uhci_info = { .qdev.name = "piix3-usb-uhci", .qdev.size = sizeof(UHCIState), .qdev.vmsd = &vmstate_uhci, @@ -1204,7 +1203,9 @@ static PCIDeviceInfo uhci_info[] = { .revision = 0x01, .class_id = PCI_CLASS_SERIAL_USB, .qdev.props = uhci_properties, - },{ +}; + +static PCIDeviceInfo piix4_uhci_info = { .qdev.name = "piix4-usb-uhci", .qdev.size = sizeof(UHCIState), .qdev.vmsd = &vmstate_uhci, @@ -1215,55 +1216,65 @@ static PCIDeviceInfo uhci_info[] = { .revision = 0x01, .class_id = PCI_CLASS_SERIAL_USB, .qdev.props = uhci_properties, - },{ - .qdev.name = "vt82c686b-usb-uhci", - .qdev.size = sizeof(UHCIState), - .qdev.vmsd = &vmstate_uhci, - .init = usb_uhci_vt82c686b_initfn, - .exit = usb_uhci_exit, - .vendor_id = PCI_VENDOR_ID_VIA, - .device_id = PCI_DEVICE_ID_VIA_UHCI, - .revision = 0x01, - .class_id = PCI_CLASS_SERIAL_USB, - .qdev.props = uhci_properties, - },{ - .qdev.name = "ich9-usb-uhci1", - .qdev.size = sizeof(UHCIState), - .qdev.vmsd = &vmstate_uhci, - .init = usb_uhci_common_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82801I_UHCI1, - .revision = 0x03, - .class_id = PCI_CLASS_SERIAL_USB, - .qdev.props = uhci_properties, - },{ - .qdev.name = "ich9-usb-uhci2", - .qdev.size = sizeof(UHCIState), - .qdev.vmsd = &vmstate_uhci, - .init = usb_uhci_common_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82801I_UHCI2, - .revision = 0x03, - .class_id = PCI_CLASS_SERIAL_USB, - .qdev.props = uhci_properties, - },{ - .qdev.name = "ich9-usb-uhci3", - .qdev.size = sizeof(UHCIState), - .qdev.vmsd = &vmstate_uhci, - .init = usb_uhci_common_initfn, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_82801I_UHCI3, - .revision = 0x03, - .class_id = PCI_CLASS_SERIAL_USB, - .qdev.props = uhci_properties, - },{ - /* end of list */ - } +}; + +static PCIDeviceInfo vt82c686b_uhci_info = { + .qdev.name = "vt82c686b-usb-uhci", + .qdev.size = sizeof(UHCIState), + .qdev.vmsd = &vmstate_uhci, + .init = usb_uhci_vt82c686b_initfn, + .exit = usb_uhci_exit, + .vendor_id = PCI_VENDOR_ID_VIA, + .device_id = PCI_DEVICE_ID_VIA_UHCI, + .revision = 0x01, + .class_id = PCI_CLASS_SERIAL_USB, + .qdev.props = uhci_properties, +}; + +static PCIDeviceInfo ich9_uhci1_info = { + .qdev.name = "ich9-usb-uhci1", + .qdev.size = sizeof(UHCIState), + .qdev.vmsd = &vmstate_uhci, + .init = usb_uhci_common_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82801I_UHCI1, + .revision = 0x03, + .class_id = PCI_CLASS_SERIAL_USB, + .qdev.props = uhci_properties, +}; + +static PCIDeviceInfo ich9_uhci2_info = { + .qdev.name = "ich9-usb-uhci2", + .qdev.size = sizeof(UHCIState), + .qdev.vmsd = &vmstate_uhci, + .init = usb_uhci_common_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82801I_UHCI2, + .revision = 0x03, + .class_id = PCI_CLASS_SERIAL_USB, + .qdev.props = uhci_properties, +}; + +static PCIDeviceInfo ich9_uhci3_info = { + .qdev.name = "ich9-usb-uhci3", + .qdev.size = sizeof(UHCIState), + .qdev.vmsd = &vmstate_uhci, + .init = usb_uhci_common_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82801I_UHCI3, + .revision = 0x03, + .class_id = PCI_CLASS_SERIAL_USB, + .qdev.props = uhci_properties, }; static void uhci_register(void) { - pci_qdev_register_many(uhci_info); + pci_qdev_register(&piix3_uhci_info); + pci_qdev_register(&piix4_uhci_info); + pci_qdev_register(&vt82c686b_uhci_info); + pci_qdev_register(&ich9_uhci1_info); + pci_qdev_register(&ich9_uhci2_info); + pci_qdev_register(&ich9_uhci3_info); } device_init(uhci_register); diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index c93889a2ab..72b53afc81 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -806,98 +806,96 @@ static int virtio_balloon_exit_pci(PCIDevice *pci_dev) return virtio_exit_pci(pci_dev); } -static PCIDeviceInfo virtio_info[] = { - { - .qdev.name = "virtio-blk-pci", - .qdev.alias = "virtio-blk", - .qdev.size = sizeof(VirtIOPCIProxy), - .init = virtio_blk_init_pci, - .exit = virtio_blk_exit_pci, - .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, - .device_id = PCI_DEVICE_ID_VIRTIO_BLOCK, - .revision = VIRTIO_PCI_ABI_VERSION, - .class_id = PCI_CLASS_STORAGE_SCSI, - .qdev.props = (Property[]) { - DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), - DEFINE_BLOCK_PROPERTIES(VirtIOPCIProxy, block), - DEFINE_PROP_STRING("serial", VirtIOPCIProxy, block_serial), - DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, - VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), - DEFINE_VIRTIO_BLK_FEATURES(VirtIOPCIProxy, host_features), - DEFINE_PROP_END_OF_LIST(), - }, - .qdev.reset = virtio_pci_reset, - },{ - .qdev.name = "virtio-net-pci", - .qdev.alias = "virtio-net", - .qdev.size = sizeof(VirtIOPCIProxy), - .init = virtio_net_init_pci, - .exit = virtio_net_exit_pci, - .romfile = "pxe-virtio.rom", - .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, - .device_id = PCI_DEVICE_ID_VIRTIO_NET, - .revision = VIRTIO_PCI_ABI_VERSION, - .class_id = PCI_CLASS_NETWORK_ETHERNET, - .qdev.props = (Property[]) { - DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, - VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false), - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3), - DEFINE_VIRTIO_NET_FEATURES(VirtIOPCIProxy, host_features), - DEFINE_NIC_PROPERTIES(VirtIOPCIProxy, nic), - DEFINE_PROP_UINT32("x-txtimer", VirtIOPCIProxy, - net.txtimer, TX_TIMER_INTERVAL), - DEFINE_PROP_INT32("x-txburst", VirtIOPCIProxy, - net.txburst, TX_BURST), - DEFINE_PROP_STRING("tx", VirtIOPCIProxy, net.tx), - DEFINE_PROP_END_OF_LIST(), - }, - .qdev.reset = virtio_pci_reset, - },{ - .qdev.name = "virtio-serial-pci", - .qdev.alias = "virtio-serial", - .qdev.size = sizeof(VirtIOPCIProxy), - .init = virtio_serial_init_pci, - .exit = virtio_serial_exit_pci, - .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, - .device_id = PCI_DEVICE_ID_VIRTIO_CONSOLE, - .revision = VIRTIO_PCI_ABI_VERSION, - .class_id = PCI_CLASS_COMMUNICATION_OTHER, - .qdev.props = (Property[]) { - DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, - VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, - DEV_NVECTORS_UNSPECIFIED), - DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), - DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, - serial.max_virtserial_ports, 31), - DEFINE_PROP_END_OF_LIST(), - }, - .qdev.reset = virtio_pci_reset, - },{ - .qdev.name = "virtio-balloon-pci", - .qdev.alias = "virtio-balloon", - .qdev.size = sizeof(VirtIOPCIProxy), - .init = virtio_balloon_init_pci, - .exit = virtio_balloon_exit_pci, - .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, - .device_id = PCI_DEVICE_ID_VIRTIO_BALLOON, - .revision = VIRTIO_PCI_ABI_VERSION, - .class_id = PCI_CLASS_MEMORY_RAM, - .qdev.props = (Property[]) { - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), - DEFINE_PROP_END_OF_LIST(), - }, - .qdev.reset = virtio_pci_reset, - },{ - /* end of list */ - } +static PCIDeviceInfo virtio_blk_info = { + .qdev.name = "virtio-blk-pci", + .qdev.alias = "virtio-blk", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_blk_init_pci, + .exit = virtio_blk_exit_pci, + .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, + .device_id = PCI_DEVICE_ID_VIRTIO_BLOCK, + .revision = VIRTIO_PCI_ABI_VERSION, + .class_id = PCI_CLASS_STORAGE_SCSI, + .qdev.props = (Property[]) { + DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), + DEFINE_BLOCK_PROPERTIES(VirtIOPCIProxy, block), + DEFINE_PROP_STRING("serial", VirtIOPCIProxy, block_serial), + DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), + DEFINE_VIRTIO_BLK_FEATURES(VirtIOPCIProxy, host_features), + DEFINE_PROP_END_OF_LIST(), + }, + .qdev.reset = virtio_pci_reset, +}; + +static PCIDeviceInfo virtio_net_info = { + .qdev.name = "virtio-net-pci", + .qdev.alias = "virtio-net", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_net_init_pci, + .exit = virtio_net_exit_pci, + .romfile = "pxe-virtio.rom", + .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, + .device_id = PCI_DEVICE_ID_VIRTIO_NET, + .revision = VIRTIO_PCI_ABI_VERSION, + .class_id = PCI_CLASS_NETWORK_ETHERNET, + .qdev.props = (Property[]) { + DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3), + DEFINE_VIRTIO_NET_FEATURES(VirtIOPCIProxy, host_features), + DEFINE_NIC_PROPERTIES(VirtIOPCIProxy, nic), + DEFINE_PROP_UINT32("x-txtimer", VirtIOPCIProxy, net.txtimer, TX_TIMER_INTERVAL), + DEFINE_PROP_INT32("x-txburst", VirtIOPCIProxy, net.txburst, TX_BURST), + DEFINE_PROP_STRING("tx", VirtIOPCIProxy, net.tx), + DEFINE_PROP_END_OF_LIST(), + }, + .qdev.reset = virtio_pci_reset, +}; + +static PCIDeviceInfo virtio_serial_info = { + .qdev.name = "virtio-serial-pci", + .qdev.alias = "virtio-serial", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_serial_init_pci, + .exit = virtio_serial_exit_pci, + .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, + .device_id = PCI_DEVICE_ID_VIRTIO_CONSOLE, + .revision = VIRTIO_PCI_ABI_VERSION, + .class_id = PCI_CLASS_COMMUNICATION_OTHER, + .qdev.props = (Property[]) { + DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, DEV_NVECTORS_UNSPECIFIED), + DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), + DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), + DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, serial.max_virtserial_ports, 31), + DEFINE_PROP_END_OF_LIST(), + }, + .qdev.reset = virtio_pci_reset, +}; + +static PCIDeviceInfo virtio_balloon_info = { + .qdev.name = "virtio-balloon-pci", + .qdev.alias = "virtio-balloon", + .qdev.size = sizeof(VirtIOPCIProxy), + .init = virtio_balloon_init_pci, + .exit = virtio_balloon_exit_pci, + .vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET, + .device_id = PCI_DEVICE_ID_VIRTIO_BALLOON, + .revision = VIRTIO_PCI_ABI_VERSION, + .class_id = PCI_CLASS_MEMORY_RAM, + .qdev.props = (Property[]) { + DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), + DEFINE_PROP_END_OF_LIST(), + }, + .qdev.reset = virtio_pci_reset, }; static void virtio_pci_register_devices(void) { - pci_qdev_register_many(virtio_info); + pci_qdev_register(&virtio_blk_info); + pci_qdev_register(&virtio_net_info); + pci_qdev_register(&virtio_serial_info); + pci_qdev_register(&virtio_balloon_info); } device_init(virtio_pci_register_devices) |