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

@ -234,11 +234,15 @@ private:
void notify_s1ap_ue_erab_setup_response(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e); void notify_s1ap_ue_erab_setup_response(const asn1::s1ap::erab_to_be_setup_list_bearer_su_req_l& e);
// Getters for PUCCH resources // Getters for PUCCH resources
int allocate_scell_pucch(uint32_t cc_idx); int allocate_scell_pucch(uint32_t cc_idx);
int get_sr(uint8_t* I_sr, uint16_t* N_pucch_sr); int get_sr(uint8_t* I_sr, uint16_t* N_pucch_sr);
int get_cqi(uint16_t* pmi_idx, uint16_t* n_pucch, uint32_t ue_cc_idx); 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_ri(uint32_t m_ri, uint16_t* ri_idx);
int get_n_pucch_cs(uint16_t* N_pucch_cs); 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(); bool select_security_algorithms();
void send_dl_ccch(asn1::rrc::dl_ccch_msg_s* dl_ccch_msg); 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); auto user_it = users.find(rnti);
if (user_it == users.end()) { 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})));
rlc->add_user(rnti); if (p.second and p.first->second->is_allocated()) {
pdcp->add_user(rnti); rlc->add_user(rnti);
rrc_log->info("Added new user rnti=0x%x\n", 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 { } else {
rrc_log->error("Adding user rnti=0x%x (already exists)\n", rnti); 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); apply_setup_phy_common(parent->cfg.sibs[1].sib2().rr_cfg_common);
// Allocate PUCCH resources // Allocate PUCCH resources
cqi_allocate(parent->cfg.cqi_cfg.period, 0); if (cqi_allocate(parent->cfg.cqi_cfg.period, UE_PCELL_CC_IDX) != SRSLTE_SUCCESS) {
sr_allocate(parent->cfg.cqi_cfg.period); 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() rrc::ue::~ue()

Loading…
Cancel
Save