summaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-09 19:56:45 -0800
committerJosh Blum <josh@joshknows.com>2011-02-09 19:56:45 -0800
commitaa73e29d507f1523c17cf625dbd9c68f5a7d3787 (patch)
treee208a28773b0f6b4780bd24d1d1d6c085e69f1fa /host/lib/transport
parenta72e29ca1de5b484bedcb1cfa8be6cd2216dc54e (diff)
downloaduhd-aa73e29d507f1523c17cf625dbd9c68f5a7d3787.tar.gz
uhd-aa73e29d507f1523c17cf625dbd9c68f5a7d3787.tar.bz2
uhd-aa73e29d507f1523c17cf625dbd9c68f5a7d3787.zip
uhd: tweaks to vrt pkt handler and usrp2 fc monitor
pkt handler, only resize once per call to send/recv (not per fragment) fc monitor, code tweaks, check ready before touching time wait stuff (faster)
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/vrt_packet_handler.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/host/lib/transport/vrt_packet_handler.hpp b/host/lib/transport/vrt_packet_handler.hpp
index 11c70dd07..795d5bc62 100644
--- a/host/lib/transport/vrt_packet_handler.hpp
+++ b/host/lib/transport/vrt_packet_handler.hpp
@@ -196,8 +196,7 @@ template <typename T> UHD_INLINE T get_context_code(
size_t bytes_to_copy = nsamps_to_copy*bytes_per_item;
size_t nsamps_to_copy_per_io_buff = nsamps_to_copy/chans_per_otw_buff;
- state.io_buffs.resize(chans_per_otw_buff);
- for (size_t i = 0; i < state.width; i+=chans_per_otw_buff){
+ for (size_t i = 0; i < buffs.size(); i+=chans_per_otw_buff){
//fill a vector with pointers to the io buffers
for (size_t j = 0; j < chans_per_otw_buff; j++){
@@ -240,6 +239,8 @@ template <typename T> UHD_INLINE T get_context_code(
size_t vrt_header_offset_words32 = 0,
size_t chans_per_otw_buff = 1
){
+ state.io_buffs.resize(chans_per_otw_buff);
+
uhd::convert::function_type converter(
uhd::convert::get_converter_otw_to_cpu(
io_type, otw_type, 1, chans_per_otw_buff
@@ -345,7 +346,6 @@ template <typename T> UHD_INLINE T get_context_code(
//get send buffers for each otw channel
if (not get_send_buffs(state.managed_buffs)) return 0;
- state.io_buffs.resize(chans_per_otw_buff);
for (size_t i = 0; i < buffs.size(); i+=chans_per_otw_buff){
//calculate pointers with offsets to io and otw memory
for (size_t j = 0; j < chans_per_otw_buff; j++){
@@ -387,6 +387,8 @@ template <typename T> UHD_INLINE T get_context_code(
size_t vrt_header_offset_words32 = 0,
size_t chans_per_otw_buff = 1
){
+ state.io_buffs.resize(chans_per_otw_buff);
+
uhd::convert::function_type converter(
uhd::convert::get_converter_cpu_to_otw(
io_type, otw_type, chans_per_otw_buff, 1