aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-08-28 17:28:50 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-09-11 07:43:01 +0200
commit6d51b2bb07030c38e5f2d9048c6c474ca486fe9b (patch)
treeb42d9780493a68eb47c82964c7b42c4b5d102c0f /hw/usb
parent0846e6359c407e372f446723b8b7b09ac20d0f03 (diff)
usb3: superspeed descriptors
Add superspeed descriptor entry to USBDesc, advertise superspeed support when present. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/desc.c10
-rw-r--r--hw/usb/desc.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/hw/usb/desc.c b/hw/usb/desc.c
index 0a9d3c9f60..3e8c6cb503 100644
--- a/hw/usb/desc.c
+++ b/hw/usb/desc.c
@@ -359,6 +359,9 @@ static void usb_desc_setdefaults(USBDevice *dev)
case USB_SPEED_HIGH:
dev->device = desc->high;
break;
+ case USB_SPEED_SUPER:
+ dev->device = desc->super;
+ break;
}
usb_desc_set_config(dev, 0);
}
@@ -376,6 +379,9 @@ void usb_desc_init(USBDevice *dev)
if (desc->high) {
dev->speedmask |= USB_SPEED_MASK_HIGH;
}
+ if (desc->super) {
+ dev->speedmask |= USB_SPEED_MASK_SUPER;
+ }
usb_desc_setdefaults(dev);
}
@@ -384,7 +390,9 @@ void usb_desc_attach(USBDevice *dev)
const USBDesc *desc = usb_device_get_usb_desc(dev);
assert(desc != NULL);
- if (desc->high && (dev->port->speedmask & USB_SPEED_MASK_HIGH)) {
+ if (desc->super && (dev->port->speedmask & USB_SPEED_MASK_SUPER)) {
+ dev->speed = USB_SPEED_SUPER;
+ } else if (desc->high && (dev->port->speedmask & USB_SPEED_MASK_HIGH)) {
dev->speed = USB_SPEED_HIGH;
} else if (desc->full && (dev->port->speedmask & USB_SPEED_MASK_FULL)) {
dev->speed = USB_SPEED_FULL;
diff --git a/hw/usb/desc.h b/hw/usb/desc.h
index 7cf5442945..d89fa41666 100644
--- a/hw/usb/desc.h
+++ b/hw/usb/desc.h
@@ -152,6 +152,7 @@ struct USBDesc {
USBDescID id;
const USBDescDevice *full;
const USBDescDevice *high;
+ const USBDescDevice *super;
const char* const *str;
};