[Pcsclite-git-commit] [CCID] 02/03: Add support of HID Omnikey 5422 as multi slot

Ludovic Rousseau rousseau at moszumanska.debian.org
Sun Mar 12 15:01:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository CCID.

commit b3f88d9596c6379f11e52119d931876539e012df
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Fri Mar 10 18:22:33 2017 +0100

    Add support of HID Omnikey 5422 as multi slot
    
    The HID Omnikey 5422 device is a composite device with 2 CCID
    interfaces.
    This device can be seen as a multi-slot device if
    USE_COMPOSITE_AS_MULTISLOT is used.
---
 src/ccid.h       |  1 +
 src/ccid_usb.c   | 13 ++++++++++++-
 src/ifdhandler.c |  6 +++++-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/ccid.h b/src/ccid.h
index da0fd75..fc3a484 100644
--- a/src/ccid.h
+++ b/src/ccid.h
@@ -213,6 +213,7 @@ typedef struct
 #define ElatecTWN4	0x09D80427
 #define SCM_SCL011 0x04E65293
 #define HID_AVIATOR	0x076B3A21
+#define HID_OMNIKEY_5422 0x076B5422
 
 #define VENDOR_GEMALTO 0x08E6
 #define GET_VENDOR(readerID) ((readerID >> 16) & 0xFFFF)
diff --git a/src/ccid_usb.c b/src/ccid_usb.c
index 9c50583..0cea7f6 100644
--- a/src/ccid_usb.c
+++ b/src/ccid_usb.c
@@ -427,10 +427,12 @@ again_libusb:
 #ifdef USE_COMPOSITE_AS_MULTISLOT
 				/* use the first CCID interface on first call */
 				static int static_interface = -1;
+				int max_interface_number = 2;
 
 				/* simulate a composite device as when libudev is used */
 				if ((GEMALTOPROXDU == readerID)
 					|| (GEMALTOPROXSU == readerID)
+					|| (HID_OMNIKEY_5422 == readerID)
 					|| (FEITIANR502DUAL == readerID))
 				{
 						/*
@@ -462,8 +464,16 @@ again_libusb:
 					 * 0: R502 Contactless Reader (CCID)
 					 * 1: R502 Contact Reader (CCID)
 					 * 2: R502 SAM1 Reader (CCID)
+					 *
+					 * For the HID Omnikey 5422 the interfaces are:
+					 * 0: OMNIKEY 5422CL Smartcard Reader
+					 * 1: OMNIKEY 5422 Smartcard Reader
 					 */
 					interface_number = static_interface;
+
+					if (HID_OMNIKEY_5422 == readerID)
+						/* only 2 interfaces for this device */
+						max_interface_number = 1;
 				}
 #endif
 				/* is it already opened? */
@@ -658,6 +668,7 @@ again:
 #ifdef USE_COMPOSITE_AS_MULTISLOT
 				if ((GEMALTOPROXDU == readerID)
 					|| (GEMALTOPROXSU == readerID)
+					|| (HID_OMNIKEY_5422 == readerID)
 					|| (FEITIANR502DUAL == readerID))
 				{
 					/* use the next interface for the next "slot" */
@@ -665,7 +676,7 @@ again:
 
 					/* reset for a next reader */
 					/* max interface number for all 3 readers is 2 */
-					if (static_interface > 2)
+					if (static_interface > max_interface_number)
 						static_interface = -1;
 				}
 #endif
diff --git a/src/ifdhandler.c b/src/ifdhandler.c
index 20465c6..665681e 100644
--- a/src/ifdhandler.c
+++ b/src/ifdhandler.c
@@ -463,9 +463,13 @@ EXTERNAL RESPONSECODE IFDHGetCapabilities(DWORD Lun, DWORD Tag,
 					 * multi-slot reader */
 					int readerID =  get_ccid_descriptor(reader_index) -> readerID;
 
-					if ((GEMALTOPROXDU == readerID) || (GEMALTOPROXSU == readerID))
+					/* 2 CCID interfaces */
+					if ((GEMALTOPROXDU == readerID)
+						|| (GEMALTOPROXSU == readerID)
+						|| (HID_OMNIKEY_5422 == readerID))
 						*Value = 2;
 
+					/* 3 CCID interfaces */
 					if (FEITIANR502DUAL == readerID)
 						*Value = 3;
 				}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/CCID.git



More information about the Pcsclite-cvs-commit mailing list