Commit 8e9d9807 authored by Robert Schmidt's avatar Robert Schmidt

lte-ru.c: fct for interface -dependant config, export more functions

- add set_function_spec_param() which configures RU_t instance depending on its
  function(al split)
- export more functions like kill_RU_proc() so that they can be reused by
  restart functionality
parent a91a3587
......@@ -1959,55 +1959,9 @@ void init_precoding_weights(PHY_VARS_eNB *eNB) {
}
}
extern void RCconfig_RU(void);
void init_RU(char *rf_config_file) {
int ru_id;
RU_t *ru;
void set_function_spec_param(RU_t *ru)
{
int ret;
PHY_VARS_eNB *eNB0;
int i;
int CC_id;
// create status mask
RC.ru_mask = 0;
pthread_mutex_init(&RC.ru_mutex,NULL);
pthread_cond_init(&RC.ru_cond,NULL);
// read in configuration file)
printf("configuring RU from file\n");
RCconfig_RU();
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs());
for (i=0;i<RC.nb_L1_inst;i++)
for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.eNB[i][CC_id]->num_RU=0;
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
ru = RC.ru[ru_id];
ru->rf_config_file = rf_config_file;
ru->idx = ru_id;
ru->ts_offset = 0;
// use eNB_list[0] as a reference for RU frame parameters
// NOTE: multiple CC_id are not handled here yet!
eNB0 = ru->eNB_list[0];
if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
AssertFatal(eNB0!=NULL,"eNB0 is null!\n");
if (eNB0) {
LOG_I(PHY,"Copying frame parms from eNB %d to ru %d\n",eNB0->Mod_id,ru->idx);
memcpy((void*)&ru->frame_parms,(void*)&eNB0->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
// attach all RU to all eNBs in its list/
for (i=0;i<ru->num_eNB;i++) {
eNB0 = ru->eNB_list[i];
eNB0->RU_list[eNB0->num_RU++] = ru;
}
}
// LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
switch (ru->if_south) {
case LOCAL_RF: // this is an RU with integrated RF (RRU, eNB)
......@@ -2030,7 +1984,7 @@ void init_RU(char *rf_config_file) {
reset_meas(&ru->transport);
ret = openair0_transport_load(&ru->ifdevice,&ru->openair0_cfg,&ru->eth_params);
printf("openair0_transport_init returns %d for ru_id %d\n",ret,ru_id);
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
exit(-1);
......@@ -2055,7 +2009,7 @@ void init_RU(char *rf_config_file) {
reset_meas(&ru->transport);
ret = openair0_transport_load(&ru->ifdevice,&ru->openair0_cfg,&ru->eth_params);
printf("openair0_transport_init returns %d for ru_id %d\n",ret,ru_id);
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
exit(-1);
......@@ -2075,7 +2029,7 @@ void init_RU(char *rf_config_file) {
ru->fh_south_in = rx_rf; // local synchronous RF RX
ru->fh_south_out = tx_rf; // local synchronous RF TX
ru->start_rf = start_rf; // need to start the local RF interface
printf("configuring ru_id %d (start_rf %p)\n",ru_id,start_rf);
printf("configuring ru_id %d (start_rf %p)\n", ru->idx, start_rf);
/*
if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise
fill_rf_config(ru,rf_config_file);
......@@ -2112,7 +2066,7 @@ void init_RU(char *rf_config_file) {
ru->ifdevice.configure_rru = configure_ru;
ret = openair0_transport_load(&ru->ifdevice,&ru->openair0_cfg,&ru->eth_params);
printf("openair0_transport_init returns %d for ru_id %d\n",ret,ru_id);
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
exit(-1);
......@@ -2136,7 +2090,7 @@ void init_RU(char *rf_config_file) {
ru->ifdevice.configure_rru = configure_ru;
ret = openair0_transport_load(&ru->ifdevice, &ru->openair0_cfg, &ru->eth_params);
printf("openair0_transport_init returns %d for ru_id %d\n",ret,ru_id);
printf("openair0_transport_init returns %d for ru_id %d\n", ret, ru->idx);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
exit(-1);
......@@ -2150,7 +2104,57 @@ void init_RU(char *rf_config_file) {
LOG_E(PHY,"RU with invalid or unknown southbound interface type %d\n",ru->if_south);
break;
} // switch on interface type
}
extern void RCconfig_RU(void);
void init_RU(char *rf_config_file) {
int ru_id;
RU_t *ru;
PHY_VARS_eNB *eNB0;
int i;
int CC_id;
// create status mask
RC.ru_mask = 0;
pthread_mutex_init(&RC.ru_mutex,NULL);
pthread_cond_init(&RC.ru_cond,NULL);
// read in configuration file)
printf("configuring RU from file\n");
RCconfig_RU();
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs());
for (i=0;i<RC.nb_L1_inst;i++)
for (CC_id=0;CC_id<RC.nb_CC[i];CC_id++) RC.eNB[i][CC_id]->num_RU=0;
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
ru = RC.ru[ru_id];
ru->rf_config_file = rf_config_file;
ru->idx = ru_id;
ru->ts_offset = 0;
// use eNB_list[0] as a reference for RU frame parameters
// NOTE: multiple CC_id are not handled here yet!
eNB0 = ru->eNB_list[0];
if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
AssertFatal(eNB0!=NULL,"eNB0 is null!\n");
if (eNB0) {
LOG_I(PHY,"Copying frame parms from eNB %d to ru %d\n",eNB0->Mod_id,ru->idx);
memcpy((void*)&ru->frame_parms,(void*)&eNB0->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
// attach all RU to all eNBs in its list/
for (i=0;i<ru->num_eNB;i++) {
eNB0 = ru->eNB_list[i];
eNB0->RU_list[eNB0->num_RU++] = ru;
}
}
// LOG_I(PHY,"Initializing RRU descriptor %d : (%s,%s,%d)\n",ru_id,ru_if_types[ru->if_south],eNB_timing[ru->if_timing],ru->function);
set_function_spec_param(ru);
LOG_I(PHY,"Starting ru_thread %d\n",ru_id);
init_RU_proc(ru);
......
......@@ -244,6 +244,10 @@ extern void kill_eNB_proc(int inst);
// In lte-ru.c
extern void init_RU(const char*);
extern void init_RU_proc(RU_t *ru);
extern void stop_RU(int nb_ru);
extern void kill_RU_proc(int inst);
extern void set_function_spec_param(RU_t *ru);
// In lte-ue.c
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
......
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