[Pcsclite-cvs-commit] r3403 - in /trunk/Drivers/ccid/src: ccid.c ccid.h ifdhandler.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Mon Mar 30 08:55:59 UTC 2009


Author: rousseau
Date: Mon Mar 30 08:55:59 2009
New Revision: 3403

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=3403
Log:
split ccid_open_hack() in ccid_open_hack_pre() and ccid_open_hack_post()
before and after the empirical "warm up" sequence

The problem is the USB toggle bit. I could not find a simple way to
reset it. So when the driver is started again the reader and the host
may not be in sync. The few first CCID commands may fail.

Modified:
    trunk/Drivers/ccid/src/ccid.c
    trunk/Drivers/ccid/src/ccid.h
    trunk/Drivers/ccid/src/ifdhandler.c

Modified: trunk/Drivers/ccid/src/ccid.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ccid.c?rev=3403&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ccid.c (original)
+++ trunk/Drivers/ccid/src/ccid.c Mon Mar 30 08:55:59 2009
@@ -37,10 +37,10 @@
 
 /*****************************************************************************
  *
- *					ccid_open_hack
+ *					ccid_open_hack_pre
  *
  ****************************************************************************/
-int ccid_open_hack(unsigned int reader_index)
+int ccid_open_hack_pre(unsigned int reader_index)
 {
 	_ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index);
 
@@ -346,7 +346,23 @@
 	}
 
 	return 0;
-} /* ccid_open_hack */
+} /* ccid_open_hack_pre */
+
+/*****************************************************************************
+ *
+ *					ccid_open_hack_post
+ *
+ ****************************************************************************/
+int ccid_open_hack_post(unsigned int reader_index)
+{
+	_ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index);
+
+	switch (ccid_descriptor->readerID)
+	{
+	}
+
+	return 0;
+} /* ccid_open_hack_post */
 
 /*****************************************************************************
  *

Modified: trunk/Drivers/ccid/src/ccid.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ccid.h?rev=3403&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ccid.h (original)
+++ trunk/Drivers/ccid/src/ccid.h Mon Mar 30 08:55:59 2009
@@ -200,7 +200,8 @@
 #define VOLTAGE_3V 2
 #define VOLTAGE_1_8V 3
 
-int ccid_open_hack(unsigned int reader_index);
+int ccid_open_hack_pre(unsigned int reader_index);
+int ccid_open_hack_post(unsigned int reader_index);
 void ccid_error(int error, const char *file, int line, const char *function);
 _ccid_descriptor *get_ccid_descriptor(unsigned int reader_index);
 

Modified: trunk/Drivers/ccid/src/ifdhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ifdhandler.c?rev=3403&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c (original)
+++ trunk/Drivers/ccid/src/ifdhandler.c Mon Mar 30 08:55:59 2009
@@ -108,7 +108,7 @@
 	else
 	{
 		/* Maybe we have a special treatment for this reader */
-		(void)ccid_open_hack(reader_index);
+		(void)ccid_open_hack_pre(reader_index);
 
 		/* Try to access the reader */
 		/* This "warm up" sequence is sometimes needed when pcscd is
@@ -126,6 +126,9 @@
 			(void)ClosePort(reader_index);
 			ReleaseReaderIndex(reader_index);
 		}
+
+		/* Maybe we have a special treatment for this reader */
+		(void)ccid_open_hack_post(reader_index);
 	}
 
 #ifdef HAVE_PTHREAD
@@ -206,6 +209,9 @@
 	}
 	else
 	{
+		/* Maybe we have a special treatment for this reader */
+		(void)ccid_open_hack_pre(reader_index);
+
 		/* Try to access the reader */
 		/* This "warm up" sequence is sometimes needed when pcscd is
 		 * restarted with the reader already connected. We get some
@@ -224,7 +230,7 @@
 		}
 
 		/* Maybe we have a special treatment for this reader */
-		(void)ccid_open_hack(reader_index);
+		(void)ccid_open_hack_post(reader_index);
 	}
 
 #ifdef HAVE_PTHREAD




More information about the Pcsclite-cvs-commit mailing list