[Pcsclite-cvs-commit] CVS Drivers/ccid/src

CVS User rousseau ludovic.rousseau@free.fr
Fri, 03 Sep 2004 13:42:37 -0600


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv21915/src

Modified Files:
	ifdhandler.c 
Log Message:
IFDHSetProtocolParameters(): return the result value of SetParameters()
in case of error instead of always IFD_COMMUNICATION_ERROR.

This will allow to return IFD_NOT_SUPPORTED in some cases and avoid a
PTS negociation failure (and card ignored) in pcscd.


--- /cvsroot/pcsclite/Drivers/ccid/src/ifdhandler.c	2004/08/24 07:58:01	1.52
+++ /cvsroot/pcsclite/Drivers/ccid/src/ifdhandler.c	2004/09/03 19:42:37	1.53
@@ -17,7 +17,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-/* $Id: ifdhandler.c,v 1.52 2004/08/24 07:58:01 rousseau Exp $ */
+/* $Id: ifdhandler.c,v 1.53 2004/09/03 19:42:37 rousseau Exp $ */
 
 #include <stdio.h>
 #include <string.h>
@@ -537,6 +537,7 @@
 		};
 		int i;
 		t1_state_t *t1 = &(ccid_slot -> t1);
+		RESPONSECODE ret;
 
 		/* TA1 is not default */
 		if (PPS_HAS_PPS1(pps))
@@ -566,8 +567,9 @@
 				break;
 			}
 
-		if (IFD_SUCCESS != SetParameters(reader_index, 1, sizeof(param), param))
-			return IFD_COMMUNICATION_ERROR;
+		ret = SetParameters(reader_index, 1, sizeof(param), param);
+		if (IFD_SUCCESS != ret)
+			return ret;
 	}
 	else
 	/* T=0 */
@@ -579,6 +581,7 @@
 			0x0A,	/* WaitingInteger	*/
 			0x00	/* ClockStop		*/
 		};
+		RESPONSECODE ret;
 
 		/* TA1 is not default */
 		if (PPS_HAS_PPS1(pps))
@@ -595,8 +598,9 @@
 		if (atr.ib[1][ATR_INTERFACE_BYTE_TC].present)
 			param[3] = atr.ib[1][ATR_INTERFACE_BYTE_TC].value;
 
-		if (IFD_SUCCESS != SetParameters(reader_index, 0, sizeof(param), param))
-			return IFD_COMMUNICATION_ERROR;
+		ret = SetParameters(reader_index, 0, sizeof(param), param);
+		if (IFD_SUCCESS != ret)
+			return ret;
 	}
 
 	/* set IFSC & IFSD in T=1 */