diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 98d241388e..1b68465968 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -1281,7 +1281,7 @@ static void nr_generate_Msg2(module_id_t module_idP, if (CCEIndex < 0) { LOG_E(NR_MAC, "cannot find free CCE for Msg2 of RA RNTI 0x%04x!\n", ra->rnti); - nr_clear_ra_proc(module_idP, CC_id, frameP, ra); + nr_clear_ra_proc(ra); return; } @@ -1986,7 +1986,7 @@ static void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, s // UE->apply_cellgroup was already set when processing RRCReestablishment message nr_mac_enable_ue_rrc_processing_timer(RC.nrmac[module_id], UE, UE->apply_cellgroup); - nr_clear_ra_proc(module_id, CC_id, frame, ra); + nr_clear_ra_proc(ra); if (sched_ctrl->retrans_dl_harq.head >= 0) { remove_nr_list(&sched_ctrl->retrans_dl_harq, current_harq_pid); } @@ -1997,14 +1997,12 @@ static void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, s } } -void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t *ra) +void nr_clear_ra_proc(NR_RA_t *ra) { /* we assume that this function is mutex-protected from outside */ - NR_SCHED_ENSURE_LOCKED(&RC.nrmac[module_idP]->sched_lock); - LOG_D(NR_MAC,"[gNB %d][RAPROC] CC_id %d Frame %d Clear Random access information rnti %x\n", module_idP, CC_id, frameP, ra->rnti); + NR_SCHED_ENSURE_LOCKED(&RC.nrmac[0]->sched_lock); ra->ra_state = nrRA_gNB_IDLE; ra->timing_offset = 0; - ra->RRC_timer = 20; ra->msg3_round = 0; if(ra->cfra == false) { ra->rnti = 0; @@ -2151,7 +2149,7 @@ void nr_schedule_RA(module_id_t module_idP, if (ra->contention_resolution_timer < 0) { LOG_W(NR_MAC, "(%d.%d) RA Contention Resolution timer expired for UE 0x%04x, RA procedure failed...\n", frameP, slotP, ra->rnti); nr_mac_release_ue(mac, ra->rnti); - nr_clear_ra_proc(module_idP, CC_id, frameP, ra); + nr_clear_ra_proc(ra); continue; } } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 7ed78885ed..ada64a4189 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -717,7 +717,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, if (no_sig) { LOG_D(NR_MAC, "Random Access %i failed at state %s (no signal)\n", i, nrra_text[ra->ra_state]); - nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + nr_clear_ra_proc(ra); continue; } @@ -732,7 +732,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, nrra_text[ra->ra_state], ra->rnti, current_rnti); - nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + nr_clear_ra_proc(ra); } continue; @@ -747,7 +747,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ra->rnti, current_rnti); - nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + nr_clear_ra_proc(ra); return; } @@ -778,7 +778,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, nr_mac_reset_ul_failure(UE_scheduling_control); reset_dl_harq_list(UE_scheduling_control); reset_ul_harq_list(UE_scheduling_control); - nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + nr_clear_ra_proc(ra); process_CellGroup(ra->CellGroup, UE); } else { @@ -809,7 +809,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, // solution may be implemented LOG_W(NR_MAC, "No UE found with C-RNTI %04x, ignoring Msg3 to have UE come back with new RA attempt\n", ra->rnti); mac_remove_nr_ue(RC.nrmac[gnb_mod_idP], ra->rnti); - nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + nr_clear_ra_proc(ra); return; } @@ -859,13 +859,13 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, // for CFRA (NSA) do not schedule retransmission of msg3 if (ra->cfra) { LOG_D(NR_MAC, "Random Access %i failed at state %s (NSA msg3 reception failed)\n", i, nrra_text[ra->ra_state]); - nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + nr_clear_ra_proc(ra); return; } if (ra->msg3_round >= gNB_mac->ul_bler.harq_round_max - 1) { LOG_W(NR_MAC, "Random Access %i failed at state %s (Reached msg3 max harq rounds)\n", i, nrra_text[ra->ra_state]); - nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); + nr_clear_ra_proc(ra); return; } diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 6e38f491f6..d156663bc9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -115,7 +115,7 @@ void nr_schedule_RA(module_id_t module_idP, void nr_initiate_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, uint16_t preamble_index, uint8_t freq_index, uint8_t symbol, int16_t timing_offset); -void nr_clear_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, NR_RA_t *ra); +void nr_clear_ra_proc(NR_RA_t *ra); int nr_allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t slotP, int test_only); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index 6f4c832802..f0d5b7ce18 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -612,7 +612,7 @@ void ue_context_modification_refuse(const f1ap_ue_context_modif_refuse_t *refuse for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) { NR_RA_t *ra = &cc->ra[i]; if (ra->rnti == UE->rnti) - nr_clear_ra_proc(0, CC_id, 0 /* frame */, ra); + nr_clear_ra_proc(ra); } NR_SCHED_UNLOCK(&mac->sched_lock); diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 17c5134bcd..479dd9dffe 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -188,8 +188,6 @@ typedef struct { uint8_t cont_res_id[6]; /// Timing offset indicated by PHY int16_t timing_offset; - /// Timeout for RRC connection - int16_t RRC_timer; /// Msg3 first RB int msg3_first_rb; /// Msg3 number of RB