Commit a2d16b34 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/develop_integration_w48' into develop

Summary of changes:
- bug fixes: random access, crash on physicalConfigDedicated)
- some work on the UE to have it functional again
- IQ record and playback (work from Nokia)
  see documentation at: oai/openairinterface5g!244
parents fc0a60e1 a7b7de35
...@@ -241,6 +241,7 @@ add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs ...@@ -241,6 +241,7 @@ add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace") add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace") add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros") add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros")
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
...@@ -1803,6 +1804,7 @@ add_executable(lte-softmodem-nos1 ...@@ -1803,6 +1804,7 @@ add_executable(lte-softmodem-nos1
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-softmodem.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
...@@ -1933,7 +1935,7 @@ add_executable(oaisim_nos1 ...@@ -1933,7 +1935,7 @@ add_executable(oaisim_nos1
${x2ap_h} ${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c ${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
......
...@@ -66,6 +66,7 @@ UE_AUTOTEST_TRACE="False" ...@@ -66,6 +66,7 @@ UE_AUTOTEST_TRACE="False"
UE_DEBUG_TRACE="False" UE_DEBUG_TRACE="False"
UE_TIMING_TRACE="False" UE_TIMING_TRACE="False"
DISABLE_LOG_X="False" DISABLE_LOG_X="False"
USRP_REC_PLAY="False"
BUILD_ECLIPSE=0 BUILD_ECLIPSE=0
trap handle_ctrl_c INT trap handle_ctrl_c INT
...@@ -158,6 +159,8 @@ Options ...@@ -158,6 +159,8 @@ Options
Disable all LOG_* macros Disable all LOG_* macros
--build-eclipse --build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh Build eclipse project files. Paths are auto corrected by fixprj.sh
--usrp-recplay
Build for I/Q record-playback modes
Usage (first build): Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
...@@ -350,6 +353,10 @@ function main() { ...@@ -350,6 +353,10 @@ function main() {
BUILD_TELNETSRV=1 BUILD_TELNETSRV=1
echo_info "Build embedded telnet server" echo_info "Build embedded telnet server"
shift ;; shift ;;
--usrp-recplay)
USRP_REC_PLAY="True"
echo_info "Enabling USRP record playback mode"
shift 1;;
-h | --help) -h | --help)
print_help print_help
exit 1;; exit 1;;
...@@ -540,6 +547,7 @@ function main() { ...@@ -540,6 +547,7 @@ function main() {
echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
echo_info "Compiling UE S1 build : enabling Linux and NETLINK" echo_info "Compiling UE S1 build : enabling Linux and NETLINK"
echo "set (LINUX True )" >> $cmake_file echo "set (LINUX True )" >> $cmake_file
......
...@@ -52,9 +52,12 @@ char defbool[2]="1"; ...@@ -52,9 +52,12 @@ char defbool[2]="1";
switch(cfgoptions->type) switch(cfgoptions->type)
{ {
case TYPE_STRING: case TYPE_STRING:
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *)); if (cfgoptions->numelt == 0 ) {
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1)); config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
sprintf(*(cfgoptions->strptr), "%s",tmpval); sprintf(*(cfgoptions->strptr), "%s",tmpval);
} else {
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
}
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval); printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
optisset=1; optisset=1;
break; break;
......
...@@ -129,20 +129,21 @@ int i; ...@@ -129,20 +129,21 @@ int i;
/* default */ /* default */
if (cfgparam == NULL) { if (cfgparam == NULL) {
cfgparam = "libconfig:oaisoftmodem.conf"; tmpflags = tmpflags | CONFIG_NOOOPT;
cfgparam = DEFAULT_CFGMODE ":" DEFAULT_CFGFILENAME;
} }
/* parse the config parameters to set the config source */ /* parse the config parameters to set the config source */
i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams); i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams);
if (i< 0) { if (i< 0) {
fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno)); fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno));
cfgmode=strdup("libconfig"); cfgmode=strdup(DEFAULT_CFGMODE);
modeparams = strdup("oaisoftmodem.conf"); modeparams = strdup(DEFAULT_CFGFILENAME);
} }
else if ( i == 1 ) { else if ( i == 1 ) {
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig /* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
with one parameter, the path to the configuration file */ with one parameter, the path to the configuration file */
modeparams=cfgmode; modeparams=cfgmode;
cfgmode=strdup("libconfig"); cfgmode=strdup(DEFAULT_CFGMODE);
} }
cfgptr = malloc(sizeof(configmodule_interface_t)); cfgptr = malloc(sizeof(configmodule_interface_t));
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages #define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
#define CONFIG_HELP 8 // print help message #define CONFIG_HELP 8 // print help message
#define CONFIG_ABORT 16 // config failed,abort execution #define CONFIG_ABORT 16 // config failed,abort execution
#define CONFIG_NOOOPT 32 // no -O option found when parsing command line
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP); typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
......
...@@ -50,7 +50,11 @@ configmodule_interface_t *config_get_if(void) ...@@ -50,7 +50,11 @@ configmodule_interface_t *config_get_if(void)
char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
{ {
printf_ptrs("-- %s 0x%08lx %i\n",cfgoptions->optname,(uintptr_t)(*ptr),length); printf_ptrs("[CONFIG] %s ptr: 0x%08lx requested size: %i\n",cfgoptions->optname,(uintptr_t)(ptr),length);
if(cfgoptions->numelt > 0) { /* already allocated */
return *ptr;
}
if (*ptr == NULL) { if (*ptr == NULL) {
*ptr = malloc(length); *ptr = malloc(length);
if ( *ptr != NULL) { if ( *ptr != NULL) {
...@@ -147,3 +151,7 @@ int config_isparamset(paramdef_t *params,int paramidx) ...@@ -147,3 +151,7 @@ int config_isparamset(paramdef_t *params,int paramidx)
return 0; return 0;
} }
} }
int config_getparamval_fromparamdefidx(paramdef_t *cfgoptions,int paramidx) {
return -1;
}
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
extern "C" extern "C"
{ {
#endif #endif
#define DEFAULT_CFGFILENAME "oaisoftmodem.conf"
#define DEFAULT_CFGMODE "libconfig"
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode ) #define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP ) #define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] ) #define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
...@@ -51,6 +54,7 @@ extern int config_get(paramdef_t *params,int numparams, char *prefix); ...@@ -51,6 +54,7 @@ extern int config_get(paramdef_t *params,int numparams, char *prefix);
extern int config_isparamset(paramdef_t *params,int paramidx); extern int config_isparamset(paramdef_t *params,int paramidx);
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val); extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix); extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix);
extern int config_getparamval_fromparamdefidx(paramdef_t *cfgoptions,int paramidx);
#define config_getlist config_get_if()->getlist #define config_getlist config_get_if()->getlist
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0]) #define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
......
...@@ -104,17 +104,28 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) ...@@ -104,17 +104,28 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
cfgpath,str,cfgoptions[i].numelt); cfgpath,str,cfgoptions[i].numelt);
str[strlen(str)-1] = 0; str[strlen(str)-1] = 0;
} }
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *)); if (cfgoptions[i].numelt == 0 ) {
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1); config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
sprintf( *(cfgoptions[i].strptr) , "%s", str); config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) ); sprintf( *(cfgoptions[i].strptr) , "%s", str);
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) );
} else {
sprintf( (char *)(cfgoptions[i].strptr) , "%s", str);
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,(char *)cfgoptions[i].strptr );
}
} else { } else {
if( cfgoptions[i].defstrval != NULL) { if( cfgoptions[i].defstrval != NULL) {
defval=1; defval=1;
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1); if (cfgoptions[i].numelt == 0 ) {
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval); config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr)); config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1);
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr));
} else {
sprintf((char *)(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, (char *)cfgoptions[i].strptr);
}
} else { } else {
notfound=1; notfound=1;
} }
...@@ -183,7 +194,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) ...@@ -183,7 +194,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
read_intarray(&cfgoptions[i],setting,cfgpath); read_intarray(&cfgoptions[i],setting,cfgpath);
} else { } else {
if( cfgoptions[i].defintarrayval != NULL) { if( cfgoptions[i].defintarrayval != NULL) {
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t)); config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t*));
cfgoptions[i].iptr=cfgoptions[i].defintarrayval; cfgoptions[i].iptr=cfgoptions[i].defintarrayval;
defval=1; defval=1;
for (int j=0; j<cfgoptions[i].numelt ; j++) { for (int j=0; j<cfgoptions[i].numelt ; j++) {
......
...@@ -1871,6 +1871,23 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -1871,6 +1871,23 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
eNB->pucch1ab_stats_cnt[j][i]=0; eNB->pucch1ab_stats_cnt[j][i]=0;
} }
} }
#if defined(USRP_REC_PLAY)
// It's probably bad to do this statically only once.
// Looks like the above is incomplete.
// Such reset needs to be done once a UE PHY structure is being used/re-used
// Don't know if this is ever possible in current architecture
for (i=0;i<10240;i++) {
for (j=0;j<NUMBER_OF_UE_MAX;j++) {
eNB->pucch1_stats[j][i]=0;
eNB->pucch1_stats_thres[j][i]=0;
}
}
for (i=0;i<20480;i++) {
for (j=0;j<NUMBER_OF_UE_MAX;j++) {
eNB->pucch1ab_stats[j][i]=0;
}
}
#endif
first_call=0; first_call=0;
} }
...@@ -2152,8 +2169,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -2152,8 +2169,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
} //phase } //phase
// stat_max *= nsymb; // normalize to energy per symbol // stat_max *= nsymb; // normalize to energy per symbol
// stat_max /= (frame_parms->N_RB_UL*12); // // stat_max /= (frame_parms->N_RB_UL*12); //
stat_max /= (nsymb*12); stat_max /= (nsymb*12);
#ifdef DEBUG_PUCCH_RX #ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max); printf("[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
#endif #endif
...@@ -2289,8 +2307,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -2289,8 +2307,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
stat_im=0; stat_im=0;
// Do detection now // Do detection now
#if defined(USRP_REC_PLAY)
// It looks like the value is a bit messy when RF is replayed.
// For instance i assume to skip pucch1_thres from the test below.
if (sigma2_dB<(dB_fixed(stat_max))) {//
#else
if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {// if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {//
#endif
chL = (nsymb>>1)-4; chL = (nsymb>>1)-4;
chest_mag=0; chest_mag=0;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max]; cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max];
...@@ -2431,7 +2454,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB, ...@@ -2431,7 +2454,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
if (fmt==pucch_format1b) if (fmt==pucch_format1b)
*(1+payload) = (stat_im<0) ? 1 : 2; *(1+payload) = (stat_im<0) ? 1 : 2;
} else { // insufficient energy on PUCCH so NAK } else { // insufficient energy on PUCCH so NAK
#if defined(USRP_REC_PLAY)
LOG_I(PHY,"PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
#else
LOG_I(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres); LOG_I(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
#endif
*payload = 4; // DTX *payload = 4; // DTX
((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re); ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im); ((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
......
...@@ -2939,12 +2939,12 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ...@@ -2939,12 +2939,12 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
//dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
ue->UE_mode[eNB_id] = PUSCH; ue->UE_mode[eNB_id] = PUSCH;
}
} else { } else {
LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Problem in DCI!\n",ue->Mod_id,frame_rx,subframe_rx); LOG_E(PHY,"[UE %d] Frame %d, subframe %d: Problem in DCI!\n",ue->Mod_id,frame_rx,subframe_rx);
dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
} }
} }
else if ((dci_alloc_rx[i].rnti == SI_RNTI) && else if ((dci_alloc_rx[i].rnti == SI_RNTI) &&
((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) {
...@@ -2977,7 +2977,6 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint ...@@ -2977,7 +2977,6 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
} }
} }
}
else if ((dci_alloc_rx[i].rnti == P_RNTI) && else if ((dci_alloc_rx[i].rnti == P_RNTI) &&
((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) { ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) {
......
...@@ -2592,7 +2592,9 @@ void RCConfig(void) { ...@@ -2592,7 +2592,9 @@ void RCConfig(void) {
/* get global parameters, defined outside any section in the config file */ /* get global parameters, defined outside any section in the config file */
printf("Getting ENBSParams\n");
config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL); config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt; RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
......
...@@ -128,7 +128,11 @@ ...@@ -128,7 +128,11 @@
/*!\brief Maximum number od control elemenets */ /*!\brief Maximum number od control elemenets */
#define MAX_NUM_CE 5 #define MAX_NUM_CE 5
/*!\brief Maximum number of random access process */ /*!\brief Maximum number of random access process */
#if defined(USRP_REC_PLAY)
#define NB_RA_PROC_MAX 1
#else
#define NB_RA_PROC_MAX 4 #define NB_RA_PROC_MAX 4
#endif
/*!\brief size of buffer status report table */ /*!\brief size of buffer status report table */
#define BSR_TABLE_SIZE 64 #define BSR_TABLE_SIZE 64
/*!\brief The power headroom reporting range is from -23 ...+40 dB and beyond, with step 1 */ /*!\brief The power headroom reporting range is from -23 ...+40 dB and beyond, with step 1 */
......
...@@ -352,17 +352,17 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -352,17 +352,17 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
ul_req = ul_req =
&RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body; &RC.mac[module_idP]->UL_req[CC_id].ul_config_request_body;
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status
(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED)
continue;
AssertFatal(UE_list-> AssertFatal(UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated UE_template[CC_id][UE_id].physicalConfigDedicated
!= NULL, != NULL,
"physicalConfigDedicated is null for UE %d\n", "physicalConfigDedicated is null for UE %d\n",
UE_id); UE_id);
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
if (mac_eNB_get_rrc_status
(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED)
continue;
if ((SRconfig = if ((SRconfig =
UE_list-> UE_list->
UE_template[CC_id][UE_id].physicalConfigDedicated-> UE_template[CC_id][UE_id].physicalConfigDedicated->
......
...@@ -1579,7 +1579,25 @@ initiate_ra_proc(module_id_t module_idP, ...@@ -1579,7 +1579,25 @@ initiate_ra_proc(module_id_t module_idP,
ra[i].Msg2_subframe = (subframeP + 4) % 10; ra[i].Msg2_subframe = (subframeP + 4) % 10;
/* TODO: find better procedure to allocate RNTI */ /* TODO: find better procedure to allocate RNTI */
do { do {
#if defined(USRP_REC_PLAY) // deterministic rnti in usrp record/playback mode
static int drnti[NUMBER_OF_UE_MAX] = { 0xbda7, 0x71da, 0x9c40, 0xc350, 0x2710, 0x4e20, 0x7530, 0x1388, 0x3a98, 0x61a8, 0x88b8, 0xafc8, 0xd6d8, 0x1b58, 0x4268, 0x6978 };
int j = 0;
int nb_ue = 0;
for (j = 0; j < NUMBER_OF_UE_MAX; j++) {
if (UE_RNTI(module_idP, j) > 0) {
nb_ue++;
} else {
break;
}
}
if (nb_ue >= NUMBER_OF_UE_MAX) {
printf("No more free RNTI available, increase NUMBER_OF_UE_MAX\n");
abort();
}
ra[i].rnti = drnti[nb_ue];
#else
ra[i].rnti = taus(); ra[i].rnti = taus();
#endif
loop++; loop++;
} }
while (loop != 100 && while (loop != 100 &&
......
...@@ -1349,9 +1349,14 @@ fill_nfapi_harq_information(module_id_t module_idP, ...@@ -1349,9 +1349,14 @@ fill_nfapi_harq_information(module_id_t module_idP,
AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n"); AssertFatal(UE_id >= 0, "UE_id cannot be found, impossible\n");
AssertFatal(UE_list != NULL, "UE_list is null\n"); AssertFatal(UE_list != NULL, "UE_list is null\n");
#if 0
/* TODO: revisit, don't use Assert, it's perfectly possible to
* have physicalConfigDedicated NULL here
*/
AssertFatal(UE_list->UE_template[CC_idP][UE_id]. AssertFatal(UE_list->UE_template[CC_idP][UE_id].
physicalConfigDedicated != NULL, physicalConfigDedicated != NULL,
"physicalConfigDedicated for rnti %x is null\n", rntiP); "physicalConfigDedicated for rnti %x is null\n", rntiP);
#endif
harq_information->harq_information_rel11.num_ant_ports = 1; harq_information->harq_information_rel11.num_ant_ports = 1;
...@@ -2057,6 +2062,9 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP ...@@ -2057,6 +2062,9 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP, int harq_pidP
UE_list->ordered_ULCCids[0][UE_id] = cc_idP; UE_list->ordered_ULCCids[0][UE_id] = cc_idP;
UE_list->num_UEs++; UE_list->num_UEs++;
UE_list->active[UE_id] = TRUE; UE_list->active[UE_id] = TRUE;
#if defined(USRP_REC_PLAY) // not specific to record/playback ?
UE_list->UE_template[cc_idP][UE_id].pre_assigned_mcs_ul = 0;
#endif
#ifdef Rel14 #ifdef Rel14
UE_list->UE_template[cc_idP][UE_id].rach_resource_type = UE_list->UE_template[cc_idP][UE_id].rach_resource_type =
...@@ -3585,11 +3593,9 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id, ...@@ -3585,11 +3593,9 @@ extract_harq(module_id_t mod_idP, int CC_idP, int UE_id,
uint8_t *pdu; uint8_t *pdu;
#ifdef Rel14 #ifdef Rel14
AssertFatal(UE_list-> if (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated != NULL &&
UE_template[pCCid][UE_id].physicalConfigDedicated-> UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->pucch_ConfigDedicated != NULL &&
pucch_ConfigDedicated != NULL, (UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7)
"pucch_ConfigDedicated is null!\n");
if ((UE_list->UE_template[pCCid][UE_id].physicalConfigDedicated->ext7)
&& (UE_list->UE_template[pCCid][UE_id]. && (UE_list->UE_template[pCCid][UE_id].
physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13) physicalConfigDedicated->ext7->pucch_ConfigDedicated_r13)
&& &&
......
...@@ -268,6 +268,9 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -268,6 +268,9 @@ rx_sdu(const module_id_t enb_mod_idP,
"[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n", "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",
enb_mod_idP, frameP, subframeP, CC_idP, rx_ces[i], i, enb_mod_idP, frameP, subframeP, CC_idP, rx_ces[i], i,
num_ce, old_rnti, old_UE_id); num_ce, old_rnti, old_UE_id);
/* receiving CRNTI means that the current rnti has to go away */
cancel_ra_proc(enb_mod_idP, CC_idP, frameP,
current_rnti);
if (old_UE_id != -1) { if (old_UE_id != -1) {
/* TODO: if the UE did random access (followed by a MAC uplink with /* TODO: if the UE did random access (followed by a MAC uplink with
* CRNTI) because none of its scheduling request was granted, then * CRNTI) because none of its scheduling request was granted, then
...@@ -288,9 +291,6 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -288,9 +291,6 @@ rx_sdu(const module_id_t enb_mod_idP,
mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP, mac_eNB_rrc_ul_in_sync(enb_mod_idP, CC_idP, frameP,
subframeP, old_rnti); subframeP, old_rnti);
} }
/* receiving CRNTI means that the current rnti has to go away */
cancel_ra_proc(enb_mod_idP, CC_idP, frameP,
current_rnti);
current_rnti = old_rnti; current_rnti = old_rnti;
} }
crnti_rx = 1; crnti_rx = 1;
......
...@@ -210,7 +210,7 @@ void mac_init_cell_params(int Mod_idP, int CC_idP) ...@@ -210,7 +210,7 @@ void mac_init_cell_params(int Mod_idP, int CC_idP)
UE_TEMPLATE *UE_template; UE_TEMPLATE *UE_template;
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", Mod_idP); LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", Mod_idP);
COMMON_channels_t *cc = &RC.mac[Mod_idP]->common_channels[CC_idP]; //COMMON_channels_t *cc = &RC.mac[Mod_idP]->common_channels[CC_idP];
memset(&RC.mac[Mod_idP]->eNB_stats, 0, sizeof(eNB_STATS)); memset(&RC.mac[Mod_idP]->eNB_stats, 0, sizeof(eNB_STATS));
UE_template = UE_template =
......
...@@ -220,7 +220,7 @@ pdcp_validate_security( ...@@ -220,7 +220,7 @@ pdcp_validate_security(
stream_decrypt(pdcp_pP->cipheringAlgorithm, stream_decrypt(pdcp_pP->cipheringAlgorithm,
&decrypt_params, &decrypt_params,
&buffer_decrypted); &buffer_decrypted);
#if !defined(USRP_REC_PLAY)
if (srb_flagP) { if (srb_flagP) {
/* Now check the integrity of the complete PDU */ /* Now check the integrity of the complete PDU */
decrypt_params.message = pdcp_pdu_buffer; decrypt_params.message = pdcp_pdu_buffer;
...@@ -241,7 +241,7 @@ pdcp_validate_security( ...@@ -241,7 +241,7 @@ pdcp_validate_security(
return -1; return -1;
} }
} }
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT);
return 0; return 0;
......
...@@ -807,7 +807,10 @@ mac_UE_get_rrc_status( ...@@ -807,7 +807,10 @@ mac_UE_get_rrc_status(
) )
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
{ {
return(UE_rrc_inst[Mod_idP].Info[indexP].State); if (UE_rrc_inst)
return(UE_rrc_inst[Mod_idP].Info[indexP].State);
else
return(-1);
} }
//-------------------------------------------------------------------------------------------// //-------------------------------------------------------------------------------------------//
......
...@@ -242,7 +242,11 @@ typedef enum HO_STATE_e { ...@@ -242,7 +242,11 @@ typedef enum HO_STATE_e {
// #define NUM_MAX_CBA_GROUP 4 // in the platform_constants // #define NUM_MAX_CBA_GROUP 4 // in the platform_constants
/* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */ /* TS 36.331: RRC-TransactionIdentifier ::= INTEGER (0..3) */
#if defined(USRP_REC_PLAY)
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 1
#else
#define RRC_TRANSACTION_IDENTIFIER_NUMBER 3 #define RRC_TRANSACTION_IDENTIFIER_NUMBER 3
#endif
typedef struct { typedef struct {
unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */ unsigned short transport_block_size; /*!< \brief Minimum PDU size in bytes provided by RLC to MAC layer interface */
......
...@@ -627,12 +627,12 @@ void rrc_eNB_emulation_notify_ue_module_id( ...@@ -627,12 +627,12 @@ void rrc_eNB_emulation_notify_ue_module_id(
return; return;
} }
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
if (RC.rrc[enb_module_id].carrier[CC_id].sib1 != NULL) { if (&RC.rrc[enb_module_id]->carrier[CC_id].sib1 != NULL) {
if ( if (
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[0] == cell_identity_byte0P) && (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[0] == cell_identity_byte0P) &&
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[1] == cell_identity_byte1P) && (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[1] == cell_identity_byte1P) &&
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) && (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[2] == cell_identity_byte2P) &&
(RC.rrc[enb_module_id].carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P) (&RC.rrc[enb_module_id]->carrier[CC_id].sib1->cellAccessRelatedInfo.cellIdentity.buf[3] == cell_identity_byte3P)
) { ) {