From 01847c5f5d083a248145600e2b972c5480d092a7 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 29 Nov 2019 15:04:33 +0000 Subject: [PATCH] phy_config_enabled is general to all the carriers of the ue --- srsenb/hdr/stack/mac/scheduler.h | 2 +- srsenb/hdr/stack/mac/scheduler_ue.h | 11 +++++------ srsenb/src/stack/mac/mac.cc | 4 +--- srsenb/src/stack/mac/scheduler.cc | 4 ++-- srsenb/src/stack/mac/scheduler_ue.cc | 29 +++++++++++----------------- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/srsenb/hdr/stack/mac/scheduler.h b/srsenb/hdr/stack/mac/scheduler.h index 8815acf93..43ce89629 100644 --- a/srsenb/hdr/stack/mac/scheduler.h +++ b/srsenb/hdr/stack/mac/scheduler.h @@ -119,7 +119,7 @@ public: bool ue_exists(uint16_t rnti) final; void ue_needs_ta_cmd(uint16_t rnti, uint32_t nof_ta_cmd); - void phy_config_enabled(uint16_t rnti, uint32_t cc_idx, bool enabled); + void phy_config_enabled(uint16_t rnti, bool enabled); int bearer_ue_cfg(uint16_t rnti, uint32_t lc_id, ue_bearer_cfg_t* cfg) final; int bearer_ue_rem(uint16_t rnti, uint32_t lc_id) final; diff --git a/srsenb/hdr/stack/mac/scheduler_ue.h b/srsenb/hdr/stack/mac/scheduler_ue.h index 231f647b8..859d5fed9 100644 --- a/srsenb/hdr/stack/mac/scheduler_ue.h +++ b/srsenb/hdr/stack/mac/scheduler_ue.h @@ -107,7 +107,7 @@ public: ************************************************************/ sched_ue(); void reset(); - void phy_config_enabled(uint32_t tti, uint32_t cc_idx, bool enabled); + void phy_config_enabled(uint32_t tti, bool enabled); void set_cfg(uint16_t rnti, const sched_params_t& sched_params_, sched_interface::ue_cfg_t* cfg); void set_bearer_cfg(uint32_t lc_id, srsenb::sched_interface::ue_bearer_cfg_t* cfg); @@ -243,12 +243,11 @@ private: const rbgmask_t& user_mask); bool is_first_dl_tx(); - bool is_first_dl_tx(uint32_t cc_idx); - sched_interface::ue_cfg_t cfg = {}; - srslte_cell_t cell = {}; - srslte::log* log_h = nullptr; - const sched_params_t* sched_params; + sched_interface::ue_cfg_t cfg = {}; + srslte_cell_t cell = {}; + srslte::log* log_h = nullptr; + const sched_params_t* sched_params = nullptr; std::mutex mutex; diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index f1594659c..56a35493c 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -203,9 +203,7 @@ int mac::bearer_ue_rem(uint16_t rnti, uint32_t lc_id) void mac::phy_config_enabled(uint16_t rnti, bool enabled) { - // FIXME: "cc_idx must be specified" - uint32_t cc_idx = 0; - scheduler.phy_config_enabled(rnti, cc_idx, enabled); + scheduler.phy_config_enabled(rnti, enabled); } // Update UE configuration diff --git a/srsenb/src/stack/mac/scheduler.cc b/srsenb/src/stack/mac/scheduler.cc index 712ef1b0a..f15ce22e7 100644 --- a/srsenb/src/stack/mac/scheduler.cc +++ b/srsenb/src/stack/mac/scheduler.cc @@ -251,10 +251,10 @@ void sched::ue_needs_ta_cmd(uint16_t rnti, uint32_t nof_ta_cmd) pthread_rwlock_unlock(&rwlock); } -void sched::phy_config_enabled(uint16_t rnti, uint32_t cc_idx, bool enabled) +void sched::phy_config_enabled(uint16_t rnti, bool enabled) { // FIXME: Check if correct use of current_tti - ue_db_access(rnti, [this, cc_idx, enabled](sched_ue& ue) { ue.phy_config_enabled(current_tti, cc_idx, enabled); }); + ue_db_access(rnti, [this, enabled](sched_ue& ue) { ue.phy_config_enabled(current_tti, enabled); }); } int sched::bearer_ue_cfg(uint16_t rnti, uint32_t lc_id, sched_interface::ue_bearer_cfg_t* cfg_) diff --git a/srsenb/src/stack/mac/scheduler_ue.cc b/srsenb/src/stack/mac/scheduler_ue.cc index 1b012bbd4..b560ac0fd 100644 --- a/srsenb/src/stack/mac/scheduler_ue.cc +++ b/srsenb/src/stack/mac/scheduler_ue.cc @@ -171,10 +171,11 @@ void sched_ue::rem_bearer(uint32_t lc_id) } } -void sched_ue::phy_config_enabled(uint32_t tti, uint32_t cc_idx, bool enabled) +void sched_ue::phy_config_enabled(uint32_t tti, bool enabled) { - carriers[cc_idx].dl_cqi_tti = tti; - // FIXME: "why do we need this?" + for (sched_ue_carrier& c : carriers) { + c.dl_cqi_tti = tti; + } phy_config_dedicated_enabled = enabled; } @@ -400,7 +401,7 @@ int sched_ue::generate_format1(dl_harq_proc* h, // If this is the first transmission for this UE, make room for MAC Contention Resolution ID bool need_conres_ce = false; - if (is_first_dl_tx(cc_idx)) { + if (is_first_dl_tx()) { need_conres_ce = true; } if (h->is_empty(0)) { @@ -727,19 +728,11 @@ uint32_t sched_ue::get_max_retx() bool sched_ue::is_first_dl_tx() { - for (uint32_t i = 0; i < carriers.size(); ++i) { - if (not is_first_dl_tx(i)) { - return false; - } - } - return true; -} - -bool sched_ue::is_first_dl_tx(uint32_t cc_idx) -{ - for (auto& h : carriers[cc_idx].dl_harq) { - if (h.nof_tx(0) > 0) { - return false; + for (const sched_ue_carrier& c : carriers) { + for (auto& h : c.dl_harq) { + if (h.nof_tx(0) > 0) { + return false; + } } } return true; @@ -892,7 +885,7 @@ uint32_t sched_ue::get_required_prb_dl(uint32_t cc_idx, uint32_t req_bytes, uint uint32_t nbytes = 0; uint32_t n; - int mcs0 = (is_first_dl_tx(cc_idx) and cell.nof_prb == 6) ? MCS_FIRST_DL : carriers[cc_idx].fixed_mcs_dl; + int mcs0 = (is_first_dl_tx() and cell.nof_prb == 6) ? MCS_FIRST_DL : carriers[cc_idx].fixed_mcs_dl; for (n = 0; n < cell.nof_prb && nbytes < req_bytes; ++n) { nof_re = srslte_ra_dl_approx_nof_re(&cell, n + 1, nof_ctrl_symbols); if (mcs0 < 0) {