From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1EDB-0003hJ-4d for qemu-devel@nongnu.org; Fri, 01 Feb 2013 05:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1ED7-0005nJ-Cd for qemu-devel@nongnu.org; Fri, 01 Feb 2013 05:51:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1ED7-0005n4-2O for qemu-devel@nongnu.org; Fri, 01 Feb 2013 05:51:09 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r11Ap6ec024947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Feb 2013 05:51:07 -0500 From: Gerd Hoffmann Date: Fri, 1 Feb 2013 11:51:02 +0100 Message-Id: <1359715865-6798-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1359715865-6798-1-git-send-email-kraxel@redhat.com> References: <1359715865-6798-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/4] usb: fix endpoint descriptor ordering List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 --- 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