From 67935d2b993be89ff3acd2a9f0226c87b36c6cc9 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Tue, 26 Nov 2019 18:48:51 +0100 Subject: [PATCH] SRSUE: RRC blocks MAC RA procedure during reestablishment --- lib/include/srslte/interfaces/ue_interfaces.h | 1 + srsue/hdr/stack/mac/mac.h | 2 ++ srsue/src/stack/mac/mac.cc | 6 ++-- srsue/src/stack/rrc/rrc_procedures.cc | 33 ++++++++++++------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index bedebffa5..395dd9145 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -453,6 +453,7 @@ public: virtual void reconfiguration(const uint32_t& cc_idx, const bool& enable) = 0; virtual void reset() = 0; virtual void wait_uplink() = 0; + virtual void set_enable_ra_proc(bool en) = 0; }; /** PHY interface diff --git a/srsue/hdr/stack/mac/mac.h b/srsue/hdr/stack/mac/mac.h index 4692f6bd2..575aedcc0 100644 --- a/srsue/hdr/stack/mac/mac.h +++ b/srsue/hdr/stack/mac/mac.h @@ -86,6 +86,7 @@ public: void reconfiguration(const uint32_t& cc_idx, const bool& enable); void reset(); void wait_uplink(); + void set_enable_ra_proc(bool en) { enable_ra_proc = en; }; /******** set/get MAC configuration ****************/ void set_config(mac_cfg_t& mac_cfg); @@ -175,6 +176,7 @@ private: mac_metrics_t metrics[SRSLTE_MAX_CARRIERS] = {}; bool initialized = false; + bool enable_ra_proc = true; }; } // namespace srsue diff --git a/srsue/src/stack/mac/mac.cc b/srsue/src/stack/mac/mac.cc index a19f00a54..44f96ac33 100644 --- a/srsue/src/stack/mac/mac.cc +++ b/srsue/src/stack/mac/mac.cc @@ -227,8 +227,10 @@ void mac::run_tti(const uint32_t tti) sr_procedure.step(tti); // Check SR if we need to start RA - if (sr_procedure.need_random_access()) { - ra_procedure.start_mac_order(); + if (enable_ra_proc) { + if (sr_procedure.need_random_access()) { + ra_procedure.start_mac_order(); + } } ra_procedure.step(tti); diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index c91e2625f..3e7b51fad 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -908,6 +908,7 @@ proc_outcome_t rrc::connection_reest_proc::init(asn1::rrc::reest_cause_e cause) } // reset MAC; + rrc_ptr->mac->set_enable_ra_proc(false); // Prevent MAC from running RA procedure rrc_ptr->mac->reset(); // apply the default physical channel configuration as specified in 9.2.4; @@ -1031,24 +1032,32 @@ srslte::proc_outcome_t rrc::connection_reest_proc::cell_criteria() proc_outcome_t rrc::connection_reest_proc::step() { + proc_outcome_t ret = proc_outcome_t::yield; + // Abort procedure if T311 expires if (!rrc_ptr->t311.is_running()) { Info("T311 expired. Aborting.\n"); - return proc_outcome_t::success; - } - - /* - * Implementation of procedure in 3GPP 36.331 Section 5.3.7.3: Actions following cell selection while T311 is running - */ - switch (state) { - case state_t::cell_reselection: - return step_cell_reselection(); + ret = proc_outcome_t::success; + } else { + /* + * Implementation of procedure in 3GPP 36.331 Section 5.3.7.3: Actions following cell selection while T311 is + * running + */ + switch (state) { + case state_t::cell_reselection: + ret = step_cell_reselection(); + break; - case state_t::cell_configuration: - return step_cell_configuration(); + case state_t::cell_configuration: + ret = step_cell_configuration(); + break; + } + } + if (ret != proc_outcome_t::yield) { + rrc_ptr->mac->set_enable_ra_proc(true); } - return proc_outcome_t::error; + return ret; } } // namespace srsue