summaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-11 18:38:06 -0700
committerJosh Blum <josh@joshknows.com>2010-10-11 18:38:06 -0700
commitb49e2955b0f68d59e7903f89a26c39dc9b3614fd (patch)
treefcdc50d9cf78b482de1d3227c0b5dec05be6bfae /host/lib
parentd54fd2abffd8849bf41a5f8084a828e6472ba342 (diff)
downloaduhd-b49e2955b0f68d59e7903f89a26c39dc9b3614fd.tar.gz
uhd-b49e2955b0f68d59e7903f89a26c39dc9b3614fd.tar.bz2
uhd-b49e2955b0f68d59e7903f89a26c39dc9b3614fd.zip
usrp2: enable the cycles per ack, and drain recv without the timeout (fixes previous conflict)
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp2
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp
index 2d1ebe57b..c9271cc8c 100644
--- a/host/lib/usrp/usrp2/io_impl.cpp
+++ b/host/lib/usrp/usrp2/io_impl.cpp
@@ -250,7 +250,7 @@ void usrp2_impl::io_init(void){
std::memcpy(send_buff->cast<void*>(), &data, sizeof(data));
send_buff->commit(sizeof(data));
//drain the recv buffers (may have junk)
- while (data_transport->get_recv_buff().get()){};
+ while (data_transport->get_recv_buff(0).get()){};
}
//the assumption is that all data transports should be identical
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 37e69b39d..ddf147c8d 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -95,7 +95,7 @@ usrp2_mboard_impl::usrp2_mboard_impl(
_iface->poke32(U2_REG_TX_CTRL_REPORT_SID, 1); //sid 1 (different from rx)
_iface->poke32(U2_REG_TX_CTRL_POLICY, U2_FLAG_TX_CTRL_POLICY_NEXT_PACKET);
const size_t cycles_per_ack = size_t(_clock_ctrl->get_master_clock_rate()/100); //100 aps
- //_iface->poke32(U2_REG_TX_CTRL_CYCLES_PER_ACK, U2_FLAG_TX_CTRL_ACK_ENB | cycles_per_ack); //FIXME total pause frames
+ _iface->poke32(U2_REG_TX_CTRL_CYCLES_PER_ACK, U2_FLAG_TX_CTRL_ACK_ENB | cycles_per_ack);
static const double sram_frac = 1.0/8.0; //fraction of sram to fill before ack
const size_t packets_per_ack = size_t(usrp2_impl::sram_bytes*sram_frac/send_bytes_per_packet);
_iface->poke32(U2_REG_TX_CTRL_PACKETS_PER_ACK, U2_FLAG_TX_CTRL_ACK_ENB | packets_per_ack);
@@ -121,7 +121,8 @@ usrp2_mboard_impl::usrp2_mboard_impl(
}
usrp2_mboard_impl::~usrp2_mboard_impl(void){
- /* NOP */
+ _iface->poke32(U2_REG_TX_CTRL_CYCLES_PER_ACK, 0);
+ _iface->poke32(U2_REG_TX_CTRL_PACKETS_PER_ACK, 0);
}
/***********************************************************************