[Pcsclite-cvs-commit] r5321 - in /trunk/PCSC/src: PCSC/ifdhandler.h eventhandler.c ifdwrapper.c ifdwrapper.h readerfactory.c readerfactory.h

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Oct 15 12:59:50 UTC 2010


Author: rousseau
Date: Fri Oct 15 12:59:47 2010
New Revision: 5321

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5321
Log:
Remove the support of IFDHandler v1 API. I don't know any driver using
this API.

We can now simplify the API of IFDStatusICC() and remove the ATR
related parameters. These paremeters were only used by the IFDHandler
v1 API.

diffstat says: 6 files changed, 51 insertions(+), 335 deletions(-)

Modified:
    trunk/PCSC/src/PCSC/ifdhandler.h
    trunk/PCSC/src/eventhandler.c
    trunk/PCSC/src/ifdwrapper.c
    trunk/PCSC/src/ifdwrapper.h
    trunk/PCSC/src/readerfactory.c
    trunk/PCSC/src/readerfactory.h

Modified: trunk/PCSC/src/PCSC/ifdhandler.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/PCSC/ifdhandler.h?rev=5321&op=diff
==============================================================================
--- trunk/PCSC/src/PCSC/ifdhandler.h (original)
+++ trunk/PCSC/src/PCSC/ifdhandler.h Fri Oct 15 12:59:47 2010
@@ -626,10 +626,6 @@
 @ingroup IFDHandler
 @param[in] Lun Logical Unit Number
 @param[in] Tag Tag of the desired data value
-- \ref TAG_IFD_SLOTNUM
-  This is used in IFDHandler v1.0 to select the slot to use for the next
-  IFD_* command. This tag is no more used with versions 2.0 and 3.0 of
-  the IFD Handler.
 @param[in,out] Length Length of the desired data value
 @param[out] Value Value of the desired data
 

