From ecd941e9466edac9379dcf3d974c5763437690d9 Mon Sep 17 00:00:00 2001 From: rmagueta Date: Wed, 5 Jun 2024 08:11:56 +0200 Subject: [PATCH] Remove old RA process(es) when removing UE In handover, we might need to remove a UE that we knew under it's C-RNTI, for which we also have the RA process. Hence, when removing a UE by RNTI, remove it also from RA. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 0b09bb78a9..7ac6d28fb8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2675,6 +2675,16 @@ void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti) memcpy(UE_info->list, newUEs, sizeof(UE_info->list)); NR_SCHED_UNLOCK(&UE_info->mutex); + const int CC_id = 0; + NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id]; + 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(ra); + ra->cfra = 0; + } + } + delete_nr_ue_data(UE, nr_mac->common_channels, &UE_info->uid_allocator); }