From 74c18ecf6c621473565181e3a5b2d3e0bdd3ff18 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 9 Oct 2020 13:59:30 +0100 Subject: [PATCH] implementation of SCell Deactivation --- srsenb/hdr/stack/rrc/mac_controller.h | 6 ++++++ srsenb/src/stack/mac/scheduler_ue.cc | 8 ++++++++ srsenb/src/stack/rrc/mac_controller.cc | 16 ++++++++++++++++ srsenb/src/stack/rrc/rrc_mobility.cc | 2 ++ 4 files changed, 32 insertions(+) diff --git a/srsenb/hdr/stack/rrc/mac_controller.h b/srsenb/hdr/stack/rrc/mac_controller.h index feea7e903..7e78e1e3c 100644 --- a/srsenb/hdr/stack/rrc/mac_controller.h +++ b/srsenb/hdr/stack/rrc/mac_controller.h @@ -23,6 +23,7 @@ #define SRSLTE_MAC_CONTROLLER_H #include "rrc_ue.h" +#include namespace srsenb { @@ -49,6 +50,11 @@ public: const sched_interface::ue_cfg_t& get_ue_sched_cfg() const { return current_sched_ue_cfg; } + void set_scell_activation(const std::bitset& scell_mask); + + enum proc_stage_t : int8_t { config_tx, config_complete, other }; + void update_mac(proc_stage_t stage); + private: void handle_con_reconf_with_mobility(); int apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& rr_cfg); diff --git a/srsenb/src/stack/mac/scheduler_ue.cc b/srsenb/src/stack/mac/scheduler_ue.cc index b68596061..ddfc0f264 100644 --- a/srsenb/src/stack/mac/scheduler_ue.cc +++ b/srsenb/src/stack/mac/scheduler_ue.cc @@ -1258,8 +1258,16 @@ void cc_sched_ue::reset() void cc_sched_ue::set_cfg(const sched_interface::ue_cfg_t& cfg_) { cfg = &cfg_; + // Config HARQ processes harq_ent.set_cfg(cfg->maxharq_tx); + + // Handle deactivation + if (ue_cc_idx > 0 and not cfg_.supported_cc_list[ue_cc_idx].active and active) { + active = false; + reset(); + log_h->info("SCHED: rnti=0x%x SCellIndex=%d deactivated\n", rnti, ue_cc_idx); + } } /* Find lowest DCI aggregation level supported by the UE spectral efficiency */ diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index ddc4aa9c0..8fa1b4d97 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -336,4 +336,20 @@ void rrc::ue::mac_controller::handle_ho_prep(const asn1::rrc::ho_prep_info_r8_ie void rrc::ue::mac_controller::handle_ho_prep_complete() {} +void rrc::ue::mac_controller::set_scell_activation(const std::bitset& scell_mask) +{ + for (uint32_t i = 1; i < current_sched_ue_cfg.supported_cc_list.size(); ++i) { + current_sched_ue_cfg.supported_cc_list[i].active = scell_mask[i]; + } +} + +void rrc::ue::mac_controller::update_mac(proc_stage_t stage) +{ + // Apply changes to MAC scheduler + mac->ue_cfg(rrc_ue->rnti, ¤t_sched_ue_cfg); + if (stage != proc_stage_t::other) { + mac->phy_config_enabled(rrc_ue->rnti, stage == proc_stage_t::config_complete); + } +} + } // namespace srsenb diff --git a/srsenb/src/stack/rrc/rrc_mobility.cc b/srsenb/src/stack/rrc/rrc_mobility.cc index 8486ca489..e7ec7755f 100644 --- a/srsenb/src/stack/rrc/rrc_mobility.cc +++ b/srsenb/src/stack/rrc/rrc_mobility.cc @@ -1318,6 +1318,8 @@ void rrc::ue::rrc_mobility::intraenb_ho_st::enter(rrc_mobility* f, const ho_meas } /* Freeze all DRBs. SRBs DL are needed for sending the HO Cmd */ + f->rrc_ue->mac_ctrl->set_scell_activation({0}); + f->rrc_ue->mac_ctrl->update_mac(mac_controller::config_tx); for (const drb_to_add_mod_s& drb : f->rrc_ue->bearer_list.get_established_drbs()) { f->rrc_enb->mac->bearer_ue_rem(f->rrc_ue->rnti, drb.drb_id + 2); }