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. --- usrp/host/lib/Makefile.am | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 8e40692a5..e7c3f34c4 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -84,6 +84,9 @@ ra_wb_CODE = \ fusb_ra_wb.cc \ fusb_sysconfig_ra_wb.cc +libusb1_CODE = \ + fusb_libusb1.cc \ + fusb_sysconfig_libusb1.cc # # include each _CODE entry here... @@ -93,8 +96,8 @@ EXTRA_libusrp_la_SOURCES = \ $(darwin_CODE) \ $(win32_CODE) \ $(linux_CODE) \ - $(ra_wb_CODE) - + $(ra_wb_CODE) \ + $(libusb1_CODE) # work around automake deficiency libusrp_la_common_SOURCES = \ @@ -141,6 +144,11 @@ if FUSB_TECH_ra_wb libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(ra_wb_CODE) endif +if FUSB_TECH_libusb1 +libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(libusb1_CODE) +endif + + noinst_HEADERS = \ ad9862.h \ db_base_impl.h \ @@ -150,6 +158,7 @@ noinst_HEADERS = \ fusb_darwin.h \ fusb_generic.h \ fusb_linux.h \ + fusb_libusb1.h \ fusb_ra_wb.h \ fusb_win32.h \ md5.h \ -- 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 --- usrp/host/lib/Makefile.am | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index e7c3f34c4..4dd47595e 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -78,7 +78,9 @@ win32_CODE = \ linux_CODE = \ fusb_linux.cc \ - fusb_sysconfig_linux.cc + fusb_sysconfig_linux.cc \ + usrp_prims_libusb.cc \ + usrp_basic_libusb.cc ra_wb_CODE = \ fusb_ra_wb.cc \ @@ -86,7 +88,9 @@ ra_wb_CODE = \ libusb1_CODE = \ fusb_libusb1.cc \ - fusb_sysconfig_libusb1.cc + fusb_sysconfig_libusb1.cc \ + usrp_prims_libusb1.cc \ + usrp_basic_libusb1.cc # # include each _CODE entry here... @@ -103,17 +107,17 @@ EXTRA_libusrp_la_SOURCES = \ libusrp_la_common_SOURCES = \ fusb.cc \ md5.c \ - usrp_basic.cc \ + usrp_basic_common.cc \ usrp_config.cc \ usrp_dbid.cc \ usrp_local_sighandler.cc \ - usrp_prims.cc \ + usrp_prims_common.cc \ usrp_standard.cc \ db_boards.cc \ db_base.cc \ db_basic.cc \ db_tv_rx.cc \ - db_tv_rx_mimo.cc \ + db_tv_rx_mimo.cc \ db_flexrf.cc \ db_flexrf_mimo.cc \ db_dbs_rx.cc \ -- cgit From c6f6e69024bd21e99f5f8673dce2399c4bfd8bb8 Mon Sep 17 00:00:00 2001 From: U-CERVELO\ttsou Date: Fri, 11 Sep 2009 15:35:28 -0400 Subject: changes to build on windows / cygwin --- usrp/host/lib/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 4dd47595e..7c5dc25a5 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -74,7 +74,10 @@ darwin_CODE = \ win32_CODE = \ fusb_win32.cc \ - fusb_sysconfig_win32.cc + fusb_sysconfig_win32.cc \ + usrp_prims_libusb.cc \ + usrp_basic_libusb.cc + linux_CODE = \ fusb_linux.cc \ -- cgit From 68b0364367f8d99a34f0c38e8a0db0a290f297fc Mon Sep 17 00:00:00 2001 From: ttsou Date: Mon, 14 Sep 2009 14:43:37 -0400 Subject: Commonized more usrp_prims code and renamed libusb-0.12 files to libusb0 --- usrp/host/lib/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 7c5dc25a5..7455b1536 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -75,15 +75,15 @@ darwin_CODE = \ win32_CODE = \ fusb_win32.cc \ fusb_sysconfig_win32.cc \ - usrp_prims_libusb.cc \ - usrp_basic_libusb.cc + usrp_prims_libusb0.cc \ + usrp_basic_libusb0.cc linux_CODE = \ fusb_linux.cc \ fusb_sysconfig_linux.cc \ - usrp_prims_libusb.cc \ - usrp_basic_libusb.cc + usrp_prims_libusb0.cc \ + usrp_basic_libusb0.cc ra_wb_CODE = \ fusb_ra_wb.cc \ -- cgit From 579c6354514d57d3f1881131203ba6bbd9648816 Mon Sep 17 00:00:00 2001 From: ttsou Date: Mon, 14 Sep 2009 19:50:26 -0400 Subject: Removed preprocessor declrs out of fusb.h and created separate fusb_libusb1_base.h --- usrp/host/lib/Makefile.am | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 7455b1536..3687aae72 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -61,7 +61,9 @@ BUILT_SOURCES += usrp_dbid.cc \ generic_CODE = \ fusb_generic.cc \ - fusb_sysconfig_generic.cc + fusb_sysconfig_generic.cc \ + usrp_prims_libusb0.cc \ + usrp_basic_libusb0.cc darwin_CODE = \ fusb_darwin.cc \ @@ -87,7 +89,9 @@ linux_CODE = \ ra_wb_CODE = \ fusb_ra_wb.cc \ - fusb_sysconfig_ra_wb.cc + fusb_sysconfig_ra_wb.cc \ + usrp_prims_libusb0.cc \ + usrp_basic_libusb0.cc libusb1_CODE = \ fusb_libusb1.cc \ @@ -162,6 +166,7 @@ noinst_HEADERS = \ db_boards.h \ db_util.h \ fusb.h \ + fusb_libusb1_base.h \ fusb_darwin.h \ fusb_generic.h \ fusb_linux.h \ -- cgit From 44269e7b15129102f93131269e7796fde70ddc05 Mon Sep 17 00:00:00 2001 From: ttsou Date: Mon, 14 Sep 2009 21:42:03 -0400 Subject: Moved to single generated fusb.h, headers now generated out of lib directory --- usrp/host/lib/Makefile.am | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 3687aae72..16f53bd38 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -44,10 +44,16 @@ endif EXTRA_DIST = \ std_paths.h.in \ - usrp_dbid.dat + usrp_dbid.dat \ + fusb.h.in \ + usrp_prims.h.in \ + usrp_basic.h.in BUILT_SOURCES = \ - $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h + $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h \ + fusb.h \ + usrp_prims.h \ + usrp_basic.h BUILT_SOURCES += usrp_dbid.cc \ usrp_dbid.py @@ -133,8 +139,6 @@ libusrp_la_common_SOURCES = \ db_dtt768.cc \ db_util.cc - - if FUSB_TECH_generic libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(generic_CODE) endif @@ -166,7 +170,6 @@ noinst_HEADERS = \ db_boards.h \ db_util.h \ fusb.h \ - fusb_libusb1_base.h \ fusb_darwin.h \ fusb_generic.h \ fusb_linux.h \ @@ -193,3 +196,23 @@ gen_sources = $(BUILT_SOURCES) gen_sources_deps = gen_usrp_dbid.py usrp_dbid.dat par_gen_command = PYTHONPATH=$(top_srcdir)/usrp/src srcdir=$(srcdir) $(PYTHON) $(srcdir)/gen_usrp_dbid.py $(srcdir)/usrp_dbid.dat include $(top_srcdir)/Makefile.par.gen + + +# Generate libusb dependent header files from configure. +# These are already defined, but override them here, which throws warnings. +# Need to figure out how to separate rules for BUILD_SOURCES. +fusb.h: fusb.h.in $(top_srcdir)/config.status + cd $(top_srcdir) \ + && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=fusb.h \ + $(SHELL) ./config.status + +usrp_prims.h: usrp_prims.h.in $(top_srcdir)/config.status + cd $(top_srcdir) \ + && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=usrp_prims.h \ + $(SHELL) ./config.status + +usrp_basic.h: usrp_basic.h.in $(top_srcdir)/config.status + cd $(top_srcdir) \ + && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=usrp_basic.h \ + $(SHELL) ./config.status + -- cgit From 889a053c6171a6bc6746aa4e36056a073e8bec4f Mon Sep 17 00:00:00 2001 From: ttsou Date: Tue, 15 Sep 2009 20:28:04 -0400 Subject: Removed internal functions from external header file --- usrp/host/lib/Makefile.am | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 16f53bd38..4c37a8f15 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -78,7 +78,10 @@ darwin_CODE = \ circular_buffer.h \ circular_linked_list.h \ darwin_libusb.h \ - mld_threads.h + mld_threads.h \ + usrp_prims_libusb0.cc \ + usrp_basic_libusb0.cc + win32_CODE = \ fusb_win32.cc \ @@ -178,7 +181,8 @@ noinst_HEADERS = \ fusb_win32.h \ md5.h \ rate_to_regval.h \ - usrp_config.h + usrp_config.h \ + usrp_primsi.h if PYTHON usrppython_PYTHON = \ -- 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 --- usrp/host/lib/Makefile.am | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 4c37a8f15..8a2efa5a8 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -44,19 +44,12 @@ endif EXTRA_DIST = \ std_paths.h.in \ - usrp_dbid.dat \ - fusb.h.in \ - usrp_prims.h.in \ - usrp_basic.h.in + usrp_dbid.dat -BUILT_SOURCES = \ - $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h \ - fusb.h \ - usrp_prims.h \ - usrp_basic.h +BUILT_SOURCES = $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h BUILT_SOURCES += usrp_dbid.cc \ - usrp_dbid.py + usrp_dbid.py # ---------------------------------------------------------------- # FUSB_TECH is set at configure time by way of @@ -200,23 +193,3 @@ gen_sources = $(BUILT_SOURCES) gen_sources_deps = gen_usrp_dbid.py usrp_dbid.dat par_gen_command = PYTHONPATH=$(top_srcdir)/usrp/src srcdir=$(srcdir) $(PYTHON) $(srcdir)/gen_usrp_dbid.py $(srcdir)/usrp_dbid.dat include $(top_srcdir)/Makefile.par.gen - - -# Generate libusb dependent header files from configure. -# These are already defined, but override them here, which throws warnings. -# Need to figure out how to separate rules for BUILD_SOURCES. -fusb.h: fusb.h.in $(top_srcdir)/config.status - cd $(top_srcdir) \ - && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=fusb.h \ - $(SHELL) ./config.status - -usrp_prims.h: usrp_prims.h.in $(top_srcdir)/config.status - cd $(top_srcdir) \ - && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=usrp_prims.h \ - $(SHELL) ./config.status - -usrp_basic.h: usrp_basic.h.in $(top_srcdir)/config.status - cd $(top_srcdir) \ - && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=usrp_basic.h \ - $(SHELL) ./config.status - -- cgit From 6f820db7a8076d38eb2633f44916e2328708ea42 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Thu, 1 Oct 2009 12:47:24 -0700 Subject: Add required include directory for new header organization --- usrp/host/lib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 8a2efa5a8..17d4b8014 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -20,7 +20,7 @@ include $(top_srcdir)/Makefile.common -common_INCLUDES = $(USRP_INCLUDES) +common_INCLUDES = $(USRP_INCLUDES) -I$(USB_INCLUDEDIR) lib_LTLIBRARIES = libusrp.la -- cgit From d894a95ef6370f91ec14334e6b2b2f578a1cb090 Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Fri, 2 Oct 2009 21:46:41 -0400 Subject: usrp: Build fix for non-pkgconfig installs of libusb --- usrp/host/lib/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usrp/host/lib/Makefile.am') diff --git a/usrp/host/lib/Makefile.am b/usrp/host/lib/Makefile.am index 17d4b8014..2f8cbe6de 100644 --- a/usrp/host/lib/Makefile.am +++ b/usrp/host/lib/Makefile.am @@ -20,7 +20,7 @@ include $(top_srcdir)/Makefile.common -common_INCLUDES = $(USRP_INCLUDES) -I$(USB_INCLUDEDIR) +common_INCLUDES = $(USRP_INCLUDES) $(USB_INCLUDES) lib_LTLIBRARIES = libusrp.la -- cgit