From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2KAw-000762-GB for qemu-devel@nongnu.org; Tue, 28 Feb 2012 05:21:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2KAo-00043m-ML for qemu-devel@nongnu.org; Tue, 28 Feb 2012 05:20:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2KAo-000432-Ev for qemu-devel@nongnu.org; Tue, 28 Feb 2012 05:20:46 -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 q1SAKjaH006462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 Feb 2012 05:20:45 -0500 From: Gerd Hoffmann Date: Tue, 28 Feb 2012 11:20:29 +0100 Message-Id: <1330424430-23015-21-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> Subject: [Qemu-devel] [PATCH 20/21] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hans de Goede , Gerd Hoffmann From: Hans de Goede We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data for an interrupt IN endpoint. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- usb-redir.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index d905463..755492f 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -548,7 +548,10 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev, /* Check interrupt_error for stream errors */ status = dev->endpoint[EP2I(ep)].interrupt_error; dev->endpoint[EP2I(ep)].interrupt_error = 0; - return usbredir_handle_status(dev, status, 0); + if (status) { + return usbredir_handle_status(dev, status, 0); + } + return USB_RET_NAK; } DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep, intp->status, intp->len); -- 1.7.1