|
|
@ -170,7 +170,7 @@ const ue_cell_ded* ue_cell_ded_list::find_cell(uint32_t earfcn, uint32_t pci) co
|
|
|
|
return it == cell_list.end() ? nullptr : &(*it);
|
|
|
|
return it == cell_list.end() ? nullptr : &(*it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ue_cell_ded* ue_cell_ded_list::add_cell(uint32_t enb_cc_idx)
|
|
|
|
ue_cell_ded* ue_cell_ded_list::add_cell(uint32_t enb_cc_idx, bool init_pucch)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const enb_cell_common* cell_common = common_list.get_cc_idx(enb_cc_idx);
|
|
|
|
const enb_cell_common* cell_common = common_list.get_cc_idx(enb_cc_idx);
|
|
|
|
if (cell_common == nullptr) {
|
|
|
|
if (cell_common == nullptr) {
|
|
|
@ -193,9 +193,11 @@ ue_cell_ded* ue_cell_ded_list::add_cell(uint32_t enb_cc_idx)
|
|
|
|
cell_list.emplace_back(cell_list.size(), *cell_common);
|
|
|
|
cell_list.emplace_back(cell_list.size(), *cell_common);
|
|
|
|
|
|
|
|
|
|
|
|
// Allocate CQI, SR, and PUCCH CS resources. If failure, do not add new cell
|
|
|
|
// Allocate CQI, SR, and PUCCH CS resources. If failure, do not add new cell
|
|
|
|
if (not alloc_cell_resources(ue_cc_idx)) {
|
|
|
|
if (init_pucch) {
|
|
|
|
rem_last_cell();
|
|
|
|
if (not alloc_cell_resources(ue_cc_idx)) {
|
|
|
|
return nullptr;
|
|
|
|
rem_last_cell();
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return &cell_list.back();
|
|
|
|
return &cell_list.back();
|
|
|
@ -216,6 +218,17 @@ bool ue_cell_ded_list::rem_last_cell()
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool ue_cell_ded_list::init_pucch_pcell()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (not alloc_cell_resources(UE_PCELL_CC_IDX)) {
|
|
|
|
|
|
|
|
dealloc_sr_resources();
|
|
|
|
|
|
|
|
dealloc_pucch_cs_resources();
|
|
|
|
|
|
|
|
dealloc_cqi_resources(UE_PCELL_CC_IDX);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool ue_cell_ded_list::alloc_cell_resources(uint32_t ue_cc_idx)
|
|
|
|
bool ue_cell_ded_list::alloc_cell_resources(uint32_t ue_cc_idx)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const uint32_t meas_gap_duration = 6;
|
|
|
|
const uint32_t meas_gap_duration = 6;
|
|
|
@ -265,7 +278,7 @@ bool ue_cell_ded_list::alloc_cell_resources(uint32_t ue_cc_idx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (not alloc_cqi_resources(ue_cc_idx, cfg.cqi_cfg.period)) {
|
|
|
|
if (not alloc_cqi_resources(ue_cc_idx, cfg.cqi_cfg.period)) {
|
|
|
|
logger.error("Failed to allocate CQIresources for cell ue_cc_idx=%d", ue_cc_idx);
|
|
|
|
logger.error("Failed to allocate CQI resources for cell ue_cc_idx=%d", ue_cc_idx);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|