aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2016-09-02 04:58:33 +0000
committerNIIBE Yutaka <[email protected]>2016-09-02 04:58:33 +0000
commitd1ae7103352fbda2a05f098379cd3043a0ab5566 (patch)
treeacb916740a82593afa13628565a1f9337a7628ca
parentagent: invoke scdaemon with --homedir. (diff)
downloadgnupg-d1ae7103352fbda2a05f098379cd3043a0ab5566.tar.gz
gnupg-d1ae7103352fbda2a05f098379cd3043a0ab5566.zip
scd: Clean up unused shutdown method.
* scd/apdu.c (shutdown_ccid_reader, apdu_shutdown_reader): Remove. (reset_ccid_reader): Don't set shutdown_reader. * scd/ccid-driver.c (ccid_shutdown_reader): Remove. -- Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to '')
-rw-r--r--scd/apdu.c48
-rw-r--r--scd/apdu.h1
-rw-r--r--scd/ccid-driver.c72
3 files changed, 0 insertions, 121 deletions
diff --git a/scd/apdu.c b/scd/apdu.c
index 268a2c6dc..c139d76c1 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -101,7 +101,6 @@ struct reader_table_s {
int (*connect_card)(int);
int (*disconnect_card)(int);
int (*close_reader)(int);
- int (*shutdown_reader)(int);
int (*reset_reader)(int);
int (*get_status_reader)(int, unsigned int *);
int (*send_apdu_reader)(int,unsigned char *,size_t,
@@ -462,7 +461,6 @@ new_reader_slot (void)
reader_table[reader].connect_card = NULL;
reader_table[reader].disconnect_card = NULL;
reader_table[reader].close_reader = NULL;
- reader_table[reader].shutdown_reader = NULL;
reader_table[reader].reset_reader = NULL;
reader_table[reader].get_status_reader = NULL;
reader_table[reader].send_apdu_reader = NULL;
@@ -2476,14 +2474,6 @@ close_ccid_reader (int slot)
static int
-shutdown_ccid_reader (int slot)
-{
- ccid_shutdown_reader (reader_table[slot].ccid.handle);
- return 0;
-}
-
-
-static int
reset_ccid_reader (int slot)
{
int err;
@@ -2649,7 +2639,6 @@ open_ccid_reader (const char *portstr)
}
reader_table[slot].close_reader = close_ccid_reader;
- reader_table[slot].shutdown_reader = shutdown_ccid_reader;
reader_table[slot].reset_reader = reset_ccid_reader;
reader_table[slot].get_status_reader = get_status_ccid;
reader_table[slot].send_apdu_reader = send_apdu_ccid;
@@ -3264,43 +3253,6 @@ apdu_prepare_exit (void)
}
-/* Shutdown a reader; that is basically the same as a close but keeps
- the handle ready for later use. A apdu_reset_reader or apdu_connect
- should be used to get it active again. */
-int
-apdu_shutdown_reader (int slot)
-{
- int sw;
-
- if (DBG_READER)
- log_debug ("enter: apdu_shutdown_reader: slot=%d\n", slot);
-
- if (slot < 0 || slot >= MAX_READER || !reader_table[slot].used )
- {
- if (DBG_READER)
- log_debug ("leave: apdu_shutdown_reader => SW_HOST_NO_DRIVER\n");
- return SW_HOST_NO_DRIVER;
- }
- sw = apdu_disconnect (slot);
- if (sw)
- {
- if (DBG_READER)
- log_debug ("leave: apdu_shutdown_reader => 0x%x (apdu_disconnect)\n",
- sw);
- return sw;
- }
- if (reader_table[slot].shutdown_reader)
- {
- sw = reader_table[slot].shutdown_reader (slot);
- if (DBG_READER)
- log_debug ("leave: apdu_shutdown_reader => 0x%x (close_reader)\n", sw);
- return sw;
- }
- if (DBG_READER)
- log_debug ("leave: apdu_shutdown_reader => SW_HOST_NOT_SUPPORTED\n");
- return SW_HOST_NOT_SUPPORTED;
-}
-
/* Enumerate all readers and return information on whether this reader
is in use. The caller should start with SLOT set to 0 and
increment it with each call until an error is returned. */
diff --git a/scd/apdu.h b/scd/apdu.h
index 1694eac80..7ca4c147e 100644
--- a/scd/apdu.h
+++ b/scd/apdu.h
@@ -96,7 +96,6 @@ int apdu_open_remote_reader (const char *portstr,
void *writefnc_value,
void (*closefnc) (void *opaque),
void *closefnc_value);
-int apdu_shutdown_reader (int slot);
int apdu_close_reader (int slot);
void apdu_prepare_exit (void);
int apdu_enum_reader (int slot, int *used);
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index b1523cbde..478e03854 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1717,78 +1717,6 @@ do_close_reader (ccid_driver_t handle)
}
-/* Reset a reader on HANDLE. This is useful in case a reader has been
- plugged of and inserted at a different port. By resetting the
- handle, the same reader will be get used. Note, that on error the
- handle won't get released.
-
- This does not return an ATR, so ccid_get_atr should be called right
- after this one.
-*/
-int
-ccid_shutdown_reader (ccid_driver_t handle)
-{
- int rc = 0;
- libusb_device_handle *idev = NULL;
- unsigned char *ifcdesc_extra = NULL;
- size_t ifcdesc_extra_len;
- int ifc_no, ep_bulk_out, ep_bulk_in, ep_intr;
-
- if (!handle || !handle->rid)
- return CCID_DRIVER_ERR_INV_VALUE;
-
- do_close_reader (handle);
-
- if (scan_or_find_devices (-1, handle->rid, NULL, NULL,
- &ifcdesc_extra, &ifcdesc_extra_len,
- &ifc_no, &ep_bulk_out, &ep_bulk_in, &ep_intr,
- &idev, NULL) || !idev)
- {
- DEBUGOUT_1 ("no CCID reader with ID %s\n", handle->rid);
- return CCID_DRIVER_ERR_NO_READER;
- }
-
- if (idev)
- {
- handle->idev = idev;
- handle->ifc_no = ifc_no;
- handle->ep_bulk_out = ep_bulk_out;
- handle->ep_bulk_in = ep_bulk_in;
- handle->ep_intr = ep_intr;
-
- if (parse_ccid_descriptor (handle, ifcdesc_extra, ifcdesc_extra_len))
- {
- DEBUGOUT ("device not supported\n");
- rc = CCID_DRIVER_ERR_NO_READER;
- goto leave;
- }
-
- rc = libusb_claim_interface (idev, ifc_no);
- if (rc)
- {
- DEBUGOUT_1 ("usb_claim_interface failed: %d\n", rc);
- rc = CCID_DRIVER_ERR_CARD_IO_ERROR;
- goto leave;
- }
- }
-
- leave:
- free (ifcdesc_extra);
- if (rc)
- {
- if (handle->idev)
- libusb_close (handle->idev);
- handle->idev = NULL;
- if (handle->dev_fd != -1)
- close (handle->dev_fd);
- handle->dev_fd = -1;
- }
-
- return rc;
-
-}
-
-
int
ccid_set_progress_cb (ccid_driver_t handle,
void (*cb)(void *, const char *, int, int, int),