From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDF8R-0001Ar-Vh for qemu-devel@nongnu.org; Mon, 19 Jan 2015 11:25:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDF8O-0005tU-MJ for qemu-devel@nongnu.org; Mon, 19 Jan 2015 11:25:03 -0500 Received: from mail.codeweavers.com ([216.251.189.131]:51513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDF8O-0005tO-HG for qemu-devel@nongnu.org; Mon, 19 Jan 2015 11:25:00 -0500 Message-ID: <54BD2FDB.5050109@codeweavers.com> Date: Mon, 19 Jan 2015 10:24:59 -0600 From: Jeremy White MIME-Version: 1.0 References: <1421679451-9096-1-git-send-email-jwhite@codeweavers.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] Retrieve the correct TD byte when checking an ATR. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Cc: qemu-devel@nongnu.org >> The '40' should have been the second TD; instead >> the FF is used, incorrectly. > > The second TD? There is only one here, T0 = 0x95 & 0xf0 >> 4 = b1001 Yes, sorry, I should not have capitalized TD in my comment. The code uses the variable 'td' to hold the upper 4 bits of T0, and then, if present, the upper 4 bits of TD1. So what is read imprecisely is the upper 4 bits of TD1. I don't know qemu patch protocol; that seems like a very minor detail in the comment; does it justify a resubmit? > >> >> Signed-off-by: Jeremy White >> --- >> hw/usb/ccid-card-passthru.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c >> index 10f1d30..2ae3b81 100644 >> --- a/hw/usb/ccid-card-passthru.c >> +++ b/hw/usb/ccid-card-passthru.c >> @@ -168,8 +168,8 @@ static int check_atr(PassthruState *card, uint8_t *data, int len) >> opt_bytes++; >> } >> if (td & 0x8) { >> - opt_bytes++; >> td = data[opt_bytes + 2] >> 4; >> + opt_bytes++; >> } >> } >> if (len < 2 + historical_length + opt_bytes) { >> -- >> 1.7.10.4 >> >> > > That looks correct, opt_bytes before incrementing points to the current TD. > > Reviewed-by: Marc-André Lureau >