config module fix and extensions for Nb-IoT, shared lib loader and telnet server implementation
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
|
||||
int set_device(openair0_device *device) {
|
||||
|
||||
@@ -85,52 +86,26 @@ int set_transport(openair0_device *device) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
typedef int(*devfunc_t)(openair0_device *, openair0_config_t *, eth_params_t *);
|
||||
/* look for the interface library and load it */
|
||||
int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * cfg, uint8_t flag) {
|
||||
|
||||
void *lib_handle;
|
||||
oai_device_initfunc_t dp ;
|
||||
oai_transport_initfunc_t tp ;
|
||||
loader_shlibfunc_t shlib_fdesc[1];
|
||||
int ret=0;
|
||||
|
||||
char *libname;
|
||||
if (flag == RAU_LOCAL_RADIO_HEAD) {
|
||||
lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY);
|
||||
if (!lib_handle) {
|
||||
fprintf(stderr,"Unable to locate %s: HW device set to NONE_DEV.\n", OAI_RF_LIBNAME);
|
||||
fprintf(stderr,"%s\n",dlerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
dp = dlsym(lib_handle,"device_init");
|
||||
|
||||
if (dp != NULL ) {
|
||||
ret = dp(device,openair0_cfg);
|
||||
if (ret<0) {
|
||||
fprintf(stderr, "%s %d:oai device intialization failed %s\n", __FILE__, __LINE__, dlerror());
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror());
|
||||
return -1;
|
||||
}
|
||||
libname=OAI_RF_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
} else {
|
||||
lib_handle = dlopen(OAI_TP_LIBNAME, RTLD_LAZY);
|
||||
if (!lib_handle) {
|
||||
printf( "Unable to locate %s: transport protocol set to NONE_TP.\n", OAI_TP_LIBNAME);
|
||||
printf( "%s\n",dlerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
tp = dlsym(lib_handle,"transport_init");
|
||||
|
||||
if (tp != NULL ) {
|
||||
tp(device,openair0_cfg,cfg);
|
||||
} else {
|
||||
fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror());
|
||||
return -1;
|
||||
}
|
||||
libname=OAI_TP_LIBNAME;
|
||||
shlib_fdesc[0].fname="transport_init";
|
||||
}
|
||||
|
||||
ret=load_module_shlib(libname,shlib_fdesc,1);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr,"Library %s couldn't be loaded\n",libname);
|
||||
} else {
|
||||
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
/* name of shared library implementing the radio front end */
|
||||
#define OAI_RF_LIBNAME "liboai_device.so"
|
||||
#define OAI_RF_LIBNAME "oai_device"
|
||||
/* name of shared library implementing the transport */
|
||||
#define OAI_TP_LIBNAME "liboai_transpro.so"
|
||||
#define OAI_TP_LIBNAME "oai_transpro"
|
||||
|
||||
/* flags for BBU to determine whether the attached radio head is local or remote */
|
||||
#define RAU_LOCAL_RADIO_HEAD 0
|
||||
|
||||
@@ -135,11 +135,11 @@ volatile int oai_exit = 0;
|
||||
static clock_source_t clock_source = internal;
|
||||
static int wait_for_sync = 0;
|
||||
|
||||
static char UE_flag=0;
|
||||
static int8_t UE_flag=0;
|
||||
unsigned int mmapped_dma=0;
|
||||
int single_thread_flag=1;
|
||||
|
||||
static char threequarter_fs=0;
|
||||
static int8_t threequarter_fs=0;
|
||||
|
||||
uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
@@ -570,7 +570,7 @@ void *l2l1_task(void *arg) {
|
||||
|
||||
static void get_options(void) {
|
||||
int CC_id;
|
||||
int tddflag;
|
||||
int tddflag, nonbiotflag;
|
||||
char *loopfile=NULL;
|
||||
int dumpframe;
|
||||
uint32_t online_log_messages;
|
||||
@@ -627,10 +627,10 @@ static void get_options(void) {
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = debug_prach;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = no_L2_connect;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = calib_prach_tx;
|
||||
if ( (cmdline_uemodeparams[CMDLINE_DUMPMEMORY_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_dump_frame;
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach;
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect;
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
|
||||
if (dumpframe > 0) mode = rx_dump_frame;
|
||||
|
||||
if ( downlink_frequency[0][0] > 0) {
|
||||
printf("Downlink frequency set to %u\n", downlink_frequency[0][0]);
|
||||
@@ -645,35 +645,36 @@ static void get_options(void) {
|
||||
frame_parms[CC_id]->frame_type = TDD;
|
||||
}
|
||||
|
||||
if (n_rb_dl !=0) {
|
||||
printf("NB_RB set to %d\n",n_rb_dl);
|
||||
if ( n_rb_dl < 6 ) {
|
||||
n_rb_dl = 6;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",n_rb_dl);
|
||||
}
|
||||
if ( n_rb_dl > 100 ) {
|
||||
n_rb_dl = 100;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",n_rb_dl);
|
||||
}
|
||||
if ( n_rb_dl > 50 && n_rb_dl < 100 ) {
|
||||
n_rb_dl = 50;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",n_rb_dl);
|
||||
}
|
||||
if ( n_rb_dl > 25 && n_rb_dl < 50 ) {
|
||||
n_rb_dl = 25;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",n_rb_dl);
|
||||
}
|
||||
UE_scan = 0;
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->N_RB_DL=n_rb_dl;
|
||||
frame_parms[CC_id]->N_RB_UL=n_rb_dl;
|
||||
}
|
||||
if (frame_parms[0]->N_RB_DL !=0) {
|
||||
if ( frame_parms[0]->N_RB_DL < 6 ) {
|
||||
frame_parms[0]->N_RB_DL = 6;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 100;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 50;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
||||
frame_parms[0]->N_RB_DL = 25;
|
||||
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
UE_scan = 0;
|
||||
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
|
||||
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
|
||||
}
|
||||
}
|
||||
|
||||
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
tx_max_power[CC_id]=tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
|
||||
for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
tx_max_power[CC_id]=tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
}
|
||||
} /* UE_flag > 0 */
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
#define CONFIG_HLP_TPORT "tracer port\n"
|
||||
#define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n"
|
||||
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
|
||||
|
||||
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
|
||||
|
||||
/***************************************************************************************************************************************/
|
||||
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
|
||||
@@ -129,7 +129,7 @@
|
||||
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \
|
||||
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&n_rb_dl, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:0, TYPE_UINT8, 0}, \
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,8 @@ extern int16_t dlsch_demod_shift;
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&ouput_vcd, defintval:0, TYPE_INT, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0} \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT,PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
#define CONFIG_HLP_FLOG "Enable online log \n"
|
||||
|
||||
Reference in New Issue
Block a user