Commit 6658eb28 authored by Robert Schmidt's avatar Robert Schmidt

Simplify nr_clear_ra_proc()

parent 3289189a
...@@ -1281,7 +1281,7 @@ static void nr_generate_Msg2(module_id_t module_idP, ...@@ -1281,7 +1281,7 @@ static void nr_generate_Msg2(module_id_t module_idP,
if (CCEIndex < 0) { if (CCEIndex < 0) {
LOG_E(NR_MAC, "cannot find free CCE for Msg2 of RA RNTI 0x%04x!\n", ra->rnti); 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; return;
} }
...@@ -1986,7 +1986,7 @@ static void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, s ...@@ -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 // 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_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) { if (sched_ctrl->retrans_dl_harq.head >= 0) {
remove_nr_list(&sched_ctrl->retrans_dl_harq, current_harq_pid); 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 ...@@ -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 */ /* we assume that this function is mutex-protected from outside */
NR_SCHED_ENSURE_LOCKED(&RC.nrmac[module_idP]->sched_lock); NR_SCHED_ENSURE_LOCKED(&RC.nrmac[0]->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);
ra->ra_state = nrRA_gNB_IDLE; ra->ra_state = nrRA_gNB_IDLE;
ra->timing_offset = 0; ra->timing_offset = 0;
ra->RRC_timer = 20;
ra->msg3_round = 0; ra->msg3_round = 0;
if(ra->cfra == false) { if(ra->cfra == false) {
ra->rnti = 0; ra->rnti = 0;
...@@ -2151,7 +2149,7 @@ void nr_schedule_RA(module_id_t module_idP, ...@@ -2151,7 +2149,7 @@ void nr_schedule_RA(module_id_t module_idP,
if (ra->contention_resolution_timer < 0) { 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); 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_mac_release_ue(mac, ra->rnti);
nr_clear_ra_proc(module_idP, CC_id, frameP, ra); nr_clear_ra_proc(ra);
continue; continue;
} }
} }
......
...@@ -717,7 +717,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -717,7 +717,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
if (no_sig) { if (no_sig) {
LOG_D(NR_MAC, "Random Access %i failed at state %s (no signal)\n", i, nrra_text[ra->ra_state]); 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; continue;
} }
...@@ -732,7 +732,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -732,7 +732,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
nrra_text[ra->ra_state], nrra_text[ra->ra_state],
ra->rnti, ra->rnti,
current_rnti); current_rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); nr_clear_ra_proc(ra);
} }
continue; continue;
...@@ -747,7 +747,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -747,7 +747,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
ra->rnti, ra->rnti,
current_rnti); current_rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); nr_clear_ra_proc(ra);
return; return;
} }
...@@ -778,7 +778,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -778,7 +778,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
nr_mac_reset_ul_failure(UE_scheduling_control); nr_mac_reset_ul_failure(UE_scheduling_control);
reset_dl_harq_list(UE_scheduling_control); reset_dl_harq_list(UE_scheduling_control);
reset_ul_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); process_CellGroup(ra->CellGroup, UE);
} else { } else {
...@@ -809,7 +809,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -809,7 +809,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP,
// solution may be implemented // 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); 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); 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; return;
} }
...@@ -859,13 +859,13 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -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 // for CFRA (NSA) do not schedule retransmission of msg3
if (ra->cfra) { 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]); 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; return;
} }
if (ra->msg3_round >= gNB_mac->ul_bler.harq_round_max - 1) { 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]); 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; return;
} }
......
...@@ -115,7 +115,7 @@ void nr_schedule_RA(module_id_t module_idP, ...@@ -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, 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); 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); int nr_allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t slotP, int test_only);
......
...@@ -612,7 +612,7 @@ void ue_context_modification_refuse(const f1ap_ue_context_modif_refuse_t *refuse ...@@ -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++) { for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) {
NR_RA_t *ra = &cc->ra[i]; NR_RA_t *ra = &cc->ra[i];
if (ra->rnti == UE->rnti) 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); NR_SCHED_UNLOCK(&mac->sched_lock);
......
...@@ -188,8 +188,6 @@ typedef struct { ...@@ -188,8 +188,6 @@ typedef struct {
uint8_t cont_res_id[6]; uint8_t cont_res_id[6];
/// Timing offset indicated by PHY /// Timing offset indicated by PHY
int16_t timing_offset; int16_t timing_offset;
/// Timeout for RRC connection
int16_t RRC_timer;
/// Msg3 first RB /// Msg3 first RB
int msg3_first_rb; int msg3_first_rb;
/// Msg3 number of RB /// Msg3 number of RB
......
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