aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-20 18:29:40 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:06:11 -0800
commit3ee587672022ed9b7093b22d25bc8e2a4432f618 (patch)
tree9ba5eb9d35c1b6cdad1402f431c840bd8976ee1b /host
parenta2d0b50bc61442b471fe1a724d61d336af961e21 (diff)
downloaduhd-3ee587672022ed9b7093b22d25bc8e2a4432f618.tar.gz
uhd-3ee587672022ed9b7093b22d25bc8e2a4432f618.tar.bz2
uhd-3ee587672022ed9b7093b22d25bc8e2a4432f618.zip
mg: Set default spp at ctor time, when xports have been init'd
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp
index 45c1794c3..2b842cbcf 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp
@@ -10,6 +10,7 @@
#include <uhd/utils/log.hpp>
#include <uhd/types/eeprom.hpp>
#include <uhd/types/sensors.hpp>
+#include <uhd/transport/chdr.hpp>
#include <vector>
#include <string>
@@ -50,6 +51,17 @@ void magnesium_radio_ctrl_impl::_init_defaults()
radio_ctrl_impl::set_tx_gain(0, chan);
radio_ctrl_impl::set_tx_antenna(MAGNESIUM_DEFAULT_TX_ANTENNA, chan);
}
+
+
+ /** Update default SPP (overwrites the default value from the XML file) **/
+ const size_t max_bytes_header =
+ uhd::transport::vrt::chdr::max_if_hdr_words64 * sizeof(uint64_t);
+ const size_t default_spp =
+ (_tree->access<size_t>("mtu/recv").get() - max_bytes_header)
+ / (2 * sizeof(int16_t));
+ UHD_LOG_DEBUG(unique_id(),
+ "Setting default spp to " << default_spp);
+ _tree->access<int>(get_arg_path("spp") / "value").set(default_spp);
}
void magnesium_radio_ctrl_impl::_init_peripherals()