From 3ee587672022ed9b7093b22d25bc8e2a4432f618 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 20 Dec 2017 18:29:40 -0800 Subject: mg: Set default spp at ctor time, when xports have been init'd --- host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'host/lib') 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 #include #include +#include #include #include @@ -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("mtu/recv").get() - max_bytes_header) + / (2 * sizeof(int16_t)); + UHD_LOG_DEBUG(unique_id(), + "Setting default spp to " << default_spp); + _tree->access(get_arg_path("spp") / "value").set(default_spp); } void magnesium_radio_ctrl_impl::_init_peripherals() -- cgit v1.2.3