提交 f3f01bab 编写于 作者: J Jason Andryuk 提交者: Michael Roth

ccid: Fix dwProtocols advertisement of T=0

Commit d7d218ef attempted to change
dwProtocols to only advertise support for T=0 and not T=1.  The change
was incorrect as it changed 0x00000003 to 0x00010000.

lsusb -v in a linux guest shows:
"dwProtocols         65536  (Invalid values detected)", though the
smart card could still be accessed.  Windows 7 does not detect inserted
smart cards and logs the the following Error in the Event Logs:

    Source: Smart Card Service
    Event ID: 610
    Smart Card Reader 'QEMU QEMU USB CCID 0' rejected IOCTL SET_PROTOCOL:
    Incorrect function. If this error persists, your smart card or reader
    may not be functioning correctly

    Command Header: 03 00 00 00

Setting to 0x00000001 fixes the Windows issue.
Signed-off-by: NJason Andryuk <jandryuk@gmail.com>
Message-id: 20180420183219.20722-1-jandryuk@gmail.com
Cc: qemu-stable@nongnu.org
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 0ee86bb6)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 5648a81d
...@@ -329,8 +329,8 @@ static const uint8_t qemu_ccid_descriptor[] = { ...@@ -329,8 +329,8 @@ static const uint8_t qemu_ccid_descriptor[] = {
*/ */
0x07, /* u8 bVoltageSupport; 01h - 5.0v, 02h - 3.0, 03 - 1.8 */ 0x07, /* u8 bVoltageSupport; 01h - 5.0v, 02h - 3.0, 03 - 1.8 */
0x00, 0x00, /* u32 dwProtocols; RRRR PPPP. RRRR = 0000h.*/ 0x01, 0x00, /* u32 dwProtocols; RRRR PPPP. RRRR = 0000h.*/
0x01, 0x00, /* PPPP: 0001h = Protocol T=0, 0002h = Protocol T=1 */ 0x00, 0x00, /* PPPP: 0001h = Protocol T=0, 0002h = Protocol T=1 */
/* u32 dwDefaultClock; in kHZ (0x0fa0 is 4 MHz) */ /* u32 dwDefaultClock; in kHZ (0x0fa0 is 4 MHz) */
0xa0, 0x0f, 0x00, 0x00, 0xa0, 0x0f, 0x00, 0x00,
/* u32 dwMaximumClock; */ /* u32 dwMaximumClock; */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册