addition of cells provided in cell_meas_list of rr.conf to cellsToAddModList in the rrc reconfiguration message

master
Francisco Paisana 4 years ago
parent 0842ed9db1
commit f1bdf33d10

@ -62,6 +62,7 @@ struct cell_info_common {
asn1::rrc::sib_type2_s sib2;
const cell_cfg_t& cell_cfg;
std::vector<srslte::unique_byte_buffer_t> sib_buffer; ///< Packed SIBs for given CC
std::vector<const cell_info_common*> scells;
cell_info_common(uint32_t idx_, const cell_cfg_t& cfg) : enb_cc_idx(idx_), cell_cfg(cfg) {}
};
@ -85,7 +86,7 @@ private:
// Helper methods
std::vector<const cell_info_common*> get_cfg_intraenb_scells(const cell_info_common_list& list,
uint32_t pcell_enb_cc_idx);
std::vector<uint32_t> get_cfg_intraenb_measobj_earfcns(const cell_info_common_list& list, uint32_t pcell_enb_cc_idx);
std::vector<uint32_t> get_measobj_earfcns(const cell_info_common& pcell);
/** Class used to store all the resources specific to a UE's cell */
struct cell_ctxt_dedicated {

@ -68,7 +68,7 @@ public:
std::string to_string() const;
static var_meas_cfg_t make(const asn1::rrc::meas_cfg_s& meas_cfg);
static var_meas_cfg_t make(const std::vector<uint32_t>& active_earfcns, const rrc_cfg_t& cfg);
static var_meas_cfg_t make(const rrc_cfg_t& cfg, const cell_info_common& pcell);
private:
asn1::rrc::var_meas_cfg_s var_meas;
@ -104,9 +104,9 @@ public:
private:
// helper methods
bool update_ue_var_meas_cfg(uint32_t src_earfcn,
std::vector<uint32_t> target_earfcns,
asn1::rrc::meas_cfg_s* diff_meas_cfg);
bool update_ue_var_meas_cfg(uint32_t src_earfcn,
const cell_info_common& target_pcell,
asn1::rrc::meas_cfg_s* diff_meas_cfg);
// Handover from source cell
bool start_ho_preparation(uint32_t target_eci, uint8_t measobj_id, bool fwd_direct_path_available);

@ -52,29 +52,44 @@ cell_info_common_list::cell_info_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_)
// Store the SIB cfg of each carrier
for (uint32_t ccidx = 0; ccidx < cfg.cell_list.size(); ++ccidx) {
cell_list.emplace_back(std::unique_ptr<cell_info_common>{new cell_info_common{ccidx, cfg.cell_list[ccidx]}});
cell_info_common* cell_ctxt = cell_list.back().get();
cell_info_common* new_cell = cell_list.back().get();
// Set Cell MIB
asn1::number_to_enum(cell_ctxt->mib.dl_bw, cfg.cell.nof_prb);
cell_ctxt->mib.phich_cfg.phich_res.value = (phich_cfg_s::phich_res_opts::options)cfg.cell.phich_resources;
cell_ctxt->mib.phich_cfg.phich_dur.value = (phich_cfg_s::phich_dur_opts::options)cfg.cell.phich_length;
asn1::number_to_enum(new_cell->mib.dl_bw, cfg.cell.nof_prb);
new_cell->mib.phich_cfg.phich_res.value = (phich_cfg_s::phich_res_opts::options)cfg.cell.phich_resources;
new_cell->mib.phich_cfg.phich_dur.value = (phich_cfg_s::phich_dur_opts::options)cfg.cell.phich_length;
// Set Cell SIB1
cell_ctxt->sib1 = cfg.sib1;
new_cell->sib1 = cfg.sib1;
// Update cellId
sib_type1_s::cell_access_related_info_s_* cell_access = &cell_ctxt->sib1.cell_access_related_info;
cell_access->cell_id.from_number((cfg.enb_id << 8u) + cell_ctxt->cell_cfg.cell_id);
cell_access->tac.from_number(cell_ctxt->cell_cfg.tac);
sib_type1_s::cell_access_related_info_s_* cell_access = &new_cell->sib1.cell_access_related_info;
cell_access->cell_id.from_number((cfg.enb_id << 8u) + new_cell->cell_cfg.cell_id);
cell_access->tac.from_number(new_cell->cell_cfg.tac);
// Update DL EARFCN
cell_ctxt->sib1.freq_band_ind = (uint8_t)srslte_band_get_band(cell_ctxt->cell_cfg.dl_earfcn);
new_cell->sib1.freq_band_ind = (uint8_t)srslte_band_get_band(new_cell->cell_cfg.dl_earfcn);
// Set Cell SIB2
// update PRACH root seq index for this cell
cell_ctxt->sib2 = cfg.sibs[1].sib2();
cell_ctxt->sib2.rr_cfg_common.prach_cfg.root_seq_idx = cell_ctxt->cell_cfg.root_seq_idx;
new_cell->sib2 = cfg.sibs[1].sib2();
new_cell->sib2.rr_cfg_common.prach_cfg.root_seq_idx = new_cell->cell_cfg.root_seq_idx;
// update carrier freq
if (cell_ctxt->sib2.freq_info.ul_carrier_freq_present) {
cell_ctxt->sib2.freq_info.ul_carrier_freq = cell_ctxt->cell_cfg.ul_earfcn;
if (new_cell->sib2.freq_info.ul_carrier_freq_present) {
new_cell->sib2.freq_info.ul_carrier_freq = new_cell->cell_cfg.ul_earfcn;
}
}
// Once all Cells are added to the list, fill the scell list of each cell for convenient access
for (uint32_t i = 0; i < cell_list.size(); ++i) {
auto& c = cell_list[i];
c->scells.resize(cfg.cell_list[i].scell_list.size());
for (uint32_t j = 0; j < c->scells.size(); ++j) {
uint32_t cell_id = cfg.cell_list[i].scell_list[j].cell_id;
auto it = std::find_if(cell_list.begin(), cell_list.end(), [cell_id](const std::unique_ptr<cell_info_common>& e) {
return e->cell_cfg.cell_id == cell_id;
});
if (it != cell_list.end()) {
c->scells[j] = it->get();
}
}
}
}
@ -107,19 +122,15 @@ std::vector<const cell_info_common*> get_cfg_intraenb_scells(const cell_info_com
return cells;
}
std::vector<uint32_t> get_cfg_intraenb_measobj_earfcns(const cell_info_common_list& list, uint32_t pcell_enb_cc_idx)
std::vector<uint32_t> get_measobj_earfcns(const cell_info_common& pcell)
{
std::vector<const cell_info_common*> scells = get_cfg_intraenb_scells(list, pcell_enb_cc_idx);
const cell_info_common* pcell = list.get_cc_idx(pcell_enb_cc_idx);
std::vector<uint32_t> earfcns{};
earfcns.reserve(1 + scells.size() + pcell->cell_cfg.meas_cfg.meas_cells.size());
earfcns.push_back(pcell->cell_cfg.dl_earfcn);
for (auto& scell : scells) {
// Make a list made of EARFCNs of the PCell and respective SCells (according to conf file)
std::vector<uint32_t> earfcns{};
earfcns.reserve(1 + pcell.scells.size());
earfcns.push_back(pcell.cell_cfg.dl_earfcn);
for (auto& scell : pcell.scells) {
earfcns.push_back(scell->cell_cfg.dl_earfcn);
}
for (auto meas_cell : pcell->cell_cfg.meas_cfg.meas_cells) {
earfcns.push_back(meas_cell.earfcn);
}
// sort by earfcn
std::sort(earfcns.begin(), earfcns.end());
// remove duplicates

@ -237,9 +237,11 @@ var_meas_cfg_t::add_cell_cfg(const meas_cell_cfg_t& cellcfg)
inserted_flag = false;
}
} else {
auto& eutra_obj = ret.first->meas_obj.meas_obj_eutra();
// pci not found. create new cell
new_cell.cell_idx = srslte::find_rrc_obj_id_gap(ret.first->meas_obj.meas_obj_eutra().cells_to_add_mod_list);
ret.second = srslte::add_rrc_obj(ret.first->meas_obj.meas_obj_eutra().cells_to_add_mod_list, new_cell);
new_cell.cell_idx = srslte::find_rrc_obj_id_gap(eutra_obj.cells_to_add_mod_list);
ret.second = srslte::add_rrc_obj(eutra_obj.cells_to_add_mod_list, new_cell);
eutra_obj.cells_to_add_mod_list_present = true;
}
} else {
// no measobj has been found with same earfcn, create a new one
@ -453,8 +455,11 @@ var_meas_cfg_t var_meas_cfg_t::make(const asn1::rrc::meas_cfg_s& meas_cfg)
return var;
}
var_meas_cfg_t var_meas_cfg_t::make(const std::vector<uint32_t>& active_earfcns, const rrc_cfg_t& cfg)
var_meas_cfg_t var_meas_cfg_t::make(const rrc_cfg_t& cfg, const cell_info_common& pcell)
{
// The measConfig contains measObjs for the PCell DL-EARFCN and activated UE carriers
auto active_earfcns = get_measobj_earfcns(pcell);
var_meas_cfg_t var_meas;
if (not cfg.meas_cfg_present) {
return var_meas;
@ -466,9 +471,9 @@ var_meas_cfg_t var_meas_cfg_t::make(const std::vector<uint32_t>& active_earfcns,
}
for (const auto& cell_cfg : cfg.cell_list) {
// inserts all neighbor cells
// inserts all neighbor cells and pcell, if q_offset > 0
for (const meas_cell_cfg_t& meascell : cell_cfg.meas_cfg.meas_cells) {
if (meascell.q_offset > 0) {
if (meascell.pci != pcell.cell_cfg.pci or meascell.earfcn != pcell.cell_cfg.dl_earfcn or meascell.q_offset > 0) {
var_meas.add_cell_cfg(meascell);
}
}
@ -577,8 +582,7 @@ bool rrc::ue::rrc_mobility::fill_conn_recfg_no_ho_cmd(asn1::rrc::rrc_conn_recfg_
// Check if there has been any update in ue_var_meas based on UE current cell list
cell_ctxt_dedicated* pcell = rrc_ue->cell_ded_list.get_ue_cc_idx(UE_PCELL_CC_IDX);
uint32_t src_earfcn = pcell->get_dl_earfcn();
auto target_earfcns = get_cfg_intraenb_measobj_earfcns(*rrc_enb->cell_common_list, pcell->cell_common->enb_cc_idx);
conn_recfg->meas_cfg_present = update_ue_var_meas_cfg(src_earfcn, target_earfcns, &conn_recfg->meas_cfg);
conn_recfg->meas_cfg_present = update_ue_var_meas_cfg(src_earfcn, *pcell->cell_common, &conn_recfg->meas_cfg);
return conn_recfg->meas_cfg_present;
}
@ -803,13 +807,13 @@ bool rrc::ue::rrc_mobility::start_s1_tenb_ho(
return is_in_state<s1_target_ho_st>();
}
bool rrc::ue::rrc_mobility::update_ue_var_meas_cfg(uint32_t src_earfcn,
std::vector<uint32_t> target_earfcns,
asn1::rrc::meas_cfg_s* diff_meas_cfg)
bool rrc::ue::rrc_mobility::update_ue_var_meas_cfg(uint32_t src_earfcn,
const cell_info_common& target_pcell,
asn1::rrc::meas_cfg_s* diff_meas_cfg)
{
// Make UE Target VarMeasCfg based on active cells and parsed Config files
var_meas_cfg_t target_var_meas = var_meas_cfg_t::make(target_earfcns, rrc_enb->cfg);
uint32_t target_earfcn = target_earfcns[0];
var_meas_cfg_t target_var_meas = var_meas_cfg_t::make(rrc_enb->cfg, target_pcell);
uint32_t target_earfcn = target_pcell.cell_cfg.dl_earfcn;
// Apply TS 36.331 5.5.6.1 - If Source and Target eNB EARFCNs do no match, update SourceVarMeasCfg.MeasIdList
if (target_earfcn != src_earfcn) {
@ -933,8 +937,7 @@ void rrc::ue::rrc_mobility::fill_mobility_reconf_common(asn1::rrc::dl_dcch_msg_s
rrc_ue->apply_reconf_phy_config(recfg_r8, false);
// Add MeasConfig of target cell
auto target_earfcns = get_cfg_intraenb_measobj_earfcns(*rrc_enb->cell_common_list, target_cell.enb_cc_idx);
recfg_r8.meas_cfg_present = update_ue_var_meas_cfg(src_dl_earfcn, target_earfcns, &recfg_r8.meas_cfg);
recfg_r8.meas_cfg_present = update_ue_var_meas_cfg(src_dl_earfcn, target_cell, &recfg_r8.meas_cfg);
// Add SCells
if (rrc_ue->fill_scell_to_addmod_list(&recfg_r8) != SRSLTE_SUCCESS) {

@ -240,6 +240,38 @@ int test_correct_meascfg_calculation()
TESTASSERT(result_meascfg.report_cfg_to_add_mod_list[0].report_cfg.report_cfg_eutra() == rep3);
}
{
// TEST: creation of a var_meas_cfg using the srsenb::rrc_cfg_t
rrc_cfg_t cfg;
cfg.enb_id = 0x19B;
cfg.meas_cfg_present = true;
cfg.cell_list.resize(2);
cfg.cell_list[0].dl_earfcn = 2850;
cfg.cell_list[0].cell_id = 0x01;
cfg.cell_list[0].scell_list.resize(1);
cfg.cell_list[0].scell_list[0].cell_id = 0x02;
cfg.cell_list[1].dl_earfcn = 3400;
cfg.cell_list[1].cell_id = 0x02;
cfg.sibs[1].set_sib2();
// TEST: correct construction of list of cells
cell_info_common_list cell_list{cfg};
TESTASSERT(cell_list.nof_cells() == 2);
TESTASSERT(cell_list.get_cc_idx(0)->scells.size() == 1);
TESTASSERT(cell_list.get_cc_idx(0)->scells[0] == cell_list.get_cc_idx(1));
TESTASSERT(cell_list.get_cc_idx(1)->scells.empty());
// measConfig only includes earfcns of active carriers for a given pcell
var_meas_cfg_t var_meas = var_meas_cfg_t::make(cfg, *cell_list.get_cc_idx(0));
TESTASSERT(var_meas.meas_objs().size() == 2);
TESTASSERT(var_meas.meas_objs()[0].meas_obj.meas_obj_eutra().carrier_freq == 2850);
TESTASSERT(var_meas.meas_objs()[1].meas_obj.meas_obj_eutra().carrier_freq == 3400);
var_meas_cfg_t var_meas2 = var_meas_cfg_t::make(cfg, *cell_list.get_cc_idx(1));
TESTASSERT(var_meas2.meas_objs().size() == 1);
TESTASSERT(var_meas2.meas_objs()[0].meas_obj.meas_obj_eutra().carrier_freq == 3400);
}
return SRSLTE_SUCCESS;
}

Loading…
Cancel
Save