simtrace2-cardem-pcsc: continue in case of LIBUSB_TRANSFER_ERROR

Sometimes I get LIBUSB_TRANSFER_ERROR particularly when the USB bus
is very busy.  We shouldn't terminate the program, but simply resubmit
it.  That's what we have multiple transfers for...

Change-Id: I77d7bc636c21171fcff7e70e87c0109cbaee9b51
This commit is contained in:
Harald Welte 2022-01-26 20:31:46 +01:00
parent 5cc3add0b0
commit b01dc91c0b
1 changed files with 6 additions and 0 deletions

View File

@ -278,6 +278,9 @@ static void usb_in_xfer_cb(struct libusb_transfer *xfer)
/* hand the message up the stack */
process_usb_msg(ci, xfer->buffer, xfer->actual_length);
break;
case LIBUSB_TRANSFER_ERROR:
LOGCI(ci, LOGL_FATAL, "USB IN transfer error, trying resubmit\n");
break;
case LIBUSB_TRANSFER_NO_DEVICE:
LOGCI(ci, LOGL_FATAL, "USB device disappeared\n");
exit(1);
@ -329,6 +332,9 @@ static void usb_irq_xfer_cb(struct libusb_transfer *xfer)
case LIBUSB_TRANSFER_COMPLETED:
process_usb_msg_irq(ci, xfer->buffer, xfer->actual_length);
break;
case LIBUSB_TRANSFER_ERROR:
LOGCI(ci, LOGL_FATAL, "USB INT transfer error, trying resubmit\n");
break;
case LIBUSB_TRANSFER_NO_DEVICE:
LOGCI(ci, LOGL_FATAL, "USB device disappeared\n");
exit(1);