added code to handle fail to alloc ue cqi and sr

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent 2d39c7261c
commit 439193e4b0

@ -239,6 +239,10 @@ private:
int get_cqi(uint16_t* pmi_idx, uint16_t* n_pucch, uint32_t ue_cc_idx);
int get_ri(uint32_t m_ri, uint16_t* ri_idx);
int get_n_pucch_cs(uint16_t* N_pucch_cs);
bool is_allocated() const
{
return cqi_allocated and sr_allocated and (parent->cfg.cell_list.size() <= 1 or n_pucch_cs_alloc);
}
bool select_security_algorithms();
void send_dl_ccch(asn1::rrc::dl_ccch_msg_s* dl_ccch_msg);

@ -173,10 +173,15 @@ void rrc::add_user(uint16_t rnti, const sched_interface::ue_cfg_t& sched_ue_cfg)
{
auto user_it = users.find(rnti);
if (user_it == users.end()) {
users.insert(std::make_pair(rnti, std::unique_ptr<ue>(new ue{this, rnti, sched_ue_cfg})));
auto p = users.insert(std::make_pair(rnti, std::unique_ptr<ue>(new ue{this, rnti, sched_ue_cfg})));
if (p.second and p.first->second->is_allocated()) {
rlc->add_user(rnti);
pdcp->add_user(rnti);
rrc_log->info("Added new user rnti=0x%x\n", rnti);
} else {
mac->bearer_ue_rem(rnti, 0);
rrc_log->error("Adding user rnti=0x%x - Fail to allocate user resources\n", rnti);
}
} else {
rrc_log->error("Adding user rnti=0x%x (already exists)\n", rnti);
}
@ -1029,8 +1034,15 @@ rrc::ue::ue(rrc* outer_rrc, uint16_t rnti_, const sched_interface::ue_cfg_t& sch
apply_setup_phy_common(parent->cfg.sibs[1].sib2().rr_cfg_common);
// Allocate PUCCH resources
cqi_allocate(parent->cfg.cqi_cfg.period, 0);
sr_allocate(parent->cfg.cqi_cfg.period);
if (cqi_allocate(parent->cfg.cqi_cfg.period, UE_PCELL_CC_IDX) != SRSLTE_SUCCESS) {
return;
}
if (sr_allocate(parent->cfg.cqi_cfg.period) != SRSLTE_SUCCESS) {
return;
}
if (parent->cfg.cell_list.size() > 1) {
n_pucch_cs_allocate();
}
}
rrc::ue::~ue()

Loading…
Cancel
Save