From patchwork Wed Nov 21 14:00:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 200775 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 34CDE2C008E for ; Thu, 22 Nov 2012 01:12:43 +1100 (EST) Received: from localhost ([::1]:33747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbB2f-0007mo-8H for incoming@patchwork.ozlabs.org; Wed, 21 Nov 2012 09:12:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbB2Y-0007ma-Df for qemu-devel@nongnu.org; Wed, 21 Nov 2012 09:12:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbB2Q-00080p-Cz for qemu-devel@nongnu.org; Wed, 21 Nov 2012 09:12:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbB2Q-00080g-5T for qemu-devel@nongnu.org; Wed, 21 Nov 2012 09:12:26 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qALECPXh023540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Nov 2012 09:12:25 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qALE0Was024936; Wed, 21 Nov 2012 09:00:44 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 7998040B06; Wed, 21 Nov 2012 15:00:05 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 21 Nov 2012 15:00:02 +0100 Message-Id: <1353506404-29446-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1353506404-29446-1-git-send-email-kraxel@redhat.com> References: <1353506404-29446-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Hans de Goede , Alon Levy , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 5/7] usb-smartcard-reader: Properly NAK interrupt eps when we've no events 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 When we've no data to return from the interrupt endpoint, return NAK rather then a 0 length packet. CC: Alon Levy Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb/dev-smartcard-reader.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 190fcd6..de955b7 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -1002,6 +1002,8 @@ static void ccid_handle_data(USBDevice *dev, USBPacket *p) "handle_data: int_in: notify_slot_change %X, " "requested len %zd\n", s->bmSlotICCState, p->iov.size); + } else { + p->status = USB_RET_NAK; } break; default: