Re: GemPC Express Reader (Was: Support for Lenovo Integrated Smart Card Reader)
Joachim Breitner <[email protected]> Thu, 12 Feb 2009 20:29:48 +0000
| Newsgroups | gmane.comp.lib.libchipcard.devel |
|---|---|
| Message-ID | <1234470588.3803.55.camel@localhost> |
Hello,
Am Donnerstag, den 12.02.2009, 21:04 +0100 schrieb Ludovic Rousseau:
> Hello,
>
> It looks like libchipcard is not calling IFDHSetProtocolParameters()
> from the CCID driver. I don't see any trace of this function in your
> logs.
thanks for the pointer. I think the problem is somewhere in this
function from ./src/drivers/ifd/driverifd.c:
uint32_t DriverIFD_ConnectSlot(LCD_DRIVER *d, LCD_SLOT *sl) {
int i;
DRIVER_IFD *dct;
long retval;
assert(d);
dct=GWEN_INHERIT_GETDATA(LCD_DRIVER, DRIVER_IFD, d);
assert(dct);
retval=DriverIFD__ConnectSlot(d, sl);
if (retval!=CCID_ERROR_POWER_ACTION) {
DBG_INFO(LCD_Reader_GetLogger(LCD_Slot_GetReader(sl)),
"CCID: Result is not POWER_ACTION (%d)",
(int)retval);
return retval;
}
if (dct->setProtoFn==NULL)
return retval;
/* try protocols 0 through 15 */
for (i=0; i<16; i++) {
/* set protocol bt don't change PTS */
retval=dct->setProtoFn(LCD_Slot_GetSlotNum(sl),
i, 0, 0, 0, 0);
if (retval) {
DBG_INFO(LCD_Reader_GetLogger(LCD_Slot_GetReader(sl)),
"CCID: Error setting protocol %d (%d)",
i, (int)retval);
}
else {
retval=DriverIFD__ConnectSlot(d, sl);
if (retval!=CCID_ERROR_POWER_ACTION) {
DBG_INFO(LCD_Reader_GetLogger(LCD_Slot_GetReader(sl)),
"CCID: Result is not POWER_ACTION (%d, proto=%d)",
(int)retval, i);
return retval;
}
}
}
/* assuming no card inserted */
DBG_INFO(LCD_Reader_GetLogger(LCD_Slot_GetReader(sl)),
"Assuming no card is inserted");
return 0;
}
Adding some more debugging, I found out that it never passes the first
if clause, which is:
retval=DriverIFD__ConnectSlot(d, sl);
if (retval!=CCID_ERROR_POWER_ACTION) {
DBG_INFO(LCD_Reader_GetLogger(LCD_Slot_GetReader(sl)),
"CCID: Result is not POWER_ACTION (%d)",
(int)retval);
return retval;
}
Now I’m a bit at a loss there: It seems that the protocol is only tried
to be set when there was an error condition in DriverIFD__ConnectSlot
(which would be returned from IFDHPowerICC), but in my case, there is no
error condition returned.
Ludovic: Is it a bug in libccid that IFDHPowerICC does not return
IFD_ERROR_POWER_ACTION even though the protocol bits have not set up, or
libchipcard wrong in only trying to set the protocol when there is an
error? What would be the correct way of setting the protocol? (Sorry if
these questions are too obvious, but I’m new to the code base...)
Thanks,
Joachim
--
Joachim "nomeata" Breitner
mail: [email protected] | ICQ# 74513189 | GPG-Key: 4743206C
JID: [email protected] | http://www.joachim-breitner.de/
Debian Developer: [email protected]
------------------------------------------------------------------------------
_______________________________________________
Libchipcard-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libchipcard-devel
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkmUhroACgkQ9ijrk0dDIGyeyQCgk8Um3w10tGxImyLg3z5T6/LH 5rEAoJLAqNzeO7s4KwEUzWz1K4r+baeQ =+VCd -----END PGP SIGNATURE-----