From 35ce942354a3b0e37b67ad72b047c5a79de9149d Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Mon, 4 Oct 2010 12:04:06 +0000 Subject: [PATCH] - added command line parameter for USB iInterface, use it to fool AusweisApp - fixed population of event notification status - dont initialize serial number, when given in input git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@295 96b47cad-a561-4643-ad3b-153ac7d7599c --- ccid/src/usb.c | 73 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/ccid/src/usb.c b/ccid/src/usb.c index 536f9d5..18d90f3 100644 --- a/ccid/src/usb.c +++ b/ccid/src/usb.c @@ -58,6 +58,8 @@ static int debug = 0; static int dohid = 0; static int doint = 0; static int doinfo = 0; +static const char *doserial = NULL; +static const char *doiintf = NULL; static int usb_reader_num = -1; static const char *cdriver = NULL; @@ -65,6 +67,7 @@ static const char *cdriver = NULL; #define OPT_INTERRUPT 'n' #define OPT_READER 'r' #define OPT_SERIAL 's' +#define OPT_IINTERFACE 'i' #define OPT_PRODUCT 'p' #define OPT_VENDOR 'e' #define OPT_VERBOSE 'v' @@ -77,6 +80,7 @@ static const struct option options[] = { { "reader", required_argument, NULL, OPT_READER }, { "card-driver", required_argument, NULL, OPT_CARD }, { "serial", required_argument, NULL, OPT_SERIAL }, + { "interface", required_argument, NULL, OPT_IINTERFACE }, { "product", required_argument, NULL, OPT_PRODUCT }, { "vendor", required_argument, NULL, OPT_VENDOR }, { "interrupt", no_argument, NULL, OPT_INTERRUPT }, @@ -87,11 +91,12 @@ static const struct option options[] = { static const char *option_help[] = { /*"Emulate HID device",*/ "Print help and exit", - "Number of reader to use (default: auto-detect)", - "Which card driver to use (default: auto-detect)", - "USB serial number (default: random)", - "USB product ID (default: 0x3010)", - "USB vendor ID (default: 0x0D46)", + "Number of reader (default: auto-detect)", + "Card driver to use (default: auto-detect)", + "USB serial number (default: random)", + "USB iInterface (default: notification status)", + "USB product ID (default: 0x3010)", + "USB vendor ID (default: 0x0D46)", "Add interrupt pipe for CCID", "Use (several times) to be more verbose", "Print version, available readers and drivers.", @@ -286,8 +291,8 @@ static const struct usb_endpoint_descriptor *hs_eps [] = { /* 56 is the maximum for the KOBIL Class 3 Reader */ static char serial [57]; -static const char interrupt_on_string[] = "REINER SCT cyberJack pinpad/e-com USB"; -static const char interrupt_off_string[] = "REINER SCT cyberJack pinpad/e-com USB"; +static const char interrupt_on_string[] = "Insertion and removal events enabled"; +static const char interrupt_off_string[] = "Insertion and removal events disabled"; static struct usb_string stringtab [] = { { STRINGID_MFGR, "Virtual Smart Card Architecture", }, { STRINGID_PRODUCT, "CCID Emulator", }, @@ -593,10 +598,12 @@ static int autoconfig () if (!doint) { source_sink_intf.bNumEndpoints = 2; int i; - for (i=0; i