From b5aa407ec2b1bdebc1c950a9428789fe50327776 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Mon, 17 Aug 2009 23:46:30 -0400 Subject: Applied libusb-1.0 patch set from Thomas Tsou : This patch set updates the usrp to support libusb-1.0. Asynchronous I/O through libusb is added with fusb_libusb1.*, which is heavily based on fusb_linux.*. In short, URB's and ioctl calls are replaced with libusb_transfer structs and native calls. Transfer reaping is handled by libusb and associated callbacks. I get 32Mb/s on all of my machines using test_usrp_standard_rx or tx. Due to the API rewrite in 1.0 from 0.12, there are alot of changes, many are simply name changes. Known Issues: Transmit and receive both work, but not at same time (e.g. usrp_benchmark_usb.py). libusb does not create any internal threads, so for a single session fusb_libusb1 works in the same manner as fusb_linux with the callback called at controlled times. With multiple libusb sessions the callback may occur at any time and threading issues come into play causing behavior to become undefined. The use of separate libusb_contexts _might_ solve this issue; I have not had the time to look into it. --- config/usrp_fusb_tech.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'config/usrp_fusb_tech.m4') diff --git a/config/usrp_fusb_tech.m4 b/config/usrp_fusb_tech.m4 index db857249b..bda6f5af9 100644 --- a/config/usrp_fusb_tech.m4 +++ b/config/usrp_fusb_tech.m4 @@ -37,9 +37,9 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ [x_have_usbdevice_fs_h=yes], [x_have_usbdevice_fs_h=no]) if test x${x_have_usbdevice_fs_h} = xyes; then - FUSB_TECH=linux + FUSB_TECH=libusb1 else - FUSB_TECH=generic + FUSB_TECH=libusb1 fi ;; darwin*) @@ -69,6 +69,7 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ AM_CONDITIONAL(FUSB_TECH_darwin, test x$FUSB_TECH = xdarwin) AM_CONDITIONAL(FUSB_TECH_win32, test x$FUSB_TECH = xwin32) AM_CONDITIONAL(FUSB_TECH_generic, test x$FUSB_TECH = xgeneric) + AM_CONDITIONAL(FUSB_TECH_libusb1, test x$FUSB_TECH = xlibusb1) AM_CONDITIONAL(FUSB_TECH_linux, test x$FUSB_TECH = xlinux) AM_CONDITIONAL(FUSB_TECH_ra_wb, test x$FUSB_TECH = xra_wb) ]) -- cgit From c62085a66bd97f389f49167492f7dccfb0b02976 Mon Sep 17 00:00:00 2001 From: ttsou Date: Thu, 27 Aug 2009 18:13:54 -0400 Subject: first shot at re-adding libusb-0.12 support --- config/usrp_fusb_tech.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/usrp_fusb_tech.m4') diff --git a/config/usrp_fusb_tech.m4 b/config/usrp_fusb_tech.m4 index bda6f5af9..196799e34 100644 --- a/config/usrp_fusb_tech.m4 +++ b/config/usrp_fusb_tech.m4 @@ -37,9 +37,9 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ [x_have_usbdevice_fs_h=yes], [x_have_usbdevice_fs_h=no]) if test x${x_have_usbdevice_fs_h} = xyes; then - FUSB_TECH=libusb1 + FUSB_TECH=linux else - FUSB_TECH=libusb1 + FUSB_TECH=generic fi ;; darwin*) @@ -69,7 +69,7 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ AM_CONDITIONAL(FUSB_TECH_darwin, test x$FUSB_TECH = xdarwin) AM_CONDITIONAL(FUSB_TECH_win32, test x$FUSB_TECH = xwin32) AM_CONDITIONAL(FUSB_TECH_generic, test x$FUSB_TECH = xgeneric) - AM_CONDITIONAL(FUSB_TECH_libusb1, test x$FUSB_TECH = xlibusb1) AM_CONDITIONAL(FUSB_TECH_linux, test x$FUSB_TECH = xlinux) + AM_CONDITIONAL(FUSB_TECH_libusb1, test x$FUSB_TECH = xlibusb1) AM_CONDITIONAL(FUSB_TECH_ra_wb, test x$FUSB_TECH = xra_wb) ]) -- cgit From 158caeaa92df7ffdf363236985f4b8e7825f3950 Mon Sep 17 00:00:00 2001 From: ttsou Date: Wed, 9 Sep 2009 11:02:41 -0400 Subject: Added autotools header generation and build time version checking --- config/usrp_fusb_tech.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config/usrp_fusb_tech.m4') diff --git a/config/usrp_fusb_tech.m4 b/config/usrp_fusb_tech.m4 index 196799e34..0be6a0ec5 100644 --- a/config/usrp_fusb_tech.m4 +++ b/config/usrp_fusb_tech.m4 @@ -29,9 +29,12 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ AC_HELP_STRING([--with-fusb-tech=OS], [Set fast USB technique (default=auto)]), [cf_with_fusb_tech="$withval"], - [cf_with_fusb_tech="$host_os"]) + [cf_with_fusb_tech="libusb1"]) if test [x]$1 != xno; then case "$cf_with_fusb_tech" in + libusb1*) + FUSB_TECH=libusb1 + ;; linux*) AC_CHECK_HEADER([linux/usbdevice_fs.h], [x_have_usbdevice_fs_h=yes], -- cgit From 265484bfaaaab4f83c43a53c9e0fd307e205e5c4 Mon Sep 17 00:00:00 2001 From: ttsou Date: Thu, 10 Sep 2009 16:33:49 -0400 Subject: Autoconf support for checking the required version of libusb based on fusb-tech --- config/usrp_fusb_tech.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/usrp_fusb_tech.m4') diff --git a/config/usrp_fusb_tech.m4 b/config/usrp_fusb_tech.m4 index 0be6a0ec5..200cb36af 100644 --- a/config/usrp_fusb_tech.m4 +++ b/config/usrp_fusb_tech.m4 @@ -25,15 +25,17 @@ dnl # "" : do these tests AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ + req_libusb1=no AC_ARG_WITH([fusb-tech], AC_HELP_STRING([--with-fusb-tech=OS], [Set fast USB technique (default=auto)]), [cf_with_fusb_tech="$withval"], - [cf_with_fusb_tech="libusb1"]) + [cf_with_fusb_tech="$host_os"]) if test [x]$1 != xno; then case "$cf_with_fusb_tech" in libusb1*) FUSB_TECH=libusb1 + req_libusb1=yes ;; linux*) AC_CHECK_HEADER([linux/usbdevice_fs.h], -- cgit From df4edacd55663aecee58a9b3f95cbc08bceaab81 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Tue, 29 Sep 2009 18:29:44 -0700 Subject: Consolidate conditional headers into libusb_types.h, use automake --- config/usrp_fusb_tech.m4 | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config/usrp_fusb_tech.m4') diff --git a/config/usrp_fusb_tech.m4 b/config/usrp_fusb_tech.m4 index 200cb36af..cd08e18e5 100644 --- a/config/usrp_fusb_tech.m4 +++ b/config/usrp_fusb_tech.m4 @@ -26,6 +26,7 @@ dnl AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ req_libusb1=no + USE_LIBUSB1=0 AC_ARG_WITH([fusb-tech], AC_HELP_STRING([--with-fusb-tech=OS], [Set fast USB technique (default=auto)]), @@ -36,6 +37,7 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ libusb1*) FUSB_TECH=libusb1 req_libusb1=yes + USE_LIBUSB1=1 ;; linux*) AC_CHECK_HEADER([linux/usbdevice_fs.h], @@ -77,4 +79,9 @@ AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ AM_CONDITIONAL(FUSB_TECH_linux, test x$FUSB_TECH = xlinux) AM_CONDITIONAL(FUSB_TECH_libusb1, test x$FUSB_TECH = xlibusb1) AM_CONDITIONAL(FUSB_TECH_ra_wb, test x$FUSB_TECH = xra_wb) + + AC_SUBST(USE_LIBUSB1) + AC_CONFIG_FILES([\ + usrp/host/include/usrp/libusb_types.h \ + ]) ]) -- cgit From f4a86ccaa23e7e513dbbfa45456ea5783c106ec0 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 1 Oct 2009 13:51:03 -0700 Subject: Cleanup in preparation for merge Fix trailing whitespace Use standard include guards Add more missing config.h includes Fixup emacs mode strings Update copyright notices --- config/usrp_fusb_tech.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/usrp_fusb_tech.m4') diff --git a/config/usrp_fusb_tech.m4 b/config/usrp_fusb_tech.m4 index cd08e18e5..b99cf2432 100644 --- a/config/usrp_fusb_tech.m4 +++ b/config/usrp_fusb_tech.m4 @@ -1,5 +1,5 @@ dnl -dnl Copyright 2003,2008 Free Software Foundation, Inc. +dnl Copyright 2003,2008,2009 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl -- cgit