summaryrefslogtreecommitdiff
path: root/usrp/host/lib
diff options
context:
space:
mode:
authorttsou2009-08-25 18:46:14 -0400
committerttsou2009-09-15 18:06:27 -0400
commit3d3888c40ac46cbbd8851e9bc5e83557e0415887 (patch)
treef1bb66270544a582f165409017d019e4c442d6aa /usrp/host/lib
parent0854c4604fcbdb64c74e4b93b87ac07be3d75f55 (diff)
downloadgnuradio-3d3888c40ac46cbbd8851e9bc5e83557e0415887.tar.gz
gnuradio-3d3888c40ac46cbbd8851e9bc5e83557e0415887.tar.bz2
gnuradio-3d3888c40ac46cbbd8851e9bc5e83557e0415887.zip
non-blocking reap and fusb default buffer size change
Diffstat (limited to 'usrp/host/lib')
-rw-r--r--usrp/host/lib/fusb_libusb1.cc17
-rw-r--r--usrp/host/lib/fusb_sysconfig_libusb1.cc2
2 files changed, 12 insertions, 7 deletions
diff --git a/usrp/host/lib/fusb_libusb1.cc b/usrp/host/lib/fusb_libusb1.cc
index 0559022bb..6f1fc913f 100644
--- a/usrp/host/lib/fusb_libusb1.cc
+++ b/usrp/host/lib/fusb_libusb1.cc
@@ -268,8 +268,18 @@ bool
fusb_devhandle_libusb1::_reap (bool ok_to_block_p)
{
int ret;
+ struct timeval tv;
- if ((ret = libusb_handle_events(d_ctx)) < 0) {
+ if (ok_to_block_p) {
+ tv.tv_sec = 2;
+ tv.tv_usec = 0;
+ }
+ else {
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ }
+
+ if ((ret = libusb_handle_events_timeout(d_ctx, &tv)) < 0) {
fprintf (stderr, "fusb::_reap libusb_handle_events()\n");
return false;
}
@@ -281,11 +291,6 @@ void
fusb_devhandle_libusb1::_wait_for_completion ()
{
- int ret;
- struct timeval tv;
- tv.tv_sec = 1;
- tv.tv_usec = 0;
-
while (!d_pending_rqsts.empty ())
if (!_reap(true))
break;
diff --git a/usrp/host/lib/fusb_sysconfig_libusb1.cc b/usrp/host/lib/fusb_sysconfig_libusb1.cc
index c82bfe9a1..a005f540d 100644
--- a/usrp/host/lib/fusb_sysconfig_libusb1.cc
+++ b/usrp/host/lib/fusb_sysconfig_libusb1.cc
@@ -25,7 +25,7 @@
static const int MAX_BLOCK_SIZE = 16 * 1024; // hard limit
static const int DEFAULT_BLOCK_SIZE = 4 * 1024;
-static const int FUSB_BUFFER_SIZE = 2 * (1L << 20); // 2 MB
+static const int FUSB_BUFFER_SIZE = 1 * (1L << 20); // 1 MB
struct libusb_context;