Re: Bug in CCID library
Ludovic Rousseau <[email protected]> Wed, 5 Oct 2016 10:52:08 +0200
| Newsgroups | gmane.comp.lib.muscle |
|---|---|
| Message-ID | <CAGstE8BArodvECDX3K=De0Fr1bkK1rWwgBrS5HwZddQJBYpn8A@mail.gmail.com> |
Hello, Thanks Godfrey for pointing to your version of the driver. I found the patch in: https://github.com/acshk/acsccid/commit/4a7631d014781d36a2d21210b0b8768c07ef8c6d I propose a simpler version. Abraham can you test with the attached patch? Bye 2016-10-05 9:53 GMT+02:00 Abraham Macias Paredes <[email protected]>: > Hi, my reader is not an ACS one, is a C3PO LTC31 v2. > > You can see more details in http://pcsclite.alioth.debian. > org/ccid/supported.html > > > > > > Thanks Godfrey. > > > > *De:* Pcsclite-muscle [mailto:pcsclite-muscle-bounces+amacias= > [email protected]] *En nombre de *Godfrey Chung > *Enviado el:* miƩrcoles, 5 de octubre de 2016 9:27 > *Para:* Talks about MUSCLE <[email protected]> > *Asunto:* Re: [Pcsclite-muscle] Bug in CCID library > > > > Hi Abraham > > If you are using ACS readers, you can try acsccid driver and it already > contains a fix for this issue. > > > > On Wed, Oct 5, 2016 at 2:44 PM, Abraham Macias Paredes < > [email protected]> wrote: > > > > But this sets the speed to 125000 bauds. How can I set the speed to 230400 > bps (the reader maximum data rate)? > > > It depends on F/D values from the card. It cannot be set 230400 bps > directly. > > > > Regards > > Godfrey > > _______________________________________________ > Pcsclite-muscle mailing list > [email protected] > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle > -- Dr. Ludovic Rousseau _______________________________________________ Pcsclite-muscle mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pcsclite-muscle
patch.txt
(text/plain, 1.3 KB)
--- /var/folders/sg/t7kts8_n6j13n11r6_tgr36r0000gn/T//lKsbAa_ifdhandler.c 2016-10-05 10:51:04.000000000 +0200
+++ src/ifdhandler.c 2016-10-05 10:47:53.000000000 +0200
@@ -831,9 +831,7 @@ EXTERNAL RESPONSECODE IFDHSetProtocolPar
/* the card is too fast for the reader */
if ((card_baudrate > ccid_desc->dwMaxDataRate +2)
/* but TA1 <= 97 */
- && (atr.ib[0][ATR_INTERFACE_BYTE_TA].value <= 0x97)
- /* and the reader has a baud rate table */
- && ccid_desc->arrayOfSupportedDataRates)
+ && (atr.ib[0][ATR_INTERFACE_BYTE_TA].value <= 0x97))
{
unsigned char old_TA1;
@@ -850,8 +848,15 @@ EXTERNAL RESPONSECODE IFDHSetProtocolPar
card_baudrate = (unsigned int) (1000 *
ccid_desc->dwDefaultClock * d / f);
- if (find_baud_rate(card_baudrate,
+ /* the reader has a baud rate table */
+ if ((ccid_desc->arrayOfSupportedDataRates
+ /* and the baud rate is supported */
+ && find_baud_rate(card_baudrate,
ccid_desc->arrayOfSupportedDataRates))
+ /* or the reader has NO baud rate table */
+ || ((NULL == ccid_desc->arrayOfSupportedDataRates)
+ /* and the baud rate is bellow the limit */
+ && (card_baudrate <= ccid_desc->dwMaxDataRate)))
{
pps[1] |= 0x10; /* PTS1 presence */
pps[2] = atr.ib[0][ATR_INTERFACE_BYTE_TA].value;