aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2016-09-02 04:58:33 +0000
committerNIIBE Yutaka <[email protected]>2016-11-30 00:08:23 +0000
commit5acce7060ca48e6c5e06a3918950c4eb83668fda (patch)
tree82fea4f1c332d1734c3a2feb4735c0a7a8403c1b
parentscd: Fix card removal/reset on multiple contexts. (diff)
downloadgnupg-5acce7060ca48e6c5e06a3918950c4eb83668fda.tar.gz
gnupg-5acce7060ca48e6c5e06a3918950c4eb83668fda.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. -- Backport of master commit: d1ae7103352fbda2a05f098379cd3043a0ab5566 Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--scd/apdu.c29
-rw-r--r--scd/apdu.h1
-rw-r--r--scd/ccid-driver.c73
3 files changed, 0 insertions, 103 deletions
diff --git a/scd/apdu.c b/scd/apdu.c
index 00351c82a..570e1501a 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -98,7 +98,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,
@@ -432,7 +431,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;
@@ -2437,14 +2435,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;
@@ -2609,7 +2599,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;
@@ -3178,24 +3167,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 (slot < 0 || slot >= MAX_READER || !reader_table[slot].used )
- return SW_HOST_NO_DRIVER;
- sw = apdu_disconnect (slot);
- if (sw)
- return sw;
- if (reader_table[slot].shutdown_reader)
- return reader_table[slot].shutdown_reader (slot);
- 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 1524f9986..ac16ea127 100644
--- a/scd/apdu.h
+++ b/scd/apdu.h
@@ -92,7 +92,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 95f6c02a6..07e884c01 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -1744,79 +1744,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;
- struct usb_device *dev = NULL;
- usb_dev_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, &dev,
- &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 = usb_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)
- usb_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),