From 4838cd2f5e292467cbcdeb9eb8d2291b1f27a72a Mon Sep 17 00:00:00 2001 From: Francisco Date: Thu, 15 Apr 2021 13:28:19 +0100 Subject: [PATCH] implement cell measurement bandwidth feature --- lib/include/srsran/common/lte_common.h | 24 +++++++++++++++++++ .../interfaces/enb_rrc_interface_types.h | 2 ++ srsenb/rr.conf.example | 4 +++- srsenb/src/enb_cfg_parser.cc | 4 ++++ srsenb/src/stack/rrc/ue_meas_cfg.cc | 13 +++++----- 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/lib/include/srsran/common/lte_common.h b/lib/include/srsran/common/lte_common.h index 315e3e10c..788c2b1da 100644 --- a/lib/include/srsran/common/lte_common.h +++ b/lib/include/srsran/common/lte_common.h @@ -20,6 +20,30 @@ namespace srsran { // Cell nof PRBs const std::array lte_cell_nof_prbs = {6, 15, 25, 50, 75, 100}; +inline uint32_t lte_cell_nof_prb_to_index(uint32_t nof_prb) +{ + switch (nof_prb) { + case 6: + return 0; + case 15: + return 1; + case 25: + return 2; + case 50: + return 3; + case 75: + return 4; + case 100: + return 5; + default: + break; + } + return -1; +} +inline bool is_lte_cell_nof_prb(uint32_t nof_prb) +{ + return lte_cell_nof_prb_to_index(nof_prb) < lte_cell_nof_prbs.size(); +} // Radio Bearers enum class lte_srb { srb0, srb1, srb2, count }; diff --git a/lib/include/srsran/interfaces/enb_rrc_interface_types.h b/lib/include/srsran/interfaces/enb_rrc_interface_types.h index d14f00785..e90017768 100644 --- a/lib/include/srsran/interfaces/enb_rrc_interface_types.h +++ b/lib/include/srsran/interfaces/enb_rrc_interface_types.h @@ -32,6 +32,7 @@ struct meas_cell_cfg_t { uint16_t pci; uint32_t eci; float q_offset; + uint32_t allowed_meas_bw; bool direct_forward_path_available; }; @@ -41,6 +42,7 @@ struct rrc_meas_cfg_t { std::vector meas_reports; asn1::rrc::quant_cfg_eutra_s quant_cfg; uint32_t meas_gap_period; + uint32_t allowed_meas_bw; }; // Cell/Sector configuration diff --git a/srsenb/rr.conf.example b/srsenb/rr.conf.example index af1eed69a..77362484e 100644 --- a/srsenb/rr.conf.example +++ b/srsenb/rr.conf.example @@ -61,7 +61,8 @@ cell_list = dl_earfcn = 3350; //ul_earfcn = 21400; ho_active = false; - //meas_gap_period = 0; + //meas_gap_period = 0; // 0 (inactive), 40 or 80 + //allowed_meas_bw = 6; // CA cells scell_list = ( @@ -76,6 +77,7 @@ cell_list = dl_earfcn = 2850; pci = 2; //direct_forward_path_available = false; + //allowed_meas_bw = 6; } ); diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 06aba9fbe..94af5ffb8 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -681,6 +681,8 @@ static int parse_meas_cell_list(rrc_meas_cfg_t* meas_cfg, Setting& root) cell.eci = (unsigned int)root[i]["eci"]; cell.q_offset = 0; // LIBLTE_RRC_Q_OFFSET_RANGE_DB_0; // TODO parse_default_field(cell.direct_forward_path_available, root[i], "direct_forward_path_available", false); + parse_default_field(cell.allowed_meas_bw, root[i], "allowed_meas_bw", 6u); + srsran_assert(srsran::is_lte_cell_nof_prb(cell.allowed_meas_bw), "Invalid measurement Bandwidth"); } return 0; } @@ -749,6 +751,8 @@ static int parse_cell_list(all_args_t* args, rrc_cfg_t* rrc_cfg, Setting& root) parse_default_field(cell_cfg.meas_cfg.meas_gap_period, cellroot, "meas_gap_period", 0u); HANDLEPARSERCODE(parse_default_field(cell_cfg.target_ul_sinr_db, cellroot, "target_ul_sinr", -1)); HANDLEPARSERCODE(parse_default_field(cell_cfg.enable_phr_handling, cellroot, "enable_phr_handling", false)); + parse_default_field(cell_cfg.meas_cfg.allowed_meas_bw, cellroot, "allowed_meas_bw", 6u); + srsran_assert(srsran::is_lte_cell_nof_prb(cell_cfg.meas_cfg.allowed_meas_bw), "Invalid measurement Bandwidth"); if (cellroot.exists("ho_active") and cellroot["ho_active"]) { HANDLEPARSERCODE(parse_meas_cell_list(&cell_cfg.meas_cfg, cellroot["meas_cell_list"])); diff --git a/srsenb/src/stack/rrc/ue_meas_cfg.cc b/srsenb/src/stack/rrc/ue_meas_cfg.cc index d3cbfb4e7..6f0518d2c 100644 --- a/srsenb/src/stack/rrc/ue_meas_cfg.cc +++ b/srsenb/src/stack/rrc/ue_meas_cfg.cc @@ -59,7 +59,7 @@ std::pair find_cell(meas_obj_to_add_mod_list_l } /// Add EARFCN to the MeasObjToAddModList -std::pair add_meas_obj(meas_obj_list& list, uint32_t dl_earfcn) +std::pair add_meas_obj(meas_obj_list& list, uint32_t dl_earfcn, uint32_t allowed_meas_bw) { meas_obj_t* obj = find_meas_obj(list, dl_earfcn); if (obj != nullptr) { @@ -70,9 +70,9 @@ std::pair add_meas_obj(meas_obj_list& list, uint32_t dl_earfc new_obj.meas_obj_id = srsran::find_rrc_obj_id_gap(list); asn1::rrc::meas_obj_eutra_s& eutra = new_obj.meas_obj.set_meas_obj_eutra(); eutra.carrier_freq = dl_earfcn; - eutra.allowed_meas_bw.value = asn1::rrc::allowed_meas_bw_e::mbw6; // TODO: What value to add here? - eutra.neigh_cell_cfg.from_number(1); // No MBSFN subframes present in neighbors - eutra.offset_freq_present = false; // no offset + asn1::number_to_enum(eutra.allowed_meas_bw, allowed_meas_bw); + eutra.neigh_cell_cfg.from_number(1); // No MBSFN subframes present in neighbors + eutra.offset_freq_present = false; // no offset obj = srsran::add_rrc_obj(list, new_obj); return {true, obj}; } @@ -109,7 +109,7 @@ std::tuple add_cell_enb_cfg(meas_obj_lis } } else { // no measobj has been found with same earfcn, create a new one - auto ret2 = add_meas_obj(meas_obj_list, cellcfg.earfcn); + auto ret2 = add_meas_obj(meas_obj_list, cellcfg.earfcn, cellcfg.allowed_meas_bw); ret.first = ret2.second; new_cell.cell_idx = 1; @@ -330,7 +330,8 @@ bool fill_meascfg_enb_cfg(meas_cfg_s& meascfg, const ue_cell_ded_list& ue_cell_l return cc1->get_dl_earfcn() < cc2->get_dl_earfcn(); }); for (auto* cc : sorted_ue_cells) { - add_meas_obj(meascfg.meas_obj_to_add_mod_list, cc->get_dl_earfcn()); + add_meas_obj( + meascfg.meas_obj_to_add_mod_list, cc->get_dl_earfcn(), cc->cell_common->cell_cfg.meas_cfg.allowed_meas_bw); } // Inserts all cells in meas_cell_list that are not PCell or SCells