scd: Internal CCID driver thing only for SPR532.

* scd/ccid-driver.c (ccid_vendor_specific_setup): New.  Limit
only for SPR532, excluding other readers by SCM.
(ccid_slot_status): Use ccid_vendor_specific_setup.

--

We follow the setup procedure of libccid implementation, which sends
the escape command for SPR532 only.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-10-26 11:38:47 +09:00
parent 3c6b5dfa2a
commit 31def32eee
1 changed files with 14 additions and 6 deletions

View File

@ -1287,6 +1287,19 @@ ccid_vendor_specific_init (ccid_driver_t handle)
}
static int
ccid_vendor_specific_setup (ccid_driver_t handle)
{
if (handle->id_vendor == VENDOR_SCM && handle->id_product == SCM_SPR532)
{
DEBUGOUT ("sending escape sequence to switch to a case 1 APDU\n");
send_escape_cmd (handle, (const unsigned char*)"\x80\x02\x00", 3,
NULL, 0, NULL);
}
return 0;
}
#define MAX_DEVICE 16 /* See MAX_READER in apdu.c. */
struct ccid_dev_table {
@ -2416,12 +2429,7 @@ ccid_slot_status (ccid_driver_t handle, int *statusbits, int on_wire)
if (handle->transfer == NULL)
{
ccid_setup_intr (handle);
if (handle->id_vendor == VENDOR_SCM)
{
DEBUGOUT ("sending escape sequence to switch to a case 1 APDU\n");
send_escape_cmd (handle, (const unsigned char*)"\x80\x02\x00", 3,
NULL, 0, NULL);
}
ccid_vendor_specific_setup (handle);
}
*statusbits = 0;