[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/14] usb: fix endpoint descriptor ordering
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 11/14] usb: fix endpoint descriptor ordering |
Date: |
Thu, 21 Feb 2013 10:59:10 +0100 |
Fix the ordering of the endpoint descriptors for superspeed endpoints:
The superspeed companion must come first, possible additional
descriptors for the endpoint after that.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/desc.c | 9 +++++----
1 file 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;
}
--
1.7.9.7
- [Qemu-devel] [PULL 00/14] usb patch queue, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 03/14] make usb devices configurable, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 02/14] fix scripts/make_device_config.sh, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 10/14] usb-redir: simplify packet copy, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 07/14] usb-host: remove usb_host_device_close, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 08/14] usb: add usb_ep_set_halted, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 05/14] usb-storage: use scsi_req_enqueue return value, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 11/14] usb: fix endpoint descriptor ordering,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 09/14] usb: make usb_packet_copy operate on combined packets, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 04/14] allow disabling usb smartcard support, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 01/14] usb: Makefile cleanup, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 12/14] usb-core: usb3 streams, Gerd Hoffmann, 2013/02/21
- Re: [Qemu-devel] [PATCH 12/14] usb-core: usb3 streams, Eduardo Habkost, 2013/02/21
- [Qemu-devel] [PATCH 13/14] usb-xhci: usb3 streams, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 06/14] usb-host: move legacy cmd line bits, Gerd Hoffmann, 2013/02/21
- [Qemu-devel] [PATCH 14/14] uas-uas: usb3 streams, Gerd Hoffmann, 2013/02/21