aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-desc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb-desc.c')
-rw-r--r--hw/usb-desc.c22
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);