diff options
author | NIIBE Yutaka <[email protected]> | 2017-01-27 09:01:52 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2017-01-27 09:01:52 +0000 |
commit | 25cc8575da9a9b8bf60c64c8059cb5f73cc52e1d (patch) | |
tree | a9100c34073a73e0ed13d802df7deae5d9027ab6 /scd/ccid-driver.h | |
parent | scd: Wake up the select when new USB scan. (diff) | |
download | gnupg-25cc8575da9a9b8bf60c64c8059cb5f73cc52e1d.tar.gz gnupg-25cc8575da9a9b8bf60c64c8059cb5f73cc52e1d.zip |
scd: Improve watching USB device removal.
* scd/apdu.c(struct reader_table_s): Add require_get_status.
(apdu_connect): Change return value meaning. Call apdu_reset here.
* scd/app.c (app_new_register): Add require_get_status.
(select_application): Use the return value of apdu_connect.
(scd_update_reader_status_file): Call update_fdset_for_usb with
checking all_have_intr_endp.
(app_list_start, app_list_finish): Remove.
* scd/ccid-driver.c (struct ccid_driver_s): Add transfer.
(intr_cb): Don't call libusb_transfer in this callback.
(ccid_require_get_status): New.
(do_close_reader): Call libusb_transfer here.
* scd/scdaemon.c (update_fdset_for_usb): Remove the first argument.
--
With Gnuk Token, it works fine as expected. With Gemalto reader,
intr_cb is not called when card is removed. So, the macro
LIBUSB_WORKS_EXPECTED_FOR_INTERRUPT_ENDP is not defined yet.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/ccid-driver.h')
-rw-r--r-- | scd/ccid-driver.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scd/ccid-driver.h b/scd/ccid-driver.h index 8e9f9e251..cff3f198f 100644 --- a/scd/ccid-driver.h +++ b/scd/ccid-driver.h @@ -115,7 +115,7 @@ int ccid_set_debug_level (int level); char *ccid_get_reader_list (void); gpg_error_t ccid_dev_scan (int *idx_max, struct ccid_dev_table **t_p); -int ccid_dev_scan_finish (struct ccid_dev_table *tbl, int max); +void ccid_dev_scan_finish (struct ccid_dev_table *tbl, int max); unsigned int ccid_get_BAI (int, struct ccid_dev_table *tbl); int ccid_compare_BAI (ccid_driver_t handle, unsigned int); int ccid_open_reader (const char *spec_reader_name, @@ -140,7 +140,7 @@ int ccid_transceive_escape (ccid_driver_t handle, const unsigned char *data, size_t datalen, unsigned char *resp, size_t maxresplen, size_t *nresp); - +int ccid_require_get_status (ccid_driver_t handle); #endif /*CCID_DRIVER_H*/ |