From patchwork Sat Nov 17 11:15:02 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: 199833 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 BE53F2C008F for ; Sat, 17 Nov 2012 22:13:45 +1100 (EST) Received: from localhost ([::1]:55473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZgLH-0007kp-Rm for incoming@patchwork.ozlabs.org; Sat, 17 Nov 2012 06:13:43 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZgKk-0006PL-7l for qemu-devel@nongnu.org; Sat, 17 Nov 2012 06:13:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZgKh-00061E-5a for qemu-devel@nongnu.org; Sat, 17 Nov 2012 06:13:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZgKg-000611-UM for qemu-devel@nongnu.org; Sat, 17 Nov 2012 06:13:07 -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 qAHBD6to012950 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 17 Nov 2012 06:13:06 -0500 Received: from shalem.localdomain.com (vpn1-5-33.ams2.redhat.com [10.36.5.33]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAHBD2Yo009097; Sat, 17 Nov 2012 06:13:05 -0500 From: Hans de Goede To: Gerd Hoffmann Date: Sat, 17 Nov 2012 12:15:02 +0100 Message-Id: <1353150902-24987-3-git-send-email-hdegoede@redhat.com> In-Reply-To: <1353150902-24987-1-git-send-email-hdegoede@redhat.com> References: <1353150902-24987-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: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Hans de Goede , Alon Levy , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/2] 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 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 --- hw/usb/dev-smartcard-reader.c | 2 ++ 1 file changed, 2 insertions(+) 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: