Commit a54c1f23 authored by francescomani's avatar francescomani

passing the file name on top of the path for uecap

parent 562013fa
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" #define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n"
#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n" #define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n"
#define CONFIG_HLP_UECAP_PATH "path for UE Capabilities file\n" #define CONFIG_HLP_UECAP_FILE "path for UE Capabilities file\n"
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
......
...@@ -757,14 +757,14 @@ void *UE_thread(void *arg) { ...@@ -757,14 +757,14 @@ void *UE_thread(void *arg) {
} }
void init_NR_UE(int nb_inst, void init_NR_UE(int nb_inst,
char* uecap_path, char* uecap_file,
char* rrc_config_path) { char* rrc_config_path) {
int inst; int inst;
NR_UE_MAC_INST_t *mac_inst; NR_UE_MAC_INST_t *mac_inst;
NR_UE_RRC_INST_t* rrc_inst; NR_UE_RRC_INST_t* rrc_inst;
for (inst=0; inst < nb_inst; inst++) { for (inst=0; inst < nb_inst; inst++) {
AssertFatal((rrc_inst = nr_l3_init_ue(uecap_path,rrc_config_path)) != NULL, "can not initialize RRC module\n"); AssertFatal((rrc_inst = nr_l3_init_ue(uecap_file,rrc_config_path)) != NULL, "can not initialize RRC module\n");
AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n"); AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n");
AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n"); AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n");
} }
......
...@@ -115,7 +115,7 @@ int vcdflag = 0; ...@@ -115,7 +115,7 @@ int vcdflag = 0;
double rx_gain_off = 0.0; double rx_gain_off = 0.0;
char *usrp_args = NULL; char *usrp_args = NULL;
char *rrc_config_path = NULL; char *rrc_config_path = NULL;
char *uecap_path = NULL; char *uecap_file = NULL;
int dumpframe = 0; int dumpframe = 0;
uint64_t downlink_frequency[MAX_NUM_CCs][4]; uint64_t downlink_frequency[MAX_NUM_CCs][4];
...@@ -148,8 +148,6 @@ int numerology = 0; ...@@ -148,8 +148,6 @@ int numerology = 0;
int oaisim_flag = 0; int oaisim_flag = 0;
int emulate_rf = 0; int emulate_rf = 0;
uint32_t N_RB_DL = 106; uint32_t N_RB_DL = 106;
char uecap_xer_in = 0;
char uecap_xer[1024];
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed /* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution * this is very hackish - find a proper solution
...@@ -254,14 +252,6 @@ static void get_options(void) { ...@@ -254,14 +252,6 @@ static void get_options(void) {
if (vcdflag > 0) if (vcdflag > 0)
ouput_vcd = 1; ouput_vcd = 1;
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) {
// Here the configuration file is the XER encoded UE capabilities
// Read it in and store in asn1c data structures
sprintf(uecap_xer,"%stargets/PROJECTS/GENERIC-LTE-EPC/CONF/UE_config.xml",getenv("OPENAIR_HOME"));
printf("%s\n",uecap_xer);
uecap_xer_in=1;
} /* UE with config file */
} }
// set PHY vars from command line // set PHY vars from command line
...@@ -439,7 +429,7 @@ int main( int argc, char **argv ) { ...@@ -439,7 +429,7 @@ int main( int argc, char **argv ) {
#endif #endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
init_NR_UE(1,uecap_path,rrc_config_path); init_NR_UE(1,uecap_file,rrc_config_path);
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa)
init_pdcp(); init_pdcp();
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
{"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:(uint32_t *)&nrUE_params.ofdm_offset_divisor, defuintval:UINT_MAX, TYPE_UINT32, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
{"uecap_path", CONFIG_HLP_UECAP_PATH, 0, strptr:(char **)&uecap_path, defstrval:"./", TYPE_STRING, 0}, \ {"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:(char **)&uecap_file, defstrval:"./", TYPE_STRING, 0}, \
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \
} }
......
...@@ -410,7 +410,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, ...@@ -410,7 +410,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
} }
NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_path){ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_file, char* rrc_config_path){
int nr_ue; int nr_ue;
if(NB_NR_UE_INST > 0){ if(NB_NR_UE_INST > 0){
NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t)); NR_UE_rrc_inst = (NR_UE_RRC_INST_t *)malloc(NB_NR_UE_INST * sizeof(NR_UE_RRC_INST_t));
...@@ -485,7 +485,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_ ...@@ -485,7 +485,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_
RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations);
} }
NR_UE_rrc_inst->uecap_path = uecap_path; NR_UE_rrc_inst->uecap_file = uecap_file;
if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) { if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) {
// read in files for RRCReconfiguration and RBconfig // read in files for RRCReconfiguration and RBconfig
...@@ -2634,13 +2634,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ...@@ -2634,13 +2634,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
ctxt_pP->frame, ctxt_pP->frame,
gNB_index); gNB_index);
FILE *f = NULL;
char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_path;
if (file_path) {
sprintf(UE_NR_Capability_xer_fname,"%s/uecap.xml",file_path);
f = fopen(UE_NR_Capability_xer_fname, "r");
}
memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t)); memset((void *)&ul_dcch_msg,0,sizeof(NR_UL_DCCH_Message_t));
memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); memset((void *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t));
ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1; ul_dcch_msg.message.present = NR_UL_DCCH_MessageType_PR_c1;
...@@ -2651,6 +2644,13 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ...@@ -2651,6 +2644,13 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr; ue_CapabilityRAT_Container.rat_Type = NR_RAT_Type_nr;
NR_UE_NR_Capability_t* UE_Capability_nr = NULL; NR_UE_NR_Capability_t* UE_Capability_nr = NULL;
FILE *f = NULL;
char *file_path = NR_UE_rrc_inst[ctxt_pP->module_id].uecap_file;
if (file_path) {
sprintf(UE_NR_Capability_xer_fname,"%s",file_path);
f = fopen(UE_NR_Capability_xer_fname, "r");
}
if(f){ if(f){
size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f); size = fread(UE_NR_Capability_xer, 1, sizeof UE_NR_Capability_xer, f);
if (size == 0 || size == sizeof UE_NR_Capability_xer) { if (size == 0 || size == sizeof UE_NR_Capability_xer) {
......
...@@ -120,7 +120,7 @@ typedef struct NR_UE_RRC_INST_s { ...@@ -120,7 +120,7 @@ typedef struct NR_UE_RRC_INST_s {
NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8]; NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8];
rb_id_t *defaultDRB; // remember the ID of the default DRB rb_id_t *defaultDRB; // remember the ID of the default DRB
char *uecap_path; char *uecap_file;
NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; NR_SRB_INFO Srb0[NB_SIG_CNX_UE];
NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE];
......
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