diff --git a/srsgnb/hdr/stack/mac/mac_nr.h b/srsgnb/hdr/stack/mac/mac_nr.h index 1b26be4c5..8137e43f6 100644 --- a/srsgnb/hdr/stack/mac/mac_nr.h +++ b/srsgnb/hdr/stack/mac/mac_nr.h @@ -102,10 +102,13 @@ private: // args srsran::task_sched_handle task_sched; srsran::task_queue_handle stack_task_queue; + mac_nr_args_t args = {}; + srslog::basic_logger& logger; + + // derived + srsran::phy_cfg_nr_t default_ue_phy_cfg; std::unique_ptr pcap = nullptr; - mac_nr_args_t args = {}; - srslog::basic_logger& logger; std::atomic started = {false}; diff --git a/srsgnb/src/stack/mac/mac_nr.cc b/srsgnb/src/stack/mac/mac_nr.cc index 2033591d8..e6d41ce7f 100644 --- a/srsgnb/src/stack/mac/mac_nr.cc +++ b/srsgnb/src/stack/mac/mac_nr.cc @@ -276,6 +276,14 @@ int mac_nr::cell_cfg(const std::vector& rx.reset(new mac_nr_rx{rlc, rrc, stack_task_queue, sched.get(), logger}); + srsran::phy_cfg_nr_default_t::reference_cfg_t ref_args{}; + ref_args.duplex = cell_config[0].duplex.mode == SRSRAN_DUPLEX_MODE_TDD + ? srsran::phy_cfg_nr_default_t::reference_cfg_t::R_DUPLEX_TDD_CUSTOM_6_4 + : srsran::phy_cfg_nr_default_t::reference_cfg_t::R_DUPLEX_FDD; + default_ue_phy_cfg = srsran::phy_cfg_nr_default_t{ref_args}; + default_ue_phy_cfg.pdcch = cell_config[0].bwps[0].pdcch; + default_ue_phy_cfg.csi = {}; // disable CSI until RA is complete + return SRSRAN_SUCCESS; } @@ -313,12 +321,7 @@ void mac_nr::rach_detected(const rach_info_t& rach_info) uecfg.carriers[0].active = true; uecfg.carriers[0].cc = enb_cc_idx; uecfg.ue_bearers[0].direction = mac_lc_ch_cfg_t::BOTH; - srsran::phy_cfg_nr_default_t::reference_cfg_t ref_args{}; - ref_args.duplex = cell_config[0].duplex.mode == SRSRAN_DUPLEX_MODE_TDD - ? srsran::phy_cfg_nr_default_t::reference_cfg_t::R_DUPLEX_TDD_CUSTOM_6_4 - : srsran::phy_cfg_nr_default_t::reference_cfg_t::R_DUPLEX_FDD; - uecfg.phy_cfg = srsran::phy_cfg_nr_default_t{ref_args}; - uecfg.phy_cfg.csi = {}; // disable CSI until RA is complete + uecfg.phy_cfg = default_ue_phy_cfg; uint16_t rnti = alloc_ue(enb_cc_idx);