diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h index c02155326b6b5be42f0c2225604078d70ba430f5..22b616f29ecae64fed49762ff8ec6ea00d713857 100644 --- a/executables/nr-softmodem-common.h +++ b/executables/nr-softmodem-common.h @@ -88,7 +88,8 @@ #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\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_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_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 60ff40abeb16f8eaaf5a49c1d55085a31291c6cf..ee9c4cd1748a01d42acdf6a4a2313c7abc17b1f2 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -756,13 +756,15 @@ void *UE_thread(void *arg) { return NULL; } -void init_NR_UE(int nb_inst, char* rrc_config_path) { +void init_NR_UE(int nb_inst, + char* uecap_path, + char* rrc_config_path) { int inst; NR_UE_MAC_INST_t *mac_inst; NR_UE_RRC_INST_t* rrc_inst; for (inst=0; inst < nb_inst; inst++) { - AssertFatal((rrc_inst = nr_l3_init_ue(rrc_config_path)) != NULL, "can not initialize RRC module\n"); + AssertFatal((rrc_inst = nr_l3_init_ue(uecap_path,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->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n"); } diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index ad5ea982c944e7a32fbc2d69fc56afc4b2e5f755..746297e6fb85eaa1919c2373fdcc7c40146e17f3 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -115,6 +115,7 @@ int vcdflag = 0; double rx_gain_off = 0.0; char *usrp_args = NULL; char *rrc_config_path = NULL; +char *uecap_path = NULL; int dumpframe = 0; uint64_t downlink_frequency[MAX_NUM_CCs][4]; @@ -443,7 +444,7 @@ int main( int argc, char **argv ) { #endif LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); - init_NR_UE(1,rrc_config_path); + init_NR_UE(1,uecap_path,rrc_config_path); if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) init_pdcp(); diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 7f47ed5eb3c14b6534a2bdd0704b028472ccb892..0def34dd392b0c67cfd25172625844318d29922e 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -33,8 +33,9 @@ {"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, iptr:(int32_t *)&nrUE_params.nr_dlsch_parallel, defintval:0, TYPE_UINT8, 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}, \ - {"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \ - {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 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}, \ + {"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \ } @@ -84,7 +85,7 @@ extern nrUE_params_t *get_nrUE_params(void); // In nr-ue.c extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern void fill_ue_band_info(void); -extern void init_NR_UE(int, char*); +extern void init_NR_UE(int, char*, char*); extern void init_NR_UE_threads(int); extern void reset_opp_meas(void); extern void print_opp_meas(void); diff --git a/openair2/RRC/NR_UE/main_ue.c b/openair2/RRC/NR_UE/main_ue.c index 07409c6026194f3512832678d61b4f506feebbc2..5e2bc429ebb0b59c784f49e2a3c3aa4080ce85cf 100644 --- a/openair2/RRC/NR_UE/main_ue.c +++ b/openair2/RRC/NR_UE/main_ue.c @@ -34,8 +34,8 @@ #include "rrc_proto.h" #include "common/utils/LOG/log.h" -NR_UE_RRC_INST_t* nr_l3_init_ue(char* rrc_config_path){ +NR_UE_RRC_INST_t* nr_l3_init_ue(char* uecap, char* rrc_config_path){ //LOG_I(RRC, "[MAIN] NR UE MAC initialization...\n"); - return openair_rrc_top_init_ue_nr(rrc_config_path); + return openair_rrc_top_init_ue_nr(uecap,rrc_config_path); } diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index e444b45fff3039ceebb95c4de7f78e5c32426982..f2868e9c978b3fa6d5171869f8d09e4c059594f7 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -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* rrc_config_path){ +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* uecap_path, char* rrc_config_path){ int nr_ue; 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)); @@ -485,6 +485,8 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ RRC_LIST_INIT(NR_UE_rrc_inst[nr_ue].CSI_ReportConfig_list, NR_maxNrofCSI_ReportConfigurations); } + NR_UE_rrc_inst->uecap_path = uecap_path; + if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1) { // read in files for RRCReconfiguration and RBconfig FILE *fd; @@ -494,7 +496,7 @@ NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char* rrc_config_path){ else sprintf(filename,"reconfig.raw"); fd = fopen(filename,"r"); - char buffer[1024]; + char buffer[1024]; AssertFatal(fd, "cannot read file %s: errno %d, %s\n", filename, @@ -2632,8 +2634,12 @@ nr_rrc_ue_process_ueCapabilityEnquiry( ctxt_pP->frame, gNB_index); - sprintf(UE_NR_Capability_xer_fname,"../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/uecap.xml"); - FILE *f = fopen(UE_NR_Capability_xer_fname, "r"); + 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 *)&ue_CapabilityRAT_Container,0,sizeof(NR_UE_CapabilityRAT_Container_t)); diff --git a/openair2/RRC/NR_UE/rrc_defs.h b/openair2/RRC/NR_UE/rrc_defs.h index 790da98f1bea448b39290ff6408987778ff16193..d623481c8140b489d2bde7d801e38e2f7191c9d2 100644 --- a/openair2/RRC/NR_UE/rrc_defs.h +++ b/openair2/RRC/NR_UE/rrc_defs.h @@ -120,6 +120,8 @@ typedef struct NR_UE_RRC_INST_s { NR_DRB_ToAddMod_t *DRB_config[NB_CNX_UE][8]; rb_id_t *defaultDRB; // remember the ID of the default DRB + char *uecap_path; + NR_SRB_INFO Srb0[NB_SIG_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb1[NB_CNX_UE]; NR_SRB_INFO_TABLE_ENTRY Srb2[NB_CNX_UE]; diff --git a/openair2/RRC/NR_UE/rrc_proto.h b/openair2/RRC/NR_UE/rrc_proto.h index 534da0112bf3feedd45cf7682ebde12bb9a714b9..78237a709cca2ffba1d96ff69c66c911b71b7216 100644 --- a/openair2/RRC/NR_UE/rrc_proto.h +++ b/openair2/RRC/NR_UE/rrc_proto.h @@ -43,14 +43,14 @@ // main_rrc.c // /**\brief Layer 3 initialization*/ -NR_UE_RRC_INST_t* nr_l3_init_ue(char*); +NR_UE_RRC_INST_t* nr_l3_init_ue(char*,char*); // // UE_rrc.c // /**\brief Initial the top level RRC structure instance*/ -NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*); +NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*,char*);