mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
scd: Minor code reorganization
* scd/ccid-driver.c: Move struct defines to the top. --
This commit is contained in:
parent
8ac92f0e80
commit
6294ae282d
@ -110,6 +110,10 @@
|
||||
/* CCID command timeout. */
|
||||
#define CCID_CMD_TIMEOUT (5*1000)
|
||||
|
||||
/* Number of supported devices. See MAX_READER in apdu.c. */
|
||||
#define MAX_DEVICE 16
|
||||
|
||||
|
||||
/* Depending on how this source is used we either define our error
|
||||
* output to go to stderr or to the GnuPG based logging functions. We
|
||||
* use the latter when GNUPG_MAJOR_VERSION is defined. */
|
||||
@ -248,6 +252,20 @@ struct ccid_driver_s
|
||||
};
|
||||
|
||||
|
||||
/* Object to keep infos about found ccid devices. */
|
||||
struct ccid_dev_table {
|
||||
int n; /* Index to ccid_usb_dev_list */
|
||||
int interface_number;
|
||||
int setting_number;
|
||||
unsigned char *ifcdesc_extra;
|
||||
int ep_bulk_out;
|
||||
int ep_bulk_in;
|
||||
int ep_intr;
|
||||
size_t ifcdesc_extra_len;
|
||||
};
|
||||
|
||||
|
||||
|
||||
static int initialized_usb; /* Tracks whether USB has been initialized. */
|
||||
static int debug_level; /* Flag to control the debug output.
|
||||
0 = No debugging
|
||||
@ -257,6 +275,10 @@ static int debug_level; /* Flag to control the debug output.
|
||||
*/
|
||||
static int ccid_usb_thread_is_alive;
|
||||
|
||||
static libusb_device **ccid_usb_dev_list;
|
||||
static struct ccid_dev_table ccid_dev_table[MAX_DEVICE];
|
||||
|
||||
|
||||
|
||||
static unsigned int compute_edc (const unsigned char *data, size_t datalen,
|
||||
int use_crc);
|
||||
@ -1310,22 +1332,6 @@ ccid_vendor_specific_pinpad_setup (ccid_driver_t handle)
|
||||
}
|
||||
|
||||
|
||||
#define MAX_DEVICE 16 /* See MAX_READER in apdu.c. */
|
||||
|
||||
struct ccid_dev_table {
|
||||
int n; /* Index to ccid_usb_dev_list */
|
||||
int interface_number;
|
||||
int setting_number;
|
||||
unsigned char *ifcdesc_extra;
|
||||
int ep_bulk_out;
|
||||
int ep_bulk_in;
|
||||
int ep_intr;
|
||||
size_t ifcdesc_extra_len;
|
||||
};
|
||||
|
||||
static libusb_device **ccid_usb_dev_list;
|
||||
static struct ccid_dev_table ccid_dev_table[MAX_DEVICE];
|
||||
|
||||
gpg_error_t
|
||||
ccid_dev_scan (int *idx_max_p, void **t_p)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user