Modified: trunk/PCSC/src/eventhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/eventhandler.c?rev=5321&op=diff
==============================================================================
--- trunk/PCSC/src/eventhandler.c (original)
+++ trunk/PCSC/src/eventhandler.c Fri Oct 15 12:59:47 2010
@@ -209,10 +209,8 @@
 {
 	LONG rv;
 	DWORD dwStatus = 0;
-	UCHAR ucAtr[MAX_ATR_SIZE];
-	DWORD dwAtrLen = 0;
-
-	rv = IFDStatusICC(rContext, &dwStatus, ucAtr, &dwAtrLen);
+
+	rv = IFDStatusICC(rContext, &dwStatus);
 	if (rv != SCARD_S_SUCCESS)
 	{
 		Log2(PCSC_LOG_ERROR, "Initial Check Failed on %s",
@@ -251,14 +249,11 @@
 
 	readerName = rContext->readerState->readerName;
 
-	dwAtrLen = rContext->readerState->cardAtrLength;
-	rv = IFDStatusICC(rContext, &dwStatus, rContext->readerState->cardAtr,
-		&dwAtrLen);
-	rContext->readerState->cardAtrLength = dwAtrLen;
+	rv = IFDStatusICC(rContext, &dwStatus);
 
 	if (dwStatus & SCARD_PRESENT)
 	{
-		dwAtrLen = MAX_ATR_SIZE;
+		dwAtrLen = sizeof(rContext->readerState->cardAtr);
 		rv = IFDPowerICC(rContext, IFD_POWER_UP,
 			rContext->readerState->cardAtr, &dwAtrLen);
 		rContext->readerState->cardAtrLength = dwAtrLen;
@@ -308,10 +303,7 @@
 	{
 		dwStatus = 0;
 
-		dwAtrLen = rContext->readerState->cardAtrLength;
-		rv = IFDStatusICC(rContext, &dwStatus,
-			rContext->readerState->cardAtr, &dwAtrLen);
-		rContext->readerState->cardAtrLength = dwAtrLen;
+		rv = IFDStatusICC(rContext, &dwStatus);
 
 		if (rv != SCARD_S_SUCCESS)
 		{
@@ -362,7 +354,7 @@
 				/*
 				 * Power and reset the card
 				 */
-				dwAtrLen = MAX_ATR_SIZE;
+				dwAtrLen = sizeof(rContext->readerState->cardAtr);
 				rv = IFDPowerICC(rContext, IFD_POWER_UP,
 					rContext->readerState->cardAtr, &dwAtrLen);
 				rContext->readerState->cardAtrLength = dwAtrLen;

Modified: trunk/PCSC/src/ifdwrapper.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/ifdwrapper.c?rev=5321&op=diff
==============================================================================
--- trunk/PCSC/src/ifdwrapper.c (original)
+++ trunk/PCSC/src/ifdwrapper.c Fri Oct 15 12:59:47 2010
@@ -33,9 +33,9 @@
 #include "utils.h"
 
 #ifdef PCSCLITE_STATIC_DRIVER
-/* check that either IFDHANDLERv1, IFDHANDLERv2 or IFDHANDLERv3 is
+/* check that either IFDHANDLERv2 or IFDHANDLERv3 is
  * defined */
-  #if ! (defined(IFDHANDLERv1) || defined(IFDHANDLERv2) || defined(IFDHANDLERv3))
+  #if ! (defined(IFDHANDLERv2) || defined(IFDHANDLERv3))
   #error IFDHANDLER version not defined
   #endif
 #endif
@@ -51,28 +51,15 @@
 	UCHAR ucValue[1];
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IFD_set_protocol_parameters) (DWORD, UCHAR, UCHAR,
-		UCHAR, UCHAR) = NULL;
 	RESPONSECODE(*IFDH_set_protocol_parameters) (DWORD, DWORD, UCHAR,
 		UCHAR, UCHAR, UCHAR) = NULL;
 
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		IFD_set_protocol_parameters = (RESPONSECODE(*)(DWORD, UCHAR, UCHAR,
-			UCHAR, UCHAR)) rContext->psFunctions.psFunctions_v1.pvfSetProtocolParameters;
-
-		if (NULL == IFD_set_protocol_parameters)
-			return SCARD_E_UNSUPPORTED_FEATURE;
-	}
-	else
-	{
-		IFDH_set_protocol_parameters = (RESPONSECODE(*)(DWORD, DWORD, UCHAR,
-			UCHAR, UCHAR, UCHAR))
-			rContext->psFunctions.psFunctions_v2.pvfSetProtocolParameters;
-
-		if (NULL == IFDH_set_protocol_parameters)
-			return SCARD_E_UNSUPPORTED_FEATURE;
-	}
+	IFDH_set_protocol_parameters = (RESPONSECODE(*)(DWORD, DWORD, UCHAR,
+		UCHAR, UCHAR, UCHAR))
+		rContext->psFunctions.psFunctions_v2.pvfSetProtocolParameters;
+
+	if (NULL == IFDH_set_protocol_parameters)
+		return SCARD_E_UNSUPPORTED_FEATURE;
 #endif
 
 	/*
@@ -85,31 +72,12 @@
 	ucValue[0] = rContext->slot;
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = (*IFD_set_protocol_parameters) (dwProtocol,
-			ucFlags, ucPTS1, ucPTS2, ucPTS3);
-	}
-	else
-	{
-		rv = (*IFDH_set_protocol_parameters) (rContext->slot,
-			dwProtocol, ucFlags, ucPTS1, ucPTS2, ucPTS3);
-	}
-#else
-#ifdef IFDHANDLERv1
-	{
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = IFD_Set_Protocol_Parameters(dwProtocol, ucFlags, ucPTS1,
-			ucPTS2, ucPTS3);
-	}
+	rv = (*IFDH_set_protocol_parameters) (rContext->slot,
+		dwProtocol, ucFlags, ucPTS1, ucPTS2, ucPTS3);
 #else
 	rv = IFDHSetProtocolParameters(rContext->slot, dwProtocol, ucFlags,
 		ucPTS1, ucPTS2, ucPTS3); 
 #endif
-#endif
 
 	return rv;
 }
@@ -122,34 +90,26 @@
 	RESPONSECODE rv = 0;
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IO_create_channel) (DWORD) = NULL;
 	RESPONSECODE(*IFDH_create_channel) (DWORD, DWORD) = NULL;
 	RESPONSECODE(*IFDH_create_channel_by_name) (DWORD, LPSTR) = NULL;
 
-	if (rContext->version == IFD_HVERSION_1_0)
-		IO_create_channel =
-			rContext->psFunctions.psFunctions_v1.pvfCreateChannel;
+	if (rContext->version == IFD_HVERSION_2_0)
+		IFDH_create_channel =
+			rContext->psFunctions.psFunctions_v2.pvfCreateChannel;
 	else
-		if (rContext->version == IFD_HVERSION_2_0)
-			IFDH_create_channel =
-				rContext->psFunctions.psFunctions_v2.pvfCreateChannel;
-		else
-		{
-			IFDH_create_channel =
-				rContext->psFunctions.psFunctions_v3.pvfCreateChannel;
-			IFDH_create_channel_by_name =
-				rContext->psFunctions.psFunctions_v3.pvfCreateChannelByName;
-		}
-#endif
-
-	/* LOCK THIS CODE REGION */
-	(void)pthread_mutex_lock(rContext->mMutex);
-
-#ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		rv = (*IO_create_channel) (rContext->port);
-	} else if (rContext->version == IFD_HVERSION_2_0)
+	{
+		IFDH_create_channel =
+			rContext->psFunctions.psFunctions_v3.pvfCreateChannel;
+		IFDH_create_channel_by_name =
+			rContext->psFunctions.psFunctions_v3.pvfCreateChannelByName;
+	}
+#endif
+
+	/* LOCK THIS CODE REGION */
+	(void)pthread_mutex_lock(rContext->mMutex);
+
+#ifndef PCSCLITE_STATIC_DRIVER
+	if (rContext->version == IFD_HVERSION_2_0)
 	{
 		rv = (*IFDH_create_channel) (rContext->slot, rContext->port);
 	} else
@@ -161,9 +121,7 @@
 			rv = (*IFDH_create_channel) (rContext->slot, rContext->port);
 	}
 #else
-#ifdef IFDHANDLERv1
-	rv = IO_Create_Channel(rContext->port);
-#elif defined(IFDHANDLERv2)
+#if defined(IFDHANDLERv2)
 	rv = IFDHCreateChannel(rContext->slot, rContext->port);
 #else
 	{
@@ -191,13 +149,9 @@
 	int repeat;
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IO_close_channel) (void) = NULL;
 	RESPONSECODE(*IFDH_close_channel) (DWORD) = NULL;
 
-	if (rContext->version == IFD_HVERSION_1_0)
-		IO_close_channel = rContext->psFunctions.psFunctions_v1.pvfCloseChannel;
-	else
-		IFDH_close_channel = rContext->psFunctions.psFunctions_v2.pvfCloseChannel;
+	IFDH_close_channel = rContext->psFunctions.psFunctions_v2.pvfCloseChannel;
 #endif
 
 	/* TRY TO LOCK THIS CODE REGION */
@@ -216,17 +170,9 @@
 	}
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-
-		rv = (*IO_close_channel) ();
-	else
-		rv = (*IFDH_close_channel) (rContext->slot);
-#else
-#ifdef IFDHANDLERv1
-	rv = IO_Close_Channel();
+	rv = (*IFDH_close_channel) (rContext->slot);
 #else
 	rv = IFDHCloseChannel(rContext->slot);
-#endif
 #endif
 
 	/* END OF LOCKED REGION */
@@ -244,13 +190,9 @@
 	RESPONSECODE rv = IFD_SUCCESS;
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IFD_set_capabilities) (DWORD, PUCHAR) = NULL;
 	RESPONSECODE(*IFDH_set_capabilities) (DWORD, DWORD, DWORD, PUCHAR) = NULL;
 
