diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2017-01-27 16:18:11 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2017-01-27 16:36:27 +0100 |
commit | f3d9b2582bcaa1936b4fed5ec42a889b02df2f42 (patch) | |
tree | 6a1a814d7a688e411d2b655dd73398200d629eb7 /scd/scdaemon.h | |
parent | scd: Fix release of transfer object. (diff) | |
download | gnupg2-f3d9b2582bcaa1936b4fed5ec42a889b02df2f42.tar.xz gnupg2-f3d9b2582bcaa1936b4fed5ec42a889b02df2f42.zip |
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 <gniibe@fsij.org>
Diffstat (limited to 'scd/scdaemon.h')
-rw-r--r-- | scd/scdaemon.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scd/scdaemon.h b/scd/scdaemon.h index 9e616f4c9..6d950b5c0 100644 --- a/scd/scdaemon.h +++ b/scd/scdaemon.h @@ -125,7 +125,7 @@ void send_status_info (ctrl_t ctrl, const char *keyword, ...) void send_status_direct (ctrl_t ctrl, const char *keyword, const char *args); void scd_update_reader_status_file (void); void send_client_notifications (app_t app, int removal); -void update_fdset_for_usb (int all_have_intr_endp); - +void update_usb (int periodical_check_needed); +void scd_kick_the_loop (void); #endif /*SCDAEMON_H*/ |