diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index ccdc8aca595dd1f53656ef0600d1aa6c8f2b5977..376baa908dd4d041156b64994c34e978415b50f4 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) { - - 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); - } + 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); + + 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 fdd6fb95445ad8c99b4b381e0e73341ca21b607d..fa4a29754f7fa55971bd76654e5cca2c35740f11 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; }