-	if (rContext->version == IFD_HVERSION_1_0)
-		IFD_set_capabilities = rContext->psFunctions.psFunctions_v1.pvfSetCapabilities;
-	else
-		IFDH_set_capabilities = rContext->psFunctions.psFunctions_v2.pvfSetCapabilities;
+	IFDH_set_capabilities = rContext->psFunctions.psFunctions_v2.pvfSetCapabilities;
 #endif
 
 	/*
@@ -259,17 +201,10 @@
 	 */
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-		rv = (*IFD_set_capabilities) (dwTag, pucValue);
-	else
-		rv = (*IFDH_set_capabilities) (rContext->slot, dwTag,
+	rv = (*IFDH_set_capabilities) (rContext->slot, dwTag,
 			dwLength, pucValue);
 #else
-#ifdef IFDHANDLERv1
-	rv = IFD_Set_Capabilities(dwTag, pucValue);
-#else
 	rv = IFDHSetCapabilities(rContext->slot, dwTag, dwLength, pucValue);
-#endif
 #endif
 
 	return rv;
@@ -286,32 +221,19 @@
 	RESPONSECODE rv = IFD_SUCCESS;
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IFD_get_capabilities) (DWORD, /*@out@*/ PUCHAR) = NULL;
 	RESPONSECODE(*IFDH_get_capabilities) (DWORD, DWORD, PDWORD, /*@out@*/ PUCHAR) = NULL;
 
