|
|
|
@ -25,34 +25,18 @@ using namespace asn1::rrc;
|
|
|
|
|
|
|
|
|
|
namespace srsenb {
|
|
|
|
|
|
|
|
|
|
freq_res_common_list::freq_res_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_)
|
|
|
|
|
{
|
|
|
|
|
for (const auto& c : cfg.cell_list) {
|
|
|
|
|
auto it = pucch_res_list.find(c.dl_earfcn);
|
|
|
|
|
if (it == pucch_res_list.end()) {
|
|
|
|
|
pucch_res_list[c.dl_earfcn] = {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/********************************
|
|
|
|
|
* eNB cell common context
|
|
|
|
|
*******************************/
|
|
|
|
|
|
|
|
|
|
cell_res_common* freq_res_common_list::get_earfcn(uint32_t earfcn)
|
|
|
|
|
{
|
|
|
|
|
auto it = pucch_res_list.find(earfcn);
|
|
|
|
|
return (it == pucch_res_list.end()) ? nullptr : &(it->second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************
|
|
|
|
|
* cell ctxt common
|
|
|
|
|
************************/
|
|
|
|
|
|
|
|
|
|
cell_info_common_list::cell_info_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_)
|
|
|
|
|
enb_cell_common_list::enb_cell_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_)
|
|
|
|
|
{
|
|
|
|
|
cell_list.reserve(cfg.cell_list.size());
|
|
|
|
|
|
|
|
|
|
// 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* new_cell = cell_list.back().get();
|
|
|
|
|
cell_list.emplace_back(std::unique_ptr<enb_cell_common>{new enb_cell_common{ccidx, cfg.cell_list[ccidx]}});
|
|
|
|
|
enb_cell_common* new_cell = cell_list.back().get();
|
|
|
|
|
|
|
|
|
|
// Set Cell MIB
|
|
|
|
|
asn1::number_to_enum(new_cell->mib.dl_bw, cfg.cell.nof_prb);
|
|
|
|
@ -84,7 +68,7 @@ cell_info_common_list::cell_info_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_)
|
|
|
|
|
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) {
|
|
|
|
|
auto it = std::find_if(cell_list.begin(), cell_list.end(), [cell_id](const std::unique_ptr<enb_cell_common>& e) {
|
|
|
|
|
return e->cell_cfg.cell_id == cell_id;
|
|
|
|
|
});
|
|
|
|
|
if (it != cell_list.end()) {
|
|
|
|
@ -94,27 +78,26 @@ cell_info_common_list::cell_info_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cell_info_common* cell_info_common_list::get_cell_id(uint32_t cell_id) const
|
|
|
|
|
const enb_cell_common* enb_cell_common_list::get_cell_id(uint32_t cell_id) const
|
|
|
|
|
{
|
|
|
|
|
auto it = std::find_if(cell_list.begin(), cell_list.end(), [cell_id](const std::unique_ptr<cell_info_common>& c) {
|
|
|
|
|
auto it = std::find_if(cell_list.begin(), cell_list.end(), [cell_id](const std::unique_ptr<enb_cell_common>& c) {
|
|
|
|
|
return c->cell_cfg.cell_id == cell_id;
|
|
|
|
|
});
|
|
|
|
|
return it == cell_list.end() ? nullptr : it->get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cell_info_common* cell_info_common_list::get_pci(uint32_t pci) const
|
|
|
|
|
const enb_cell_common* enb_cell_common_list::get_pci(uint32_t pci) const
|
|
|
|
|
{
|
|
|
|
|
auto it = std::find_if(cell_list.begin(), cell_list.end(), [pci](const std::unique_ptr<cell_info_common>& c) {
|
|
|
|
|
auto it = std::find_if(cell_list.begin(), cell_list.end(), [pci](const std::unique_ptr<enb_cell_common>& c) {
|
|
|
|
|
return c->cell_cfg.pci == pci;
|
|
|
|
|
});
|
|
|
|
|
return it == cell_list.end() ? nullptr : it->get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<const cell_info_common*> get_cfg_intraenb_scells(const cell_info_common_list& list,
|
|
|
|
|
uint32_t pcell_enb_cc_idx)
|
|
|
|
|
std::vector<const enb_cell_common*> get_cfg_intraenb_scells(const enb_cell_common_list& list, uint32_t pcell_enb_cc_idx)
|
|
|
|
|
{
|
|
|
|
|
const cell_info_common* pcell = list.get_cc_idx(pcell_enb_cc_idx);
|
|
|
|
|
std::vector<const cell_info_common*> cells(pcell->cell_cfg.scell_list.size());
|
|
|
|
|
const enb_cell_common* pcell = list.get_cc_idx(pcell_enb_cc_idx);
|
|
|
|
|
std::vector<const enb_cell_common*> cells(pcell->cell_cfg.scell_list.size());
|
|
|
|
|
for (uint32_t i = 0; i < pcell->cell_cfg.scell_list.size(); ++i) {
|
|
|
|
|
uint32_t cell_id = pcell->cell_cfg.scell_list[i].cell_id;
|
|
|
|
|
cells[i] = list.get_cell_id(cell_id);
|
|
|
|
@ -122,7 +105,7 @@ std::vector<const cell_info_common*> get_cfg_intraenb_scells(const cell_info_com
|
|
|
|
|
return cells;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<uint32_t> get_measobj_earfcns(const cell_info_common& pcell)
|
|
|
|
|
std::vector<uint32_t> get_measobj_earfcns(const enb_cell_common& pcell)
|
|
|
|
|
{
|
|
|
|
|
// Make a list made of EARFCNs of the PCell and respective SCells (according to conf file)
|
|
|
|
|
std::vector<uint32_t> earfcns{};
|
|
|
|
@ -138,64 +121,84 @@ std::vector<uint32_t> get_measobj_earfcns(const cell_info_common& pcell)
|
|
|
|
|
return earfcns;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************
|
|
|
|
|
* eNB cell resources
|
|
|
|
|
************************/
|
|
|
|
|
|
|
|
|
|
freq_res_common_list::freq_res_common_list(const rrc_cfg_t& cfg_) : cfg(cfg_)
|
|
|
|
|
{
|
|
|
|
|
for (const auto& c : cfg.cell_list) {
|
|
|
|
|
auto it = pucch_res_list.find(c.dl_earfcn);
|
|
|
|
|
if (it == pucch_res_list.end()) {
|
|
|
|
|
pucch_res_list[c.dl_earfcn] = {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cell_res_common* freq_res_common_list::get_earfcn(uint32_t earfcn)
|
|
|
|
|
{
|
|
|
|
|
auto it = pucch_res_list.find(earfcn);
|
|
|
|
|
return (it == pucch_res_list.end()) ? nullptr : &(it->second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************
|
|
|
|
|
* cell ctxt dedicated
|
|
|
|
|
************************/
|
|
|
|
|
|
|
|
|
|
cell_ctxt_dedicated_list::cell_ctxt_dedicated_list(const rrc_cfg_t& cfg_,
|
|
|
|
|
freq_res_common_list& cell_res_list_,
|
|
|
|
|
const cell_info_common_list& enb_common_list) :
|
|
|
|
|
ue_cell_ded_list::ue_cell_ded_list(const rrc_cfg_t& cfg_,
|
|
|
|
|
freq_res_common_list& cell_res_list_,
|
|
|
|
|
const enb_cell_common_list& enb_common_list) :
|
|
|
|
|
cfg(cfg_), cell_res_list(cell_res_list_), common_list(enb_common_list)
|
|
|
|
|
{
|
|
|
|
|
cell_ded_list.reserve(common_list.nof_cells());
|
|
|
|
|
cell_list.reserve(common_list.nof_cells());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cell_ctxt_dedicated_list::~cell_ctxt_dedicated_list()
|
|
|
|
|
ue_cell_ded_list::~ue_cell_ded_list()
|
|
|
|
|
{
|
|
|
|
|
for (auto& c : cell_ded_list) {
|
|
|
|
|
for (auto& c : cell_list) {
|
|
|
|
|
dealloc_cqi_resources(c.ue_cc_idx);
|
|
|
|
|
}
|
|
|
|
|
dealloc_sr_resources();
|
|
|
|
|
dealloc_pucch_cs_resources();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cell_ctxt_dedicated* cell_ctxt_dedicated_list::get_enb_cc_idx(uint32_t enb_cc_idx)
|
|
|
|
|
ue_cell_ded* ue_cell_ded_list::get_enb_cc_idx(uint32_t enb_cc_idx)
|
|
|
|
|
{
|
|
|
|
|
auto it = std::find_if(cell_ded_list.begin(), cell_ded_list.end(), [enb_cc_idx](const cell_ctxt_dedicated& c) {
|
|
|
|
|
auto it = std::find_if(cell_list.begin(), cell_list.end(), [enb_cc_idx](const ue_cell_ded& c) {
|
|
|
|
|
return c.cell_common->enb_cc_idx == enb_cc_idx;
|
|
|
|
|
});
|
|
|
|
|
return it == cell_ded_list.end() ? nullptr : &(*it);
|
|
|
|
|
return it == cell_list.end() ? nullptr : &(*it);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cell_ctxt_dedicated* cell_ctxt_dedicated_list::find_cell(uint32_t earfcn, uint32_t pci) const
|
|
|
|
|
const ue_cell_ded* ue_cell_ded_list::find_cell(uint32_t earfcn, uint32_t pci) const
|
|
|
|
|
{
|
|
|
|
|
auto it = std::find_if(cell_ded_list.begin(), cell_ded_list.end(), [earfcn, pci](const cell_ctxt_dedicated& c) {
|
|
|
|
|
auto it = std::find_if(cell_list.begin(), cell_list.end(), [earfcn, pci](const ue_cell_ded& c) {
|
|
|
|
|
return c.get_pci() == pci and c.get_dl_earfcn() == earfcn;
|
|
|
|
|
});
|
|
|
|
|
return it == cell_ded_list.end() ? nullptr : &(*it);
|
|
|
|
|
return it == cell_list.end() ? nullptr : &(*it);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cell_ctxt_dedicated* cell_ctxt_dedicated_list::add_cell(uint32_t enb_cc_idx)
|
|
|
|
|
ue_cell_ded* ue_cell_ded_list::add_cell(uint32_t enb_cc_idx)
|
|
|
|
|
{
|
|
|
|
|
const cell_info_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) {
|
|
|
|
|
log_h->error("cell with enb_cc_idx=%d does not exist.\n", enb_cc_idx);
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
cell_ctxt_dedicated* ret = get_enb_cc_idx(enb_cc_idx);
|
|
|
|
|
ue_cell_ded* ret = get_enb_cc_idx(enb_cc_idx);
|
|
|
|
|
if (ret != nullptr) {
|
|
|
|
|
log_h->error("UE already registered cell %d\n", enb_cc_idx);
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t ue_cc_idx = cell_ded_list.size();
|
|
|
|
|
uint32_t ue_cc_idx = cell_list.size();
|
|
|
|
|
|
|
|
|
|
if (ue_cc_idx == UE_PCELL_CC_IDX) {
|
|
|
|
|
// Fetch PUCCH resources if it's pcell
|
|
|
|
|
pucch_res = cell_res_list.get_earfcn(cell_common->cell_cfg.dl_earfcn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cell_ded_list.emplace_back(cell_ded_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
|
|
|
|
|
if (not alloc_cell_resources(ue_cc_idx)) {
|
|
|
|
@ -203,25 +206,25 @@ cell_ctxt_dedicated* cell_ctxt_dedicated_list::add_cell(uint32_t enb_cc_idx)
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &cell_ded_list.back();
|
|
|
|
|
return &cell_list.back();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::rem_last_cell()
|
|
|
|
|
bool ue_cell_ded_list::rem_last_cell()
|
|
|
|
|
{
|
|
|
|
|
if (cell_ded_list.empty()) {
|
|
|
|
|
if (cell_list.empty()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
uint32_t ue_cc_idx = cell_ded_list.size() - 1;
|
|
|
|
|
uint32_t ue_cc_idx = cell_list.size() - 1;
|
|
|
|
|
if (ue_cc_idx == UE_PCELL_CC_IDX) {
|
|
|
|
|
dealloc_sr_resources();
|
|
|
|
|
dealloc_pucch_cs_resources();
|
|
|
|
|
}
|
|
|
|
|
dealloc_cqi_resources(ue_cc_idx);
|
|
|
|
|
cell_ded_list.pop_back();
|
|
|
|
|
cell_list.pop_back();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::alloc_cell_resources(uint32_t ue_cc_idx)
|
|
|
|
|
bool ue_cell_ded_list::alloc_cell_resources(uint32_t ue_cc_idx)
|
|
|
|
|
{
|
|
|
|
|
// Allocate CQI, SR, and PUCCH CS resources. If failure, do not add new cell
|
|
|
|
|
if (ue_cc_idx == UE_PCELL_CC_IDX) {
|
|
|
|
@ -237,9 +240,9 @@ bool cell_ctxt_dedicated_list::alloc_cell_resources(uint32_t ue_cc_idx)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cell_ctxt_dedicated* cell = get_ue_cc_idx(UE_PCELL_CC_IDX);
|
|
|
|
|
cell->meas_gap_period = cell->cell_common->cell_cfg.meas_cfg.meas_gap_period;
|
|
|
|
|
cell->meas_gap_offset = pucch_res->next_measgap_offset;
|
|
|
|
|
ue_cell_ded* cell = get_ue_cc_idx(UE_PCELL_CC_IDX);
|
|
|
|
|
cell->meas_gap_period = cell->cell_common->cell_cfg.meas_cfg.meas_gap_period;
|
|
|
|
|
cell->meas_gap_offset = pucch_res->next_measgap_offset;
|
|
|
|
|
pucch_res->next_measgap_offset += 6;
|
|
|
|
|
}
|
|
|
|
|
if (not alloc_cqi_resources(ue_cc_idx, cfg.cqi_cfg.period)) {
|
|
|
|
@ -255,13 +258,13 @@ bool cell_ctxt_dedicated_list::alloc_cell_resources(uint32_t ue_cc_idx)
|
|
|
|
|
* @param enb_cc_idxs list of cells supported by the UE
|
|
|
|
|
* @return true if all cells were allocated
|
|
|
|
|
*/
|
|
|
|
|
bool cell_ctxt_dedicated_list::set_cells(const std::vector<uint32_t>& enb_cc_idxs)
|
|
|
|
|
bool ue_cell_ded_list::set_cells(const std::vector<uint32_t>& enb_cc_idxs)
|
|
|
|
|
{
|
|
|
|
|
// Remove extra previously allocked cells
|
|
|
|
|
while (enb_cc_idxs.size() < cell_ded_list.size()) {
|
|
|
|
|
while (enb_cc_idxs.size() < cell_list.size()) {
|
|
|
|
|
rem_last_cell();
|
|
|
|
|
}
|
|
|
|
|
if (cell_ded_list.empty()) {
|
|
|
|
|
if (cell_list.empty()) {
|
|
|
|
|
// There were no previous cells allocated. Just add new ones
|
|
|
|
|
for (auto& cc_idx : enb_cc_idxs) {
|
|
|
|
|
if (not add_cell(cc_idx)) {
|
|
|
|
@ -271,18 +274,18 @@ bool cell_ctxt_dedicated_list::set_cells(const std::vector<uint32_t>& enb_cc_idx
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const cell_info_common* prev_pcell = cell_ded_list[UE_PCELL_CC_IDX].cell_common;
|
|
|
|
|
const cell_info_common* new_pcell = common_list.get_cc_idx(enb_cc_idxs[0]);
|
|
|
|
|
bool pcell_freq_changed = prev_pcell->cell_cfg.dl_earfcn != new_pcell->cell_cfg.dl_earfcn;
|
|
|
|
|
uint32_t prev_pcell_enb_cc_idx = prev_pcell->enb_cc_idx;
|
|
|
|
|
const enb_cell_common* prev_pcell = cell_list[UE_PCELL_CC_IDX].cell_common;
|
|
|
|
|
const enb_cell_common* new_pcell = common_list.get_cc_idx(enb_cc_idxs[0]);
|
|
|
|
|
bool pcell_freq_changed = prev_pcell->cell_cfg.dl_earfcn != new_pcell->cell_cfg.dl_earfcn;
|
|
|
|
|
uint32_t prev_pcell_enb_cc_idx = prev_pcell->enb_cc_idx;
|
|
|
|
|
|
|
|
|
|
if (pcell_freq_changed) {
|
|
|
|
|
// Need to clean all allocated resources if PCell earfcn changes
|
|
|
|
|
while (not cell_ded_list.empty()) {
|
|
|
|
|
while (not cell_list.empty()) {
|
|
|
|
|
rem_last_cell();
|
|
|
|
|
}
|
|
|
|
|
while (cell_ded_list.size() < enb_cc_idxs.size()) {
|
|
|
|
|
if (not add_cell(enb_cc_idxs[cell_ded_list.size()])) {
|
|
|
|
|
while (cell_list.size() < enb_cc_idxs.size()) {
|
|
|
|
|
if (not add_cell(enb_cc_idxs[cell_list.size()])) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -291,39 +294,39 @@ bool cell_ctxt_dedicated_list::set_cells(const std::vector<uint32_t>& enb_cc_idx
|
|
|
|
|
|
|
|
|
|
uint32_t ue_cc_idx = 0;
|
|
|
|
|
for (; ue_cc_idx < enb_cc_idxs.size(); ++ue_cc_idx) {
|
|
|
|
|
uint32_t enb_cc_idx = enb_cc_idxs[ue_cc_idx];
|
|
|
|
|
const cell_info_common* cell_common = common_list.get_cc_idx(enb_cc_idx);
|
|
|
|
|
uint32_t enb_cc_idx = enb_cc_idxs[ue_cc_idx];
|
|
|
|
|
const enb_cell_common* cell_common = common_list.get_cc_idx(enb_cc_idx);
|
|
|
|
|
if (cell_common == nullptr) {
|
|
|
|
|
log_h->error("cell with enb_cc_idx=%d does not exist.\n", enb_cc_idx);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
auto* prev_cell_common = cell_ded_list[ue_cc_idx].cell_common;
|
|
|
|
|
auto* prev_cell_common = cell_list[ue_cc_idx].cell_common;
|
|
|
|
|
if (enb_cc_idx == prev_cell_common->enb_cc_idx) {
|
|
|
|
|
// Same cell. Do not realloc resources
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dealloc_cqi_resources(ue_cc_idx);
|
|
|
|
|
cell_ded_list[ue_cc_idx] = cell_ctxt_dedicated{ue_cc_idx, *cell_common};
|
|
|
|
|
cell_list[ue_cc_idx] = ue_cell_ded{ue_cc_idx, *cell_common};
|
|
|
|
|
if (not alloc_cqi_resources(ue_cc_idx, cfg.cqi_cfg.period)) {
|
|
|
|
|
log_h->error("Failed to allocate CQI resources for cell ue_cc_idx=%d\n", ue_cc_idx);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Remove cells after the last successful insertion
|
|
|
|
|
while (ue_cc_idx < cell_ded_list.size()) {
|
|
|
|
|
while (ue_cc_idx < cell_list.size()) {
|
|
|
|
|
rem_last_cell();
|
|
|
|
|
}
|
|
|
|
|
if (cell_ded_list.empty()) {
|
|
|
|
|
if (cell_list.empty()) {
|
|
|
|
|
// We failed to allocate new PCell. Fallback to old PCell
|
|
|
|
|
add_cell(prev_pcell_enb_cc_idx);
|
|
|
|
|
}
|
|
|
|
|
return ue_cc_idx == enb_cc_idxs.size();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::alloc_cqi_resources(uint32_t ue_cc_idx, uint32_t period)
|
|
|
|
|
bool ue_cell_ded_list::alloc_cqi_resources(uint32_t ue_cc_idx, uint32_t period)
|
|
|
|
|
{
|
|
|
|
|
cell_ctxt_dedicated* cell = get_ue_cc_idx(ue_cc_idx);
|
|
|
|
|
ue_cell_ded* cell = get_ue_cc_idx(ue_cc_idx);
|
|
|
|
|
if (cell == nullptr) {
|
|
|
|
|
log_h->error("The user cell ue_cc_idx=%d has not been allocated\n", ue_cc_idx);
|
|
|
|
|
return false;
|
|
|
|
@ -409,9 +412,9 @@ bool cell_ctxt_dedicated_list::alloc_cqi_resources(uint32_t ue_cc_idx, uint32_t
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::dealloc_cqi_resources(uint32_t ue_cc_idx)
|
|
|
|
|
bool ue_cell_ded_list::dealloc_cqi_resources(uint32_t ue_cc_idx)
|
|
|
|
|
{
|
|
|
|
|
cell_ctxt_dedicated* c = get_ue_cc_idx(ue_cc_idx);
|
|
|
|
|
ue_cell_ded* c = get_ue_cc_idx(ue_cc_idx);
|
|
|
|
|
if (c == nullptr or not c->cqi_res_present) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -427,9 +430,9 @@ bool cell_ctxt_dedicated_list::dealloc_cqi_resources(uint32_t ue_cc_idx)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::alloc_sr_resources(uint32_t period)
|
|
|
|
|
bool ue_cell_ded_list::alloc_sr_resources(uint32_t period)
|
|
|
|
|
{
|
|
|
|
|
cell_ctxt_dedicated* cell = get_ue_cc_idx(UE_PCELL_CC_IDX);
|
|
|
|
|
ue_cell_ded* cell = get_ue_cc_idx(UE_PCELL_CC_IDX);
|
|
|
|
|
if (cell == nullptr) {
|
|
|
|
|
log_h->error("The user cell pcell has not been allocated\n");
|
|
|
|
|
return false;
|
|
|
|
@ -494,7 +497,7 @@ bool cell_ctxt_dedicated_list::alloc_sr_resources(uint32_t period)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::dealloc_sr_resources()
|
|
|
|
|
bool ue_cell_ded_list::dealloc_sr_resources()
|
|
|
|
|
{
|
|
|
|
|
if (sr_res_present) {
|
|
|
|
|
if (pucch_res->sr_sched.nof_users[sr_res.sr_sched_prb_idx][sr_res.sr_sched_sf_idx] > 0) {
|
|
|
|
@ -516,9 +519,9 @@ bool cell_ctxt_dedicated_list::dealloc_sr_resources()
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::alloc_pucch_cs_resources()
|
|
|
|
|
bool ue_cell_ded_list::alloc_pucch_cs_resources()
|
|
|
|
|
{
|
|
|
|
|
cell_ctxt_dedicated* cell = get_ue_cc_idx(UE_PCELL_CC_IDX);
|
|
|
|
|
ue_cell_ded* cell = get_ue_cc_idx(UE_PCELL_CC_IDX);
|
|
|
|
|
if (cell == nullptr) {
|
|
|
|
|
log_h->error("The user cell pcell has not been allocated\n");
|
|
|
|
|
return false;
|
|
|
|
@ -546,7 +549,7 @@ bool cell_ctxt_dedicated_list::alloc_pucch_cs_resources()
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool cell_ctxt_dedicated_list::dealloc_pucch_cs_resources()
|
|
|
|
|
bool ue_cell_ded_list::dealloc_pucch_cs_resources()
|
|
|
|
|
{
|
|
|
|
|
if (n_pucch_cs_present) {
|
|
|
|
|
pucch_res->n_pucch_cs_used[n_pucch_cs_idx] = false;
|
|
|
|
|