From f3d9b2582bcaa1936b4fed5ec42a889b02df2f42 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Sat, 28 Jan 2017 00:18:11 +0900 Subject: scd: More changes on watching removal of card/reader. * scd/app-common.h (struct app_ctx_s): Rename field to periodical_check_needed. * scd/scdaemon.c (update_usb): Rename from update_fdset_for_usb. Don't use libusb_get_pollfds any more. (scd_kick_the_loop): New. (need_tick): Follow the rename. (handle_connections): No libusb event handling here. * scd/app.c (app_new_register): Follow the change of rename. (select_application, scd_update_reader_status_file): Likewise. * scd/ccid-driver.c (ccid_usb_thread_is_alive): New. (intr_cb): Call scd_kick_the_loop. (ccid_usb_thread): New. Thread to invoke INTERRUPT callback. (ccid_open_usb_reader): Add thread invocation. (ccid_require_get_status): Remove LIBUSB_WORKS_EXPECTED_FOR_INTERRUPT_ENDP. (do_close_reader): Carefully handle handle->transfer. (get_escaped_usb_string): Insert npth_unprotect/npth_protect. (do_close_reader, bulk_out, bulk_in, abort_cmd, ccid_slot_status) (ccid_transceive, ccid_transceive_secure): Likewise. -- It found that libusb_get_pollfds is not supported on Windows. Besides, it's a bit difficult to use for the select loop. Thus, we use the thread named ccid_usb_thread, instead. Signed-off-by: NIIBE Yutaka --- scd/app-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scd/app-common.h') diff --git a/scd/app-common.h b/scd/app-common.h index 521fcf329..c79e36b55 100644 --- a/scd/app-common.h +++ b/scd/app-common.h @@ -54,7 +54,7 @@ struct app_ctx_s { const char *apptype; unsigned int card_version; unsigned int card_status; - unsigned int require_get_status:1; + unsigned int periodical_check_needed:1; unsigned int did_chv1:1; unsigned int force_chv1:1; /* True if the card does not cache CHV1. */ unsigned int did_chv2:1; -- cgit v1.2.3