-	if (rContext->version == IFD_HVERSION_1_0)
-		IFD_get_capabilities =
-			rContext->psFunctions.psFunctions_v1.pvfGetCapabilities;
-	else
-		IFDH_get_capabilities =
-			rContext->psFunctions.psFunctions_v2.pvfGetCapabilities;
-#endif
-
-	/* LOCK THIS CODE REGION */
-	(void)pthread_mutex_lock(rContext->mMutex);
-
-#ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-		rv = (*IFD_get_capabilities) (dwTag, pucValue);
-	else
-		rv = (*IFDH_get_capabilities) (rContext->slot, dwTag,
-			pdwLength, pucValue);
-#else
-#ifdef IFDHANDLERv1
-	rv = IFD_Get_Capabilities(dwTag, pucValue);
+	IFDH_get_capabilities =
+		rContext->psFunctions.psFunctions_v2.pvfGetCapabilities;
+#endif
+
+	/* LOCK THIS CODE REGION */
+	(void)pthread_mutex_lock(rContext->mMutex);
+
+#ifndef PCSCLITE_STATIC_DRIVER
+	rv = (*IFDH_get_capabilities) (rContext->slot, dwTag, pdwLength, pucValue);
 #else
 	rv = IFDHGetCapabilities(rContext->slot, dwTag, pdwLength, pucValue);
-#endif
 #endif
 
 	/* END OF LOCKED REGION */
@@ -337,7 +259,6 @@
 	DWORD dummyAtrLen = sizeof(dummyAtr);
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IFD_power_icc) (DWORD) = NULL;
 	RESPONSECODE(*IFDH_power_icc) (DWORD, DWORD, PUCHAR, PDWORD) = NULL;
 #endif
 
@@ -356,44 +277,23 @@
 	/*
 	 * Check that the card is inserted first
 	 */
-	(void)IFDStatusICC(rContext, &dwStatus, pucAtr, pdwAtrLen);
+	(void)IFDStatusICC(rContext, &dwStatus);
 
 	if (dwStatus & SCARD_ABSENT)
 		return SCARD_W_REMOVED_CARD;
 #ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-		IFD_power_icc = rContext->psFunctions.psFunctions_v1.pvfPowerICC;
-	else
-		IFDH_power_icc = rContext->psFunctions.psFunctions_v2.pvfPowerICC;
-#endif
-
-	/* LOCK THIS CODE REGION */
-	(void)pthread_mutex_lock(rContext->mMutex);
-
-#ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = (*IFD_power_icc) (dwAction);
-	}
-	else
-	{
-		rv = (*IFDH_power_icc) (rContext->slot, dwAction,
-			pucAtr, pdwAtrLen);
-
-		ret = ATRDecodeAtr(&sSmartCard, pucAtr, *pdwAtrLen);
-	}
-#else
-#ifdef IFDHANDLERv1
-	{
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = IFD_Power_ICC(dwAction);
-	}
+	IFDH_power_icc = rContext->psFunctions.psFunctions_v2.pvfPowerICC;
+#endif
+
+	/* LOCK THIS CODE REGION */
+	(void)pthread_mutex_lock(rContext->mMutex);
+
+#ifndef PCSCLITE_STATIC_DRIVER
+	rv = (*IFDH_power_icc) (rContext->slot, dwAction, pucAtr, pdwAtrLen);
+
+	ret = ATRDecodeAtr(&sSmartCard, pucAtr, *pdwAtrLen);
 #else
 	rv = IFDHPowerICC(rContext->slot, dwAction, pucAtr, pdwAtrLen);
-#endif
 #endif
 
 	/* END OF LOCKED REGION */
@@ -414,12 +314,6 @@
 		return SCARD_E_NOT_TRANSACTED;
 	}
 
-	/*
-	 * Get the ATR and it's length
-	 */
-	if (rContext->version == IFD_HVERSION_1_0)
-		(void)IFDStatusICC(rContext, &dwStatus, pucAtr, pdwAtrLen);
-
 	return rv;
 }
 
@@ -427,52 +321,24 @@
  * Provide statistical information about the IFD and ICC including insertions,
  * atr, powering status/etc.
  */
