[Pcsclite-cvs-commit] r2204 - trunk/PCSC/src

Ludovic Rousseau rousseau at alioth.debian.org
Wed Nov 15 15:27:40 CET 2006


Author: rousseau
Date: 2006-11-15 15:27:40 +0100 (Wed, 15 Nov 2006)
New Revision: 2204

Modified:
   trunk/PCSC/src/ifdwrapper.c
Log:
if a driver command returns IFD_NO_SUCH_DEVICE we call
SendHotplugSignal() to rescan the USB/serial/etc. readers and purge the
removed readers from the reader list


Modified: trunk/PCSC/src/ifdwrapper.c
===================================================================
--- trunk/PCSC/src/ifdwrapper.c	2006-11-15 14:13:26 UTC (rev 2203)
+++ trunk/PCSC/src/ifdwrapper.c	2006-11-15 14:27:40 UTC (rev 2204)
@@ -24,6 +24,7 @@
 #include "atrhandler.h"
 #include "dyn_generic.h"
 #include "sys_generic.h"
+#include "hotplug.h"
 
 #undef PCSCLITE_STATIC_DRIVER
 
@@ -402,6 +403,14 @@
 	{
 		*pdwAtrLen = 0;
 		pucAtr[0] = '\0';
+
+		if (rv == IFD_NO_SUCH_DEVICE)
+		{
+			SendHotplugSignal();
+			return SCARD_E_READER_UNAVAILABLE;
+		}
+
+		return SCARD_E_NOT_TRANSACTED;
 	}
 
 	/*
@@ -482,6 +491,13 @@
 		else
 		{
 			Log2(PCSC_LOG_ERROR, "Card not transacted: %ld", rv);
+
+			if (rv == IFD_NO_SUCH_DEVICE)
+			{
+				SendHotplugSignal();
+				return SCARD_E_READER_UNAVAILABLE;
+			}
+
 			return SCARD_E_NOT_TRANSACTED;
 		}
 
@@ -652,6 +668,13 @@
 	else
 	{
 		Log2(PCSC_LOG_ERROR, "Card not transacted: %ld", rv);
+
+		if (rv == IFD_NO_SUCH_DEVICE)
+		{
+			SendHotplugSignal();
+			return SCARD_E_READER_UNAVAILABLE;
+		}
+
 		return SCARD_E_NOT_TRANSACTED;
 	}
 }
@@ -733,6 +756,13 @@
 	else
 	{
 		Log2(PCSC_LOG_ERROR, "Card not transacted: %ld", rv);
+
+		if (rv == IFD_NO_SUCH_DEVICE)
+		{
+			SendHotplugSignal();
+			return SCARD_E_READER_UNAVAILABLE;
+		}
+
 		return SCARD_E_NOT_TRANSACTED;
 	}
 }




More information about the Pcsclite-cvs-commit mailing list