From 8d37fde91fe808e8379343b6d2b75ec918e0bc94 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 19 Mar 2024 16:38:47 +0100 Subject: [PATCH] Refactor: store Msg.1 parameters in RA process - the preamble is needed to detect when we are outside of the RA window, so store it - store the rest of Msg1 variables together in struct --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 1 + openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 84d5bd2619..e5bca56fde 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -699,6 +699,7 @@ void nr_initiate_ra_proc(module_id_t module_idP, } ra->ra_state = nrRA_Msg2; + ra->preamble_frame = frameP; ra->preamble_slot = slotP; ra->preamble_index = preamble_index; ra->timing_offset = timing_offset; diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 479dd9dffe..e162ecbff5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -164,8 +164,14 @@ typedef struct { RA_gNB_state_t ra_state; /// CORESET0 configured flag int coreset0_configured; + /// Frame where preamble was received + int preamble_frame; /// Slot where preamble was received uint8_t preamble_slot; + /// Received preamble_index + uint8_t preamble_index; + /// Timing offset indicated by PHY + int16_t timing_offset; /// Subframe where Msg2 is to be sent uint8_t Msg2_slot; /// Frame where Msg2 is to be sent @@ -182,12 +188,8 @@ typedef struct { rnti_t rnti; /// RA RNTI allocated from received PRACH uint16_t RA_rnti; - /// Received preamble_index - uint8_t preamble_index; /// Received UE Contention Resolution Identifier uint8_t cont_res_id[6]; - /// Timing offset indicated by PHY - int16_t timing_offset; /// Msg3 first RB int msg3_first_rb; /// Msg3 number of RB