From 8a37a2dadb53c7db3990ffc16970550b565b7d36 Mon Sep 17 00:00:00 2001 From: luis_pereira87 Date: Thu, 17 Nov 2022 15:42:56 +0000 Subject: [PATCH] Send RRCReconfiguration when RA with Msg3 through DCCH also when the UE is in the InitialBWP This commit re-enables SRS when Msg3 through DCCH in InitialBWP that seems to be disabled after the RA (the same behaviour for other configurations may happen, so it is safer to send always the RRCReconfiguration when we have this RA). --- .../NR_MAC_gNB/gNB_scheduler_primitives.c | 33 ++++++++----------- openair2/RRC/NR/rrc_gNB.c | 4 +-- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index ccdc8aca59..376baa908d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2280,9 +2280,13 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac, // 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; + } else { + sched_ctrl->next_dl_bwp_id = 0; } if (servingCellConfig->uplinkConfig->firstActiveUplinkBWP_Id) { sched_ctrl->next_ul_bwp_id = *servingCellConfig->uplinkConfig->firstActiveUplinkBWP_Id; + } else { + sched_ctrl->next_ul_bwp_id = 0; } } else { @@ -3041,26 +3045,17 @@ void schedule_nr_bwp_switch(module_id_t module_id, NR_UE_DL_BWP_t *dl_bwp = &UE->current_DL_BWP; NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; if (sched_ctrl->rrc_processing_timer == 0 && UE->Msg4_ACKed && sched_ctrl->next_dl_bwp_id >= 0) { + LOG_W(NR_MAC, + "%4d.%2d UE %04x Scheduling BWP switch from DL_BWP %ld to %ld and from UL_BWP %ld to %ld\n", + frame, + slot, + UE->rnti, + dl_bwp->bwp_id, + sched_ctrl->next_dl_bwp_id, + ul_bwp->bwp_id, + sched_ctrl->next_ul_bwp_id); - int schedule_bwp_switching = false; - if (dl_bwp->bwp_id == 0) { - // Switching from Initial BWP to Dedicated BWP - if (sched_ctrl->next_dl_bwp_id > 0 && sched_ctrl->next_ul_bwp_id > 0) { - schedule_bwp_switching = true; - LOG_W(NR_MAC,"%4d.%2d UE %04x Schedule BWP switch from Initial DL BWP to %ld and from Initial UL BWP to %ld\n", - frame, slot, UE->rnti, sched_ctrl->next_dl_bwp_id, sched_ctrl->next_ul_bwp_id); - } - } else if (dl_bwp->bwp_id != sched_ctrl->next_dl_bwp_id && ul_bwp->bwp_id != sched_ctrl->next_ul_bwp_id) { - // Switching between Dedicated BWPs - schedule_bwp_switching = true; - LOG_W(NR_MAC,"%4d.%2d UE %04x Schedule BWP switch from dl_bwp_id %ld to %ld and from ul_bwp_id %ld to %ld\n", - frame, slot, UE->rnti, dl_bwp->bwp_id, sched_ctrl->next_dl_bwp_id, ul_bwp->bwp_id, sched_ctrl->next_ul_bwp_id); - } - - if (schedule_bwp_switching) { - AssertFatal(sched_ctrl->next_dl_bwp_id > 0 && sched_ctrl->next_ul_bwp_id > 0, "BWP switching from a Dedicated BWP to the Initial BWP not handled yet!"); - nr_mac_rrc_bwp_switch_req(module_id, frame, slot, UE->rnti, sched_ctrl->next_dl_bwp_id, sched_ctrl->next_ul_bwp_id); - } + nr_mac_rrc_bwp_switch_req(module_id, frame, slot, UE->rnti, sched_ctrl->next_dl_bwp_id, sched_ctrl->next_ul_bwp_id); } } } diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index fdd6fb9544..fa4a29754f 100755 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -1787,11 +1787,11 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id); NR_CellGroupConfig_t *masterCellGroup = ue_context_pP->ue_context.masterCellGroup; - if (dl_bwp_id >= 0) { + if (dl_bwp_id > 0) { *masterCellGroup->spCellConfig->spCellConfigDedicated->firstActiveDownlinkBWP_Id = dl_bwp_id; *masterCellGroup->spCellConfig->spCellConfigDedicated->defaultDownlinkBWP_Id = dl_bwp_id; } - if (ul_bwp_id >= 0) { + if (ul_bwp_id > 0) { *masterCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->firstActiveUplinkBWP_Id = ul_bwp_id; }