Commit 881c6b0c authored by Guido Casati's avatar Guido Casati

Refactor l1_north_init_gNB

* code cleanup
* clang-formatted
* simplified code
parent 3e5292ca
......@@ -41,28 +41,25 @@
#include "SCHED_NR/fapi_nr_l1.h"
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
int l1_north_init_gNB() {
if (RC.nb_nr_L1_inst > 0 && RC.gNB != NULL) {
AssertFatal(RC.nb_nr_L1_inst>0,"nb_nr_L1_inst=%d\n",RC.nb_nr_L1_inst);
AssertFatal(RC.gNB!=NULL,"RC.gNB is null\n");
LOG_D(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
int l1_north_init_gNB()
{
AssertFatal(RC.nb_nr_L1_inst > 0, "Failed to init PHY callbacks: nb_nr_L1_inst = %d\n", RC.nb_nr_L1_inst);
AssertFatal(RC.gNB != NULL, "Failed to init PHY callbacks: RC.gNB is null\n");
LOG_I(NR_PHY, "RC.nb_nr_L1_inst = %d\n", RC.nb_nr_L1_inst);
for (int i=0; i<RC.nb_nr_L1_inst; i++) {
AssertFatal(RC.gNB[i]!=NULL,"RC.gNB[%d] is null\n",i);
for (uint8_t i = 0; i < RC.nb_nr_L1_inst; i++) {
if ((RC.gNB[i]->if_inst = NR_IF_Module_init(i))<0) return(-1);
if ((RC.gNB[i]->if_inst = NR_IF_Module_init(i)) < 0) {
LOG_E(NR_PHY, "Error: Failed to initialize NR_IF_Module for gNB[%d]\n", i);
return -1;
}
LOG_D(PHY, "%s() RC.gNB[%d] installing callbacks\n", __FUNCTION__, i);
LOG_D(NR_PHY, "RC.gNB[%d]: installing callbacks\n", i);
RC.gNB[i]->if_inst->NR_PHY_config_req = nr_phy_config_request;
RC.gNB[i]->if_inst->NR_Schedule_response = nr_schedule_response;
}
} else {
LOG_D(PHY, "%s() Not installing PHY callbacks - RC.nb_nr_L1_inst:%d RC.gNB:%p\n", __FUNCTION__, RC.nb_nr_L1_inst, RC.gNB);
}
return(0);
return 0;
}
NR_gNB_PHY_STATS_t *get_phy_stats(PHY_VARS_gNB *gNB, uint16_t rnti)
......
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