[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/23] uhci: add ich9 controllers
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 16/23] uhci: add ich9 controllers |
Date: |
Fri, 8 Jul 2011 11:51:06 +0200 |
Add ich9 controllers, Factor out properties to a separate
struct and reference it to reduce duplication.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb-uhci.c | 54 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 925c03b..2ef4c5b 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -1176,6 +1176,12 @@ static int usb_uhci_vt82c686b_initfn(PCIDevice *dev)
return usb_uhci_common_initfn(dev);
}
+static Property uhci_properties[] = {
+ DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
+ DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static PCIDeviceInfo uhci_info[] = {
{
.qdev.name = "piix3-usb-uhci",
@@ -1186,11 +1192,7 @@ static PCIDeviceInfo uhci_info[] = {
.device_id = PCI_DEVICE_ID_INTEL_82371SB_2,
.revision = 0x01,
.class_id = PCI_CLASS_SERIAL_USB,
- .qdev.props = (Property[]) {
- DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
- DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
- DEFINE_PROP_END_OF_LIST(),
- },
+ .qdev.props = uhci_properties,
},{
.qdev.name = "piix4-usb-uhci",
.qdev.size = sizeof(UHCIState),
@@ -1200,11 +1202,7 @@ static PCIDeviceInfo uhci_info[] = {
.device_id = PCI_DEVICE_ID_INTEL_82371AB_2,
.revision = 0x01,
.class_id = PCI_CLASS_SERIAL_USB,
- .qdev.props = (Property[]) {
- DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
- DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
- DEFINE_PROP_END_OF_LIST(),
- },
+ .qdev.props = uhci_properties,
},{
.qdev.name = "vt82c686b-usb-uhci",
.qdev.size = sizeof(UHCIState),
@@ -1214,11 +1212,37 @@ static PCIDeviceInfo uhci_info[] = {
.device_id = PCI_DEVICE_ID_VIA_UHCI,
.revision = 0x01,
.class_id = PCI_CLASS_SERIAL_USB,
- .qdev.props = (Property[]) {
- DEFINE_PROP_STRING("masterbus", UHCIState, masterbus),
- DEFINE_PROP_UINT32("firstport", UHCIState, firstport, 0),
- DEFINE_PROP_END_OF_LIST(),
- },
+ .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 */
}
--
1.7.1
- [Qemu-devel] [PATCH 09/23] usb-ehci: cleanup port reset handling, (continued)
- [Qemu-devel] [PATCH 09/23] usb-ehci: cleanup port reset handling, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 08/23] usb-ehci: Connect Status bit is read only, don't allow changing it by the guest, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 11/23] usb-ehci: Fix handling of PED and PEDC port status bits, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 01/23] hw/usb-musb.c: Don't misuse usb_packet_complete(), Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 07/23] usb-ehci: drop unused num-ports state member, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 05/23] usb: Make port wakeup and complete ops take a USBPort instead of a Device, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 14/23] usb-ohci: Add support for being a companion controller, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 13/23] usb-uhci: Add support for being a companion controller, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 06/23] usb: Replace device_destroy bus op with a child_detach port op, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 12/23] usb-ehci: Add support for registering companion controllers, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 16/23] uhci: add ich9 controllers,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 17/23] ehci: fix port count., Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 15/23] pci: add ich9 usb controller ids, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 18/23] ehci: add ich9 controller., Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 19/23] usb: update documentation, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 23/23] usb-ohci: raise interrupt on attach, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 20/23] usb_register_port(): do not set port->opaque and port->index twice, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 22/23] usb-hub: remove unused descriptor arrays, Gerd Hoffmann, 2011/07/08
- [Qemu-devel] [PATCH 21/23] usb: fixup bluetooth descriptors, Gerd Hoffmann, 2011/07/08
- Re: [Qemu-devel] [PULL] usb patch queue, Gerd Hoffmann, 2011/07/12
- Re: [Qemu-devel] [PULL] usb patch queue, Anthony Liguori, 2011/07/19