aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/desc.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-02-21 09:39:17 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-21 09:39:17 -0600
commit70aa41b56ce3f34fceac44e828ba2d8cc19523ee (patch)
tree360b9559d0ed7faa747da79e5ae2958e933cb785 /hw/usb/desc.c
parent259dc0c1ce8eef14e5e0c349bc68ba05c9d5d82f (diff)
parent89a453d4a5c195e6d0a3c3d4fcaacb447447115f (diff)
downloadqemu-70aa41b56ce3f34fceac44e828ba2d8cc19523ee.zip
qemu-70aa41b56ce3f34fceac44e828ba2d8cc19523ee.tar.gz
qemu-70aa41b56ce3f34fceac44e828ba2d8cc19523ee.tar.bz2
Merge remote-tracking branch 'kraxel/usb.78' into staging
# By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/usb.78: uas-uas: usb3 streams usb-xhci: usb3 streams usb-core: usb3 streams usb: fix endpoint descriptor ordering usb-redir: simplify packet copy usb: make usb_packet_copy operate on combined packets usb: add usb_ep_set_halted usb-host: remove usb_host_device_close usb-host: move legacy cmd line bits usb-storage: use scsi_req_enqueue return value allow disabling usb smartcard support make usb devices configurable fix scripts/make_device_config.sh usb: Makefile cleanup
Diffstat (limited to 'hw/usb/desc.c')
-rw-r--r--hw/usb/desc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/usb/desc.c b/hw/usb/desc.c
index b7c3233..b389381 100644
--- a/hw/usb/desc.c
+++ b/hw/usb/desc.c
@@ -225,12 +225,9 @@ int usb_desc_endpoint(const USBDescEndpoint *ep, int flags,
d->u.endpoint.bRefresh = ep->bRefresh;
d->u.endpoint.bSynchAddress = ep->bSynchAddress;
}
- if (ep->extra) {
- memcpy(dest + bLength, ep->extra, extralen);
- }
if (superlen) {
- USBDescriptor *d = (void *)(dest + bLength + extralen);
+ USBDescriptor *d = (void *)(dest + bLength);
d->bLength = 0x06;
d->bDescriptorType = USB_DT_ENDPOINT_COMPANION;
@@ -243,6 +240,10 @@ int usb_desc_endpoint(const USBDescEndpoint *ep, int flags,
usb_hi(ep->wBytesPerInterval);
}
+ if (ep->extra) {
+ memcpy(dest + bLength + superlen, ep->extra, extralen);
+ }
+
return bLength + extralen + superlen;
}