diff --git a/srsenb/src/stack/mac/scheduler_ue.cc b/srsenb/src/stack/mac/scheduler_ue.cc index 1af6ed86d..3f68e2b96 100644 --- a/srsenb/src/stack/mac/scheduler_ue.cc +++ b/srsenb/src/stack/mac/scheduler_ue.cc @@ -1381,6 +1381,10 @@ int cc_sched_ue::alloc_tbs(uint32_t nof_prb, uint32_t nof_re, uint32_t req_bytes if (tbs_bytes > (int)req_bytes && req_bytes > 0) { int req_tbs_idx = srslte_ra_tbs_to_table_idx(req_bytes * 8, nof_prb); int req_mcs = srslte_ra_mcs_from_tbs_idx(req_tbs_idx, cfg->use_tbs_index_alt, is_ul); + while (cfg->use_tbs_index_alt and req_mcs < 0 and req_tbs_idx < 33) { + // some tbs_idx are invalid for 256QAM. See TS 36.213 - Table 7.1.7.1-1A + req_mcs = srslte_ra_mcs_from_tbs_idx(++req_tbs_idx, cfg->use_tbs_index_alt, is_ul); + } if (req_mcs >= 0 and req_mcs < (int)sel_mcs) { sel_mcs = req_mcs; diff --git a/srsenb/src/stack/rrc/mac_controller.cc b/srsenb/src/stack/rrc/mac_controller.cc index 8d406f96c..95dc120a8 100644 --- a/srsenb/src/stack/rrc/mac_controller.cc +++ b/srsenb/src/stack/rrc/mac_controller.cc @@ -127,7 +127,7 @@ int rrc::ue::mac_controller::apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& current_sched_ue_cfg.continuous_pusch = false; // Only PCell active at this point - current_sched_ue_cfg.supported_cc_list.resize(1); + current_sched_ue_cfg.supported_cc_list.resize(1, {}); current_sched_ue_cfg.supported_cc_list[0].active = true; current_sched_ue_cfg.supported_cc_list[0].enb_cc_idx = pcell->cell_common->enb_cc_idx; @@ -136,8 +136,9 @@ int rrc::ue::mac_controller::apply_basic_conn_cfg(const asn1::rrc::rr_cfg_ded_s& current_sched_ue_cfg.ue_bearers[0].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH; current_sched_ue_cfg.ue_bearers[1].direction = srsenb::sched_interface::ue_bearer_cfg_t::BOTH; - // Set basic antenna configuration + // Set default configuration current_sched_ue_cfg.supported_cc_list[0].dl_cfg.tm = SRSLTE_TM1; + current_sched_ue_cfg.use_tbs_index_alt = false; // Apply common PhyConfig updates (e.g. SR/CQI resources, antenna cfg) if (rr_cfg.phys_cfg_ded_present) { diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index f708b48c0..023c1402f 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -388,7 +388,6 @@ void rrc::ue::handle_rrc_con_reest_req(rrc_conn_reest_request_s* msg) } else { parent->rrc_log->error("Received ReestablishmentRequest from an rnti=0x%x not in IDLE\n", rnti); } - return; } void rrc::ue::send_connection_reest(uint8_t ncc) diff --git a/srsue/hdr/stack/rrc/phy_controller.h b/srsue/hdr/stack/rrc/phy_controller.h index fd08544cc..dd348c2b0 100644 --- a/srsue/hdr/stack/rrc/phy_controller.h +++ b/srsue/hdr/stack/rrc/phy_controller.h @@ -67,6 +67,7 @@ public: void out_sync() { trigger(out_sync_ev{}); } bool set_cell_config(const srslte::phy_cfg_t& config, uint32_t cc_idx = 0); void set_phy_to_default(); + void set_phy_to_default_dedicated(); void set_phy_to_default_pucch_srs(); void set_config_complete(); @@ -77,7 +78,7 @@ public: srslte::span current_cell_config() const { return current_cells_cfg; } srslte::span current_cell_config() { return current_cells_cfg; } - const std::bitset& current_config_scells() const { return current_scells_cfg; } + const std::bitset& current_config_scells() const { return configured_scell_mask; } // FSM states struct unknown_st {}; @@ -133,11 +134,11 @@ private: srslte::event_observer cell_selection_notifier; std::function cell_selection_always_observer; srslte::event_dispatcher cell_search_observers; - uint32_t nof_pending_configs = 0; - std::array current_cells_cfg = {}; - std::bitset current_scells_cfg = {}; + uint32_t nof_pending_configs = 0; + std::array current_cells_cfg = {}; + std::bitset configured_scell_mask = {}; - bool set_cell_config_common(const srslte::phy_cfg_t& cfg, uint32_t cc_idx, bool is_set); + bool set_cell_config(const srslte::phy_cfg_t& cfg, uint32_t cc_idx, bool is_set); protected: state_list states{this, diff --git a/srsue/src/stack/rrc/phy_controller.cc b/srsue/src/stack/rrc/phy_controller.cc index bd915c461..89e1b5013 100644 --- a/srsue/src/stack/rrc/phy_controller.cc +++ b/srsue/src/stack/rrc/phy_controller.cc @@ -47,7 +47,7 @@ void phy_controller::in_sync() bool phy_controller::set_cell_config(const srslte::phy_cfg_t& config, uint32_t cc_idx) { log_h->info("Setting PHY config for cc_idx=%d\n", cc_idx); - return set_cell_config_common(config, cc_idx, true); + return set_cell_config(config, cc_idx, true); } void phy_controller::set_phy_to_default() @@ -57,7 +57,19 @@ void phy_controller::set_phy_to_default() srslte::phy_cfg_t& default_cfg = current_cells_cfg[0]; default_cfg.set_defaults(); for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; ++i) { - set_cell_config_common(default_cfg, i, false); + set_cell_config(default_cfg, i, false); + } +} + +/// Apply default PHY config for all SCells as specified in TS 36.331 9.2.4 +void phy_controller::set_phy_to_default_dedicated() +{ + log_h->info("Setting default dedicated PHY config\n"); + + srslte::phy_cfg_t& default_cfg = current_cells_cfg[0]; + default_cfg.set_defaults_dedicated(); + for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; ++i) { + set_cell_config(default_cfg, i, false); } } @@ -68,16 +80,16 @@ void phy_controller::set_phy_to_default_pucch_srs() srslte::phy_cfg_t& default_cfg_ded = current_cells_cfg[0]; default_cfg_ded.set_defaults_pucch_sr(); for (uint32_t i = 0; i < SRSLTE_MAX_CARRIERS; ++i) { - set_cell_config_common(default_cfg_ded, i, false); + set_cell_config(default_cfg_ded, i, false); } } -bool phy_controller::set_cell_config_common(const srslte::phy_cfg_t& cfg, uint32_t cc_idx, bool is_set) +bool phy_controller::set_cell_config(const srslte::phy_cfg_t& cfg, uint32_t cc_idx, bool is_set) { - if ((is_set or cc_idx == 0 or current_scells_cfg[cc_idx]) and phy->set_config(cfg, cc_idx)) { + if ((is_set or cc_idx == 0 or configured_scell_mask[cc_idx]) and phy->set_config(cfg, cc_idx)) { current_cells_cfg[cc_idx] = cfg; if (cc_idx > 0) { - current_scells_cfg[cc_idx] = is_set; + configured_scell_mask[cc_idx] = is_set; } nof_pending_configs++; return true; diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index ff4531b17..5e2d5227a 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -1332,7 +1332,7 @@ proc_outcome_t rrc::connection_reest_proc::init(asn1::rrc::reest_cause_e cause) } // 1> apply the default physical channel configuration as specified in 9.2.4; - // Note: this is done by the MAC Reset procedure + rrc_ptr->phy_ctrl->set_phy_to_default_dedicated(); // 1> apply the default semi-persistent scheduling configuration as specified in 9.2.3; // N.A.