sending description about the running configuration via usb descriptor
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@290 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
#include <libaio.h>
|
#include <libaio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
#include "usbstring.h"
|
#include "usbstring.h"
|
||||||
#include "ccid.h"
|
#include "ccid.h"
|
||||||
#include "binutil.h"
|
#include "binutil.h"
|
||||||
@@ -285,12 +286,18 @@ static const struct usb_endpoint_descriptor *hs_eps [] = {
|
|||||||
/* 56 is the maximum for the KOBIL Class 3 Reader */
|
/* 56 is the maximum for the KOBIL Class 3 Reader */
|
||||||
static char serial [57];
|
static char serial [57];
|
||||||
|
|
||||||
|
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 [] = {
|
static struct usb_string stringtab [] = {
|
||||||
{ STRINGID_MFGR, "morgner@informatik.hu-berlin.de", },
|
{ STRINGID_MFGR, "Virtual Smart Card Architecture", },
|
||||||
{ STRINGID_PRODUCT, "CCID Emulator", },
|
{ STRINGID_PRODUCT, "CCID Emulator", },
|
||||||
{ STRINGID_SERIAL, serial, },
|
{ STRINGID_SERIAL, serial, },
|
||||||
{ STRINGID_CONFIG, "", },
|
#ifdef WITH_PACE
|
||||||
{ STRINGID_INTERFACE, "", },
|
{ STRINGID_CONFIG, "PACE support enabled", },
|
||||||
|
#else
|
||||||
|
{ STRINGID_CONFIG, "PACE support disabled", },
|
||||||
|
#endif
|
||||||
|
{ STRINGID_INTERFACE, interrupt_on_string, },
|
||||||
{ STRINGID_HID_INTERFACE, "Human Device Interface Gadget", },
|
{ STRINGID_HID_INTERFACE, "Human Device Interface Gadget", },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -585,6 +592,13 @@ static int autoconfig ()
|
|||||||
}
|
}
|
||||||
if (!doint) {
|
if (!doint) {
|
||||||
source_sink_intf.bNumEndpoints = 2;
|
source_sink_intf.bNumEndpoints = 2;
|
||||||
|
int i;
|
||||||
|
for (i=0; i<sizeof(stringtab)/sizeof(struct usb_string); i++) {
|
||||||
|
if (stringtab[i].id == STRINGID_INTERFACE) {
|
||||||
|
stringtab[i].s = interrupt_off_string;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Automatic activation of ICC on inserting not supported
|
// Automatic activation of ICC on inserting not supported
|
||||||
// USB Wake up signaling not supported
|
// USB Wake up signaling not supported
|
||||||
ccid_desc.dwFeatures &= ~__constant_cpu_to_le32(0x4|0x100000);
|
ccid_desc.dwFeatures &= ~__constant_cpu_to_le32(0x4|0x100000);
|
||||||
@@ -885,6 +899,7 @@ static void close_fd (void *fd_ptr)
|
|||||||
if (close (fd) < 0)
|
if (close (fd) < 0)
|
||||||
perror ("close fd");
|
perror ("close fd");
|
||||||
else
|
else
|
||||||
|
if (debug)
|
||||||
fprintf (stderr, "closed fd\n");
|
fprintf (stderr, "closed fd\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user