Commit 2ff25e68 authored by Guido Casati's avatar Guido Casati

Remove gNB and L1 init in RCconfig_nr_prs

* gNB and L1 init is done in init_gNB and RCconfig_NR_L1
* moved RCconfig_nr_prs out of create_gNB_tasks for consistency
* do RCconfig_nr_prs only for L1 instances
parent e57acf61
......@@ -273,10 +273,6 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
RCconfig_verify(cfg, node_type);
if(NFAPI_MODE != NFAPI_MODE_AERIAL){
RCconfig_nr_prs();
}
if (RC.nb_nr_macrlc_inst > 0)
RCconfig_nr_macrlc(cfg);
......@@ -636,6 +632,9 @@ int main( int argc, char **argv ) {
init_gNB(wait_for_sync);
// Initialize L1
RCconfig_NR_L1();
// Initialize Positioning Reference Signal configuration
if(NFAPI_MODE != NFAPI_MODE_PNF && NFAPI_MODE != NFAPI_MODE_AERIAL)
RCconfig_nr_prs();
}
if (NFAPI_MODE != NFAPI_MODE_PNF) {
......
......@@ -746,25 +746,15 @@ void RCconfig_nr_prs(void)
prs_config_t *prs_config = NULL;
char str[7][100] = {0};
AssertFatal(RC.gNB != NULL, "gNB context is null, cannot complete PRS configuration\n");
paramdef_t PRS_Params[] = PRS_PARAMS_DESC;
paramlist_def_t PRS_ParamList = {CONFIG_STRING_PRS_CONFIG,NULL,0};
if (RC.gNB == NULL) {
RC.gNB = (PHY_VARS_gNB **)malloc((1+NUMBER_OF_gNB_MAX)*sizeof(PHY_VARS_gNB*));
LOG_I(NR_PHY,"RC.gNB = %p\n",RC.gNB);
memset(RC.gNB,0,(1+NUMBER_OF_gNB_MAX)*sizeof(PHY_VARS_gNB*));
}
config_getlist(config_get_if(), &PRS_ParamList, PRS_Params, sizeofArray(PRS_Params), NULL);
if (PRS_ParamList.numelt > 0) {
for (j = 0; j < RC.nb_nr_L1_inst; j++) {
if (RC.gNB[j] == NULL) {
RC.gNB[j] = (PHY_VARS_gNB *)malloc(sizeof(PHY_VARS_gNB));
LOG_I(NR_PHY,"RC.gNB[%d] = %p\n",j,RC.gNB[j]);
memset(RC.gNB[j],0,sizeof(PHY_VARS_gNB));
RC.gNB[j]->Mod_id = j;
}
AssertFatal(RC.gNB[j] != NULL, "gNB L1 instance is null at index %d, cannot complete L1 configuration\n", j);
RC.gNB[j]->prs_vars.NumPRSResources = *(PRS_ParamList.paramarray[j][NUM_PRS_RESOURCES].uptr);
for (k = 0; k < RC.gNB[j]->prs_vars.NumPRSResources; k++)
......
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