From patchwork Fri Mar 2 18:32:22 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: 144294 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 22C2D1007D3 for ; Sat, 3 Mar 2012 05:31:04 +1100 (EST) Received: from localhost ([::1]:42471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3XFt-00084Z-JL for incoming@patchwork.ozlabs.org; Fri, 02 Mar 2012 13:31:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3XFl-00084K-PT for qemu-devel@nongnu.org; Fri, 02 Mar 2012 13:30:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3XFk-000665-28 for qemu-devel@nongnu.org; Fri, 02 Mar 2012 13:30:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3XFj-00065t-P7 for qemu-devel@nongnu.org; Fri, 02 Mar 2012 13:30:51 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q22IUoLU029282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Mar 2012 13:30:50 -0500 Received: from shalem.localdomain.com (vpn1-7-1.ams2.redhat.com [10.36.7.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q22IUlt4003764; Fri, 2 Mar 2012 13:30:49 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Fri, 2 Mar 2012 19:32:22 +0100 Message-Id: <1330713154-3229-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1330713154-3229-1-git-send-email-hdegoede@redhat.com> References: <1330713154-3229-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 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; } }