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

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Feb 15 15:55:01 UTC 2008


Author: rousseau
Date: Fri Feb 15 15:55:01 2008
New Revision: 2825

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2825
Log:
use usb_interrupt_read() only if libusb > 0.1.12 or
--enable-usb-interrupt is used

Modified:
    trunk/Drivers/ccid/configure.in
    trunk/Drivers/ccid/src/ifdhandler.c

Modified: trunk/Drivers/ccid/configure.in
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/configure.in?rev=2825&op=diff
==============================================================================
--- trunk/Drivers/ccid/configure.in (original)
+++ trunk/Drivers/ccid/configure.in Fri Feb 15 15:55:01 2008
@@ -153,9 +153,32 @@
 	LIBS="$saved_LIBS"
 
 	use_libusb=yes
+
+	LIBUSB_POLL_VERSION="0.1.12"
+	AC_MSG_CHECKING([for libusb > $LIBUSB_POLL_VERSION])
+	if $PKG_CONFIG --exists "libusb > $LIBUSB_POLL_VERSION" ;
+	then
+		AC_MSG_RESULT([yes])
+		use_usb_interrupt=yes
+	else
+		AC_MSG_RESULT([no])
+		use_usb_interrupt=no
+	fi
+
 fi
 AC_SUBST(LIBUSB_CFLAGS)
 AC_SUBST(LIBUSB_LIBS)
+
+# --enable-usb-interrupt
+AC_ARG_ENABLE(usb-interrupt,
+	AC_HELP_STRING([--enable-usb-interrupt], [force the use of USB
+	interrupt even with an old libusb]),
+	[ use_usb_interrupt="${enableval}" ] )
+
+if test "x$use_usb_interrupt" = xyes; then
+	AC_DEFINE(USE_USB_INTERRUPT, 1, [use libusb usb_interrupt_read()
+	instead of polling])
+fi
 
 # check if the compiler support -fvisibility=hidden (GCC >= 4)
 saved_CFLAGS="$CFLAGS"
@@ -278,6 +301,7 @@
 SYMBOL_VISIBILITY:   ${SYMBOL_VISIBILITY}
 
 libusb support:          ${use_libusb}
+use USB interrupt        ${use_usb_interrupt}
 multi threading:         ${multithread}
 bundle directory name:   ${bundle}
 USB drop directory:      ${usbdropdir}

Modified: trunk/Drivers/ccid/src/ifdhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ifdhandler.c?rev=2825&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c (original)
+++ trunk/Drivers/ccid/src/ifdhandler.c Fri Feb 15 15:55:01 2008
@@ -57,7 +57,7 @@
 static int DebugInitialized = FALSE;
 
 /* local functions */
-#if HAVE_DECL_TAG_IFD_POLLING_THREAD && !defined(TWIN_SERIAL)
+#if HAVE_DECL_TAG_IFD_POLLING_THREAD && !defined(TWIN_SERIAL) && USE_USB_INTERRUPT
 static RESPONSECODE IFDHPolling(DWORD Lun);
 static RESPONSECODE IFDHSleep(DWORD Lun);
 #endif
@@ -250,7 +250,7 @@
 } /* IFDHCloseChannel */
 
 
-#if HAVE_DECL_TAG_IFD_POLLING_THREAD && !defined(TWIN_SERIAL)
+#if HAVE_DECL_TAG_IFD_POLLING_THREAD && !defined(TWIN_SERIAL) && USE_USB_INTERRUPT
 static RESPONSECODE IFDHPolling(DWORD Lun)
 {
 	int reader_index;
@@ -381,7 +381,7 @@
 				*(uint32_t *)Value = get_ccid_descriptor(reader_index) -> dwMaxCCIDMessageLength -10;
 			break;
 
-#if HAVE_DECL_TAG_IFD_POLLING_THREAD && !defined(TWIN_SERIAL)
+#if HAVE_DECL_TAG_IFD_POLLING_THREAD && !defined(TWIN_SERIAL) && USE_USB_INTERRUPT
 		case TAG_IFD_POLLING_THREAD:
 			{
 				_ccid_descriptor *ccid_desc;




More information about the Pcsclite-cvs-commit mailing list