Merge remote-tracking branch 'origin/BWP_with_no_RA' into integration_2025_w40 (!3609)

BWP with no PRACH occasions

This MR includes fixes at gNB and UE in case the current BWP has no PRACH
occasions, i.e. we need to switch to initial BWP.
This commit is contained in:
Jaroslava Fiedlerova
2025-09-29 12:55:30 +02:00
2 changed files with 19 additions and 13 deletions
+4 -4
View File
@@ -879,23 +879,23 @@ bool init_RA(NR_UE_MAC_INST_t *mac, int frame)
// set POWER_OFFSET_2STEP_RA to 0 dB
prach_resources->power_offset_2step = 0;
const NR_UE_UL_BWP_t *current_UL_BWP = mac->current_UL_BWP;
// perform the BWP operation as specified in clause 5.15
// if PRACH occasions are not configured for the active UL BWP
if (!current_UL_BWP->rach_ConfigCommon) {
if (!mac->current_UL_BWP->rach_ConfigCommon) {
// switch the active UL BWP to BWP indicated by initialUplinkBWP
current_UL_BWP = get_ul_bwp_structure(mac, 0, false);
mac->current_UL_BWP = get_ul_bwp_structure(mac, 0, false);
// if the Serving Cell is an SpCell
// switch the active DL BWP to BWP indicated by initialDownlinkBWP
mac->current_DL_BWP = get_dl_bwp_structure(mac, 0, false);
} else {
// if the active DL BWP does not have the same bwp-Id as the active UL BWP
if (current_UL_BWP->bwp_id != mac->current_DL_BWP->bwp_id) {
if (mac->current_UL_BWP->bwp_id != mac->current_DL_BWP->bwp_id) {
// switch the active DL BWP to the DL BWP with the same bwp-Id as the active UL BWP
mac->current_DL_BWP = get_dl_bwp_structure(mac, 0, false);
}
}
const NR_UE_UL_BWP_t *current_UL_BWP = mac->current_UL_BWP;
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = current_UL_BWP->rach_ConfigCommon;
AssertFatal(nr_rach_ConfigCommon, "rach-ConfigCommon should be configured here\n");
// stop the bwp-InactivityTimer associated with the active DL BWP of this Serving Cell, if running
@@ -2718,8 +2718,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
AssertFatal(dl_bwp_switch == ul_bwp_switch, "Different UL and DL BWP not supported\n");
DL_BWP->bwp_id = dl_bwp_switch;
UL_BWP->bwp_id = ul_bwp_switch;
}
else {
} else {
// (re)configuring BWP
// TODO BWP switching not via RRC reconfiguration
// via RRC if firstActiveXlinkBWP_Id is NULL, MAC stays on the same BWP as before
@@ -2768,8 +2767,7 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
UL_BWP->pusch_Config = ubwpd->pusch_Config->choice.setup;
UL_BWP->pucch_Config = ubwpd->pucch_Config->choice.setup;
UL_BWP->srs_Config = ubwpd->srs_Config->choice.setup;
}
else {
} else {
DL_BWP->bwp_id = 0;
UL_BWP->bwp_id = 0;
DL_BWP->pdsch_Config = NULL;
@@ -2778,11 +2776,6 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
UL_BWP->configuredGrantConfig = NULL;
}
if (old_dl_bwp_id != DL_BWP->bwp_id)
LOG_I(NR_MAC, "Switching to DL-BWP %li\n", DL_BWP->bwp_id);
if (old_ul_bwp_id != UL_BWP->bwp_id)
LOG_I(NR_MAC, "Switching to UL-BWP %li\n", UL_BWP->bwp_id);
// TDA lists
if (DL_BWP->bwp_id>0)
DL_BWP->tdaList_Common = dl_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
@@ -2832,6 +2825,19 @@ void configure_UE_BWP(gNB_MAC_INST *nr_mac,
UL_BWP->rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
}
// if PRACH occasions are not configured for the active UL BWP
// switch the active UL BWP to BWP indicated by initialUplinkBWP
// as described in 5.15 of 38.321
if (is_RA && !UL_BWP->rach_ConfigCommon) {
LOG_I(NR_MAC, "Cannot perform RA in current BWP, switching to initial BWP\n");
configure_UE_BWP(nr_mac, scc, UE, is_RA, target_ss, 0, 0);
return;
}
if (old_dl_bwp_id != DL_BWP->bwp_id)
LOG_I(NR_MAC, "Switching to DL-BWP %li\n", DL_BWP->bwp_id);
if (old_ul_bwp_id != UL_BWP->bwp_id)
LOG_I(NR_MAC, "Switching to UL-BWP %li\n", UL_BWP->bwp_id);
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
// Reset required fields in sched_ctrl (e.g. ul_ri and tpmi)
reset_sched_ctrl(sched_ctrl);