From 1825f0885212d68205bc082d40e909c56ca3d5a6 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 18 Oct 2019 15:12:56 -0700 Subject: mpmd: Skip generation of mb_controller and mb_iface for skip_init=1 The mpmd_mb_controller requires access to the fully functional FPGA, which in turn assumes flawless initialization. skip_init doesn't init at all, so inializing an mb_controller may not be possible, and shouldn't be attempted. This skips init of both mb_iface and mb_controller for skip_init, leaving it to the other code to figure out if they are initialized. --- host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/mpmd') diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp index 5c8fd5485..e7bd0cff9 100644 --- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp @@ -290,9 +290,12 @@ mpmd_mboard_impl::mpmd_mboard_impl( this->dboard_info.push_back(this_db_info); } - // Initialize mb_iface and mb_controller - mb_iface = std::make_unique(mb_args, rpc); - mb_ctrl = std::make_shared(rpc, device_info); + if (!mb_args.has_key("skip_init")) { + // Initialize mb_iface and mb_controller + mb_iface = std::make_unique(mb_args, rpc); + mb_ctrl = std::make_shared(rpc, device_info); + } // Note -- when skip_init is used, these are not initialized, and trying + // to use them will result in a null pointer dereference exception! } mpmd_mboard_impl::~mpmd_mboard_impl() -- cgit v1.2.3