-LONG IFDStatusICC(READER_CONTEXT * rContext, PDWORD pdwStatus,
-	PUCHAR pucAtr, PDWORD pdwAtrLen)
-{
-	RESPONSECODE rv = IFD_SUCCESS;
-	DWORD dwTag = 0, dwCardStatus = 0;
-	SMARTCARD_EXTENSION sSmartCard;
-	UCHAR ucValue[1] = "\x00";
-
-#ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IFD_is_icc_present) (void) = NULL;
+LONG IFDStatusICC(READER_CONTEXT * rContext, PDWORD pdwStatus)
+{
+	RESPONSECODE rv = IFD_SUCCESS;
+	DWORD dwCardStatus = 0;
+
+#ifndef PCSCLITE_STATIC_DRIVER
 	RESPONSECODE(*IFDH_icc_presence) (DWORD) = NULL;
-	RESPONSECODE(*IFD_get_capabilities) (DWORD, /*@out@*/ PUCHAR) = NULL;
-
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		IFD_is_icc_present =
-			rContext->psFunctions.psFunctions_v1.pvfICCPresence;
-		IFD_get_capabilities =
-			rContext->psFunctions.psFunctions_v1.pvfGetCapabilities;
-	}
-	else
-		IFDH_icc_presence = rContext->psFunctions.psFunctions_v2.pvfICCPresence;
-#endif
-
-	/* LOCK THIS CODE REGION */
-	(void)pthread_mutex_lock(rContext->mMutex);
-
-#ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = (*IFD_is_icc_present) ();
-	}
-	else
-		rv = (*IFDH_icc_presence) (rContext->slot);
-#else
-#ifdef IFDHANDLERv1
-	{
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = IFD_Is_ICC_Present();
-	}
+
+	IFDH_icc_presence = rContext->psFunctions.psFunctions_v2.pvfICCPresence;
+#endif
+
+	/* LOCK THIS CODE REGION */
+	(void)pthread_mutex_lock(rContext->mMutex);
+
+#ifndef PCSCLITE_STATIC_DRIVER
+	rv = (*IFDH_icc_presence) (rContext->slot);
 #else
 	rv = IFDHICCPresence(rContext->slot);
-#endif
 #endif
 
 	/* END OF LOCKED REGION */
@@ -497,64 +363,6 @@
 			return SCARD_E_NOT_TRANSACTED;
 		}
 
-	/*
-	 * Now lets get the ATR and process it if IFD Handler version 1.0.
-	 * IFD Handler version 2.0 does this immediately after reset/power up
-	 * to conserve resources
-	 */
-
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		if (rv == IFD_SUCCESS || rv == IFD_ICC_PRESENT)
-		{
-			short ret;
-
-			dwTag = TAG_IFD_ATR;
-
-			/* LOCK THIS CODE REGION */
-			(void)pthread_mutex_lock(rContext->mMutex);
-
-			ucValue[0] = rContext->slot;
-			(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-
-#ifndef PCSCLITE_STATIC_DRIVER
-			rv = (*IFD_get_capabilities) (dwTag, pucAtr);
-#else
-#ifdef IFDHANDLERv1
-			rv = IFD_Get_Capabilities(dwTag, pucAtr);
-#endif
-#endif
-
-			/* END OF LOCKED REGION */
-			(void)pthread_mutex_unlock(rContext->mMutex);
-
-			/*
-			 * FIX :: This is a temporary way to return the correct size
-			 * of the ATR since most of the drivers return MAX_ATR_SIZE
-			 */
-
-			ret = ATRDecodeAtr(&sSmartCard, pucAtr, MAX_ATR_SIZE);
-
-			/*
-			 * Might be a memory card without an ATR
-			 */
-			if (ret == 0)
-				*pdwAtrLen = 0;
-			else
-				*pdwAtrLen = sSmartCard.ATR.Length;
-		}
-		else
-		{
-			/*
-			 * No card is inserted - Atr length is 0
-			 */
-			*pdwAtrLen = 0;
-		}
-		/*
-		 * End of FIX
-		 */
-	}
-
 	*pdwStatus = dwCardStatus;
 
 	return SCARD_S_SUCCESS;
