From 7949b622bec0391b8439d51edb5acb607e6c55c3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 20 Feb 2024 16:21:06 +0100 Subject: [PATCH] RACH.indication: don't check time window Since commit defc97ec16 ("Msg2 and Msg3 at gNB: check allocation before committing to Msg2"), the scheduler calculate Msg2/Msg3 frame/slot before allocation of Msg2, and not when receiving Msg1. It also respects the RA response window correctly. Correspondingly, we don't need to calculate here if the RACH.indication is within the time window. The scheduler will do this. --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 46 ++++++++++-------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 6e6b204d20..ca8d32be75 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -73,34 +73,26 @@ static void handle_nr_rach(NR_UL_IND_t *UL_info) return; } if (UL_info->rach_ind.number_of_pdus) { - int frame_diff = UL_info->frame - UL_info->rach_ind.sfn; - if (frame_diff < 0) { - frame_diff += 1024; - } - bool in_timewindow = frame_diff == 0 || (frame_diff == 1 && UL_info->slot < 7); - - if (in_timewindow) { - LOG_D(MAC, - "UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", - UL_info->frame, - UL_info->slot, - UL_info->rach_ind.sfn, - UL_info->rach_ind.slot); - for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) { - nfapi_nr_prach_indication_pdu_t *rach = UL_info->rach_ind.pdu_list + i; - if (rach->num_preamble > 1) { - LOG_E(MAC, "Not more than 1 preamble per RACH PDU supported, ignoring the rest\n"); - } - nr_initiate_ra_proc(UL_info->module_id, - UL_info->CC_id, - UL_info->rach_ind.sfn, - UL_info->rach_ind.slot, - rach->preamble_list[0].preamble_index, - rach->freq_index, - rach->symbol_index, - rach->preamble_list[0].timing_advance, - rach->preamble_list[0].preamble_pwr); + LOG_D(MAC, + "UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", + UL_info->frame, + UL_info->slot, + UL_info->rach_ind.sfn, + UL_info->rach_ind.slot); + for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) { + nfapi_nr_prach_indication_pdu_t *rach = UL_info->rach_ind.pdu_list + i; + if (rach->num_preamble > 1) { + LOG_E(MAC, "Not more than 1 preamble per RACH PDU supported, ignoring the rest\n"); } + nr_initiate_ra_proc(UL_info->module_id, + UL_info->CC_id, + UL_info->rach_ind.sfn, + UL_info->rach_ind.slot, + rach->preamble_list[0].preamble_index, + rach->freq_index, + rach->symbol_index, + rach->preamble_list[0].timing_advance, + rach->preamble_list[0].preamble_pwr); } } }