diff --git a/lib/include/srslte/asn1/rrc_asn1_utils.h b/lib/include/srslte/asn1/rrc_asn1_utils.h index 5e7f15a06..56e7cc92b 100644 --- a/lib/include/srslte/asn1/rrc_asn1_utils.h +++ b/lib/include/srslte/asn1/rrc_asn1_utils.h @@ -132,7 +132,7 @@ void set_phy_cfg_t_enable_64qam(phy_cfg_t* cfg, const bool enabled); /*************************** * EUTRA UE Capabilities **************************/ -void set_rrc_ue_capabilities_t(rrc_ue_capabilities_t& ue_cap, const asn1::rrc::ue_eutra_cap_s& eutra_cap_s); +rrc_ue_capabilities_t make_rrc_ue_capabilities(const asn1::rrc::ue_eutra_cap_s& eutra_cap_s); // mbms mbms_notif_cfg_t make_mbms_notif_cfg(const asn1::rrc::mbms_notif_cfg_r9_s& asn1_type); diff --git a/lib/include/srslte/interfaces/rrc_interface_types.h b/lib/include/srslte/interfaces/rrc_interface_types.h index 0fc7354a5..bc2b8927a 100644 --- a/lib/include/srslte/interfaces/rrc_interface_types.h +++ b/lib/include/srslte/interfaces/rrc_interface_types.h @@ -348,14 +348,14 @@ inline std::string to_string(const barring_t& b) /** * Flat UE capabilities */ -typedef struct { +struct rrc_ue_capabilities_t { uint8_t release = 8; uint8_t category = 4; uint8_t category_dl = 0; uint8_t category_ul = 0; bool support_dl_256qam = false; bool support_ul_64qam = false; -} rrc_ue_capabilities_t; +}; } // namespace srslte diff --git a/lib/src/asn1/rrc_asn1_utils.cc b/lib/src/asn1/rrc_asn1_utils.cc index 0e1ecc732..4ef512eaf 100644 --- a/lib/src/asn1/rrc_asn1_utils.cc +++ b/lib/src/asn1/rrc_asn1_utils.cc @@ -896,9 +896,11 @@ static void set_rrc_ue_eutra_cap_t_gen(rrc_ue_capabilities_t& ; // Do nothing } -void set_rrc_ue_capabilities_t(rrc_ue_capabilities_t& ue_cap, const asn1::rrc::ue_eutra_cap_s& eutra_cap_s) +rrc_ue_capabilities_t make_rrc_ue_capabilities(const asn1::rrc::ue_eutra_cap_s& eutra_cap_s) { + rrc_ue_capabilities_t ue_cap; set_rrc_ue_eutra_cap_t_gen(ue_cap, eutra_cap_s); + return ue_cap; } // MBMS diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index f61800c3e..703010aa6 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -668,19 +668,20 @@ void rrc::ue::handle_rrc_reconf_complete(rrc_conn_recfg_complete_s* msg, srslte: parent->phy->complete_config(rnti); if (last_rrc_conn_recfg.rrc_transaction_id == msg->rrc_transaction_id) { - // Finally, add secondary carriers to MAC - auto& list = current_sched_ue_cfg.supported_cc_list; - for (const auto& ue_cell : cell_ded_list) { - uint32_t ue_cc_idx = ue_cell.ue_cc_idx; - - if (ue_cc_idx >= list.size()) { - list.resize(ue_cc_idx + 1); + if (cell_ded_list.nof_cells() > 1) { + // Finally, add secondary carriers to MAC + auto& list = current_sched_ue_cfg.supported_cc_list; + for (const auto& ue_cell : cell_ded_list) { + uint32_t ue_cc_idx = ue_cell.ue_cc_idx; + + if (ue_cc_idx >= list.size()) { + list.resize(ue_cc_idx + 1); + } + list[ue_cc_idx].active = true; + list[ue_cc_idx].enb_cc_idx = ue_cell.cell_common->enb_cc_idx; } - list[ue_cc_idx].active = true; - list[ue_cc_idx].enb_cc_idx = ue_cell.cell_common->enb_cc_idx; + parent->mac->ue_cfg(rnti, ¤t_sched_ue_cfg); } - parent->mac->ue_cfg(rnti, ¤t_sched_ue_cfg); - bearer_list.apply_mac_bearer_updates(parent->mac, ¤t_sched_ue_cfg); // Acknowledge Dedicated Configuration @@ -763,7 +764,7 @@ bool rrc::ue::handle_ue_cap_info(ue_cap_info_s* msg) return false; } eutra_capabilities_unpacked = true; - srslte::set_rrc_ue_capabilities_t(ue_capabilities, eutra_capabilities); + ue_capabilities = srslte::make_rrc_ue_capabilities(eutra_capabilities); parent->rrc_log->info("UE rnti: 0x%x category: %d\n", rnti, eutra_capabilities.ue_category); } @@ -1019,14 +1020,18 @@ cell_info_common* rrc::ue::get_ue_cc_cfg(uint32_t ue_cc_idx) //! Method to fill SCellToAddModList for SCell info int rrc::ue::fill_scell_to_addmod_list(asn1::rrc::rrc_conn_recfg_r8_ies_s* conn_reconf) { + if (not eutra_capabilities_unpacked or ue_capabilities.release < 10 or ue_capabilities.category < 5) { + return SRSLTE_SUCCESS; + } + const cell_info_common* pcell_cfg = get_ue_cc_cfg(UE_PCELL_CC_IDX); if (pcell_cfg->cell_cfg.scell_list.empty()) { return SRSLTE_SUCCESS; } // Allocate CQI + PUCCH for SCells. - for (auto scell_idx : pcell_cfg->cell_cfg.scell_list) { - uint32_t cell_id = scell_idx.cell_id; + for (const scell_cfg_t& scell_cfg : pcell_cfg->cell_cfg.scell_list) { + uint32_t cell_id = scell_cfg.cell_id; cell_ded_list.add_cell(parent->cell_common_list->get_cell_id(cell_id)->enb_cc_idx); } if (cell_ded_list.nof_cells() == 1) {