diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-15 14:53:10 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:47 -0600 |
commit | 62aed76583fe8bf8e6ba5955b2ecfa3619ea3540 (patch) | |
tree | a536e59eab00a94fccfbb8b3ad8b32e902e77ea2 /hw/usb-hub.c | |
parent | 8f04ee0882aec9fe91fb70f767edf5dacff59835 (diff) |
usb: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-hub.c')
-rw-r--r-- | hw/usb-hub.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/hw/usb-hub.c b/hw/usb-hub.c index 069611bbfb..ee4e6a6920 100644 --- a/hw/usb-hub.c +++ b/hw/usb-hub.c @@ -533,23 +533,30 @@ static const VMStateDescription vmstate_usb_hub = { } }; -static struct USBDeviceInfo hub_info = { - .product_desc = "QEMU USB Hub", - .qdev.name = "usb-hub", - .qdev.fw_name = "hub", - .qdev.size = sizeof(USBHubState), - .qdev.vmsd = &vmstate_usb_hub, - .usb_desc = &desc_hub, - .init = usb_hub_initfn, - .handle_packet = usb_hub_handle_packet, - .handle_reset = usb_hub_handle_reset, - .handle_control = usb_hub_handle_control, - .handle_data = usb_hub_handle_data, - .handle_destroy = usb_hub_handle_destroy, +static void usb_hub_class_initfn(ObjectClass *klass, void *data) +{ + USBDeviceClass *uc = USB_DEVICE_CLASS(klass); + + uc->init = usb_hub_initfn; + uc->product_desc = "QEMU USB Hub"; + uc->usb_desc = &desc_hub; + uc->handle_packet = usb_hub_handle_packet; + uc->handle_reset = usb_hub_handle_reset; + uc->handle_control = usb_hub_handle_control; + uc->handle_data = usb_hub_handle_data; + uc->handle_destroy = usb_hub_handle_destroy; +} + +static struct DeviceInfo hub_info = { + .name = "usb-hub", + .fw_name = "hub", + .size = sizeof(USBHubState), + .vmsd = &vmstate_usb_hub, + .class_init= usb_hub_class_initfn, }; static void usb_hub_register_devices(void) { - usb_qdev_register(&hub_info); + usb_qdev_register(&hub_info, NULL, NULL); } device_init(usb_hub_register_devices) |