From 15a7e4e68db4307f32b6b75ce9c6851968333b91 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Fri, 25 Jun 2010 12:57:22 +0200 Subject: [PATCH] Always enable async mode using libusb 1.x It's no longer linux specific (depends on platform support). --- CMakeLists.txt | 5 ----- configure.in | 15 --------------- libftdi.lnt | 2 -- libftdi.spec.in | 5 +---- src/ftdi.c | 15 +++------------ 5 files changed, 4 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a87178..c5ae9cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,6 @@ set(MINOR_VERSION 17) set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") -option(ASYNC-MODE "enable experimental async mode. Linux only") -if(ASYNC-MODE) - add_definitions(-DLIBFTDI_LINUX_ASYNC_MODE) -endif(ASYNC-MODE) - # CMake if("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE Debug) diff --git a/configure.in b/configure.in index aebd985..9597311 100644 --- a/configure.in +++ b/configure.in @@ -23,21 +23,6 @@ else AC_MSG_ERROR([libusb-1.0 not found.]) fi -ENABLE_ASYNC_MODE=0 -AC_ARG_WITH(async-mode, -[ --with-async-mode enable experimental async mode. Linux only.], -[ - AC_MSG_CHECKING(for experimental linux async mode) - if test "$withval" != "no"; then - ENABLE_ASYNC_MODE=1 - CFLAGS="$CFLAGS -DLIBFTDI_LINUX_ASYNC_MODE" - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi -]) -AC_SUBST(ENABLE_ASYNC_MODE) - AC_ARG_WITH(examples, AS_HELP_STRING([--without-examples], [disable example programs])) AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$with_examples" != "xno"]) diff --git a/libftdi.lnt b/libftdi.lnt index 634b1b2..89ad21d 100644 --- a/libftdi.lnt +++ b/libftdi.lnt @@ -7,6 +7,4 @@ +fie // Allow enum to int conversion -// -dLIBFTDI_LINUX_ASYNC_MODE=1 // also lint async code - -ecall(534, usb_close) // silence ignored return value from usb_close diff --git a/libftdi.spec.in b/libftdi.spec.in index d09c86d..1246409 100644 --- a/libftdi.spec.in +++ b/libftdi.spec.in @@ -1,4 +1,3 @@ -%define enable_async_mode @ENABLE_ASYNC_MODE@ Summary: Library to program and control the FTDI USB controller Name: libftdi Version: @VERSION@ @@ -31,9 +30,7 @@ Header files and static libraries for libftdi PARAMS="" ./configure --prefix=%{prefix} \ - --libdir=%{_libdir} \ -%if %{enable_async_mode} - --with-async-mode \ + --libdir=%{_libdir} %endif make diff --git a/src/ftdi.c b/src/ftdi.c index 9b20c37..b22a55b 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -1236,10 +1236,6 @@ int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size) return offset; } -#ifdef LIBFTDI_LINUX_ASYNC_MODE -#ifdef USB_CLASS_PTP -#error LIBFTDI_LINUX_ASYNC_MODE is not compatible with libusb-compat-0.1! -#endif static void ftdi_read_data_cb(struct libusb_transfer *transfer) { struct ftdi_transfer_control *tc = (struct ftdi_transfer_control *) transfer->user_data; @@ -1354,8 +1350,7 @@ static void ftdi_write_data_cb(struct libusb_transfer *transfer) Writes data to the chip. Does not wait for completion of the transfer nor does it make sure that the transfer was successful. - Use libusb 1.0 Asynchronous API. - Only available if compiled with --with-async-mode. + Use libusb 1.0 asynchronous API. \param ftdi pointer to ftdi_context \param buf Buffer with the data @@ -1413,8 +1408,7 @@ struct ftdi_transfer_control *ftdi_write_data_submit(struct ftdi_context *ftdi, Reads data from the chip. Does not wait for completion of the transfer nor does it make sure that the transfer was successful. - Use libusb 1.0 Asynchronous API. - Only available if compiled with --with-async-mode. + Use libusb 1.0 asynchronous API. \param ftdi pointer to ftdi_context \param buf Buffer with the data @@ -1495,8 +1489,7 @@ struct ftdi_transfer_control *ftdi_read_data_submit(struct ftdi_context *ftdi, u /** Wait for completion of the transfer. - Use libusb 1.0 Asynchronous API. - Only available if compiled with --with-async-mode. + Use libusb 1.0 asynchronous API. \param tc pointer to ftdi_transfer_control @@ -1536,8 +1529,6 @@ int ftdi_transfer_data_done(struct ftdi_transfer_control *tc) return ret; } -#endif // LIBFTDI_LINUX_ASYNC_MODE - /** Configure write buffer chunk size. Default is 4096. -- 1.6.6.2