Commit 13bdcb47 authored by luis_pereira87's avatar luis_pereira87

Implementation of a RA timer to remove UE in the case of Msg4 not be decoded by the UE

parent cb3108f4
......@@ -1829,6 +1829,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
nr_clear_ra_proc(module_idP, CC_id, frameP, ra);
UE->Msg3_dcch_dtch = true;
UE->Msg4_ACKed = true;
UE->ra_timer = 0;
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
harq->feedback_slot = -1;
......@@ -1867,6 +1868,7 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram
if (stats->dl.errors == 0) {
LOG_A(NR_MAC, "(UE RNTI 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", ra->rnti);
UE->Msg4_ACKed = true;
UE->ra_timer = 0;
// Pause scheduling according to:
// 3GPP TS 38.331 Section 12 Table 12.1-1: UE performance requirements for RRC procedures for UEs
......
......@@ -2508,6 +2508,8 @@ NR_UE_info_t *add_new_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rntiP, NR_CellGroupConf
"uplinkBWP_ToAddModList has %d BWP!\n",
ul_bwp->n_ul_bwp);
UE->ra_timer = 12000 << UE->current_DL_BWP.scs; // TODO: temporary value, 12000 ms from experimental results
/* get Number of HARQ processes for this UE */
// pdsch_servingcellconfig == NULL in SA -> will create default (8) number of HARQ processes
create_dl_harq_list(sched_ctrl, dl_bwp->pdsch_servingcellconfig);
......@@ -2974,6 +2976,15 @@ void nr_mac_update_timers(module_id_t module_id,
ups);
}
}
// RA timer
if (UE->ra_timer > 0) {
UE->ra_timer--;
if (UE->ra_timer == 0) {
LOG_W(NR_MAC, "Removing UE %04x because RA timer expired\n", UE->rnti);
mac_remove_nr_ue(RC.nrmac[module_id], UE->rnti);
}
}
}
}
......
......@@ -668,6 +668,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if(ra->cfra) {
LOG_A(NR_MAC, "(rnti 0x%04x) CFRA procedure succeeded!\n", ra->rnti);
UE->ra_timer = 0;
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
process_CellGroup(ra->CellGroup, UE_scheduling_control);
......
......@@ -709,6 +709,7 @@ typedef struct {
uint8_t UE_beam_index;
bool Msg3_dcch_dtch;
bool Msg4_ACKed;
uint32_t ra_timer;
/// Sched CSI-RS: scheduling decisions
NR_gNB_UCI_STATS_t uci_statS;
float ul_thr_ue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment