diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 47659eb039..15ef948c62 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -239,7 +239,7 @@ nrUE_params_t *get_nrUE_params(void) { } -void validate_input_pmi(rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, int nrOfLayers, int pmi) +void validate_input_pmi(nr_pdsch_AntennaPorts_t pdsch_AntennaPorts, int nrOfLayers, int pmi) { if (pmi == 0) return; @@ -622,17 +622,32 @@ int main(int argc, char **argv) frame_parms->N_RB_DL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL; + AssertFatal((gNB->if_inst = NR_IF_Module_init(0)) != NULL, "Cannot register interface"); + gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; + NR_ServingCellConfigCommon_t *scc = calloc(1,sizeof(*scc));; prepare_scc(scc); uint64_t ssb_bitmap = 1; // Enable only first SSB with index ssb_indx=0 fill_scc_sim(scc, &ssb_bitmap, N_RB_DL, N_RB_DL, mu, mu); fix_scc(scc, ssb_bitmap); + // TODO do a UECAP for phy-sim + nr_pdsch_AntennaPorts_t pdsch_AntennaPorts = {0}; + pdsch_AntennaPorts.N1 = n_tx > 1 ? n_tx >> 1 : 1; + pdsch_AntennaPorts.N2 = 1; + pdsch_AntennaPorts.XP = n_tx > 1 ? 2 : 1; + const nr_mac_config_t conf = {.pdsch_AntennaPorts = pdsch_AntennaPorts, + .pusch_AntennaPorts = n_tx, + .minRXTXTIME = 6, + .do_CSIRS = 0, + .do_SRS = 0, + .force_256qam_off = false}; + RC.nb_nr_macrlc_inst = 1; RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int)); for (i = 0; i < RC.nb_nr_macrlc_inst; i++) RC.nb_nr_mac_CC[i] = 1; - mac_top_init_gNB(ngran_gNB, scc, NULL); + mac_top_init_gNB(ngran_gNB, scc, NULL, &conf); gNB_mac = RC.nrmac[0]; gNB_mac->dl_bler.harq_round_max = num_rounds; @@ -682,10 +697,6 @@ int main(int argc, char **argv) NR_ServingCellConfig_t *scd = calloc(1,sizeof(*scd)); prepare_scd(scd); - rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts = {0}; - pdsch_AntennaPorts.N1 = n_tx>1 ? n_tx>>1 : 1; - pdsch_AntennaPorts.N2 = 1; - pdsch_AntennaPorts.XP = n_tx>1 ? 2 : 1; gNB->ap_N1 = pdsch_AntennaPorts.N1; gNB->ap_N2 = pdsch_AntennaPorts.N2; gNB->ap_XP = pdsch_AntennaPorts.XP; @@ -696,12 +707,6 @@ int main(int argc, char **argv) prepare_sim_uecap(UE_Capability_nr,scc,mu, N_RB_DL,g_mcsTableIdx,0); - // TODO do a UECAP for phy-sim - const gNB_RrcConfigurationReq conf = {.pdsch_AntennaPorts = pdsch_AntennaPorts, - .minRXTXTIME = 6, - .do_CSIRS = 0, - .do_SRS = 0, - .force_256qam_off = false}; NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, 0); /* RRC parameter validation for secondaryCellGroup */ @@ -719,11 +724,6 @@ int main(int argc, char **argv) //xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup); - AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); - gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; - - // common configuration - nr_mac_config_scc(RC.nrmac[0], pdsch_AntennaPorts, n_tx, 0, 6); // UE dedicated configuration nr_mac_add_test_ue(RC.nrmac[0], secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity, secondaryCellGroup); // reset preprocessor to the one of DLSIM after it has been set during diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c index bf65be3fa2..a8c02998ee 100644 --- a/openair1/SIMULATION/NR_PHY/ulsim.c +++ b/openair1/SIMULATION/NR_PHY/ulsim.c @@ -608,6 +608,9 @@ int main(int argc, char *argv[]) frame_parms->N_RB_UL = N_RB_UL; frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL; + AssertFatal((gNB->if_inst = NR_IF_Module_init(0)) != NULL, "Cannot register interface"); + gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; + s_re = malloc(n_tx*sizeof(double*)); s_im = malloc(n_tx*sizeof(double*)); r_re = malloc(n_rx*sizeof(double*)); @@ -619,11 +622,19 @@ int main(int argc, char *argv[]) fill_scc_sim(scc, &ssb_bitmap, N_RB_DL, N_RB_DL, mu, mu); fix_scc(scc,ssb_bitmap); + // TODO do a UECAP for phy-sim + const nr_mac_config_t conf = {.pdsch_AntennaPorts = {.N1 = 1, .N2 = 1, .XP = 1}, + .pusch_AntennaPorts = n_rx, + .minRXTXTIME = 0, + .do_CSIRS = 0, + .do_SRS = 0, + .force_256qam_off = false}; + RC.nb_nr_macrlc_inst = 1; RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int)); for (i = 0; i < RC.nb_nr_macrlc_inst; i++) RC.nb_nr_mac_CC[i] = 1; - mac_top_init_gNB(ngran_gNB, scc, NULL /* scd will be updated further below */); + mac_top_init_gNB(ngran_gNB, scc, NULL /* scd will be updated further below */, &conf); NR_ServingCellConfig_t *scd = calloc(1,sizeof(NR_ServingCellConfig_t)); prepare_scd(scd); @@ -632,14 +643,6 @@ int main(int argc, char *argv[]) prepare_sim_uecap(UE_Capability_nr,scc,mu, N_RB_UL,0,mcs_table); - // TODO do a UECAP for phy-sim - const gNB_RrcConfigurationReq conf = {.pdsch_AntennaPorts = {.N1 = 1, .N2 = 1, .XP = 1}, - .pusch_AntennaPorts = n_rx, - .minRXTXTIME = 0, - .do_CSIRS = 0, - .do_SRS = 0, - .force_256qam_off = false}; - NR_CellGroupConfig_t *secondaryCellGroup = get_default_secondaryCellGroup(scc, scd, UE_Capability_nr, 0, 1, &conf, 0); /* RRC parameter validation for secondaryCellGroup */ @@ -647,11 +650,6 @@ int main(int argc, char *argv[]) NR_BCCH_BCH_Message_t *mib = get_new_MIB_NR(scc); - AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface"); - - gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; - // common configuration - nr_mac_config_scc(RC.nrmac[0], conf.pdsch_AntennaPorts, n_tx, 0, 6); // UE dedicated configuration nr_mac_add_test_ue(RC.nrmac[0], secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity, secondaryCellGroup); frame_parms->nb_antennas_tx = 1; diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 2e592b88cc..465c6c5342 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -401,12 +401,6 @@ typedef struct NbIoTRrcConfigurationReq_s { long ue_TimersAndConstants_n311_NB; } NbIoTRrcConfigurationReq; -typedef struct { - int N1; - int N2; - int XP; -} rrc_pdsch_AntennaPorts_t; - // gNB: GNB_APP -> RRC messages typedef struct NRRrcConfigurationReq_s { uint64_t cell_identity; @@ -415,15 +409,7 @@ typedef struct NRRrcConfigurationReq_s { uint16_t mnc[PLMN_LIST_MAX_SIZE]; uint8_t mnc_digit_length[PLMN_LIST_MAX_SIZE]; uint8_t num_plmn; - int sib1_tda; - rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts; - int pusch_AntennaPorts; - int minRXTXTIME; - int do_CSIRS; - int do_SRS; - bool force_256qam_off; - int pusch_TargetSNRx10; - int pucch_TargetSNRx10; + bool enable_sdap; int drbs; } gNB_RrcConfigurationReq; diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index c8869d6113..4134d03ca2 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -947,26 +947,27 @@ static NR_ServingCellConfig_t *get_scd_config(void) return scd; } -// temporary minRXTXTIME, to be taken out once all radio config is read at DU -static int minRXTXTIME = 6; static f1ap_setup_req_t *RC_read_F1Setup(const NR_ServingCellConfigCommon_t *scc, NR_BCCH_BCH_Message_t *mib, const NR_BCCH_DL_SCH_Message_t *sib1); void RCconfig_nr_macrlc() { int j = 0; uint16_t prbbl[275] = {0}; int num_prbbl = 0; + + paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0}; + paramdef_t GNBSParams[] = GNBSPARAMS_DESC; + config_get(GNBSParams, sizeof(GNBSParams) / sizeof(paramdef_t), NULL); + int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; + AssertFatal(num_gnbs == 1, + "Failed to parse config file: number of gnbs for gNB %s is %d != 1\n", + GNB_CONFIG_STRING_ACTIVE_GNBS, + num_gnbs); + paramdef_t GNBParams[] = GNBPARAMS_DESC; + config_getlist(&GNBParamList, GNBParams, sizeof(GNBParams) / sizeof(paramdef_t), NULL); + if (NFAPI_MODE != NFAPI_MODE_PNF) { - paramdef_t GNBSParams[] = GNBSPARAMS_DESC; ////////// Identification parameters - paramdef_t GNBParams[] = GNBPARAMS_DESC; - paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0}; - - config_get(GNBSParams, sizeof(GNBSParams) / sizeof(paramdef_t), NULL); - int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt; - AssertFatal(num_gnbs > 0, "Failed to parse config file no gnbs %s \n", GNB_CONFIG_STRING_ACTIVE_GNBS); - - config_getlist(&GNBParamList, GNBParams, sizeof(GNBParams) / sizeof(paramdef_t), NULL); char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr; char *save = NULL; char *pt = strtok_r(ulprbbl, ",", &save); @@ -987,14 +988,41 @@ void RCconfig_nr_macrlc() { MacRLC_Params[i].chkPptr = &(config_check_MacRLCParams[i]); config_getlist(&MacRLC_ParamList, MacRLC_Params, sizeof(MacRLC_Params) / sizeof(paramdef_t), NULL); - NR_ServingCellConfigCommon_t *scc = get_scc_config(minRXTXTIME); + nr_mac_config_t config = {0}; + config.pdsch_AntennaPorts.N1 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr; + config.pdsch_AntennaPorts.N2 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr; + config.pdsch_AntennaPorts.XP = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr; + config.pusch_AntennaPorts = *GNBParamList.paramarray[0][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; + LOG_I(GNB_APP, + "pdsch_AntennaPorts N1 %d N2 %d XP %d pusch_AntennaPorts %d\n", + config.pdsch_AntennaPorts.N1, + config.pdsch_AntennaPorts.N2, + config.pdsch_AntennaPorts.XP, + config.pusch_AntennaPorts); + + config.minRXTXTIME = *GNBParamList.paramarray[0][GNB_MINRXTXTIME_IDX].iptr; + LOG_I(GNB_APP, "minTXRXTIME %d\n", config.minRXTXTIME); + config.sib1_tda = *GNBParamList.paramarray[0][GNB_SIB1_TDA_IDX].iptr; + LOG_I(GNB_APP, "SIB1 TDA %d\n", config.sib1_tda); + config.do_CSIRS = *GNBParamList.paramarray[0][GNB_DO_CSIRS_IDX].iptr; + config.do_SRS = *GNBParamList.paramarray[0][GNB_DO_SRS_IDX].iptr; + config.force_256qam_off = *GNBParamList.paramarray[0][GNB_FORCE256QAMOFF_IDX].iptr; + LOG_I(GNB_APP, + "CSI-RS %d, SRS %d, 256 QAM %s\n", + config.do_CSIRS, + config.do_SRS, + config.force_256qam_off ? "force off" : "may be on"); + + // note: no need for PLMN info, it is read in RC_read_F1Setup() + + NR_ServingCellConfigCommon_t *scc = get_scc_config(config.minRXTXTIME); //xer_fprint(stdout, &asn_DEF_NR_ServingCellConfigCommon, scc); NR_ServingCellConfig_t *scd = get_scd_config(); if (MacRLC_ParamList.numelt > 0) { RC.nb_nr_macrlc_inst = MacRLC_ParamList.numelt; ngran_node_t node_type = get_node_type(); - mac_top_init_gNB(node_type, scc, scd); + mac_top_init_gNB(node_type, scc, scd, &config); RC.nb_nr_mac_CC = (int *)malloc(RC.nb_nr_macrlc_inst * sizeof(int)); for (j = 0; j < RC.nb_nr_macrlc_inst; j++) { @@ -1388,26 +1416,7 @@ void RCconfig_NRRRC(gNB_RRC_INST *rrc) AssertFatal((nrrrc_config.mnc_digit_length[l] == 2) || (nrrrc_config.mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d", nrrrc_config.mnc_digit_length[l]); - } - LOG_I(GNB_APP,"pdsch_AntennaPorts N1 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr); - nrrrc_config.pdsch_AntennaPorts.N1 = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr; - LOG_I(GNB_APP,"pdsch_AntennaPorts N2 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr); - nrrrc_config.pdsch_AntennaPorts.N2 = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr; - LOG_I(GNB_APP,"pdsch_AntennaPorts XP %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr); - nrrrc_config.pdsch_AntennaPorts.XP = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr; - LOG_I(GNB_APP,"pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr); - nrrrc_config.pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr; - LOG_I(GNB_APP,"minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr); - nrrrc_config.minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr; - DevAssert(nrrrc_config.minRXTXTIME == minRXTXTIME); - LOG_I(GNB_APP,"SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr); - nrrrc_config.sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr; - LOG_I(GNB_APP,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr); - nrrrc_config.do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr; - LOG_I(GNB_APP, "Do SRS %d\n",*GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr); - nrrrc_config.do_SRS = *GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr; - nrrrc_config.force_256qam_off = *GNBParamList.paramarray[i][GNB_FORCE256QAMOFF_IDX].iptr; - LOG_I(GNB_APP, "256 QAM: %s\n", nrrrc_config.force_256qam_off ? "force off" : "may be on"); + } nrrrc_config.enable_sdap = *GNBParamList.paramarray[i][GNB_ENABLE_SDAP_IDX].iptr; LOG_I(GNB_APP, "SDAP layer is %s\n", nrrrc_config.enable_sdap ? "enabled" : "disabled"); nrrrc_config.drbs = *GNBParamList.paramarray[i][GNB_DRBS].iptr; diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index 8d6f1d27fa..6ea3e10458 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -473,19 +473,13 @@ int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, rnti_t rnti, NR_S return 0; } -void nr_mac_config_scc(gNB_MAC_INST *nrmac, - rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, - int pusch_AntennaPorts, - int sib1_tda, - int minRXTXTIMEpdsch) +void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *config) { - int CC_id = 0; DevAssert(nrmac != NULL); - AssertFatal(nrmac->common_channels[0].ServingCellConfigCommon != NULL, "logic error: SCC not in MAC\n"); - NR_SCHED_LOCK(&nrmac->sched_lock); - - NR_ServingCellConfigCommon_t *scc = nrmac->common_channels[CC_id].ServingCellConfigCommon; DevAssert(scc != NULL); + DevAssert(config != NULL); + //NR_SCHED_LOCK(&nrmac->sched_lock); + AssertFatal(scc->ssb_PositionsInBurst->present > 0 && scc->ssb_PositionsInBurst->present < 4, "SSB Bitmap type %d is not valid\n", scc->ssb_PositionsInBurst->present); @@ -500,9 +494,8 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, LOG_I(NR_MAC, "Configuring common parameters from NR ServingCellConfig\n"); - int num_pdsch_antenna_ports = pdsch_AntennaPorts.N1 * pdsch_AntennaPorts.N2 * pdsch_AntennaPorts.XP; - nrmac->xp_pdsch_antenna_ports = pdsch_AntennaPorts.XP; - config_common(nrmac, num_pdsch_antenna_ports, pusch_AntennaPorts, scc); + int num_pdsch_antenna_ports = config->pdsch_AntennaPorts.N1 * config->pdsch_AntennaPorts.N2 * config->pdsch_AntennaPorts.XP; + config_common(nrmac, num_pdsch_antenna_ports, config->pusch_AntennaPorts, scc); if (NFAPI_MODE == NFAPI_MODE_PNF || NFAPI_MODE == NFAPI_MODE_VNF) { // fake that the gNB is configured in nFAPI mode, which would normally be @@ -514,7 +507,6 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, nrmac->if_inst->NR_PHY_config_req(&phycfg); } - nrmac->minRXTXTIMEpdsch = minRXTXTIMEpdsch; find_SSB_and_RO_available(nrmac); const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL; @@ -535,7 +527,7 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, nrmac->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dl_slots) << (slot % 64); nrmac->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64); - LOG_I(NR_MAC, + LOG_D(NR_MAC, "slot %d DL %d UL %d\n", slot, (nrmac->dlsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0, @@ -552,7 +544,6 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, if (get_softmodem_params()->sa > 0) { NR_COMMON_channels_t *cc = &nrmac->common_channels[0]; - nrmac->sib1_tda = sib1_tda; for (int n = 0; n < NR_NB_RA_PROC_MAX; n++) { NR_RA_t *ra = &cc->ra[n]; ra->cfra = false; @@ -563,7 +554,7 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, ra->preambles.preamble_list[i] = i; } } - NR_SCHED_UNLOCK(&nrmac->sched_lock); + //NR_SCHED_UNLOCK(&nrmac->sched_lock); } bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index bdf84ddc8e..19a1a0d34b 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -159,7 +159,7 @@ static int16_t ssb_index_from_prach(module_id_t module_idP, void find_SSB_and_RO_available(gNB_MAC_INST *nrmac) { /* already mutex protected through nr_mac_config_scc() */ - NR_SCHED_ENSURE_LOCKED(&nrmac->sched_lock); + //NR_SCHED_ENSURE_LOCKED(&nrmac->sched_lock); NR_COMMON_channels_t *cc = &nrmac->common_channels[0]; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c index 8d44a20aa1..52d6825079 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c @@ -540,7 +540,7 @@ void schedule_nr_sib1(module_id_t module_idP, gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP]; NR_ServingCellConfigCommon_t *scc = gNB_mac->common_channels[CC_id].ServingCellConfigCommon; - int time_domain_allocation = gNB_mac->sib1_tda; + int time_domain_allocation = gNB_mac->radio_config.sib1_tda; int L_max; switch (scc->ssb_PositionsInBurst->present) { diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 00fefe3b31..a3ab4eb74c 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -661,7 +661,8 @@ static void pf_dl(module_id_t module_id, else sched_pdsch->mcs = get_mcs_from_bler(bo, stats, &sched_ctrl->dl_bler_stats, max_mcs, frame); sched_pdsch->nrOfLayers = get_dl_nrOfLayers(sched_ctrl, current_BWP->dci_format); - sched_pdsch->pm_index = mac->identity_pm ? 0 : get_pm_index(UE, sched_pdsch->nrOfLayers, mac->xp_pdsch_antenna_ports); + sched_pdsch->pm_index = + mac->identity_pm ? 0 : get_pm_index(UE, sched_pdsch->nrOfLayers, mac->radio_config.pdsch_AntennaPorts.XP); const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, current_BWP->mcsTableIdx); const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, current_BWP->mcsTableIdx); uint32_t tbs = nr_compute_tbs(Qm, diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 5c3db39699..9955b240b3 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -2884,14 +2884,10 @@ void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE) { NR_SCHED_ENSURE_LOCKED(&mac->sched_lock); /* create this UE's initial CellGroup */ - /* Note: relying on the RRC is a hack, as we are in the DU; there should be - * no RRC, remove in the future */ - module_id_t mod_id = 0; int CC_id = 0; - gNB_RRC_INST *rrc = RC.nrrrc[mod_id]; const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon; const NR_ServingCellConfig_t *sccd = mac->common_channels[CC_id].pre_ServingCellConfig; - NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &rrc->configuration); + NR_CellGroupConfig_t *cellGroupConfig = get_initial_cellGroupConfig(UE->uid, scc, sccd, &mac->radio_config); UE->CellGroup = cellGroupConfig; nr_mac_update_cellgroup(mac, UE->rnti, cellGroupConfig); diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 7b130b6adb..77b0eeba9e 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1209,7 +1209,7 @@ int nr_acknack_scheduling(gNB_MAC_INST *mac, * called often, don't try to lock every time */ const int CC_id = 0; - const int minfbtime = mac->minRXTXTIMEpdsch; + const int minfbtime = mac->radio_config.minRXTXTIME; const NR_ServingCellConfigCommon_t *scc = mac->common_channels[CC_id].ServingCellConfigCommon; const NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP; const int n_slots_frame = nr_slots_per_frame[ul_bwp->scs]; diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 28900454bd..6d0896427a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -38,7 +38,10 @@ void set_cset_offset(uint16_t); -void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfig_t *scd); +void mac_top_init_gNB(ngran_node_t node_type, + NR_ServingCellConfigCommon_t *scc, + NR_ServingCellConfig_t *scd, + const nr_mac_config_t *conf); void nr_mac_send_f1_setup_req(void); int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, @@ -46,11 +49,7 @@ int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, NR_SubcarrierSpacing_t subcarrierSpacing, uint32_t rrc_reconfiguration_delay); -void nr_mac_config_scc(gNB_MAC_INST *nrmac, - rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts, - int pusch_AntennaPorts, - int sib1_tda, - int minRXTXTIMEpdsch); +void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *mac_config); bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup); bool nr_mac_prepare_ra_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup); bool nr_mac_update_cellgroup(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup); diff --git a/openair2/LAYER2/NR_MAC_gNB/main.c b/openair2/LAYER2/NR_MAC_gNB/main.c index c034d30a31..960310ff9a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/main.c +++ b/openair2/LAYER2/NR_MAC_gNB/main.c @@ -205,7 +205,10 @@ static void mac_rrc_init(gNB_MAC_INST *mac, ngran_node_t node_type) } } -void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfig_t *scd) +void mac_top_init_gNB(ngran_node_t node_type, + NR_ServingCellConfigCommon_t *scc, + NR_ServingCellConfig_t *scd, + const nr_mac_config_t *config) { module_id_t i; gNB_MAC_INST *nrmac; @@ -242,6 +245,8 @@ void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, RC.nrmac[i]->ul_handle = 0; RC.nrmac[i]->common_channels[0].ServingCellConfigCommon = scc; + RC.nrmac[i]->radio_config = *config; + RC.nrmac[i]->common_channels[0].pre_ServingCellConfig = scd; RC.nrmac[i]->first_MIB = true; @@ -250,9 +255,7 @@ void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, RC.nrmac[i]->cset0_bwp_start = 0; RC.nrmac[i]->cset0_bwp_size = 0; - /* Temporary: RRC configuration */ - gNB_RrcConfigurationReq conf = { .mcc = {208}, .mnc = {95}, .mnc_digit_length = {2}, .tac = 1, .cell_identity = 3584}; - NR_BCCH_DL_SCH_Message_t *sib1 = get_SIB1_NR(&conf, scc); + NR_BCCH_DL_SCH_Message_t *sib1 = get_SIB1_NR(config, scc); NR_COMMON_channels_t *cc = &RC.nrmac[i]->common_channels[0]; cc->sib1 = sib1; cc->sib1_bcch_length = encode_SIB1_NR(sib1, cc->sib1_bcch_pdu, sizeof(cc->sib1_bcch_pdu)); @@ -319,6 +322,9 @@ void mac_top_init_gNB(ngran_node_t node_type, NR_ServingCellConfigCommon_t *scc, du_init_f1_ue_data(); srand48(0); + + // triggers also PYH initialization in case we have L1 via FAPI + nr_mac_config_scc(RC.nrmac[0], scc, config); } void nr_mac_send_f1_setup_req(void) diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h index 1cf4efdcbb..53406b2f87 100644 --- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h +++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h @@ -121,6 +121,24 @@ typedef enum { WAIT_Msg4_ACK = 6 } RA_gNB_state_t; +typedef struct nr_pdsch_AntennaPorts_t { + int N1; + int N2; + int XP; +} nr_pdsch_AntennaPorts_t; + +typedef struct nr_mac_config_t { + int sib1_tda; + nr_pdsch_AntennaPorts_t pdsch_AntennaPorts; + int pusch_AntennaPorts; + int minRXTXTIME; + int do_CSIRS; + int do_SRS; + bool force_256qam_off; + //int pusch_TargetSNRx10; + //int pucch_TargetSNRx10; +} nr_mac_config_t; + typedef struct NR_preamble_ue { uint8_t num_preambles; uint8_t *preamble_list; @@ -744,9 +762,7 @@ typedef struct gNB_MAC_INST_s { /// Subcarrier Offset int ssb_SubcarrierOffset; int ssb_OffsetPointA; - /// SIB1 Time domain allocation - int sib1_tda; - int minRXTXTIMEpdsch; + /// Common cell resources NR_COMMON_channels_t common_channels[NFAPI_CC_MAX]; /// current PDU index (BCH,DLSCH) @@ -812,13 +828,13 @@ typedef struct gNB_MAC_INST_s { /// UL preprocessor for differentiated scheduling nr_pp_impl_ul pre_processor_ul; + nr_mac_config_t radio_config; + NR_UE_sched_ctrl_t *sched_ctrlCommon; uint16_t cset0_bwp_start; uint16_t cset0_bwp_size; NR_Type0_PDCCH_CSS_config_t type0_PDCCH_CSS_config[64]; - int xp_pdsch_antenna_ports; - bool first_MIB; NR_bler_options_t dl_bler; NR_bler_options_t ul_bler; diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 3768782b06..ee3ddd08ee 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -196,8 +196,8 @@ int xer_nr_sprint (char *string, size_t string_size, asn_TYPE_descriptor_t *td, //------------------------------------------------------------------------------ -uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier, - gNB_RrcConfigurationReq *configuration) { +uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier) +{ asn_enc_rval_t enc_rval; SystemInformation_IEs__sib_TypeAndInfo__Member *sib2 = NULL; SystemInformation_IEs__sib_TypeAndInfo__Member *sib3 = NULL; @@ -689,7 +689,6 @@ int16_t do_RRCReconfiguration( NR_MeasConfig_t *meas_config, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, rrc_gNB_ue_context_t *const ue_context_pP, - const gNB_RrcConfigurationReq *configuration, const NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *cellGroupConfig) //------------------------------------------------------------------------------ @@ -747,7 +746,7 @@ int16_t do_RRCReconfiguration( update_cellGroupConfig(cellGroupConfig, ue_context_pP->ue_context.rrc_ue_id, ue_context_pP ? ue_context_pP->ue_context.UE_Capability_nr : NULL, - configuration, + NULL, scc); } else { LOG_W(RRC, "no scc, cannot update cellGroup\n"); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h index d041c39a7c..a81091357a 100644 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.h +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h @@ -55,9 +55,7 @@ */ int xer_sprint_NR(char *string, size_t string_size, struct asn_TYPE_descriptor_s *td, void *sptr); -uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier, - gNB_RrcConfigurationReq *configuration); - +uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier); int do_RRCReject(uint8_t Mod_id, uint8_t *const buffer); @@ -111,7 +109,6 @@ int16_t do_RRCReconfiguration(const protocol_ctxt_t *const ctxt_pP, NR_MeasConfig_t *meas_config, struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList *dedicatedNAS_MessageList, rrc_gNB_ue_context_t *const ue_context_pP, - const gNB_RrcConfigurationReq *configuration, const NR_ServingCellConfigCommon_t *scc, NR_CellGroupConfig_t *cellGroupConfig); diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c index 4d4ea4f860..97bfa73547 100644 --- a/openair2/RRC/NR/nr_rrc_config.c +++ b/openair2/RRC/NR/nr_rrc_config.c @@ -30,6 +30,7 @@ #include "nr_rrc_config.h" #include "common/utils/nr/nr_common.h" +#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "executables/softmodem-common.h" #include "oai_asn1.h" #include "SIMULATION/TOOLS/sim.h" // for taus(); @@ -1249,7 +1250,7 @@ static void config_uplinkBWP(NR_BWP_Uplink_t *ubwp, long bwp_loop, bool is_SA, int uid, - const gNB_RrcConfigurationReq *configuration, + const nr_mac_config_t *configuration, const NR_ServingCellConfig_t *servingcellconfigdedicated, const NR_ServingCellConfigCommon_t *scc, const NR_UE_NR_Capability_t *uecap) @@ -1382,7 +1383,7 @@ static void set_csi_meas_periodicity(const NR_ServingCellConfigCommon_t *scc, NR } } -static void config_csi_codebook(const rrc_pdsch_AntennaPorts_t *antennaports, +static void config_csi_codebook(const nr_pdsch_AntennaPorts_t *antennaports, const int max_layers, struct NR_CodebookConfig *codebookConfig) { @@ -1487,7 +1488,7 @@ static void config_csi_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig, const NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_PUCCH_CSI_Resource_t *pucchcsires, struct NR_SetupRelease_PDSCH_Config *pdsch_Config, - const rrc_pdsch_AntennaPorts_t *antennaports, + const nr_pdsch_AntennaPorts_t *antennaports, const int max_layers, int rep_id, int uid) @@ -1712,7 +1713,7 @@ int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_s return (enc_rval.encoded + 7) / 8; } -NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configuration, const NR_ServingCellConfigCommon_t *scc) +NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const nr_mac_config_t *configuration, const NR_ServingCellConfigCommon_t *scc) { NR_BCCH_DL_SCH_Message_t *sib1_message = CALLOC(1,sizeof(NR_BCCH_DL_SCH_Message_t)); AssertFatal(sib1_message != NULL, "out of memory\n"); @@ -1740,17 +1741,17 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configurati for (int i = 0; i < num_plmn; ++i) { asn1cSequenceAdd(nr_plmn_info->plmn_IdentityList.list, struct NR_PLMN_Identity, nr_plmn); asn1cCalloc(nr_plmn->mcc, mcc); - int confMcc = configuration->mcc[i]; + int confMcc = 0; asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc0); *mcc0 = (confMcc / 100) % 10; asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc1); *mcc1 = (confMcc / 10) % 10; asn1cSequenceAdd(mcc->list, NR_MCC_MNC_Digit_t, mcc2); *mcc2 = confMcc % 10; - int mnc = configuration->mnc[i]; - if (configuration->mnc_digit_length[i] == 3) { + int mnc = 0; + if (0 == 3) { asn1cSequenceAdd(nr_plmn->mnc.list, NR_MCC_MNC_Digit_t, mnc0); - *mnc0 = (configuration->mnc[i] / 100) % 10; + *mnc0 = (0 / 100) % 10; } asn1cSequenceAdd(nr_plmn->mnc.list, NR_MCC_MNC_Digit_t, mnc1); *mnc1 = (mnc / 10) % 10; @@ -1762,13 +1763,13 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configurati AssertFatal(nr_plmn_info->cellIdentity.buf != NULL, "out of memory\n"); nr_plmn_info->cellIdentity.size = 5; nr_plmn_info->cellIdentity.bits_unused = 4; - uint64_t tmp = htobe64(configuration->cell_identity) << 4; + uint64_t tmp = htobe64(0) << 4; memcpy(nr_plmn_info->cellIdentity.buf, ((char *)&tmp) + 3, 5); nr_plmn_info->cellReservedForOperatorUse = NR_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved; nr_plmn_info->trackingAreaCode = CALLOC(1, sizeof(NR_TrackingAreaCode_t)); AssertFatal(nr_plmn_info->trackingAreaCode != NULL, "out of memory\n"); - uint32_t tmp2 = htobe32(configuration->tac); + uint32_t tmp2 = htobe32(0); nr_plmn_info->trackingAreaCode->buf = CALLOC(1, 3); AssertFatal(nr_plmn_info->trackingAreaCode->buf != NULL, "out of memory\n"); memcpy(nr_plmn_info->trackingAreaCode->buf, ((char *)&tmp2) + 1, 3); @@ -2067,7 +2068,7 @@ static NR_MAC_CellGroupConfig_t *configure_mac_cellgroup(void) static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid, const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfig_t *servingcellconfigdedicated, - const gNB_RrcConfigurationReq *configuration) + const nr_mac_config_t *configuration) { const int pdsch_AntennaPorts = configuration->pdsch_AntennaPorts.N1 * configuration->pdsch_AntennaPorts.N2 * configuration->pdsch_AntennaPorts.XP; @@ -2314,7 +2315,7 @@ static NR_SpCellConfig_t *get_initial_SpCellConfig(int uid, NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid, const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfig_t *servingcellconfigdedicated, - const gNB_RrcConfigurationReq *configuration) + const nr_mac_config_t *configuration) { NR_CellGroupConfig_t *cellGroupConfig = calloc(1, sizeof(*cellGroupConfig)); cellGroupConfig->cellGroupId = 0; @@ -2345,7 +2346,7 @@ NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid, void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, const int uid, NR_UE_NR_Capability_t *uecap, - const gNB_RrcConfigurationReq *configuration, + const nr_mac_config_t *configuration, const NR_ServingCellConfigCommon_t *scc) { DevAssert(cellGroupConfig != NULL); @@ -2527,10 +2528,10 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC const NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, - const gNB_RrcConfigurationReq *configuration, + const nr_mac_config_t *configuration, int uid) { - const rrc_pdsch_AntennaPorts_t *pdschap = &configuration->pdsch_AntennaPorts; + const nr_pdsch_AntennaPorts_t *pdschap = &configuration->pdsch_AntennaPorts; const int dl_antenna_ports = pdschap->N1 * pdschap->N2 * pdschap->XP; const int do_csirs = configuration->do_CSIRS; diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h index dbb97c14a8..ae1e31743e 100644 --- a/openair2/RRC/NR/nr_rrc_config.h +++ b/openair2/RRC/NR/nr_rrc_config.h @@ -34,6 +34,10 @@ #include "nr_rrc_defs.h" #include "openair2/RRC/NR/MESSAGES/asn1_msg.h" +// forward declaration of MAC configuration parameters, definition is included in C file +struct nr_mac_config_t; +typedef struct nr_mac_config_t nr_mac_config_t; + void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsch_TimeDomainAllocationList, frame_type_t frame_type, NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, @@ -53,18 +57,18 @@ int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_s #define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1 -NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const gNB_RrcConfigurationReq *configuration, const NR_ServingCellConfigCommon_t *scc); +NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const nr_mac_config_t *configuration, const NR_ServingCellConfigCommon_t *scc); void free_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1); int encode_SIB1_NR(NR_BCCH_DL_SCH_Message_t *sib1, uint8_t *buffer, int max_buffer_size); NR_CellGroupConfig_t *get_initial_cellGroupConfig(int uid, const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfig_t *servingcellconfigdedicated, - const gNB_RrcConfigurationReq *configuration); + const nr_mac_config_t *configuration); void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, const int uid, NR_UE_NR_Capability_t *uecap, - const gNB_RrcConfigurationReq *configuration, + const nr_mac_config_t *configuration, const NR_ServingCellConfigCommon_t *scc); void free_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig); int encode_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig, uint8_t *buffer, int max_buffer_size); @@ -78,7 +82,7 @@ NR_CellGroupConfig_t *get_default_secondaryCellGroup(const NR_ServingCellConfigC const NR_UE_NR_Capability_t *uecap, int scg_id, int servCellIndex, - const gNB_RrcConfigurationReq *configuration, + const nr_mac_config_t *configuration, int uid); #endif diff --git a/openair2/RRC/NR/nr_rrc_proto.h b/openair2/RRC/NR/nr_rrc_proto.h index 317a4976e8..69f71316ba 100644 --- a/openair2/RRC/NR/nr_rrc_proto.h +++ b/openair2/RRC/NR/nr_rrc_proto.h @@ -69,7 +69,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, NR_UE_NR_Capability_t *uecap, - const gNB_RrcConfigurationReq *configuration, int uid); int generate_CG_Config(gNB_RRC_INST *rrc, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index bcf26c0e16..07c951c4e2 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -278,28 +278,16 @@ static int get_ssb_arfcn(const f1ap_served_cell_info_t *cell_info, const NR_MIB_ ///---------------------------------------------------------------------------------------------------------------/// ///---------------------------------------------------------------------------------------------------------------/// -static void init_NR_SI(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *configuration) +static void init_NR_SI(gNB_RRC_INST *rrc) { if (!NODE_IS_DU(rrc->node_type)) { rrc->carrier.SIB23 = (uint8_t *) malloc16(100); AssertFatal(rrc->carrier.SIB23 != NULL, "cannot allocate memory for SIB"); - rrc->carrier.sizeof_SIB23 = do_SIB23_NR(&rrc->carrier, configuration); + rrc->carrier.sizeof_SIB23 = do_SIB23_NR(&rrc->carrier); LOG_I(NR_RRC,"do_SIB23_NR, size %d \n ", rrc->carrier.sizeof_SIB23); AssertFatal(rrc->carrier.sizeof_SIB23 != 255,"FATAL, RC.nrrrc[mod].carrier[CC_id].sizeof_SIB23 == 255"); } - LOG_I(NR_RRC,"Done init_NR_SI\n"); - - if (NODE_IS_MONOLITHIC(rrc->node_type) || NODE_IS_DU(rrc->node_type)){ - // update SI info - /* 1. move this to MAC */ - nr_mac_config_scc(RC.nrmac[rrc->module_id], - rrc->configuration.pdsch_AntennaPorts, - rrc->configuration.pusch_AntennaPorts, - rrc->configuration.sib1_tda, - rrc->configuration.minRXTXTIME); - } - if (get_softmodem_params()->phy_test > 0 || get_softmodem_params()->do_ra > 0) { AssertFatal(NODE_IS_MONOLITHIC(rrc->node_type), "phy_test and do_ra only work in monolithic\n"); rrc_gNB_ue_context_t *ue_context_p = rrc_gNB_allocate_new_ue_context(rrc); @@ -351,7 +339,7 @@ void openair_rrc_gNB_configuration(gNB_RRC_INST *rrc, gNB_RrcConfigurationReq *c RB_INIT(&rrc->rrc_ue_head); rrc->configuration = *configuration; /// System Information INIT - init_NR_SI(rrc, configuration); + init_NR_SI(rrc); return; } // END openair_rrc_gNB_configuration @@ -587,7 +575,6 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co measconfig, dedicatedNAS_MessageList, ue_context_pP, - &rrc->configuration, NULL, ue_p->masterCellGroup); AssertFatal(size > 0, "cannot encode RRCReconfiguration in %s()\n", __func__); @@ -709,7 +696,6 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration(const protocol_ctxt_t *const c NULL, dedicatedNAS_MessageList, ue_context_pP, - &rrc->configuration, NULL, cellGroupConfig); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size,"[MSG] RRC Reconfiguration\n"); @@ -856,7 +842,6 @@ rrc_gNB_modify_dedicatedRRCReconfiguration( dedicatedNAS_MessageList, NULL, NULL, - NULL, NULL); LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n"); @@ -942,7 +927,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release( dedicatedNAS_MessageList, NULL, NULL, - NULL, NULL); LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)buffer,size, "[MSG] RRC Reconfiguration\n"); @@ -1196,7 +1180,6 @@ static void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *co NULL, ue_context_pP, NULL, - NULL, cellGroupConfig); freeSRBlist(SRBs); freeDRBlist(DRBs); @@ -1257,7 +1240,6 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP NULL, ue_context_pP, NULL, - NULL, masterCellGroup); gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id]; diff --git a/openair2/RRC/NR/rrc_gNB_nsa.c b/openair2/RRC/NR/rrc_gNB_nsa.c index e03dcc4705..0b22621c0e 100644 --- a/openair2/RRC/NR/rrc_gNB_nsa.c +++ b/openair2/RRC/NR/rrc_gNB_nsa.c @@ -120,7 +120,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a { AssertFatal(!get_softmodem_params()->sa, "%s() cannot be called in SA mode, it is intrinsically for NSA\n", __func__); // generate nr-Config-r15 containers for LTE RRC : inside message for X2 EN-DC (CG-Config Message from 38.331) - const gNB_RrcConfigurationReq *configuration = &rrc->configuration; + const nr_mac_config_t *configuration = &RC.nrmac[0]->radio_config; MessageDef *msg; msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_ENDC_SGNB_ADDITION_REQ_ACK); gtpv1u_enb_create_tunnel_req_t create_tunnel_req; @@ -257,7 +257,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a AssertFatal(UE->secondaryCellGroup != NULL, "out of memory\n"); xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, UE->secondaryCellGroup); - fill_default_reconfig(sccc, scc, reconfig_ies, UE->secondaryCellGroup, UE->UE_Capability_nr, configuration, ue_context_p->ue_context.rrc_ue_id); + fill_default_reconfig(sccc, scc, reconfig_ies, UE->secondaryCellGroup, UE->UE_Capability_nr, ue_context_p->ue_context.rrc_ue_id); UE->rnti = UE->secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity; NR_CG_Config_t *CG_Config = calloc(1,sizeof(*CG_Config)); memset((void *)CG_Config,0,sizeof(*CG_Config)); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index c657d35831..d2ef7443c3 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -54,7 +54,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon NR_RRCReconfiguration_IEs_t *reconfig, NR_CellGroupConfig_t *secondaryCellGroup, NR_UE_NR_Capability_t *uecap, - const gNB_RrcConfigurationReq *configuration, int uid) { AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n"); AssertFatal(reconfig!=NULL,"reconfig is null\n");