From ef9d77c966654e1d9badabc8aeacea1cb922cd9e Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Wed, 30 Sep 2020 16:20:03 +0200 Subject: [PATCH] SRSUE: add PRACH config present field in PHY configuration structure --- lib/include/srslte/interfaces/rrc_interface_types.h | 4 ++++ lib/src/asn1/rrc_asn1_utils.cc | 1 + srsue/src/phy/phy.cc | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/interfaces/rrc_interface_types.h b/lib/include/srslte/interfaces/rrc_interface_types.h index bc2b8927a..528d8c7e8 100644 --- a/lib/include/srslte/interfaces/rrc_interface_types.h +++ b/lib/include/srslte/interfaces/rrc_interface_types.h @@ -177,6 +177,8 @@ struct phy_cfg_t { { ul_cfg = {}; dl_cfg = {}; + + prach_cfg_present = false; prach_cfg = {}; // CommonConfig defaults for non-zero values @@ -221,6 +223,8 @@ struct phy_cfg_t { srslte_dl_cfg_t dl_cfg = {}; srslte_ul_cfg_t ul_cfg = {}; + + bool prach_cfg_present = false; srslte_prach_cfg_t prach_cfg = {}; }; diff --git a/lib/src/asn1/rrc_asn1_utils.cc b/lib/src/asn1/rrc_asn1_utils.cc index 4ef512eaf..1a83e5006 100644 --- a/lib/src/asn1/rrc_asn1_utils.cc +++ b/lib/src/asn1/rrc_asn1_utils.cc @@ -607,6 +607,7 @@ void set_phy_cfg_t_common_prach(phy_cfg_t* cfg, const asn1::rrc::prach_cfg_info_ cfg->prach_cfg.hs_flag = asn1_type->high_speed_flag; } cfg->prach_cfg.root_seq_idx = root_seq_idx; + cfg->prach_cfg_present = true; } void set_phy_cfg_t_common_pdsch(phy_cfg_t* cfg, const asn1::rrc::pdsch_cfg_common_s& asn1_type) diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index a95d030d8..5c8997881 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -466,7 +466,11 @@ bool phy::set_config(srslte::phy_cfg_t config_, uint32_t cc_idx) Info("Setting configuration\n"); - bool reconfigure_prach = !cc_idx && (prach_cfg != config_.prach_cfg); + // The PRACH shall be re-configured only if: + // - The new configuration belongs to the primary cell + // - The PRACH configuration is present + // - The PRACH configuration has changed + bool reconfigure_prach = !cc_idx && config_.prach_cfg_present && (prach_cfg != config_.prach_cfg); if (reconfigure_prach) { prach_buffer.reset_cfg();