From dbb61821246ed801583274139fda27e67d832b2d Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 20 Oct 2022 12:12:27 +0100 Subject: [PATCH] Fix BWP switching to the previous active BWP when there is a RA with Msg3 through DCCH or DTCH --- .../LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index db4649008c..e5a1c47dc9 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2245,6 +2245,8 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, else { DL_BWP = &UE->current_DL_BWP; UL_BWP = &UE->current_UL_BWP; + sched_ctrl->next_dl_bwp_id = -1; + sched_ctrl->next_ul_bwp_id = -1; CellGroup = UE->CellGroup; } NR_BWP_Downlink_t *dl_bwp = NULL; @@ -2273,6 +2275,14 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, DL_BWP->bwp_id = 0; UL_BWP->bwp_id = 0; UE->Msg3_dcch_dtch = false; + + // Schedule BWP switching to the first active BWP (previous active BWP before RA with Msg3 carrying DCCH or DTCH message) + if (servingCellConfig->firstActiveDownlinkBWP_Id) { + sched_ctrl->next_dl_bwp_id = *servingCellConfig->firstActiveDownlinkBWP_Id; + } + if (servingCellConfig->uplinkConfig->firstActiveUplinkBWP_Id) { + sched_ctrl->next_ul_bwp_id = *servingCellConfig->uplinkConfig->firstActiveUplinkBWP_Id; + } } else { // (re)configuring BWP @@ -2326,7 +2336,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, } else { DL_BWP->bwp_id = 0; - DL_BWP->bwp_id = 0; + UL_BWP->bwp_id = 0; target_ss = NR_SearchSpace__searchSpaceType_PR_common; DL_BWP->pdsch_Config = NULL; UL_BWP->pusch_Config = NULL;