Commit 5c3c374c authored by Robert Schmidt's avatar Robert Schmidt

Add implementation to trigger BWP switch from external source

parent 805c968b
......@@ -1065,6 +1065,24 @@ bool nr_update_sib19(const gnb_sat_position_update_t *sat_position)
return true;
}
bool nr_trigger_bwp_switch(uint16_t rnti, int bwp_id)
{
gNB_MAC_INST *nrmac = RC.nrmac[0];
NR_SCHED_LOCK(&nrmac->sched_lock);
NR_UE_info_t *UE = find_nr_UE(&nrmac->UE_info, rnti);
bool success = false;
if (!UE) {
LOG_W(NR_MAC, "could not find UE for RNTI %04x\n", rnti);
} else if (UE->current_DL_BWP.bwp_id == bwp_id) {
LOG_W(NR_MAC, "UE %04x is already on BWP ID %d, not triggering reconfiguration\n", rnti, bwp_id);
} else { // UE != NULL && current_DL_BWP.bwp_id != bwp_id
nr_mac_trigger_reconfiguration(nrmac, UE, bwp_id);
success = true;
}
NR_SCHED_UNLOCK(&nrmac->sched_lock);
return success;
}
void prepare_du_configuration_update(gNB_MAC_INST *mac,
f1ap_served_cell_info_t *info,
NR_BCCH_BCH_Message_t *mib,
......
......@@ -43,4 +43,6 @@ typedef struct gnb_sat_position_update_s {
bool nr_update_sib19(const gnb_sat_position_update_t *sat_position);
bool nr_trigger_bwp_switch(uint16_t rnti, int bwp_id);
#endif /*__LAYER2_NR_MAC_CONFIG_H__*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment