scd: Fix suspend/resume handling for CCID driver.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 15 Mar 2018 14:59:22 +0000 (23:59 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 15 Mar 2018 14:59:22 +0000 (23:59 +0900)
* 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 <gniibe@fsij.org>
scd/ccid-driver.c

index 5046da5..f33a36c 100644 (file)
@@ -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;