From patchwork Thu Jul 20 09:02:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Fritsch X-Patchwork-Id: 791517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xCp5132XHz9ryQ for ; Thu, 20 Jul 2017 19:09:57 +1000 (AEST) Received: from localhost ([::1]:36799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY7T0-00038V-Rk for incoming@patchwork.ozlabs.org; Thu, 20 Jul 2017 05:09:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY7N9-0006Mt-Qq for qemu-devel@nongnu.org; Thu, 20 Jul 2017 05:03:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dY7N8-0004Q7-U2 for qemu-devel@nongnu.org; Thu, 20 Jul 2017 05:03:51 -0400 Received: from manul.sfritsch.de ([2a01:4f8:172:195f:112::2]:37002) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dY7N8-0004PT-PF for qemu-devel@nongnu.org; Thu, 20 Jul 2017 05:03:50 -0400 From: Stefan Fritsch To: Gerd Hoffmann , qemu-devel@nongnu.org Date: Thu, 20 Jul 2017 11:02:48 +0200 Message-Id: <1500541371-24788-6-git-send-email-sf@sfritsch.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1500541371-24788-1-git-send-email-sf@sfritsch.de> References: <1500541371-24788-1-git-send-email-sf@sfritsch.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:172:195f:112::2 Subject: [Qemu-devel] [PATCH v2 5/8] usb-ccid: Fix USB descriptor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" From: Stefan Fritsch - We want to support both T=0 and T=1. Additionally, note that all fields in USB descriptors are little endian and the supported protocols are in the lowest byte the of the 32-Bit dwProtocols field. - We want APDU level exchanges. This saves us from PPS exchanges and from APDU reassembly from T=1 packets. Signed-off-by: Stefan Fritsch Signed-off-by: Christian Ehrhardt --- hw/usb/dev-smartcard-reader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 769949144b..bc4dc35d3f 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -353,8 +353,8 @@ static const uint8_t qemu_ccid_descriptor[] = { */ 0x07, /* u8 bVoltageSupport; 01h - 5.0v, 02h - 3.0, 03 - 1.8 */ - 0x00, 0x00, /* u32 dwProtocols; RRRR PPPP. RRRR = 0000h.*/ - 0x01, 0x00, /* PPPP: 0001h = Protocol T=0, 0002h = Protocol T=1 */ + 0x03, 0x00, /* u32 dwProtocols; RRRR PPPP. RRRR = 0000h.*/ + 0x00, 0x00, /* PPPP: 0001h = Protocol T=0, 0002h = Protocol T=1 */ /* u32 dwDefaultClock; in kHZ (0x0fa0 is 4 MHz) */ 0xa0, 0x0f, 0x00, 0x00, /* u32 dwMaximumClock; */ @@ -397,7 +397,7 @@ static const uint8_t qemu_ccid_descriptor[] = { * insertion and removal. Must set bit 5 in bmAttributes * in Configuration descriptor if 100000 is set. */ - 0xfe, 0x04, 0x01, 0x00, + 0xfe, 0x04, 0x04, 0x00, /* * u32 dwMaxCCIDMessageLength; For extended APDU in * [261 + 10 , 65544 + 10]. Otherwise the minimum is