From patchwork Fri Mar 2 20:27:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 144342 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1CD5EB6ED0 for ; Sat, 3 Mar 2012 07:45:57 +1100 (EST) Received: from localhost ([::1]:34925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3Z3g-0004Sq-I2 for incoming@patchwork.ozlabs.org; Fri, 02 Mar 2012 15:26:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3Z37-000374-H1 for qemu-devel@nongnu.org; Fri, 02 Mar 2012 15:25:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3Z2n-00079r-AH for qemu-devel@nongnu.org; Fri, 02 Mar 2012 15:25:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3Z2n-00079X-1n for qemu-devel@nongnu.org; Fri, 02 Mar 2012 15:25:37 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q22KPZvF000824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Mar 2012 15:25:35 -0500 Received: from shalem.localdomain.com (vpn1-7-1.ams2.redhat.com [10.36.7.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q22KPWZV008746; Fri, 2 Mar 2012 15:25:34 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Fri, 2 Mar 2012 21:27:08 +0100 Message-Id: <1330720040-24507-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1330720040-24507-1-git-send-email-hdegoede@redhat.com> References: <1330720040-24507-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 01/13] usb-redir: Set ep type and interface X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Since we don't use usb_desc.c we need to do this ourselves. This fixes iso transfers no longer working for USB 2 devices due to the ep->type check in ehci.c Signed-off-by: Hans de Goede --- usb-redir.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index fc58a0e..ef9fa96 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -1149,6 +1149,7 @@ static void usbredir_device_disconnect(void *priv) for (i = 0; i < MAX_ENDPOINTS; i++) { QTAILQ_INIT(&dev->endpoint[i].bufpq); } + usb_ep_init(&dev->dev); dev->interface_info.interface_count = 0; } @@ -1175,6 +1176,7 @@ static void usbredir_ep_info(void *priv, struct usb_redir_ep_info_header *ep_info) { USBRedirDevice *dev = priv; + struct USBEndpoint *usb_ep; int i; for (i = 0; i < MAX_ENDPOINTS; i++) { @@ -1199,7 +1201,13 @@ static void usbredir_ep_info(void *priv, default: ERROR("Received invalid endpoint type\n"); usbredir_device_disconnect(dev); + return; } + usb_ep = usb_ep_get(&dev->dev, + (i & 0x10) ? USB_TOKEN_IN : USB_TOKEN_OUT, + i & 0x0f); + usb_ep->type = dev->endpoint[i].type; + usb_ep->ifnum = dev->endpoint[i].interface; } }