aboutsummaryrefslogtreecommitdiffstats
path: root/scd/ccid-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'scd/ccid-driver.c')
-rw-r--r--scd/ccid-driver.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index 305c9d2f4..7124c6e7a 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -2708,7 +2708,7 @@ ccid_poll (ccid_driver_t handle)
/* Note that this function won't return the error codes NO_CARD or
CARD_INACTIVE */
int
-ccid_slot_status (ccid_driver_t handle, int *statusbits)
+ccid_slot_status (ccid_driver_t handle, int *statusbits, int on_wire)
{
int rc;
unsigned char msg[100];
@@ -2719,6 +2719,16 @@ ccid_slot_status (ccid_driver_t handle, int *statusbits)
if (handle->powered_off)
return CCID_DRIVER_ERR_NO_READER;
+ /* If the card (with its lower-level driver) doesn't require
+ GET_STATUS on wire (because it supports INTERRUPT transfer for
+ status change, or it's a token which has a card always inserted),
+ no need to send on wire. */
+ if (!on_wire && !ccid_require_get_status (handle))
+ {
+ *statusbits = 0;
+ return 0;
+ }
+
retry:
msg[0] = PC_to_RDR_GetSlotStatus;
msg[5] = 0; /* slot */
@@ -2935,7 +2945,7 @@ ccid_get_atr (ccid_driver_t handle,
};
/* First check whether a card is available. */
- rc = ccid_slot_status (handle, &statusbits);
+ rc = ccid_slot_status (handle, &statusbits, 1);
if (rc)
return rc;
if (statusbits == 2)