summaryrefslogtreecommitdiff
path: root/usrp
diff options
context:
space:
mode:
Diffstat (limited to 'usrp')
-rw-r--r--usrp/host/lib/legacy/fusb.h9
-rw-r--r--usrp/host/lib/legacy/fusb_sysconfig_darwin.cc7
-rw-r--r--usrp/host/lib/legacy/fusb_sysconfig_generic.cc7
-rw-r--r--usrp/host/lib/legacy/fusb_sysconfig_linux.cc10
-rw-r--r--usrp/host/lib/legacy/fusb_sysconfig_ra_wb.cc5
-rw-r--r--usrp/host/lib/legacy/fusb_sysconfig_win32.cc7
-rw-r--r--usrp/host/lib/legacy/usrp_basic.cc2
7 files changed, 39 insertions, 8 deletions
diff --git a/usrp/host/lib/legacy/fusb.h b/usrp/host/lib/legacy/fusb.h
index da1b7c0ad..8116ed056 100644
--- a/usrp/host/lib/legacy/fusb.h
+++ b/usrp/host/lib/legacy/fusb.h
@@ -119,12 +119,17 @@ public:
static fusb_devhandle *make_devhandle (usb_dev_handle *udh);
/*!
- * \brief returns max block size hard limit
+ * \brief Returns max block size in bytes (hard limit).
*/
static int max_block_size ();
/*!
- * \brief returns the default buffer size
+ * \brief Returns default block size in bytes.
+ */
+ static int default_block_size ();
+
+ /*!
+ * \brief Returns the default buffer size in bytes.
*/
static int default_buffer_size ();
diff --git a/usrp/host/lib/legacy/fusb_sysconfig_darwin.cc b/usrp/host/lib/legacy/fusb_sysconfig_darwin.cc
index f66c298db..54d008437 100644
--- a/usrp/host/lib/legacy/fusb_sysconfig_darwin.cc
+++ b/usrp/host/lib/legacy/fusb_sysconfig_darwin.cc
@@ -24,7 +24,7 @@
#include <fusb_darwin.h>
static const int MAX_BLOCK_SIZE = 32 * 1024; // hard limit
-static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB (was 8 MB)
+static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB
fusb_devhandle *
fusb_sysconfig::make_devhandle (usb_dev_handle *udh)
@@ -37,6 +37,11 @@ int fusb_sysconfig::max_block_size ()
return MAX_BLOCK_SIZE;
}
+int fusb_sysconfig::default_block_size ()
+{
+ return fusb_sysconfig::max_block_size ();
+}
+
int fusb_sysconfig::default_buffer_size ()
{
return FUSB_BUFFER_SIZE;
diff --git a/usrp/host/lib/legacy/fusb_sysconfig_generic.cc b/usrp/host/lib/legacy/fusb_sysconfig_generic.cc
index d336cb946..31022c14f 100644
--- a/usrp/host/lib/legacy/fusb_sysconfig_generic.cc
+++ b/usrp/host/lib/legacy/fusb_sysconfig_generic.cc
@@ -24,7 +24,7 @@
#include <fusb_generic.h>
static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit
-static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB (was 8 MB)
+static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB
fusb_devhandle *
fusb_sysconfig::make_devhandle (usb_dev_handle *udh)
@@ -37,6 +37,11 @@ int fusb_sysconfig::max_block_size ()
return MAX_BLOCK_SIZE;
}
+int fusb_sysconfig::default_block_size ()
+{
+ return fusb_sysconfig::max_block_size ();
+}
+
int fusb_sysconfig::default_buffer_size ()
{
return FUSB_BUFFER_SIZE;
diff --git a/usrp/host/lib/legacy/fusb_sysconfig_linux.cc b/usrp/host/lib/legacy/fusb_sysconfig_linux.cc
index 468fa9f82..e5dc1f457 100644
--- a/usrp/host/lib/legacy/fusb_sysconfig_linux.cc
+++ b/usrp/host/lib/legacy/fusb_sysconfig_linux.cc
@@ -23,8 +23,9 @@
#include <fusb.h>
#include <fusb_linux.h>
-static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit
-static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB (was 8 MB)
+static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit
+static const int DEFAULT_BLOCK_SIZE = 4 * 1024; // fewer kernel memory problems
+static const int FUSB_BUFFER_SIZE = 1 * (1L << 20); // 1MB
fusb_devhandle *
fusb_sysconfig::make_devhandle (usb_dev_handle *udh)
@@ -37,6 +38,11 @@ int fusb_sysconfig::max_block_size ()
return MAX_BLOCK_SIZE;
}
+int fusb_sysconfig::default_block_size ()
+{
+ return DEFAULT_BLOCK_SIZE;
+}
+
int fusb_sysconfig::default_buffer_size ()
{
return FUSB_BUFFER_SIZE;
diff --git a/usrp/host/lib/legacy/fusb_sysconfig_ra_wb.cc b/usrp/host/lib/legacy/fusb_sysconfig_ra_wb.cc
index 68eecedc5..c5ea7fff3 100644
--- a/usrp/host/lib/legacy/fusb_sysconfig_ra_wb.cc
+++ b/usrp/host/lib/legacy/fusb_sysconfig_ra_wb.cc
@@ -41,6 +41,11 @@ int fusb_sysconfig::max_block_size ()
return MAX_BLOCK_SIZE;
}
+int fusb_sysconfig::default_block_size ()
+{
+ return fusb_sysconfig::max_block_size ();
+}
+
int fusb_sysconfig::default_buffer_size ()
{
return FUSB_BUFFER_SIZE;
diff --git a/usrp/host/lib/legacy/fusb_sysconfig_win32.cc b/usrp/host/lib/legacy/fusb_sysconfig_win32.cc
index 282e77ac4..02a3bf209 100644
--- a/usrp/host/lib/legacy/fusb_sysconfig_win32.cc
+++ b/usrp/host/lib/legacy/fusb_sysconfig_win32.cc
@@ -24,7 +24,7 @@
#include <fusb_win32.h>
static const int MAX_BLOCK_SIZE = 64 * 1024; // Windows kernel hard limit
-static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB (was 8 MB)
+static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB
fusb_devhandle *
fusb_sysconfig::make_devhandle (usb_dev_handle *udh)
@@ -37,6 +37,11 @@ int fusb_sysconfig::max_block_size ()
return MAX_BLOCK_SIZE;
}
+int fusb_sysconfig::default_block_size ()
+{
+ return fusb_sysconfig::max_block_size ();
+}
+
int fusb_sysconfig::default_buffer_size ()
{
return FUSB_BUFFER_SIZE;
diff --git a/usrp/host/lib/legacy/usrp_basic.cc b/usrp/host/lib/legacy/usrp_basic.cc
index 2eef14727..0ac9e052a 100644
--- a/usrp/host/lib/legacy/usrp_basic.cc
+++ b/usrp/host/lib/legacy/usrp_basic.cc
@@ -475,7 +475,7 @@ usrp_basic_rx::usrp_basic_rx (int which_board, int fusb_block_size, int fusb_nbl
throw std::out_of_range ("usrp_basic_rx: invalid fusb_nblocks");
if (fusb_block_size == 0)
- fusb_block_size = FUSB_BLOCK_SIZE;
+ fusb_block_size = fusb_sysconfig::default_block_size();
if (fusb_nblocks == 0)
fusb_nblocks = std::max (1, FUSB_BUFFER_SIZE / fusb_block_size);