updated code for crnti update during handover and reset of the mac

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent 45cd893e21
commit b8339031f6

@ -257,20 +257,19 @@ int mac::ue_rem(uint16_t rnti)
// Called after Msg3
int mac::ue_set_crnti(uint16_t temp_crnti, uint16_t crnti, sched_interface::ue_cfg_t* cfg)
{
int ret = ue_cfg(crnti, cfg);
if (ret != SRSLTE_SUCCESS) {
return ret;
}
srslte::rwlock_read_guard lock(rwlock);
if (temp_crnti == crnti) {
if (temp_crnti != crnti) {
// if RNTI is maintained, Msg3 contained a RRC Setup Request
scheduler.dl_mac_buffer_state(crnti, (uint32_t)srslte::dl_sch_lcid::CON_RES_ID);
} else {
// C-RNTI corresponds to older user. Handover scenario.
phy_h->rem_rnti(crnti);
phy_h->add_rnti(crnti, cfg->supported_cc_list[0].enb_cc_idx, false);
scheduler.dl_mac_buffer_state(crnti, (uint32_t)srslte::dl_sch_lcid::CON_RES_ID);
ue_db[crnti]->reset();
}
int ret = ue_cfg(crnti, cfg);
if (ret != SRSLTE_SUCCESS) {
return ret;
}
scheduler.dl_mac_buffer_state(crnti, (uint32_t)srslte::dl_sch_lcid::CON_RES_ID);
return ret;
}

@ -107,6 +107,15 @@ void ue::reset()
srslte_softbuffer_tx_reset(&buffer);
}
}
for (auto& cc_buffers : pending_buffers) {
for (auto& harq_buffer : cc_buffers) {
if (harq_buffer) {
pdus.deallocate(harq_buffer);
harq_buffer = nullptr;
}
}
}
}
/**

Loading…
Cancel
Save