From 051e8fcc528d703c44e6b7a70086143c4296994b Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 26 Mar 2020 19:55:53 +0100 Subject: [PATCH] SRSUE: Apply default PHY config to SCell as well --- srsue/hdr/stack/rrc/rrc.h | 1 + srsue/src/stack/rrc/rrc.cc | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 4707b6e80..594ddbe9f 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -405,6 +405,7 @@ private: cell_t ho_src_cell = {}; srslte::phy_cfg_t current_phy_cfg, previous_phy_cfg = {}; srslte::mac_cfg_t current_mac_cfg, previous_mac_cfg = {}; + bool current_scell_configured[SRSLTE_MAX_CARRIERS] = {}; bool pending_mob_reconf = false; asn1::rrc::rrc_conn_recfg_s mob_reconf = {}; diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index fae2e6944..8d2544ef4 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -2342,7 +2342,12 @@ void rrc::set_phy_default() current_phy_cfg.set_defaults(); if (phy != nullptr) { - phy->set_config(current_phy_cfg); + for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; i++) { + if (i == 0 or current_scell_configured[i]) { + phy->set_config(current_phy_cfg, i); + current_scell_configured[i] = false; + } + } } else { rrc_log->info("RRC not initialized. Skipping default PHY config.\n"); } @@ -2354,7 +2359,12 @@ void rrc::set_phy_config_dedicated_default() current_phy_cfg.set_defaults_dedicated(); if (phy != nullptr) { - phy->set_config(current_phy_cfg); + for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; i++) { + if (i == 0 or current_scell_configured[i]) { + phy->set_config(current_phy_cfg, i); + current_scell_configured[i] = false; + } + } } else { rrc_log->info("RRC not initialized. Skipping default PHY config.\n"); } @@ -2427,6 +2437,7 @@ void rrc::apply_phy_scell_config(const scell_to_add_mod_r10_s& scell_config) set_phy_cfg_t_scell_config(&scell_phy_cfg, scell_config); phy->set_config(scell_phy_cfg, scell_config.scell_idx_r10, earfcn, &scell); + current_scell_configured[scell_config.scell_idx_r10] = true; } void rrc::log_mac_config_dedicated()