提交 6d51b2bb 编写于 作者: G Gerd Hoffmann

usb3: superspeed descriptors

Add superspeed descriptor entry to USBDesc,
advertise superspeed support when present.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 0846e635
......@@ -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;
......
......@@ -152,6 +152,7 @@ struct USBDesc {
USBDescID id;
const USBDescDevice *full;
const USBDescDevice *high;
const USBDescDevice *super;
const char* const *str;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册