summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-04 15:17:57 -0700
committerJosh Blum <josh@joshknows.com>2010-10-04 15:17:57 -0700
commitf642942dc364c1d26a9128c1ba631d3604d0671a (patch)
tree9df6c49fa723ac4fde85d8b75399c06338938ba8 /host
parente54aa5ba5a65698a106cc0852b856cab5cd8e767 (diff)
downloaduhd-f642942dc364c1d26a9128c1ba631d3604d0671a.tar.gz
uhd-f642942dc364c1d26a9128c1ba631d3604d0671a.tar.bz2
uhd-f642942dc364c1d26a9128c1ba631d3604d0671a.zip
usrp-e: check if flags are ready after poll
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp_e/io_impl.cpp6
-rw-r--r--host/lib/usrp/usrp_e/usrp_e_mmap_zero_copy.cpp12
2 files changed, 15 insertions, 3 deletions
diff --git a/host/lib/usrp/usrp_e/io_impl.cpp b/host/lib/usrp/usrp_e/io_impl.cpp
index 1e577a4df..2802a6b87 100644
--- a/host/lib/usrp/usrp_e/io_impl.cpp
+++ b/host/lib/usrp/usrp_e/io_impl.cpp
@@ -130,12 +130,12 @@ void usrp_e_impl::io_impl::recv_pirate_loop(
continue;
}
+ //same number of frames as the data transport -> always immediate
+ recv_pirate_booty->push_with_wait(buff);
+
}catch(const std::exception &e){
std::cerr << "Error (usrp-e recv pirate loop): " << e.what() << std::endl;
}
-
- //usrp-e back-pressures on receive: push with wait
- recv_pirate_booty->push_with_wait(buff);
}
}
diff --git a/host/lib/usrp/usrp_e/usrp_e_mmap_zero_copy.cpp b/host/lib/usrp/usrp_e/usrp_e_mmap_zero_copy.cpp
index e62205a3f..9e25ed088 100644
--- a/host/lib/usrp/usrp_e/usrp_e_mmap_zero_copy.cpp
+++ b/host/lib/usrp/usrp_e/usrp_e_mmap_zero_copy.cpp
@@ -112,6 +112,12 @@ public:
if (poll_ret <= 0) return managed_recv_buffer::sptr();
}
+ //check that the frame is really ready
+ if (not (info->flags & RB_USER)){
+ if (fp_verbose) std::cout << " flags: not ready" << std::endl;
+ return managed_recv_buffer::sptr();
+ }
+
//increment the index for the next call
if (++_recv_index == size_t(_rb_size.num_rx_frames)) _recv_index = 0;
@@ -144,6 +150,12 @@ public:
if (poll_ret <= 0) return managed_send_buffer::sptr();
}
+ //check that the frame is really ready
+ if (not (info->flags & RB_KERNEL)){
+ if (fp_verbose) std::cout << " flags: not ready" << std::endl;
+ return managed_send_buffer::sptr();
+ }
+
//increment the index for the next call
if (++_send_index == size_t(_rb_size.num_tx_frames)) _send_index = 0;