@@ -688,8 +496,6 @@
 	RESPONSECODE rv = IFD_SUCCESS;
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	RESPONSECODE(*IFD_transmit_to_icc) (SCARD_IO_HEADER, PUCHAR, DWORD,
-		/*@out@*/ PUCHAR, PDWORD, PSCARD_IO_HEADER) = NULL;
 	RESPONSECODE(*IFDH_transmit_to_icc) (DWORD, SCARD_IO_HEADER, PUCHAR,
 		DWORD, /*@out@*/ PUCHAR, PDWORD, PSCARD_IO_HEADER) = NULL;
 #endif
@@ -698,46 +504,20 @@
 	DebugLogCategory(DEBUG_CATEGORY_APDU, pucTxBuffer, dwTxLength);
 
 #ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-		IFD_transmit_to_icc =
-			rContext->psFunctions.psFunctions_v1.pvfTransmitToICC;
-	else
-		IFDH_transmit_to_icc =
-			rContext->psFunctions.psFunctions_v2.pvfTransmitToICC;
-#endif
-
-	/* LOCK THIS CODE REGION */
-	(void)pthread_mutex_lock(rContext->mMutex);
-
-#ifndef PCSCLITE_STATIC_DRIVER
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		UCHAR ucValue[1];
-
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = (*IFD_transmit_to_icc) (pioTxPci, (LPBYTE) pucTxBuffer,
-			dwTxLength, pucRxBuffer, pdwRxLength, pioRxPci);
-	}
-	else
-		rv = (*IFDH_transmit_to_icc) (rContext->slot, pioTxPci,
-			(LPBYTE) pucTxBuffer, dwTxLength,
-			pucRxBuffer, pdwRxLength, pioRxPci);
-#else
-#ifdef IFDHANDLERv1
-	{
-		UCHAR ucValue[1];
-
-		ucValue[0] = rContext->slot;
-		(void)IFDSetCapabilities(rContext, TAG_IFD_SLOTNUM, 1, ucValue);
-		rv = IFD_Transmit_to_ICC(pioTxPci, (LPBYTE) pucTxBuffer,
-			dwTxLength, pucRxBuffer, pdwRxLength, pioRxPci);
-	}
+	IFDH_transmit_to_icc =
+		rContext->psFunctions.psFunctions_v2.pvfTransmitToICC;
+#endif
+
+	/* LOCK THIS CODE REGION */
+	(void)pthread_mutex_lock(rContext->mMutex);
+
+#ifndef PCSCLITE_STATIC_DRIVER
+	rv = (*IFDH_transmit_to_icc) (rContext->slot, pioTxPci, (LPBYTE)
+		pucTxBuffer, dwTxLength, pucRxBuffer, pdwRxLength, pioRxPci);
 #else
 	rv = IFDHTransmitToICC(rContext->slot, pioTxPci,
 		(LPBYTE) pucTxBuffer, dwTxLength,
 		pucRxBuffer, pdwRxLength, pioRxPci);
-#endif
 #endif
 
 	/* END OF LOCKED REGION */

Modified: trunk/PCSC/src/ifdwrapper.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/ifdwrapper.h?rev=5321&op=diff
==============================================================================
--- trunk/PCSC/src/ifdwrapper.h (original)
+++ trunk/PCSC/src/ifdwrapper.h Fri Oct 15 12:59:47 2010
@@ -26,8 +26,7 @@
 	LONG IFDOpenIFD(READER_CONTEXT *);
 	LONG IFDCloseIFD(READER_CONTEXT *);
 	LONG IFDPowerICC(READER_CONTEXT *, DWORD, PUCHAR, /*@out@*/ PDWORD);
