Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Feitain R502 dual interface reader into CCID driver #7

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ccid.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ typedef struct
#define HP_CCIDSMARTCARDKEYBOARD 0x03F00036
#define KOBIL_IDTOKEN 0x0D46301D
#define FUJITSUSMARTKEYB 0x0BF81017
#define FEITIANR502DUAL 0x096E060D

#define VENDOR_GEMALTO 0x08E6
#define GET_VENDOR(readerID) ((readerID >> 16) & 0xFFFF)
Expand Down
12 changes: 9 additions & 3 deletions src/ccid_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ status_t OpenUSBByName(unsigned int reader_index, /*@null@*/ char *device)

/* simulate a composite device as when libudev is used */
if ((GEMALTOPROXDU == readerID)
|| (GEMALTOPROXSU == readerID))
|| (GEMALTOPROXSU == readerID)
|| (FEITIANR502DUAL == readerID))
{
/*
* We can't talk to the two CCID interfaces
Expand Down Expand Up @@ -607,9 +608,14 @@ status_t OpenUSBByName(unsigned int reader_index, /*@null@*/ char *device)
#ifdef USE_COMPOSITE_AS_MULTISLOT
/* use the next interface for the next "slot" */
static_interface++;

/* reset for a next reader */
if (static_interface > 2)
if (FEITIANR502DUAL == readerID)
{
if (static_interface >= 2)
static_interface = 0;
}
else if (static_interface > 2)
static_interface = 1;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/ifdhandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ EXTERNAL RESPONSECODE IFDHGetCapabilities(DWORD Lun, DWORD Tag,
* multi-slot reader */
int readerID = get_ccid_descriptor(reader_index) -> readerID;

if ((GEMALTOPROXDU == readerID) || (GEMALTOPROXSU == readerID))
if ((GEMALTOPROXDU == readerID) || (GEMALTOPROXSU == readerID) || (FEITIANR502DUAL == readerID))
*Value = 2;
}
#endif
Expand Down