From cbf84897072c18c79be59b38e2e83c60f80f6653 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Mon, 15 Jul 2024 13:34:13 +0100 Subject: [PATCH] Switch to BWP where RA is configured when Msg3 contains MAC CE for C-RNTI Switch to BWP where RA is configured, typically in the InitialBWP At this point, MAC CE for C-RNTI received at gNB, UE already switched and triggered RA in that BWP, need to do BWP switching also at gNB for that C-RNTI --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 1048be2528..b60be4bd88 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -899,6 +899,22 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, reset_dl_harq_list(&UE->UE_sched_ctrl); reset_ul_harq_list(&UE->UE_sched_ctrl); + // Switch to BWP where RA is configured, typically in the InitialBWP + // At this point, UE already switched and triggered RA in that BWP, need to do BWP switching also at gNB for C-RNTI + if ((ra->DL_BWP.bwp_id != UE->current_DL_BWP.bwp_id) || (ra->UL_BWP.bwp_id != UE->current_UL_BWP.bwp_id)) { + LOG_I(NR_MAC, + "BWP switching at gNB from BWP id %ld to BWP id %ld due to RA configuration\n", + UE->current_DL_BWP.bwp_id, + ra->DL_BWP.bwp_id); + configure_UE_BWP(RC.nrmac[gnb_mod_idP], + RC.nrmac[gnb_mod_idP]->common_channels[CC_idP].ServingCellConfigCommon, + &UE->UE_sched_ctrl, + NULL, + UE, + ra->DL_BWP.bwp_id, + ra->UL_BWP.bwp_id); + } + if (UE->reconfigCellGroup) { // Nothing to do // A RRCReconfiguration message should be already pending (for example, an ongoing RRCReestablishment), and it will be