diff --git a/srsenb/hdr/stack/rrc/mac_controller.h b/srsenb/hdr/stack/rrc/mac_controller.h index 5c9042bc7..ff9a62b60 100644 --- a/srsenb/hdr/stack/rrc/mac_controller.h +++ b/srsenb/hdr/stack/rrc/mac_controller.h @@ -55,7 +55,7 @@ public: const srsran::rrc_ue_capabilities_t& uecaps); void handle_ho_prep(const asn1::rrc::ho_prep_info_r8_ies_s& ho_prep); - void handle_max_retx(); + void set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::direction_t dir); const ue_cfg_t& get_ue_sched_cfg() const { return current_sched_ue_cfg; } bool is_crnti_set() const { return crnti_set; } diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index 7322efd3e..56f3a8136 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -297,10 +297,10 @@ void mac_controller::handle_ho_prep(const asn1::rrc::ho_prep_info_r8_ies_s& ho_p } } -void mac_controller::handle_max_retx() +void mac_controller::set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::direction_t dir) { for (auto& ue_bearer : current_sched_ue_cfg.ue_bearers) { - ue_bearer.direction = sched_interface::ue_bearer_cfg_t::IDLE; + ue_bearer.direction = dir; } update_mac(config_tx); } diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index 580058065..ef7fab433 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -122,6 +122,7 @@ void rrc::ue::set_radiolink_dl_state(bool crc_res) parent->logger.info( "DL RLF timer stopped for rnti=0x%x (time elapsed=%dms)", rnti, phy_dl_rlf_timer.time_elapsed()); phy_dl_rlf_timer.stop(); + mac_ctrl.set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::BOTH); } return; } @@ -136,7 +137,7 @@ void rrc::ue::set_radiolink_dl_state(bool crc_res) consecutive_kos_dl++; if (consecutive_kos_dl > parent->cfg.max_mac_dl_kos) { parent->logger.info("Max KOs in DL reached, starting RLF timer rnti=0x%x", rnti); - mac_ctrl.handle_max_retx(); + mac_ctrl.set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::IDLE); phy_dl_rlf_timer.run(); } } @@ -153,6 +154,7 @@ void rrc::ue::set_radiolink_ul_state(bool crc_res) parent->logger.info( "UL RLF timer stopped for rnti=0x%x (time elapsed=%dms)", rnti, phy_ul_rlf_timer.time_elapsed()); phy_ul_rlf_timer.stop(); + mac_ctrl.set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::BOTH); } return; } @@ -167,7 +169,7 @@ void rrc::ue::set_radiolink_ul_state(bool crc_res) consecutive_kos_ul++; if (consecutive_kos_ul > parent->cfg.max_mac_ul_kos) { parent->logger.info("Max KOs in UL reached, starting RLF timer rnti=0x%x", rnti); - mac_ctrl.handle_max_retx(); + mac_ctrl.set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::IDLE); phy_ul_rlf_timer.run(); } } @@ -222,9 +224,9 @@ void rrc::ue::max_rlc_retx_reached() { parent->logger.info("Max RLC retx reached for rnti=0x%x", rnti); - // Turn off DRB scheduling but give UE chance to start re-establishment + // Turn off scheduling but give UE chance to start re-establishment + mac_ctrl.set_radio_bearer_state(sched_interface::ue_bearer_cfg_t::IDLE); rlc_rlf_timer.run(); - mac_ctrl.handle_max_retx(); } void rrc::ue::set_activity_timeout(const activity_timeout_type_t type)