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-desc.c | |
parent | 8f04ee0882aec9fe91fb70f767edf5dacff59835 (diff) |
usb: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-desc.c')
-rw-r--r-- | hw/usb-desc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/hw/usb-desc.c b/hw/usb-desc.c index b3eb97bc6b..3c3ed6a802 100644 --- a/hw/usb-desc.c +++ b/hw/usb-desc.c @@ -297,8 +297,8 @@ static int usb_desc_set_interface(USBDevice *dev, int index, int value) dev->ifaces[index] = iface; usb_desc_ep_init(dev); - if (dev->info->set_interface && old != value) { - dev->info->set_interface(dev, index, old, value); + if (old != value) { + usb_device_set_interface(dev, index, old, value); } return 0; } @@ -338,7 +338,7 @@ static int usb_desc_set_config(USBDevice *dev, int value) static void usb_desc_setdefaults(USBDevice *dev) { - const USBDesc *desc = dev->info->usb_desc; + const USBDesc *desc = usb_device_get_usb_desc(dev); assert(desc != NULL); switch (dev->speed) { @@ -355,7 +355,7 @@ static void usb_desc_setdefaults(USBDevice *dev) void usb_desc_init(USBDevice *dev) { - const USBDesc *desc = dev->info->usb_desc; + const USBDesc *desc = usb_device_get_usb_desc(dev); assert(desc != NULL); dev->speed = USB_SPEED_FULL; @@ -371,7 +371,7 @@ void usb_desc_init(USBDevice *dev) void usb_desc_attach(USBDevice *dev) { - const USBDesc *desc = dev->info->usb_desc; + const USBDesc *desc = usb_device_get_usb_desc(dev); assert(desc != NULL); if (desc->high && (dev->port->speedmask & USB_SPEED_MASK_HIGH)) { @@ -380,7 +380,7 @@ void usb_desc_attach(USBDevice *dev) dev->speed = USB_SPEED_FULL; } else { fprintf(stderr, "usb: port/device speed mismatch for \"%s\"\n", - dev->info->product_desc); + usb_device_get_product_desc(dev)); return; } usb_desc_setdefaults(dev); @@ -436,7 +436,7 @@ int usb_desc_string(USBDevice *dev, int index, uint8_t *dest, size_t len) str = usb_desc_get_string(dev, index); if (str == NULL) { - str = dev->info->usb_desc->str[index]; + str = usb_device_get_usb_desc(dev)->str[index]; if (str == NULL) { return 0; } @@ -455,7 +455,7 @@ int usb_desc_string(USBDevice *dev, int index, uint8_t *dest, size_t len) int usb_desc_get_descriptor(USBDevice *dev, int value, uint8_t *dest, size_t len) { - const USBDesc *desc = dev->info->usb_desc; + const USBDesc *desc = usb_device_get_usb_desc(dev); const USBDescDevice *other_dev; uint8_t buf[256]; uint8_t type = value >> 8; @@ -463,9 +463,9 @@ int usb_desc_get_descriptor(USBDevice *dev, int value, uint8_t *dest, size_t len int ret = -1; if (dev->speed == USB_SPEED_HIGH) { - other_dev = dev->info->usb_desc->full; + other_dev = usb_device_get_usb_desc(dev)->full; } else { - other_dev = dev->info->usb_desc->high; + other_dev = usb_device_get_usb_desc(dev)->high; } switch(type) { @@ -520,7 +520,7 @@ int usb_desc_get_descriptor(USBDevice *dev, int value, uint8_t *dest, size_t len int usb_desc_handle_control(USBDevice *dev, USBPacket *p, int request, int value, int index, int length, uint8_t *data) { - const USBDesc *desc = dev->info->usb_desc; + const USBDesc *desc = usb_device_get_usb_desc(dev); int ret = -1; assert(desc != NULL); |