-	LONG IFDStatusICC(READER_CONTEXT *, /*@out@*/ PDWORD, /*@out@*/ PUCHAR,
-		/*@out@*/ PDWORD);
+	LONG IFDStatusICC(READER_CONTEXT *, /*@out@*/ PDWORD);
 	LONG IFDControl_v2(READER_CONTEXT *, PUCHAR, DWORD, /*@out@*/ PUCHAR,
 		PDWORD);
 	LONG IFDControl(READER_CONTEXT *, DWORD, LPCVOID, DWORD, LPVOID,

Modified: trunk/PCSC/src/readerfactory.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.c?rev=5321&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.c (original)
+++ trunk/PCSC/src/readerfactory.c Fri Oct 15 12:59:47 2010
@@ -749,62 +749,13 @@
 		}
 		else
 		{
-			rv = DYN_GetAddress(rContext->vHandle, &f, "IO_Create_Channel");
-			if (SCARD_S_SUCCESS == rv)
-			{
-				/* Ifd Handler 1.0 found */
-				rContext->version = IFD_HVERSION_1_0;
-			}
-			else
-			{
-				/* Neither version of the IFD Handler was found - exit */
-				Log1(PCSC_LOG_CRITICAL, "IFDHandler functions missing");
-				return SCARD_F_UNKNOWN_ERROR;
-			}
-		}
-	}
-
-	/* The following binds version 1.0 of the IFD Handler specs */
-	if (rContext->version == IFD_HVERSION_1_0)
-	{
-		Log1(PCSC_LOG_INFO, "Loading IFD Handler 1.0");
-
-#define GET_ADDRESS_OPTIONALv1(field, function, code) \
-{ \
-	void *f1 = NULL; \
-	int rvl = DYN_GetAddress(rContext->vHandle, &f1, "IFD_" #function); \
-	if (SCARD_S_SUCCESS != rvl) \
-	{ \
-		code \
-	} \
-	rContext->psFunctions.psFunctions_v1.pvf ## field = f1; \
-}
-
-#define GET_ADDRESSv1(field, function) \
-	GET_ADDRESS_OPTIONALv1(field, function, \
-		Log1(PCSC_LOG_CRITICAL, "IFDHandler functions missing: " #function ); \
-		return(rv); )
-
-		(void)DYN_GetAddress(rContext->vHandle, &f, "IO_Create_Channel");
-		rContext->psFunctions.psFunctions_v1.pvfCreateChannel = f;
-
-		if (SCARD_S_SUCCESS != DYN_GetAddress(rContext->vHandle, &f,
-			"IO_Close_Channel"))
-		{
+			/* Neither version of the IFD Handler was found - exit */
 			Log1(PCSC_LOG_CRITICAL, "IFDHandler functions missing");
 			return SCARD_F_UNKNOWN_ERROR;
 		}
-		rContext->psFunctions.psFunctions_v1.pvfCloseChannel = f;
-
-		GET_ADDRESSv1(GetCapabilities, Get_Capabilities)
-		GET_ADDRESSv1(SetCapabilities, Set_Capabilities)
-		GET_ADDRESSv1(PowerICC, Power_ICC)
-		GET_ADDRESSv1(TransmitToICC, Transmit_to_ICC)
-		GET_ADDRESSv1(ICCPresence, Is_ICC_Present)
-
-		GET_ADDRESS_OPTIONALv1(SetProtocolParameters, Set_Protocol_Parameters, )
-	}
-	else if (rContext->version == IFD_HVERSION_2_0)
+	}
+
+	if (rContext->version == IFD_HVERSION_2_0)
 	{
 		/* The following binds version 2.0 of the IFD Handler specs */
 #define GET_ADDRESS_OPTIONALv2(s, code) \
@@ -1432,15 +1383,14 @@
 				if ((strcmp(reader_list[i].pcFriendlyname, lpcStripReader) == 0)
 					&& (reader_list[r].channelId == sReadersContexts[i]->port))
 				{
-					DWORD dwStatus = 0, dwAtrLen = 0;
-					UCHAR ucAtr[MAX_ATR_SIZE];
+					DWORD dwStatus = 0;
 
 					/* the reader was already started */
 					present = TRUE;
 
 					/* verify the reader is still connected */
-					if (IFDStatusICC(sReadersContexts[r], &dwStatus, ucAtr,
-						&dwAtrLen) != SCARD_S_SUCCESS)
+					if (IFDStatusICC(sReadersContexts[r], &dwStatus)
+						!= SCARD_S_SUCCESS)
 					{
 						Log2(PCSC_LOG_INFO, "Reader %s disappeared",
 							reader_list[i].pcFriendlyname);

Modified: trunk/PCSC/src/readerfactory.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/readerfactory.h?rev=5321&op=diff
==============================================================================
--- trunk/PCSC/src/readerfactory.h (original)
+++ trunk/PCSC/src/readerfactory.h Fri Oct 15 12:59:47 2010
@@ -115,7 +115,6 @@
                                          /**< Structure of connected handles */
 		union
 		{
-			FCT_MAP_V1 psFunctions_v1;	/**< API V1.0 */
 			FCT_MAP_V2 psFunctions_v2;	/**< API V2.0 */
 			FCT_MAP_V3 psFunctions_v3;	/**< API V3.0 */
 		} psFunctions;	/**< driver functions */




More information about the Pcsclite-cvs-commit mailing list