Configure CSI-RS according to beam_id used by UE and reconfigure upon beam change.
No need to call get_config_srs() anymore in update_cellGroupConfig_for_BWP_switch().
This commit is contained in:
committed by
Mario Joa-Ng
parent
a159f1b78a
commit
a77ba75b10
@@ -814,7 +814,8 @@ int main(int argc, char **argv)
|
||||
prepare_sim_uecap(UE_Capability_nr, scc, mu, N_RB_DL, g_mcsTableIdx, 0);
|
||||
rnti_t rnti = 0x1234;
|
||||
int uid = 0;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid);
|
||||
int ssb_index = 0;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid, ssb_index);
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc, frame);
|
||||
|
||||
/* -U option modify DMRS */
|
||||
|
||||
@@ -821,7 +821,8 @@ int main(int argc, char *argv[])
|
||||
prepare_sim_uecap(UE_Capability_nr, scc, mu, N_RB_UL, 0, mcs_table);
|
||||
rnti_t rnti = 0x1234;
|
||||
int uid = 0;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid);
|
||||
int ssb_index = 0;
|
||||
NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, UE_Capability_nr, 0, 1, &conf, uid, ssb_index);
|
||||
secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc, frame);
|
||||
|
||||
NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc);
|
||||
|
||||
@@ -1079,7 +1079,7 @@ bool nr_trigger_bwp_switch(uint16_t rnti, int bwp_id)
|
||||
} 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);
|
||||
nr_mac_trigger_reconfiguration(nrmac, UE, bwp_id, false);
|
||||
success = true;
|
||||
}
|
||||
NR_SCHED_UNLOCK(&nrmac->sched_lock);
|
||||
|
||||
@@ -3568,10 +3568,11 @@ void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti)
|
||||
mac_remove_nr_ue(mac, rnti);
|
||||
}
|
||||
|
||||
static void beam_switching_procedure(NR_UE_info_t *UE, int new_beam_index)
|
||||
void beam_switching_procedure(gNB_MAC_INST *mac, NR_UE_info_t *UE, int new_beam_index)
|
||||
{
|
||||
LOG_I(NR_MAC, "[UE %x] Switching to beam with ID %d (from %d)\n", UE->rnti, new_beam_index, UE->UE_beam_index);
|
||||
UE->UE_beam_index = new_beam_index;
|
||||
nr_mac_trigger_reconfiguration(mac, UE, -1, true);
|
||||
}
|
||||
|
||||
void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot)
|
||||
@@ -3614,7 +3615,7 @@ void nr_mac_update_timers(module_id_t module_id, frame_t frame, slot_t slot)
|
||||
}
|
||||
if (nr_timer_tick(&sched_ctrl->tci_beam_switch)) {
|
||||
nr_timer_stop(&sched_ctrl->tci_beam_switch);
|
||||
beam_switching_procedure(UE, sched_ctrl->UE_mac_ce_ctrl.tci_state_ind.tciStateId);
|
||||
beam_switching_procedure(mac, UE, sched_ctrl->UE_mac_ce_ctrl.tci_state_ind.tciStateId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3742,20 +3743,20 @@ void reset_beam_status(NR_beam_info_t *beam_info, int frame, int slot, int16_t b
|
||||
}
|
||||
}
|
||||
|
||||
void beam_selection_procedures(gNB_MAC_INST *mac, NR_UE_info_t *UE)
|
||||
int beam_selection_procedures(gNB_MAC_INST *mac, NR_UE_info_t *UE)
|
||||
{
|
||||
// do not perform beam procedures if there is no beam information
|
||||
if (mac->beam_info.beam_mode == NO_BEAM_MODE)
|
||||
return;
|
||||
return -1;
|
||||
|
||||
// simple beam switching algorithm -> we select beam with highest RSRP from CSI report
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
|
||||
RSRP_report_t *rsrp_report = &sched_ctrl->CSI_report.ssb_rsrp_report;
|
||||
int new_bf_index = get_beam_from_ssbidx(mac, rsrp_report->resource_id[0]);
|
||||
if (!mac->radio_config.do_TCI) { // if not TCI is configure we switch beam directly
|
||||
if (UE->UE_beam_index != new_bf_index)
|
||||
beam_switching_procedure(UE, new_bf_index);
|
||||
return;
|
||||
if (UE->UE_beam_index == new_bf_index)
|
||||
return -1; // no beam change needed
|
||||
return new_bf_index;
|
||||
}
|
||||
|
||||
tciStateInd_t *tci = &sched_ctrl->UE_mac_ce_ctrl.tci_state_ind;
|
||||
@@ -3764,7 +3765,7 @@ void beam_selection_procedures(gNB_MAC_INST *mac, NR_UE_info_t *UE)
|
||||
LOG_I(NR_MAC, "[UE %x] Stopping procedure to switch beam, old beam reported as best again\n", UE->rnti);
|
||||
tci->is_scheduled = false;
|
||||
}
|
||||
return; // no beam change needed
|
||||
return -1; // no beam change needed
|
||||
}
|
||||
|
||||
LOG_I(NR_MAC, "[UE %x] Starting procedure to switch beam\n", UE->rnti);
|
||||
@@ -3774,6 +3775,7 @@ void beam_selection_procedures(gNB_MAC_INST *mac, NR_UE_info_t *UE)
|
||||
tci->is_scheduled = true;
|
||||
tci->coresetId = sched_ctrl->coreset->controlResourceSetId;
|
||||
tci->tciStateId = new_bf_index; // assumption: this correspond to the TCI index
|
||||
return new_bf_index;
|
||||
}
|
||||
|
||||
void send_initial_ul_rrc_message(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data)
|
||||
@@ -3827,7 +3829,9 @@ bool prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE)
|
||||
int CC_id = 0;
|
||||
int srb_id = 1;
|
||||
const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon;
|
||||
NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, &mac->radio_config, &mac->rlc_config);
|
||||
NR_COMMON_channels_t *cc = &mac->common_channels[CC_id];
|
||||
int ssb_index = cc->ssb_index[UE->UE_beam_index];
|
||||
NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, &mac->radio_config, &mac->rlc_config, ssb_index);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_CellGroupConfig, UE->CellGroup);
|
||||
UE->CellGroup = cellGroupConfig;
|
||||
UE->local_bwp_id = mac->radio_config.first_active_bwp;
|
||||
@@ -3953,24 +3957,40 @@ static bool verify_bwp_switch(const NR_UE_info_t *UE, const nr_mac_config_t *con
|
||||
return false;
|
||||
}
|
||||
|
||||
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE, int new_bwp_id)
|
||||
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE, int new_bwp_id, bool new_beam)
|
||||
{
|
||||
DevAssert(UE->CellGroup != NULL);
|
||||
NR_CellGroupConfig_t *cellGroup_for_UE = NULL;
|
||||
if (new_bwp_id >= 0) {
|
||||
AssertFatal(UE->current_DL_BWP.bwp_id == UE->current_UL_BWP.bwp_id, "We only support same BWP for UL and DL\n");
|
||||
if (!verify_bwp_switch(UE, &nrmac->radio_config, new_bwp_id))
|
||||
return;
|
||||
else {
|
||||
if (new_beam) {
|
||||
UE->sc_info.csi_MeasConfig = NULL; // to avoid segfault when freeing csi_MeasConfig in configDedicated
|
||||
UE->local_bwp_id = new_bwp_id;
|
||||
cellGroup_for_UE = update_cellGroupConfig_for_BWP_switch(UE->CellGroup,
|
||||
NR_UE_UL_BWP_t *current_BWP = &UE->current_UL_BWP;
|
||||
current_BWP->srs_Config = NULL;
|
||||
int ssb_index = nrmac->common_channels[0].ssb_index[UE->UE_beam_index];
|
||||
cellGroup_for_UE = update_cellGroupConfig_for_beam_switch(UE->CellGroup,
|
||||
&nrmac->radio_config,
|
||||
UE->capability,
|
||||
nrmac->common_channels[0].ServingCellConfigCommon,
|
||||
UE->uid,
|
||||
UE->current_DL_BWP.bwp_id,
|
||||
new_bwp_id);
|
||||
ssb_index);
|
||||
} else {
|
||||
if (new_bwp_id >= 0) {
|
||||
AssertFatal(UE->current_DL_BWP.bwp_id == UE->current_UL_BWP.bwp_id, "We only support same BWP for UL and DL\n");
|
||||
if (!verify_bwp_switch(UE, &nrmac->radio_config, new_bwp_id))
|
||||
return;
|
||||
else {
|
||||
UE->sc_info.csi_MeasConfig = NULL; // to avoid segfault when freeing csi_MeasConfig in configDedicated
|
||||
UE->local_bwp_id = new_bwp_id;
|
||||
int ssb_index = nrmac->common_channels[0].ssb_index[UE->UE_beam_index];
|
||||
cellGroup_for_UE = update_cellGroupConfig_for_BWP_switch(UE->CellGroup,
|
||||
&nrmac->radio_config,
|
||||
UE->capability,
|
||||
nrmac->common_channels[0].ServingCellConfigCommon,
|
||||
UE->uid,
|
||||
UE->current_DL_BWP.bwp_id,
|
||||
new_bwp_id,
|
||||
ssb_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
uint8_t buf[2048];
|
||||
|
||||
@@ -757,6 +757,7 @@ static void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
const int n_slots_frame = nrmac->frame_structure.numb_slots_frame;
|
||||
int cumul_bits = 0;
|
||||
int r_index = -1;
|
||||
int new_bf_index = -1;
|
||||
for (int csi_report_id = 0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++) {
|
||||
nr_csi_report_t *csi_report = &UE->csi_report_template[csi_report_id];
|
||||
csi_report->nb_of_csi_ssb_report = 0;
|
||||
@@ -793,7 +794,7 @@ static void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP:
|
||||
evaluate_rsrp_report(nrmac, UE, sched_ctrl, csi_report_id, payload, &cumul_bits, reportQuantity_type);
|
||||
beam_selection_procedures(nrmac, UE);
|
||||
new_bf_index = beam_selection_procedures(nrmac, UE);
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI:
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.print_report = true;
|
||||
@@ -851,6 +852,9 @@ static void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((new_bf_index !=-1) && !nrmac->radio_config.do_TCI)
|
||||
// Trigger RRCReconfiguration. Need to be out of the for loop as it may modify csi_MeasConfig
|
||||
beam_switching_procedure(nrmac, UE, new_bf_index);
|
||||
}
|
||||
|
||||
static NR_UE_harq_t *find_harq(frame_t frame, slot_t slot, NR_UE_info_t * UE, int harq_round_max)
|
||||
|
||||
@@ -879,7 +879,7 @@ static void nr_rx_ra_sdu(const module_id_t mod_id,
|
||||
if (!old_UE->reconfigCellGroup) {
|
||||
LOG_I(NR_MAC, "Received UL_SCH_LCID_C_RNTI with C-RNTI 0x%04x, triggering RRC Reconfiguration\n", crnti);
|
||||
// Trigger RRCReconfiguration
|
||||
nr_mac_trigger_reconfiguration(mac, old_UE, -1);
|
||||
nr_mac_trigger_reconfiguration(mac, old_UE, -1, false);
|
||||
// we configure the UE using common search space with DCIX0 while waiting for a reconfiguration
|
||||
configure_UE_BWP(mac, scc, old_UE, false, NR_SearchSpace__searchSpaceType_PR_common, -1, -1);
|
||||
}
|
||||
@@ -1994,13 +1994,13 @@ static int pf_ul(gNB_MAC_INST *nrmac,
|
||||
|
||||
NR_beam_alloc_t dci_beam = beam_allocation_procedure(&nrmac->beam_info, frame, slot, UE->UE_beam_index, slots_per_frame);
|
||||
if (dci_beam.idx < 0) {
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] Beam could not be allocated\n", UE->rnti, frame, slot);
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] ULSCH DCI Beam could not be allocated\n", UE->rnti, frame, slot);
|
||||
continue;
|
||||
}
|
||||
|
||||
NR_beam_alloc_t beam = beam_allocation_procedure(&nrmac->beam_info, sched_frame, sched_slot, UE->UE_beam_index, slots_per_frame);
|
||||
if (beam.idx < 0) {
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] Beam could not be allocated\n", UE->rnti, frame, slot);
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] ULSCH Beam could not be allocated\n", UE->rnti, frame, slot);
|
||||
reset_beam_status(&nrmac->beam_info, frame, slot, UE->UE_beam_index, slots_per_frame, dci_beam.new_beam);
|
||||
continue;
|
||||
}
|
||||
@@ -2119,7 +2119,7 @@ static int pf_ul(gNB_MAC_INST *nrmac,
|
||||
|
||||
NR_beam_alloc_t beam = beam_allocation_procedure(&nrmac->beam_info, sched_frame, sched_slot, iterator->UE->UE_beam_index, slots_per_frame);
|
||||
if (beam.idx < 0) {
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] Beam could not be allocated\n", iterator->UE->rnti, frame, slot);
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] ULSCH Beam could not be allocated\n", iterator->UE->rnti, sched_frame, sched_slot);
|
||||
iterator++;
|
||||
continue;
|
||||
}
|
||||
@@ -2132,7 +2132,7 @@ static int pf_ul(gNB_MAC_INST *nrmac,
|
||||
|
||||
NR_beam_alloc_t dci_beam = beam_allocation_procedure(&nrmac->beam_info, frame, slot, iterator->UE->UE_beam_index, slots_per_frame);
|
||||
if (dci_beam.idx < 0) {
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] Beam could not be allocated\n", iterator->UE->rnti, frame, slot);
|
||||
LOG_D(NR_MAC, "[UE %04x][%4d.%2d] ULSCH DCI Beam could not be allocated\n", iterator->UE->rnti, frame, slot);
|
||||
reset_beam_status(&nrmac->beam_info, sched_frame, sched_slot, iterator->UE->UE_beam_index, slots_per_frame, beam.new_beam);
|
||||
iterator++;
|
||||
continue;
|
||||
|
||||
@@ -455,7 +455,8 @@ int16_t get_allocated_beam(const NR_beam_info_t *beam_info, int frame, int slot,
|
||||
uint16_t convert_to_fapi_beam(const uint16_t beam_idx, const nr_beam_mode_t mode);
|
||||
NR_beam_alloc_t beam_allocation_procedure(NR_beam_info_t *beam_info, int frame, int slot, int16_t beam_index, int slots_per_frame);
|
||||
void reset_beam_status(NR_beam_info_t *beam_info, int frame, int slot, int16_t beam_index, int slots_per_frame, bool new_beam);
|
||||
void beam_selection_procedures(gNB_MAC_INST *mac, NR_UE_info_t *UE);
|
||||
int beam_selection_procedures(gNB_MAC_INST *mac, NR_UE_info_t *UE);
|
||||
void beam_switching_procedure(gNB_MAC_INST *mac, NR_UE_info_t *UE, int new_beam_index);
|
||||
void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, slot_t slotP);
|
||||
bwp_info_t get_pdsch_bwp_start_size(gNB_MAC_INST *nr_mac, NR_UE_info_t *UE);
|
||||
bwp_info_t get_pusch_bwp_start_size(NR_UE_info_t *UE);
|
||||
@@ -483,7 +484,7 @@ void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpac
|
||||
void nr_mac_reset_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl);
|
||||
bool nr_mac_check_ul_failure(gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t *sched_ctrl);
|
||||
|
||||
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE, int new_bwp_id);
|
||||
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, NR_UE_info_t *UE, int new_bwp_id, bool new_beam);
|
||||
|
||||
bool nr_mac_add_lcid(NR_UE_sched_ctrl_t *sched_ctrl, const nr_lc_config_t *c);
|
||||
nr_lc_config_t *nr_mac_get_lc_config(NR_UE_sched_ctrl_t* sched_ctrl, int lcid);
|
||||
|
||||
@@ -567,12 +567,13 @@ static NR_UE_info_t *create_new_UE(gNB_MAC_INST *mac, uint32_t cu_id, const NR_C
|
||||
NR_COMMON_channels_t *cc = &mac->common_channels[CC_id];
|
||||
const NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
|
||||
const nr_mac_config_t *configuration = &mac->radio_config;
|
||||
int ssb_index = cc->ssb_index[UE->UE_beam_index];
|
||||
if (is_SA) {
|
||||
cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, &mac->radio_config, &mac->rlc_config);
|
||||
cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, &mac->radio_config, &mac->rlc_config, ssb_index);
|
||||
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc, mac->frame);
|
||||
} else {
|
||||
NR_UE_NR_Capability_t *cap = get_ue_nr_cap_from_cg_config_info(cgci);
|
||||
cellGroupConfig = get_default_secondaryCellGroup(scc, cap, 1, 1, configuration, UE->uid);
|
||||
cellGroupConfig = get_default_secondaryCellGroup(scc, cap, 1, 1, configuration, UE->uid, ssb_index);
|
||||
cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc, mac->frame);
|
||||
// TODO: in NSA we assign capabilities here, otherwise outside => not logic
|
||||
UE->capability = cap;
|
||||
|
||||
@@ -379,7 +379,7 @@ static void set_csirs_periodicity(NR_NZP_CSI_RS_Resource_t *nzpcsi0,
|
||||
{
|
||||
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
|
||||
// TODO ideal period to be set according to estimation by the gNB on how fast the channel changes
|
||||
const int offset = fs->numb_slots_period * id;
|
||||
const int offset = id; // id = ssb_index/2, offset should be set to ssb_index/2.
|
||||
if (check_periodicity(4, ideal_period, fs)) {
|
||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots4;
|
||||
nzpcsi0->periodicityAndOffset->choice.slots4 = offset;
|
||||
@@ -3391,7 +3391,8 @@ static NR_CSI_MeasConfig_t *get_csiMeasConfig(const NR_ServingCellConfig_t *conf
|
||||
const nr_mac_config_t *configuration,
|
||||
int uid,
|
||||
int bwp_id,
|
||||
uint64_t bitmap)
|
||||
uint64_t bitmap,
|
||||
int ssb_index)
|
||||
{
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig = calloc(1, sizeof(*csi_MeasConfig));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1, sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
@@ -3431,8 +3432,8 @@ static NR_CSI_MeasConfig_t *get_csiMeasConfig(const NR_ServingCellConfig_t *conf
|
||||
|
||||
const int pdsch_AntennaPorts =
|
||||
configuration->pdsch_AntennaPorts.N1 * configuration->pdsch_AntennaPorts.N2 * configuration->pdsch_AntennaPorts.XP;
|
||||
config_csirs(scc, csi_MeasConfig, pdsch_AntennaPorts, curr_bwp, configuration->do_CSIRS, bwp_id);
|
||||
config_csiim(configuration->do_CSIRS, pdsch_AntennaPorts, curr_bwp, csi_MeasConfig, bwp_id);
|
||||
config_csirs(scc, csi_MeasConfig, pdsch_AntennaPorts, curr_bwp, configuration->do_CSIRS, ssb_index / 2);
|
||||
config_csiim(configuration->do_CSIRS, pdsch_AntennaPorts, curr_bwp, csi_MeasConfig, ssb_index / 2);
|
||||
|
||||
NR_CSI_ResourceConfig_t *csires1 = calloc(1, sizeof(*csires1));
|
||||
csires1->csi_ResourceConfigId = bwp_id + 20;
|
||||
@@ -3458,7 +3459,7 @@ static NR_CSI_MeasConfig_t *get_csiMeasConfig(const NR_ServingCellConfig_t *conf
|
||||
csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList =
|
||||
calloc(1, sizeof(*csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList));
|
||||
NR_NZP_CSI_RS_ResourceSetId_t *nzp0 = calloc(1, sizeof(*nzp0));
|
||||
*nzp0 = bwp_id;
|
||||
*nzp0 = ssb_index / 2;
|
||||
asn1cSeqAdd(&csires0->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB->nzp_CSI_RS_ResourceSetList->list, nzp0);
|
||||
csires0->bwp_Id = bwp_id;
|
||||
csires0->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
@@ -3472,7 +3473,7 @@ static NR_CSI_MeasConfig_t *get_csiMeasConfig(const NR_ServingCellConfig_t *conf
|
||||
csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList =
|
||||
calloc(1, sizeof(*csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList));
|
||||
NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1, sizeof(*csiim00));
|
||||
*csiim00 = bwp_id;
|
||||
*csiim00 = ssb_index / 2;
|
||||
asn1cSeqAdd(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list, csiim00);
|
||||
csires2->bwp_Id = bwp_id;
|
||||
csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
@@ -3509,7 +3510,8 @@ static NR_CSI_MeasConfig_t *get_csiMeasConfig(const NR_ServingCellConfig_t *conf
|
||||
|
||||
static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const nr_mac_config_t *configuration)
|
||||
const nr_mac_config_t *configuration,
|
||||
int ssb_index)
|
||||
{
|
||||
const int pdsch_AntennaPorts =
|
||||
configuration->pdsch_AntennaPorts.N1 * configuration->pdsch_AntennaPorts.N2 * configuration->pdsch_AntennaPorts.XP;
|
||||
@@ -3573,7 +3575,8 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid,
|
||||
configuration,
|
||||
uid,
|
||||
first_active_bwp,
|
||||
bitmap);
|
||||
bitmap,
|
||||
ssb_index);
|
||||
|
||||
fill_harq_IEs(configDedicated, configuration->num_dlharq, configuration->num_ulharq, first_active_bwp);
|
||||
SpCellConfig->spCellConfigDedicated = configDedicated;
|
||||
@@ -3751,12 +3754,13 @@ static bool verify_radio_configuration(int uid, const NR_ServingCellConfigCommon
|
||||
NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const nr_mac_config_t *configuration,
|
||||
const nr_rlc_configuration_t *default_rlc_config)
|
||||
const nr_rlc_configuration_t *default_rlc_config,
|
||||
int ssb_index)
|
||||
{
|
||||
if (!verify_radio_configuration(uid, scc, configuration))
|
||||
return NULL;
|
||||
|
||||
NR_SpCellConfig_t *spCellConfig = get_initial_SpCellConfig(uid, scc, configuration);
|
||||
NR_SpCellConfig_t *spCellConfig = get_initial_SpCellConfig(uid, scc, configuration, ssb_index);
|
||||
NR_CellGroupConfig_t *cellGroupConfig = calloc(1, sizeof(*cellGroupConfig));
|
||||
cellGroupConfig->cellGroupId = 0;
|
||||
|
||||
@@ -3787,7 +3791,8 @@ NR_CellGroupConfig_t *update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
int uid,
|
||||
int old_bwp,
|
||||
int new_bwp)
|
||||
int new_bwp,
|
||||
int ssb_index)
|
||||
{
|
||||
NR_SpCellConfig_t *spCellConfig = cellGroupConfig->spCellConfig;
|
||||
NR_ServingCellConfig_t *configDedicated = spCellConfig->spCellConfigDedicated;
|
||||
@@ -3832,7 +3837,8 @@ NR_CellGroupConfig_t *update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t
|
||||
&local_config,
|
||||
uid,
|
||||
*uplinkConfig->firstActiveUplinkBWP_Id,
|
||||
bitmap);
|
||||
bitmap,
|
||||
ssb_index);
|
||||
|
||||
// we temporarily need to keep both the old and the new BWP in the CG used by the gNB
|
||||
// while removing the old from the CG sent to the UE
|
||||
@@ -3844,6 +3850,34 @@ NR_CellGroupConfig_t *update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t
|
||||
return clone_cg;
|
||||
}
|
||||
|
||||
NR_CellGroupConfig_t *update_cellGroupConfig_for_beam_switch(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const nr_mac_config_t *configuration,
|
||||
const NR_UE_NR_Capability_t *uecap,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
int uid,
|
||||
int bwp,
|
||||
int ssb_index)
|
||||
{
|
||||
NR_SpCellConfig_t *spCellConfig = cellGroupConfig->spCellConfig;
|
||||
NR_ServingCellConfig_t *configDedicated = spCellConfig->spCellConfigDedicated;
|
||||
|
||||
uint64_t bitmap = get_ssb_bitmap(scc);
|
||||
ASN_STRUCT_FREE(asn_DEF_NR_CSI_MeasConfig, configDedicated->csi_MeasConfig->choice.setup);
|
||||
configDedicated->csi_MeasConfig->choice.setup = get_csiMeasConfig(configDedicated,
|
||||
uecap,
|
||||
scc,
|
||||
configuration,
|
||||
uid,
|
||||
bwp,
|
||||
bitmap,
|
||||
ssb_index);
|
||||
|
||||
NR_CellGroupConfig_t *clone_cg = NULL;
|
||||
const int copy_result = asn_copy(&asn_DEF_NR_CellGroupConfig, (void **)&clone_cg, cellGroupConfig);
|
||||
AssertFatal(copy_result == 0, "unable to copy NR_CellGroupConfig for cloning\n");
|
||||
return clone_cg;
|
||||
}
|
||||
|
||||
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const int uid,
|
||||
const NR_UE_NR_Capability_t *uecap,
|
||||
@@ -3983,7 +4017,8 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
const nr_mac_config_t *configuration,
|
||||
int uid)
|
||||
int uid,
|
||||
int ssb_index)
|
||||
{
|
||||
const nr_pdsch_AntennaPorts_t *pdschap = &configuration->pdsch_AntennaPorts;
|
||||
const int dl_antenna_ports = pdschap->N1 * pdschap->N2 * pdschap->XP;
|
||||
@@ -4134,7 +4169,8 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
configuration,
|
||||
uid,
|
||||
firstActiveUplinkBWP_Id,
|
||||
bitmap);
|
||||
bitmap,
|
||||
ssb_index);
|
||||
|
||||
configDedicated->sCellDeactivationTimer = NULL;
|
||||
configDedicated->crossCarrierSchedulingConfig = NULL;
|
||||
|
||||
@@ -95,7 +95,8 @@ NR_SIB19_r17_t *get_SIB19_NR(const NR_ServingCellConfigCommon_t *scc);
|
||||
NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
const nr_mac_config_t *configuration,
|
||||
const nr_rlc_configuration_t *default_rlc_config);
|
||||
const nr_rlc_configuration_t *default_rlc_config,
|
||||
int ssb_index);
|
||||
void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const int uid,
|
||||
const NR_UE_NR_Capability_t *uecap,
|
||||
@@ -111,7 +112,8 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC
|
||||
int scg_id,
|
||||
int servCellIndex,
|
||||
const nr_mac_config_t *configuration,
|
||||
int uid);
|
||||
int uid,
|
||||
int ssb_index);
|
||||
|
||||
NR_ReconfigurationWithSync_t *get_reconfiguration_with_sync(rnti_t rnti, uid_t uid, const NR_ServingCellConfigCommon_t *scc, int frame);
|
||||
|
||||
@@ -133,7 +135,15 @@ NR_CellGroupConfig_t *update_cellGroupConfig_for_BWP_switch(NR_CellGroupConfig_t
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
int uid,
|
||||
int old_bwp,
|
||||
int new_bwp);
|
||||
int new_bwp,
|
||||
int ssb_index);
|
||||
NR_CellGroupConfig_t *update_cellGroupConfig_for_beam_switch(NR_CellGroupConfig_t *cellGroupConfig,
|
||||
const nr_mac_config_t *configuration,
|
||||
const NR_UE_NR_Capability_t *uecap,
|
||||
const NR_ServingCellConfigCommon_t *scc,
|
||||
int uid,
|
||||
int bwp,
|
||||
int ssb_index);
|
||||
NR_MeasurementTimingConfiguration_t *get_nr_mtc(uint8_t *buf, uint32_t len);
|
||||
measgap_config_t create_measgap_config(const NR_MeasurementTimingConfiguration_t *mtc, int scs, int min_rxtxtime);
|
||||
int encode_measgap_config(const measgap_config_t *c, uint8_t *buf);
|
||||
|
||||
Reference in New Issue
Block a user