diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 12:22:06 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 40021f08882aaef93c66c8c740087b6d3031b63a (patch) | |
tree | a0429c040df66503d807770a3b89da9a0c70d8ac /hw/usb-xhci.c | |
parent | 6e4ec3f9bb32d6f41e4fb30b872d2b7b084bc9a9 (diff) |
pci: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-xhci.c')
-rw-r--r-- | hw/usb-xhci.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c index 95bf010101..fba2de322a 100644 --- a/hw/usb-xhci.c +++ b/hw/usb-xhci.c @@ -2724,19 +2724,26 @@ static const VMStateDescription vmstate_xhci = { .unmigratable = 1, }; -static PCIDeviceInfo xhci_info = { - .qdev.name = "nec-usb-xhci", - .qdev.alias = "xhci", - .qdev.size = sizeof(XHCIState), - .qdev.vmsd = &vmstate_xhci, - .init = usb_xhci_initfn, - .vendor_id = PCI_VENDOR_ID_NEC, - .device_id = PCI_DEVICE_ID_NEC_UPD720200, - .class_id = PCI_CLASS_SERIAL_USB, - .revision = 0x03, - .is_express = 1, - .config_write = xhci_write_config, - .qdev.props = (Property[]) { +static void xhci_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->init = usb_xhci_initfn; + k->vendor_id = PCI_VENDOR_ID_NEC; + k->device_id = PCI_DEVICE_ID_NEC_UPD720200; + k->class_id = PCI_CLASS_SERIAL_USB; + k->revision = 0x03; + k->is_express = 1; + k->config_write = xhci_write_config; +} + +static DeviceInfo xhci_info = { + .name = "nec-usb-xhci", + .alias = "xhci", + .size = sizeof(XHCIState), + .vmsd = &vmstate_xhci, + .class_init = xhci_class_init, + .props = (Property[]) { DEFINE_PROP_UINT32("msi", XHCIState, msi, 0), DEFINE_PROP_END_OF_LIST(), } |