From nobody Tue Feb 10 13:01:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150053958945728.79518220609873; Thu, 20 Jul 2017 01:33:09 -0700 (PDT) Received: from localhost ([::1]:36676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY6tP-0003Ni-0H for importer@patchew.org; Thu, 20 Jul 2017 04:33:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dY6mp-0006Ag-JW for qemu-devel@nongnu.org; Thu, 20 Jul 2017 04:26:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dY6mo-0004pt-On for qemu-devel@nongnu.org; Thu, 20 Jul 2017 04:26:19 -0400 Received: from manul.sfritsch.de ([2a01:4f8:172:195f:112::2]:36933) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dY6mo-0004pk-I0 for qemu-devel@nongnu.org; Thu, 20 Jul 2017 04:26:18 -0400 From: Stefan Fritsch To: Gerd Hoffmann , qemu-devel@nongnu.org Date: Thu, 20 Jul 2017 10:25:20 +0200 Message-Id: <1500539123-23884-6-git-send-email-sf@sfritsch.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1500539123-23884-1-git-send-email-sf@sfritsch.de> References: <1500539123-23884-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 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: , Cc: Stefan Fritsch Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Stefan Fritsch - We want to support both T=3D0 and T=3D1. 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=3D1 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[] =3D { */ 0x07, /* u8 bVoltageSupport; 01h - 5.0v, 02h - 3.0, 03 - 1.= 8 */ =20 - 0x00, 0x00, /* u32 dwProtocols; RRRR PPPP. RRRR =3D 0000h.*/ - 0x01, 0x00, /* PPPP: 0001h =3D Protocol T=3D0, 0002h =3D Protocol = T=3D1 */ + 0x03, 0x00, /* u32 dwProtocols; RRRR PPPP. RRRR =3D 0000h.*/ + 0x00, 0x00, /* PPPP: 0001h =3D Protocol T=3D0, 0002h =3D Protocol = T=3D1 */ /* 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[] =3D { * insertion and removal. Must set bit 5 in bmAttribut= es * 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 --=20 2.11.0