From a24091edf8c63a284f52301f5d6cfbf4da4a9243 Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 21 Jan 2021 11:35:47 +0000 Subject: [PATCH] fix handover regression. The new pcell was not being correctly reactivated --- srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h | 2 ++ srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h index abbc7ff6a..54cffffe6 100644 --- a/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h +++ b/srsenb/hdr/stack/mac/sched_ue_ctrl/sched_ue_cell.h @@ -76,6 +76,8 @@ struct sched_ue_cell { int fixed_mcs_ul = 0, fixed_mcs_dl = 0; private: + void enter_idle_st(); + srslte::log_ref log_h{"MAC"}; const sched_interface::ue_cfg_t* ue_cfg = nullptr; diff --git a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc index c2b8fcd4f..1ac33a2f8 100644 --- a/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc +++ b/srsenb/src/stack/mac/sched_ue_ctrl/sched_ue_cell.cc @@ -61,7 +61,7 @@ void sched_ue_cell::set_ue_cfg(const sched_interface::ue_cfg_t& ue_cfg_) // Update carrier state if (ue_cc_idx == 0) { - if (cc_state() == cc_st::idle) { + if (cc_state() != cc_st::active) { reset(); // PCell is always active cc_state_ = cc_st::active; @@ -102,7 +102,7 @@ void sched_ue_cell::new_tti(tti_point tti_rx) if (ue_cc_idx > 0 and cc_state_ == cc_st::deactivating) { // wait for all ACKs to be received before completely deactivating SCell if (current_tti > to_tx_dl_ack(cfg_tti)) { - cc_state_ = cc_st::idle; + enter_idle_st(); } } } @@ -118,7 +118,6 @@ void sched_ue_cell::reset() dl_cqi_rx = false; ul_cqi = 1; ul_cqi_tti_rx = tti_point{}; - harq_ent.reset(); } void sched_ue_cell::finish_tti(tti_point tti_rx) @@ -139,6 +138,12 @@ void sched_ue_cell::set_dl_cqi(tti_point tti_rx, uint32_t dl_cqi_) } } +void sched_ue_cell::enter_idle_st() +{ + cc_state_ = cc_st::idle; + harq_ent.reset(); +} + /************************************************************* * TBS/MCS derivation ************************************************************/