From patchwork Tue Feb 28 10:20:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 143429 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 A5AFBB6F62 for ; Tue, 28 Feb 2012 22:42:20 +1100 (EST) Received: from localhost ([::1]:37341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2KBW-00087J-3O for incoming@patchwork.ozlabs.org; Tue, 28 Feb 2012 05:21:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2KAx-000781-5z for qemu-devel@nongnu.org; Tue, 28 Feb 2012 05:21:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2KAq-000444-83 for qemu-devel@nongnu.org; Tue, 28 Feb 2012 05:20:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2KAp-00043s-WB for qemu-devel@nongnu.org; Tue, 28 Feb 2012 05:20:48 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1SAKjxE005163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 Feb 2012 05:20:45 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1SAKeM5011151; Tue, 28 Feb 2012 05:20:43 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id BDE5841331; Tue, 28 Feb 2012 11:20:31 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 28 Feb 2012 11:20:28 +0100 Message-Id: <1330424430-23015-20-git-send-email-kraxel@redhat.com> In-Reply-To: <1330424430-23015-1-git-send-email-kraxel@redhat.com> References: <1330424430-23015-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 19/21] usb-redir: Limit return values returned by iso packets 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 From: Hans de Goede The usbredir protocol uses a status of usb_redir_stall to indicate that an iso data stream has stopped (ie because the urbs failed on resubmit), but iso packets should never return a result of USB_RET_STALL, since iso endpoints cannot stall. So instead simply always return USB_RET_NAK on iso stream errors. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- usb-redir.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index 6c92fd9..d905463 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -431,7 +431,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p, /* Check iso_error for stream errors, otherwise its an underrun */ status = dev->endpoint[EP2I(ep)].iso_error; dev->endpoint[EP2I(ep)].iso_error = 0; - return usbredir_handle_status(dev, status, 0); + return status ? USB_RET_NAK : 0; } DPRINTF2("iso-token-in ep %02X status %d len %d queue-size: %d\n", ep, isop->status, isop->len, dev->endpoint[EP2I(ep)].bufpq_size); @@ -439,7 +439,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p, status = isop->status; if (status != usb_redir_success) { bufp_free(dev, isop, ep); - return usbredir_handle_status(dev, status, 0); + return USB_RET_NAK; } len = isop->len;