From 81d44c64228a7bf04b33f73b3628225ef90db016 Mon Sep 17 00:00:00 2001 From: Roberto Louro Magueta Date: Mon, 24 Oct 2022 20:20:43 +0100 Subject: [PATCH] Stop timer T304 when RA is succeeded --- openair2/LAYER2/NR_MAC_UE/mac_proto.h | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/RRC/NR_UE/L2_interface_ue.c | 10 ++++++++++ openair2/RRC/NR_UE/rrc_proto.h | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h index 6015fe27bc..9776003e3f 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h @@ -371,7 +371,7 @@ void nr_ue_contention_resolution(module_id_t module_id, int cc_id, frame_t frame void nr_ra_failed(uint8_t mod_id, uint8_t CC_id, NR_PRACH_RESOURCES_t *prach_resources, frame_t frame, int slot); -void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot); +void nr_ra_succeeded(const module_id_t mod_id, const uint8_t gNB_index, const frame_t frame, const int slot); void nr_get_RA_window(NR_UE_MAC_INST_t *mac); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 80d0db469d..af1faf19eb 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3257,7 +3257,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, } if ( (ra->RA_active == 1) && ra_success) { - nr_ra_succeeded(module_idP, frameP, slot); + nr_ra_succeeded(module_idP, gNB_index, frameP, slot); } else if (!ra_success){ // TODO: Handle failure of RA procedure @ MAC layer // nr_ra_failed(module_idP, CC_id, prach_resources, frameP, slot); // prach_resources is a PHY structure diff --git a/openair2/RRC/NR_UE/L2_interface_ue.c b/openair2/RRC/NR_UE/L2_interface_ue.c index c67069e975..f3997fcdbe 100644 --- a/openair2/RRC/NR_UE/L2_interface_ue.c +++ b/openair2/RRC/NR_UE/L2_interface_ue.c @@ -185,3 +185,13 @@ rrc_data_req_nr_ue( return true; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway. } + +int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index) +{ + if (NR_UE_rrc_inst[mod_id].Info[gNB_index].T304_active == 1) { + LOG_W(NR_RRC, "T304 was stoped with value %i\n", NR_UE_rrc_inst[mod_id].Info[gNB_index].T304_cnt); + NR_UE_rrc_inst[mod_id].Info[gNB_index].T304_active = 0; + NR_UE_rrc_inst[mod_id].Info[gNB_index].T304_cnt = 0; + } + return 0; +} \ No newline at end of file diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 510fbff230..48b8510de5 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -156,6 +156,8 @@ rrc_data_req_nr_ue( const pdcp_transmission_mode_t modeP ); +int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index); + /**\brief RRC UE task. \param void *args_p Pointer on arguments to start the task. */ void *rrc_nrue_task(void *args_p);