aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2018-03-15 14:59:22 +0000
committerNIIBE Yutaka <[email protected]>2018-03-15 14:59:22 +0000
commitfd23a0524d8060ed12d87c679b7823686614aaee (patch)
tree517d467d70120216a6c287bb141b7be8265c8dfa
parentscd: After fatal error, shutdown a reader. (diff)
downloadgnupg-fd23a0524d8060ed12d87c679b7823686614aaee.tar.gz
gnupg-fd23a0524d8060ed12d87c679b7823686614aaee.zip
scd: Fix suspend/resume handling for CCID driver.
* scd/ccid-driver.c (intr_cb): Try submitting INTERRUPT urb to see if it's suspend/resume. -- Upon suspend/resume, LIBUSB_TRANSFER_NO_DEVICE is returned, since all URBs are cancelled. We need to see if it's real NODEV error or its by suspend/resume. We can distinguish by sending URB again. Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--scd/ccid-driver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index 5046da555..f33a36c83 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1467,7 +1467,8 @@ intr_cb (struct libusb_transfer *transfer)
DEBUGOUT_1 ("CCID: interrupt callback %d\n", transfer->status);
- if (transfer->status == LIBUSB_TRANSFER_TIMED_OUT)
+ if (transfer->status == LIBUSB_TRANSFER_TIMED_OUT
+ || transfer->status == LIBUSB_TRANSFER_NO_DEVICE)
{
int err;