From 031be0666508784b492ddb5e48f9b676d41ee322 Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 17 Apr 2025 18:50:03 +0200 Subject: [PATCH] use already generated RNTI when creating a new NSA US and take get_reconfiguration_with_sync out of get_default_secondaryCellGroup --- openair1/SIMULATION/NR_PHY/dlsim.c | 8 +++++--- openair1/SIMULATION/NR_PHY/ulsim.c | 11 ++++++----- openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c | 3 +-- openair2/RRC/NR/nr_rrc_config.c | 5 ----- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index f675256b0b..8babb7598d 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -780,8 +780,10 @@ printf("%d\n", slot); NR_UE_NR_Capability_t *UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); prepare_sim_uecap(UE_Capability_nr, scc, mu, N_RB_DL, g_mcsTableIdx, 0); - - NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, 0); + rnti_t rnti = 0x1234; + int uid = 0; + NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, uid); + secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc); /* -U option modify DMRS */ if(modify_dmrs) { @@ -796,7 +798,7 @@ printf("%d\n", slot); //xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); // UE dedicated configuration - nr_mac_add_test_ue(RC.nrmac[0], secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity, secondaryCellGroup); + nr_mac_add_test_ue(RC.nrmac[0], rnti, secondaryCellGroup); // reset preprocessor to the one of DLSIM after it has been set during // nr_mac_config_scc() gNB_mac->pre_processor_dl = nr_dlsim_preprocessor; diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index a23320ee10..83c1c31826 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -672,15 +672,16 @@ int main(int argc, char *argv[]) fix_scd(scd); NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t)); - prepare_sim_uecap(UE_Capability_nr,scc,mu, - N_RB_UL,0,mcs_table); - - NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, 0); + 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, scd, UE_Capability_nr, 0, 1, &conf, uid); + secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, scc); NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc); // UE dedicated configuration - nr_mac_add_test_ue(RC.nrmac[0], secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity, secondaryCellGroup); + nr_mac_add_test_ue(RC.nrmac[0], rnti, secondaryCellGroup); frame_parms->nb_antennas_tx = 1; frame_parms->nb_antennas_rx = n_rx; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c index 9d3850586b..317b030e4a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c +++ b/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c @@ -554,8 +554,7 @@ static NR_UE_info_t *create_new_UE(gNB_MAC_INST *mac, uint32_t cu_id, const NR_C } else { NR_UE_NR_Capability_t *cap = get_ue_nr_cap_from_cg_config_info(cgci); cellGroupConfig = get_default_secondaryCellGroup(scc, sccd, cap, 1, 1, configuration, UE->uid); - // TODO: fixme: gives a new random RNTI - UE->rnti = cellGroupConfig->spCellConfig->reconfigurationWithSync->newUE_Identity; + cellGroupConfig->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(UE->rnti, UE->uid, scc); // TODO: in NSA we assign capabilities here, otherwise outside => not logic UE->capability = cap; } diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 1938f4b9bc..ac4f25109e 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -3567,11 +3567,6 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC secondaryCellGroup->spCellConfig = calloc(1, sizeof(*secondaryCellGroup->spCellConfig)); secondaryCellGroup->spCellConfig->servCellIndex = calloc(1, sizeof(*secondaryCellGroup->spCellConfig->servCellIndex)); *secondaryCellGroup->spCellConfig->servCellIndex = servCellIndex; - secondaryCellGroup->spCellConfig->reconfigurationWithSync = - calloc(1, sizeof(*secondaryCellGroup->spCellConfig->reconfigurationWithSync)); - - rnti_t rnti = get_softmodem_params()->phy_test == 1 ? 0x1234 : (taus() & 0xffff); - secondaryCellGroup->spCellConfig->reconfigurationWithSync = get_reconfiguration_with_sync(rnti, uid, servingcellconfigcommon); secondaryCellGroup->spCellConfig->rlf_TimersAndConstants = calloc(1, sizeof(*secondaryCellGroup->spCellConfig->rlf_TimersAndConstants));