From dd07d878a39aa3f6a613a1e80a834f9e630c506d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 17 May 2017 12:58:21 +0200 Subject: [PATCH 01/19] bugfix: fix compilation for express MIMO target --- cmake_targets/build_oai | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 07278d82b1..93a7ac073e 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -785,20 +785,19 @@ function main() { build_dir=$rrh_build_dir fi - # build RF device libraries (currently EXMIMO is not complied with the rest of HW targets) + # build RF device libraries if [ "$HW" != "None" ] ; then rm -f liboai_device.so rm -f $dbin/liboai_device.so - # link liboai_device.so with the selected RF device library if [ "$HW" == "EXMIMO" ] ; then - - #add exmimo compilation - #TODO EXMIMO library support compilations \ $build_dir oai_exmimodevif \ liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL + + ln -sf liboai_exmimodevif.so liboai_device.so + ln -sf $dbin/liboai_exmimodevif.so.$REL $dbin/liboai_device.so echo_info "liboai_device.so is linked to EXMIMO device library" elif [ "$HW" == "OAI_USRP" ] ; then if [ -d "/usr/include/uhd" ] ; then From 5e323eefa2f413fec8b24055228fb1ac989de737 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 18 May 2017 10:39:25 +0200 Subject: [PATCH 02/19] improve logging in oaisim - print current working directory - print git version (if available) - print security keys this last one is a security breach, but as of today it's not a problem --- openair3/NAS/TOOLS/display.c | 8 ++++++ openair3/NAS/UE/EMM/emm_main.c | 46 ++++++++++++++++++++++++++++++++++ targets/SIMU/USER/oaisim.c | 16 ++++++++++++ 3 files changed, 70 insertions(+) diff --git a/openair3/NAS/TOOLS/display.c b/openair3/NAS/TOOLS/display.c index 7d145d1f3b..363fae76b8 100644 --- a/openair3/NAS/TOOLS/display.c +++ b/openair3/NAS/TOOLS/display.c @@ -248,6 +248,14 @@ void display_usim_data(const char *filename) { memcpy(key, data.keys.ik, USIM_IK_SIZE); printf("\tIK\t: \"%s\"\n", key); + printf("\n\tusim_api_k:"); + for (int i = 0; i < 16; i++) + printf(" %2.2x", data.keys.usim_api_k[i]); + printf("\n\topc :"); + for (int i = 0; i < 16; i++) + printf(" %2.2x", data.keys.opc[i]); + printf("\n\n"); + printf("EPS NAS security context:\n"); printf("\tKSIasme\t: 0x%.2x\n", data.securityctx.KSIasme.value[0]); char kasme[USIM_K_ASME_SIZE + 1]; diff --git a/openair3/NAS/UE/EMM/emm_main.c b/openair3/NAS/UE/EMM/emm_main.c index c64fd6df26..8f3ed17e4c 100644 --- a/openair3/NAS/UE/EMM/emm_main.c +++ b/openair3/NAS/UE/EMM/emm_main.c @@ -203,6 +203,52 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c LOG_TRACE(INFO, "EMM-MAIN - USIM application data successfully read"); user->emm_data->usim_is_valid = TRUE; + /* print keys (for debugging) */ + { + char usim_api_k[256]; + char opc[256]; + sprintf(usim_api_k, + "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x " + "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x", + user->usim_data.keys.usim_api_k[0], + user->usim_data.keys.usim_api_k[1], + user->usim_data.keys.usim_api_k[2], + user->usim_data.keys.usim_api_k[3], + user->usim_data.keys.usim_api_k[4], + user->usim_data.keys.usim_api_k[5], + user->usim_data.keys.usim_api_k[6], + user->usim_data.keys.usim_api_k[7], + user->usim_data.keys.usim_api_k[8], + user->usim_data.keys.usim_api_k[9], + user->usim_data.keys.usim_api_k[10], + user->usim_data.keys.usim_api_k[11], + user->usim_data.keys.usim_api_k[12], + user->usim_data.keys.usim_api_k[13], + user->usim_data.keys.usim_api_k[14], + user->usim_data.keys.usim_api_k[15]); + sprintf(opc, + "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x " + "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x", + user->usim_data.keys.opc[0], + user->usim_data.keys.opc[1], + user->usim_data.keys.opc[2], + user->usim_data.keys.opc[3], + user->usim_data.keys.opc[4], + user->usim_data.keys.opc[5], + user->usim_data.keys.opc[6], + user->usim_data.keys.opc[7], + user->usim_data.keys.opc[8], + user->usim_data.keys.opc[9], + user->usim_data.keys.opc[10], + user->usim_data.keys.opc[11], + user->usim_data.keys.opc[12], + user->usim_data.keys.opc[13], + user->usim_data.keys.opc[14], + user->usim_data.keys.opc[15]); + LOG_TRACE(INFO, "EMM-MAIN - usim_api_k: %s", usim_api_k); + LOG_TRACE(INFO, "EMM-MAIN - opc: %s", opc); + } + /* Get the Home PLMN derived from the IMSI */ user->emm_data->hplmn.MCCdigit1 = user->usim_data.imsi.u.num.digit1; user->emm_data->hplmn.MCCdigit2 = user->usim_data.imsi.u.num.digit2; diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index b60e73e37c..d07cd759d1 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -1188,6 +1188,15 @@ int T_port = 2021; /* default port to listen to to wait for the tracer */ int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ #endif +static void print_current_directory(void) +{ + char dir[8192]; /* arbitrary size (should be big enough) */ + if (getcwd(dir, 8192) == NULL) + printf("ERROR getting working directory\n"); + else + printf("working directory: %s\n", dir); +} + /*------------------------------------------------------------------------------*/ int main (int argc, char **argv) @@ -1195,6 +1204,8 @@ main (int argc, char **argv) clock_t t; + print_current_directory(); + start_background_system(); #ifdef SMBV @@ -1350,6 +1361,11 @@ main (int argc, char **argv) LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); +#ifndef PACKAGE_VERSION +# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" +#endif + LOG_I(EMU, "Version: %s\n", PACKAGE_VERSION); + #if defined(ENABLE_ITTI) // Handle signals until all tasks are terminated From 4eefaffb475c9443c8836bbbc562a041af96d02e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 18 May 2017 11:12:11 +0200 Subject: [PATCH 03/19] minor: change files mode (from 755 to 644) --- openair1/PHY/INIT/lte_init.c | 0 openair1/PHY/LTE_TRANSPORT/defs.h | 0 openair1/PHY/LTE_TRANSPORT/if4_tools.c | 0 openair1/PHY/LTE_TRANSPORT/proto.h | 0 openair1/PHY/LTE_TRANSPORT/pucch.c | 0 openair1/PHY/TOOLS/lte_phy_scope_tm4.c | 0 openair1/PHY/impl_defs_lte.h | 0 openair1/SIMULATION/LTE_PHY/pucchsim.c | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 openair1/PHY/INIT/lte_init.c mode change 100755 => 100644 openair1/PHY/LTE_TRANSPORT/defs.h mode change 100755 => 100644 openair1/PHY/LTE_TRANSPORT/if4_tools.c mode change 100755 => 100644 openair1/PHY/LTE_TRANSPORT/proto.h mode change 100755 => 100644 openair1/PHY/LTE_TRANSPORT/pucch.c mode change 100755 => 100644 openair1/PHY/TOOLS/lte_phy_scope_tm4.c mode change 100755 => 100644 openair1/PHY/impl_defs_lte.h mode change 100755 => 100644 openair1/SIMULATION/LTE_PHY/pucchsim.c diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c old mode 100755 new mode 100644 diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h old mode 100755 new mode 100644 diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c old mode 100755 new mode 100644 diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h old mode 100755 new mode 100644 diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c old mode 100755 new mode 100644 diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c old mode 100755 new mode 100644 diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h old mode 100755 new mode 100644 diff --git a/openair1/SIMULATION/LTE_PHY/pucchsim.c b/openair1/SIMULATION/LTE_PHY/pucchsim.c old mode 100755 new mode 100644 From f6693af628615512744eab3a964129305d74ab3e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 18 May 2017 11:24:40 +0200 Subject: [PATCH 04/19] add CQI to periodic logging of UE --- openair2/LAYER2/MAC/eNB_scheduler.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 6509471124..e7fbbce3c9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -140,10 +140,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, rnti = UE_RNTI(module_idP, i); CC_id = UE_PCCID(module_idP, i); - if ((frameP==0)&&(subframeP==0)) - LOG_I(MAC,"UE rnti %x : %s, PHR %d dB\n", rnti, - UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync", - UE_list->UE_template[CC_id][i].phr_info); + if ((frameP==0)&&(subframeP==0)) { + LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti); + int cqi = eNB_UE_stats == NULL ? -1 : eNB_UE_stats->DL_cqi[0]; + LOG_I(MAC,"UE rnti %x : %s, PHR %d dB CQI %d\n", rnti, + UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync", + UE_list->UE_template[CC_id][i].phr_info, + cqi); + } PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63; if (i==UE_list->head) From 94dd884325e4b613a08a3b572c8689cfb85bd047 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 18 May 2017 11:34:58 +0200 Subject: [PATCH 05/19] redo commit cb67d586a451fd77f862b1462e8b778c43169a23 Seems like this commit got lost at some point. Here was the message: ----------------------------------------------------------------------------- Author: Cedric Roux Date: Tue Jan 10 14:21:02 2017 +0100 add format indicator to get LOG_X warnings The LOG_X macros emit a lot of warnings when compiling with the T because they call the function logRecord (or logRecord_mt) which has not been "marked" as calling printf, so gcc won't emit typical printf warnings. With the T, they directly translate to sprintf, so those warnings pop up, much more verbose due to several macro expansions. Let's make them pop up all the time so it's easier to fix them. ----------------------------------------------------------------------------- --- openair2/UTIL/LOG/log.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 3a67e85d3d..5140a08dbd 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -259,8 +259,8 @@ void log_set_instance_type (log_instance_type_t instance); # include "log_if.h" /*----------------------------------------------------------------------------*/ int logInit (void); -void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...); -void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...); +void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); +void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7))); int set_comp_log(int component, int level, int verbosity, int interval); int set_log(int component, int level, int interval); void set_glog(int level, int verbosity); From 9d65f4dd09f1d391e4cc786289ad426c24a66cf3 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 18 May 2017 14:15:16 +0200 Subject: [PATCH 06/19] warnings removal in LOG_X those popped up thanks to previous commit --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 4 ++-- openair1/PHY/LTE_TRANSPORT/phich.c | 1 + openair2/RRC/LITE/rrc_UE.c | 4 ++-- openair2/RRC/LITE/rrc_eNB_S1AP.c | 4 ++-- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 4 ++-- targets/RT/USER/lte-enb.c | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 5aa676da9a..59d16c7a39 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -4888,7 +4888,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, if(rballoc > RIV_max) { - LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %d \n",rballoc, RIV_max); + LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max); // DCI false detection return(0); } @@ -5124,7 +5124,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, if( (rballoc > RIV_max) && (rah == 1) ) { // DCI false detection - LOG_I(PHY,"bad rballoc %d RIV_max %d\n", rballoc, RIV_max); + LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max); return(0); } diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index d363d4dcf6..194eea402b 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1396,6 +1396,7 @@ void rx_phich(PHY_VARS_UE *ue, HI16, nseq_PHICH, ngroup_PHICH, + ulsch->harq_processes[harq_pid]->round, ulsch->Mlimit); //#endif diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index 2cf87c3e45..dd3690e2ac 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -1042,7 +1042,7 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio // Update cqi_ReportConfig if(radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig != NULL) { - LOG_I(RRC,"Update cqi_ReportConfig config (size=%d,%d)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig), sizeof(CQI_ReportConfig_t)); + LOG_I(RRC,"Update cqi_ReportConfig config (size=%zu,%zu)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig), sizeof(CQI_ReportConfig_t)); if(UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig == NULL) UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig = CALLOC(1,sizeof(CQI_ReportConfig_t)); @@ -1052,7 +1052,7 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio sizeof(*physicalConfigDedicated2->cqi_ReportConfig)); if (radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic != NULL) { - LOG_I(RRC,"Update cqi_ReportPeriodic config (size=%d,%d)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic), sizeof(CQI_ReportPeriodic_t)); + LOG_I(RRC,"Update cqi_ReportPeriodic config (size=%zu,%zu)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic), sizeof(CQI_ReportPeriodic_t)); if(UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig->cqi_ReportPeriodic == NULL) UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig->cqi_ReportPeriodic = CALLOC(1,sizeof(CQI_ReportPeriodic_t)); diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index 3642d02a1c..1ec7cc44e8 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -287,7 +287,7 @@ rrc_eNB_process_security( // translation LOG_D(RRC, - "[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %u NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n", + "[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %lu NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n", ctxt_pP->module_id, ue_context_pP->ue_context.security_capabilities.encryption_algorithms, ue_context_pP->ue_context.ciphering_algorithm, @@ -308,7 +308,7 @@ rrc_eNB_process_security( changed = TRUE; } - LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %x, %x, %s\n", + LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %lx, %x, %s\n", ctxt_pP->module_id, ue_context_pP->ue_context.rnti, security_capabilities_pP, diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index dc2589de44..df91796049 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -261,7 +261,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp LOG_E(PHY,"[recv] received %d samples out of %d\n",samples_received,nsamps); if ( s->rx_md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE) - LOG_E(PHY,s->rx_md.to_pp_string(true).c_str()); + LOG_E(PHY, "%s\n", s->rx_md.to_pp_string(true).c_str()); s->rx_count += nsamps; s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate); @@ -664,7 +664,7 @@ extern "C" { LOG_I(PHY,"RF board max packet size %u, size for 100µs jitter %d \n", max, samples); if ( samples < max ) stream_args_rx.args["spp"] = str(boost::format("%d") % samples ); - LOG_I(PHY,"rx_max_num_samps %u\n", + LOG_I(PHY,"rx_max_num_samps %zu\n", s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps()); for (int i = 0; itimestamp_rx+eNB->ts_offset+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance; if (recv_if_count != 0 ) { recv_if_count = recv_if_count-1; - LOG_D(HW,"[From Timestamp %d to Timestamp %d] RTT_RF: %"PRId64"; RTT_RF\n", start_rf_prev_ts, end_rf_ts, clock_difftime_ns(start_rf_prev, end_rf)); - LOG_D(HW,"[From Timestamp %d to Timestamp %d] RTT_RF: %"PRId64"; RTT_RF\n",start_rf_prev2_ts, end_rf_ts, clock_difftime_ns(start_rf_prev2, end_rf)); + LOG_D(HW,"[From Timestamp %"PRId64" to Timestamp %"PRId64"] RTT_RF: %"PRId64"; RTT_RF\n", start_rf_prev_ts, end_rf_ts, clock_difftime_ns(start_rf_prev, end_rf)); + LOG_D(HW,"[From Timestamp %"PRId64" to Timestamp %"PRId64"] RTT_RF: %"PRId64"; RTT_RF\n",start_rf_prev2_ts, end_rf_ts, clock_difftime_ns(start_rf_prev2, end_rf)); } VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 ); From dcfdd76113ce9c887c120c948ca19e665634a81e Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 18 May 2017 15:35:00 +0200 Subject: [PATCH 07/19] minor: warnings removal It seems that ciphering_algorithm is "unsigned int" in RRC Rel10 and "unsigned long" in RRC Rel14 (as processed by asn1c) Let's force it to unsigned long in the log to avoid compilation-time warnings. --- openair2/RRC/LITE/rrc_eNB_S1AP.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c index 1ec7cc44e8..f3c22abeff 100644 --- a/openair2/RRC/LITE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c @@ -290,7 +290,7 @@ rrc_eNB_process_security( "[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %lu NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n", ctxt_pP->module_id, ue_context_pP->ue_context.security_capabilities.encryption_algorithms, - ue_context_pP->ue_context.ciphering_algorithm, + (unsigned long)ue_context_pP->ue_context.ciphering_algorithm, ue_context_pP->ue_context.security_capabilities.integrity_algorithms, ue_context_pP->ue_context.integrity_algorithm); /* Select relevant algorithms */ @@ -312,7 +312,7 @@ rrc_eNB_process_security( ctxt_pP->module_id, ue_context_pP->ue_context.rnti, security_capabilities_pP, - cipheringAlgorithm, + (unsigned long)cipheringAlgorithm, integrityProtAlgorithm, changed ? "changed" : "same"); From c08bd6ba9c5f6d85720aa40dbd49ed5d72e3b0cb Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Thu, 18 May 2017 15:42:44 +0200 Subject: [PATCH 08/19] warning removal force j to -1, there is a compilation warning with the T tracer (variable may be used uninitialized) --- openair2/LAYER2/MAC/eNB_scheduler_mch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c index 2d3e96bec3..56582f936c 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c @@ -87,7 +87,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra unsigned char header_len_mcch=0,header_len_msi=0,header_len_mtch=0, header_len_mtch_temp=0, header_len_mcch_temp=0, header_len_msi_temp=0; int ii=0, msi_pos=0; int mcch_mcs = -1; - uint16_t TBS,j,padding=0,post_padding=0; + uint16_t TBS,j=-1,padding=0,post_padding=0; mac_rlc_status_resp_t rlc_status; int num_mtch; int msi_length,i,k; From 8160f8a23fa600fe16a2378aa472c8eb43725318 Mon Sep 17 00:00:00 2001 From: Tomohiro Date: Fri, 19 May 2017 09:24:49 +0900 Subject: [PATCH 09/19] Fujitsu No.39 Correct pdcch symbol calculation --- openair1/PHY/LTE_TRANSPORT/dci.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) mode change 100644 => 100755 openair1/PHY/LTE_TRANSPORT/dci.c diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c old mode 100644 new mode 100755 index 21c4c8aba8..d376fcac3b --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -1979,6 +1979,9 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, uint16_t numCCE = 0; uint8_t i; uint8_t nCCEmin = 0; + uint16_t CCE_max_used_index = 0; + uint16_t firstCCE_max = dci_alloc[0].firstCCE; + uint8_t L = dci_alloc[0].L; // check pdcch duration imposed by PHICH duration (Section 6.9 of 36-211) if (frame_parms->Ncp==1) { // extended prefix @@ -1995,16 +1998,24 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, for (i=0; i %d\n",i,dci_alloc[i].L); numCCE += (1<<(dci_alloc[i].L)); + + if(firstCCE_max < dci_alloc[i].firstCCE) { + firstCCE_max = dci_alloc[i].firstCCE; + L = dci_alloc[i].L; + } + if(i == (num_dci - 1)) { + CCE_max_used_index = firstCCE_max + (1<N_RB_DL*2)) - if (numCCE <= get_nCCE(1, frame_parms, get_mi(frame_parms, subframe))) + if (CCE_max_used_index <= get_nCCE(1, frame_parms, get_mi(frame_parms, subframe))) return(cmax(1,nCCEmin)); //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 4 : 5))) - else if (numCCE <= get_nCCE(2, frame_parms, get_mi(frame_parms, subframe))) + else if (CCE_max_used_index <= get_nCCE(2, frame_parms, get_mi(frame_parms, subframe))) return(cmax(2,nCCEmin)); //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 7 : 8))) - else if (numCCE <= get_nCCE(3, frame_parms, get_mi(frame_parms, subframe))) + else if (CCE_max_used_index <= get_nCCE(3, frame_parms, get_mi(frame_parms, subframe))) return(cmax(3,nCCEmin)); else if (frame_parms->N_RB_DL<=10) { if (frame_parms->Ncp == 0) { // normal CP From d79c186a136f706868d3bf6d07428b68322383e5 Mon Sep 17 00:00:00 2001 From: echigoya Date: Fri, 19 May 2017 09:36:47 +0900 Subject: [PATCH 10/19] Fujitsu No.6 Correct DAI incrementation --- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) mode change 100644 => 100755 openair2/LAYER2/MAC/eNB_scheduler_dlsch.c diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c old mode 100644 new mode 100755 index 595d16587c..68f99bf721 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -612,17 +612,15 @@ schedule_ue_spec( if (round > 0) { - if (frame_parms[CC_id]->frame_type == TDD) { - UE_list->UE_template[CC_id][UE_id].DAI++; - update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI); - LOG_D(MAC,"DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n", - CC_id,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI); - } - // get freq_allocation nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; if (nb_rb <= nb_available_rb) { + if (frame_parms[CC_id]->frame_type == TDD) { + UE_list->UE_template[CC_id][UE_id].DAI++; + update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI); + LOG_D(MAC,"DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n", CC_id,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI); + } if(nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) { for(j=0; jN_RBG; j++) { // for indicating the rballoc for each sub-band From 667bfb017304571686b232cd8cce7e1034603033 Mon Sep 17 00:00:00 2001 From: hbilel Date: Fri, 19 May 2017 15:37:57 +0200 Subject: [PATCH 11/19] TDD config 4,5 harq,bundling,multiplexing,ack,nack config 4 tested with Amarisoft --- openair1/PHY/LTE_TRANSPORT/phich.c | 11 + openair1/SCHED/phy_procedures_lte_common.c | 177 ++++++++++++++- openair1/SCHED/phy_procedures_lte_ue.c | 251 ++++++++++++++++++++- 3 files changed, 431 insertions(+), 8 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index d363d4dcf6..5ebe555d4f 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -135,6 +135,17 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su break; + case 4: + if ( (subframe == 8) || (subframe == 9) ) { + return(subframe-8); + } else { + LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n", + subframe,frame_parms->tdd_config); + return(0); + } + + break; + } return(0); diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c index 314f934a81..0779341334 100644 --- a/openair1/SCHED/phy_procedures_lte_common.c +++ b/openair1/SCHED/phy_procedures_lte_common.c @@ -105,7 +105,47 @@ void get_Msg3_alloc(LTE_DL_FRAME_PARMS *frame_parms, *frame = (current_frame+2) & 1023; break; } - } + } else if (frame_parms->tdd_config == 4) { + switch (current_subframe) { + + case 0: + case 4: + case 5: + case 6: + *subframe = 2; + *frame = (current_frame+1) & 1023; + break; + + case 7: + *subframe = 3; + *frame = (current_frame+1) & 1023; + break; + + case 8: + case 9: + *subframe = 2; + *frame = (current_frame+2) & 1023; + break; + } + } else if (frame_parms->tdd_config == 5) { + switch (current_subframe) { + + case 0: + case 4: + case 5: + case 6: + *subframe = 2; + *frame = (current_frame+1) & 1023; + break; + + case 7: + case 8: + case 9: + *subframe = 2; + *frame = (current_frame+2) & 1023; + break; + } + } } } @@ -137,6 +177,13 @@ void get_Msg3_alloc_ret(LTE_DL_FRAME_PARMS *frame_parms, // original PUSCH in 3, PHICH in 9, ret in 3 next frame // original PUSCH in 4, PHICH in 0, ret in 4 next frame *frame=(current_frame+1) & 1023; + } else if (frame_parms->tdd_config == 4) { + // original PUSCH in 2, PHICH in 8, ret in 2 next frame + // original PUSCH in 3, PHICH in 9, ret in 3 next frame + *frame=(current_frame+1) & 1023; + } else if (frame_parms->tdd_config == 5) { + // original PUSCH in 2, PHICH in 8, ret in 2 next frame + *frame=(current_frame+1) & 1023; } } } @@ -253,6 +300,24 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig break; + case 4: + if (subframe == 2) { // ACK subframes 0, 4 and 5 + //if (ACK_index==2) + // return(1); TBC + if (ACK_index==2) + return(0); + + return(4+ACK_index); + } else if (subframe == 3) { // ACK subframes 6, 7 8 and 9 + return(6+ACK_index); // To be updated + } else { + LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n", + subframe,frame_parms->tdd_config); + return(0); + } + + break; + case 1: if (subframe == 2) { // ACK subframes 5 and 6 return(5+ACK_index); @@ -297,6 +362,30 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s break; + case 4: + if (subframe == 2) { // ACK subframes 0,4 and 5 + return(3); // should be 4 + } else if (subframe == 3) { // ACK subframes 6,7,8 and 9 + return(4); + } else { + LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n", + subframe,frame_parms->tdd_config); + return(0); + } + + break; + + case 5: + if (subframe == 2) { // ACK subframes 0,3,4,5,6,7,8 and 9 + return(8); // should be 3 + } else { + LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n", + subframe,frame_parms->tdd_config); + return(0); + } + + break; + case 1: if (subframe == 2) { // ACK subframes 5 and 6 return(2); @@ -331,7 +420,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise { uint8_t status=0; - uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff; + uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff,subframe_dl2=0xff, subframe_dl3=0xff; // printf("get_ack: SF %d\n",subframe); if (frame_parms->frame_type == FDD) { @@ -485,6 +574,63 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms, break; + case 4: + if (subframe_tx == 2) { // ACK subframes 4, 5 and 0 + subframe_dl0 = 4; + subframe_dl1 = 5; + subframe_dl2 = 0; + subframe_ul = 2; + //printf("subframe_tx 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status); + } else if (subframe_tx == 3) { // ACK subframes 6, 7 8 and 9 + subframe_dl0 = 6; + subframe_dl1 = 7; + subframe_dl2 = 8; + subframe_dl3 = 9; + subframe_ul = 3; + //printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack); + //printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]); + } else { + LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n", + subframe_tx,frame_parms->tdd_config); + return(0); + } + + // report ACK/NACK status + o_ACK[cw_idx] = 0; + if (harq_ack[subframe_dl0].send_harq_status == 1) + o_ACK[cw_idx] = harq_ack[subframe_dl0].ack; + + if (harq_ack[subframe_dl1].send_harq_status == 1) + o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack; + + if (harq_ack[subframe_dl2].send_harq_status == 1) + o_ACK[cw_idx] &= harq_ack[subframe_dl2].ack; + + if (harq_ack[subframe_dl3].send_harq_status == 1) + o_ACK[cw_idx] &= harq_ack[subframe_dl3].ack; + + pN_bundled[0] = harq_ack[subframe_rx].vDAI_UL; + status = harq_ack[subframe_dl0].send_harq_status + harq_ack[subframe_dl1].send_harq_status + harq_ack[subframe_dl2].send_harq_status + harq_ack[subframe_dl3].send_harq_status; + + LOG_I(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d dl Sfn2 %d status %d o_Ack %d dl Sfn3 %d status %d o_Ack %d subframe_rx %d N_bundled %d status %d\n", + subframe_tx, subframe_dl0, harq_ack[subframe_dl0].send_harq_status,harq_ack[subframe_dl0].ack, + subframe_dl1, harq_ack[subframe_dl1].send_harq_status,harq_ack[subframe_dl1].ack, + subframe_dl2, harq_ack[subframe_dl2].send_harq_status,harq_ack[subframe_dl2].ack, + subframe_dl3, harq_ack[subframe_dl3].send_harq_status,harq_ack[subframe_dl3].ack,subframe_rx, pN_bundled[0], status); + if (do_reset) { + // reset ACK/NACK status + harq_ack[subframe_dl0].ack = 2; + harq_ack[subframe_dl1].ack = 2; + harq_ack[subframe_dl2].ack = 2; + harq_ack[subframe_dl3].ack = 2; + harq_ack[subframe_dl0].send_harq_status = 0; + harq_ack[subframe_dl1].send_harq_status = 0; + harq_ack[subframe_dl2].send_harq_status = 0; + harq_ack[subframe_dl3].send_harq_status = 0; + } + + break; + } } @@ -609,6 +755,29 @@ lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub return(255); } + case 4: + if ((subframe<1) || (subframe>=4)) + return(SF_DL); + else if ((subframe>1) && (subframe < 4)) + return(SF_UL); + else if (subframe==1) + return (SF_S); + else { + LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n"); + return(255); + } + + case 5: + if ((subframe<1) || (subframe>=3)) + return(SF_DL); + else if ((subframe>1) && (subframe < 3)) + return(SF_UL); + else if (subframe==1) + return (SF_S); + else { + LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n"); + return(255); + } break; default: @@ -683,13 +852,13 @@ unsigned int is_phich_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub break; case 4: - if ((subframe == 0) || (subframe == 8) ) + if ((subframe == 8) || (subframe == 9) ) return(1); break; case 5: - if (subframe == 0) + if (subframe == 8) return(1); break; diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 663dc33b49..cba893eafb 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -700,13 +700,14 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, { LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; - uint8_t nCCE0,nCCE1,harq_ack1,harq_ack0; + uint8_t nCCE0,nCCE1,nCCE2,nCCE3,harq_ack1,harq_ack0,harq_ack3,harq_ack2; ANFBmode_t bundling_flag; - uint16_t n1_pucch0=0,n1_pucch1=0; + uint16_t n1_pucch0=0,n1_pucch1=0,n1_pucch2=0,n1_pucch3=0,n1_pucch_inter,pucch_sel_inter; static uint8_t candidate_dl[9]; // which downlink(s) the current ACK/NACK is associating to uint8_t last_dl=0xff; // the last downlink with valid DL-DCI. for calculating the PUCCH resource index int sf; int M; + uint8_t ack_counter=0; // clear this, important for case where n1_pucch selection is not used int subframe=proc->subframe_tx; @@ -726,10 +727,10 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, #ifdef DEBUG_PHY_PROC if (bundling_flag==bundling) { - LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, + LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex); } else { - LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, + LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR, ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex); } @@ -835,6 +836,11 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].ack; + LOG_D(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d\n", + proc->frame_tx%1024, + proc->subframe_tx, + nCCE0,n1_pucch0, + nCCE1,n1_pucch1); if (harq_ack1!=2) { // n-6 // subframe 6,8,0 and maybe 5,7,9 is to be ACK/NAKed @@ -891,6 +897,243 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, break; + case 4: // DL:S:UL:UL:DL:DL:DL:DL:DL:DL + // in this configuration we have M=4 from pg 68 of 36.213 (v8.6) + // Note: this doesn't allow using subframe 1 for PDSCH transmission!!! (i.e. SF 1 cannot be acked in SF 2) + // set ACK/NAKs to DTX + harq_ack3 = 2; // DTX + harq_ack2 = 2; // DTX + harq_ack1 = 2; // DTX + harq_ack0 = 2; // DTX + // This is the offset for a particular subframe (2,3,4) => (0,2,4) + //last_dl = (subframe-2)<<1; + if (subframe == 2) { + // i=0 + //nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe]; + nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10]; + n1_pucch0 = 2*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; + // i=1 + nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe]; + n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; + // i=2 + nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10]; + n1_pucch2 = 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; + // i=3 + //nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(9+subframe)%10]; + //n1_pucch3 = get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN; + + // set ACK/NAK to values if not DTX + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].ack; + + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].ack; + + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].ack; + + //if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + //harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].ack; + //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d cce2=%d n1_pucch2=%d\n", + // proc->frame_tx%1024, + // proc->subframe_tx, + // nCCE0,n1_pucch0, + // nCCE1,n1_pucch1, nCCE2, n1_pucch2); + }else if (subframe == 3) { + // i=0 + + nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[4+subframe]; + n1_pucch0 = 3*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN; + // i=1 + nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[5+subframe]; + n1_pucch1 = 2*get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN; + // i=2 + nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(6+subframe)]; + n1_pucch2 = get_Np(frame_parms->N_RB_DL,nCCE2,0) + 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN; + // i=3 + nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(3+subframe)]; + n1_pucch3 = 3*get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN; + + // set ACK/NAK to values if not DTX + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].ack; + + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].ack; + + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed + harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].ack; + + if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed + harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].ack; + } + + //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d harq_ack0=%d cce1=%d n1_pucch1=%d harq_ack1=%d cce2=%d n1_pucch2=%d harq_ack2=%d cce3=%d n1_pucch3=%d harq_ack3=%d bundling_flag=%d\n", + // proc->frame_tx%1024, + // proc->subframe_tx, + // nCCE0,n1_pucch0,harq_ack0, + // nCCE1,n1_pucch1,harq_ack1, nCCE2, n1_pucch2, harq_ack2, + // nCCE3, n1_pucch3, harq_ack3, bundling_flag); + + if ((bundling_flag==bundling)&&(SR == 0)) { // This is for bundling without SR, + if ((harq_ack0!=2) ) { + b[0] = harq_ack0; + n1_pucch_inter = n1_pucch0; + pucch_sel_inter = 0; + } + if ((harq_ack1!=2) ) { + b[0] = b[0]&harq_ack1; + n1_pucch_inter = n1_pucch1; + pucch_sel_inter = 1; + } + if ((harq_ack2!=2) ) { + b[0] = b[0]&harq_ack2; + n1_pucch_inter = n1_pucch2; + pucch_sel_inter = 2; + } + if ((harq_ack3!=2) ) { + b[0] = b[0]&harq_ack3; + n1_pucch_inter = n1_pucch3; + pucch_sel_inter = 3; + } + + if (subframe == 3) { + n1_pucch_inter = n1_pucch2; + } else if (subframe == 2) { + n1_pucch_inter = n1_pucch2; + } + + //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch n1_pucch_inter=%d pucch_sel_inter=%d b[0]=%d b[1]=%d \n", + // proc->frame_tx%1024, + // proc->subframe_tx,n1_pucch_inter, + // pucch_sel_inter,b[0],b[1]); + + return(n1_pucch_inter); + + } else if ((bundling_flag==multiplexing)&&(SR==0)) { // Table 10.1 + + if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && (harq_ack3 == 1)) { + b[1] = 1; + b[0] = 1; + return(n1_pucch1); + } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { + b[0] = 1; + b[1] = 0; + return(n1_pucch1); + } else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 0) && (harq_ack3 == 2)) { + b[1] = 1; + b[0] = 1; + return(n1_pucch2); + } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) { + b[1] = 1; + b[0] = 0; + return(n1_pucch1); + } else if ((harq_ack0 == 0) && (harq_ack1 == 2) && (harq_ack2 == 2) && (harq_ack3 == 2)) { + b[1] = 1; + b[0] = 0; + return(n1_pucch0); + } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { + b[1] = 1; + b[0] = 0; + return(n1_pucch1); + } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && (harq_ack3 == 1)) { + b[0] = 0; + b[1] = 1; + return(n1_pucch3); + } else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 0)) { + b[1] = 1; + b[0] = 1; + return(n1_pucch3); + } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { + b[0] = 0; + b[1] = 1; + return(n1_pucch2); + } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) { + b[0] = 0; + b[1] = 1; + return(n1_pucch0); + } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { + b[0] = 0; + b[1] = 1; + return(n1_pucch0); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && (harq_ack2 == 1) && (harq_ack3 == 1)) { + b[0] = 0; + b[1] = 1; + return(n1_pucch3); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 0) && (harq_ack2 == 2) && (harq_ack3 == 2)) { + b[0] = 0; + b[1] = 0; + return(n1_pucch1); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { + b[0] = 1; + b[1] = 0; + return(n1_pucch2); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) { + b[0] = 1; + b[1] = 0; + return(n1_pucch3); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { + b[0] = 0; + b[1] = 1; + return(n1_pucch1); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && (harq_ack3 == 1)) { + b[0] = 0; + b[1] = 1; + return(n1_pucch3); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) { + b[0] = 0; + b[1] = 0; + return(n1_pucch2); + } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack3 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0))) { + b[0] = 0; + b[1] = 0; + return(n1_pucch3); + } + + } else if (SR==1) { // SR and 0,1,or 2 ACKS, (first 3 entries in Table 7.3-1 of 36.213) + // this should be number of ACKs (including + if (harq_ack0==1) + ack_counter ++; + if (harq_ack1==1) + ack_counter ++; + if (harq_ack2==1) + ack_counter ++; + if (harq_ack3==1) + ack_counter ++; + + switch (ack_counter) { + case 0: + b[0] = 0; + b[1] = 0; + break; + + case 1: + b[0] = 1; + b[1] = 1; + break; + + case 2: + b[0] = 1; + b[1] = 0; + break; + + case 3: + b[0] = 0; + b[1] = 1; + break; + + case 4: + b[0] = 1; + b[1] = 1; + break; + } + + ack_counter = 0; + return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex); + } + + break; + } // switch tdd_config } From 8625a8672a31db9e34f08a5bbb87f3ed6ba1ae09 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 19 May 2017 16:17:56 +0200 Subject: [PATCH 12/19] T: improve trace ENB_PHY_ULSCH_UE_DCI --- common/utils/T/T_messages.txt | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt index 09ed098ee0..c78bc92d36 100644 --- a/common/utils/T/T_messages.txt +++ b/common/utils/T/T_messages.txt @@ -28,7 +28,7 @@ ID = ENB_PHY_DLSCH_UE_NACK ID = ENB_PHY_ULSCH_UE_DCI DESC = eNodeB uplink UE specific DCI as sent by the PHY layer GROUP = ALL:PHY:GRAPHIC:ENB - FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS + FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top) GROUP = ALL:PHY:GRAPHIC:ENB diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 673583f78c..f8b9a9ae59 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -906,7 +906,9 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->round), T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->first_rb), T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->nb_rb), - T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS)); + T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS), + T_INT(dci_alloc->L), + T_INT(dci_alloc->firstCCE)); } void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int num_pdcch_symbols) { From dd7691ec60eb83352e733a06bea8baec53ba81cc Mon Sep 17 00:00:00 2001 From: gabrielC Date: Fri, 19 May 2017 16:22:51 +0200 Subject: [PATCH 13/19] Fix warning compilation --- openair1/SCHED/phy_procedures_lte_ue.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index cba893eafb..d3d763cd56 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -702,7 +702,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms; uint8_t nCCE0,nCCE1,nCCE2,nCCE3,harq_ack1,harq_ack0,harq_ack3,harq_ack2; ANFBmode_t bundling_flag; - uint16_t n1_pucch0=0,n1_pucch1=0,n1_pucch2=0,n1_pucch3=0,n1_pucch_inter,pucch_sel_inter; + uint16_t n1_pucch0=0,n1_pucch1=0,n1_pucch2=0,n1_pucch3=0,n1_pucch_inter; static uint8_t candidate_dl[9]; // which downlink(s) the current ACK/NACK is associating to uint8_t last_dl=0xff; // the last downlink with valid DL-DCI. for calculating the PUCCH resource index int sf; @@ -979,22 +979,18 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, if ((harq_ack0!=2) ) { b[0] = harq_ack0; n1_pucch_inter = n1_pucch0; - pucch_sel_inter = 0; } if ((harq_ack1!=2) ) { b[0] = b[0]&harq_ack1; n1_pucch_inter = n1_pucch1; - pucch_sel_inter = 1; } if ((harq_ack2!=2) ) { b[0] = b[0]&harq_ack2; n1_pucch_inter = n1_pucch2; - pucch_sel_inter = 2; } if ((harq_ack3!=2) ) { b[0] = b[0]&harq_ack3; n1_pucch_inter = n1_pucch3; - pucch_sel_inter = 3; } if (subframe == 3) { @@ -1003,10 +999,10 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, n1_pucch_inter = n1_pucch2; } - //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch n1_pucch_inter=%d pucch_sel_inter=%d b[0]=%d b[1]=%d \n", + //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch n1_pucch_inter=%d b[0]=%d b[1]=%d \n", // proc->frame_tx%1024, // proc->subframe_tx,n1_pucch_inter, - // pucch_sel_inter,b[0],b[1]); + // b[0],b[1]); return(n1_pucch_inter); From 685464c20495140d0b84d17678b83603b3fb2f37 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 19 May 2017 16:27:08 +0200 Subject: [PATCH 14/19] pre-integration fix: correct comparison get_nCCE returns the number of available CCEs. We can put the CCEs numbers [ 0 .. get_nCCE-1 ], so we need to use <, not <=. --- openair1/PHY/LTE_TRANSPORT/dci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index d376fcac3b..298dbd9791 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2009,13 +2009,13 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, } //if ((9*numCCE) <= (frame_parms->N_RB_DL*2)) - if (CCE_max_used_index <= get_nCCE(1, frame_parms, get_mi(frame_parms, subframe))) + if (CCE_max_used_index < get_nCCE(1, frame_parms, get_mi(frame_parms, subframe))) return(cmax(1,nCCEmin)); //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 4 : 5))) - else if (CCE_max_used_index <= get_nCCE(2, frame_parms, get_mi(frame_parms, subframe))) + else if (CCE_max_used_index < get_nCCE(2, frame_parms, get_mi(frame_parms, subframe))) return(cmax(2,nCCEmin)); //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 7 : 8))) - else if (CCE_max_used_index <= get_nCCE(3, frame_parms, get_mi(frame_parms, subframe))) + else if (CCE_max_used_index < get_nCCE(3, frame_parms, get_mi(frame_parms, subframe))) return(cmax(3,nCCEmin)); else if (frame_parms->N_RB_DL<=10) { if (frame_parms->Ncp == 0) { // normal CP From 9cf288f6f3679e0c33df7f67a01a111b6c862faa Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 19 May 2017 16:29:07 +0200 Subject: [PATCH 15/19] pre-integration fix: minor improvement we can compute CCE_max_used_index out of the loop. --- openair1/PHY/LTE_TRANSPORT/dci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index 298dbd9791..8b7a818297 100755 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -2000,13 +2000,11 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, numCCE += (1<<(dci_alloc[i].L)); if(firstCCE_max < dci_alloc[i].firstCCE) { - firstCCE_max = dci_alloc[i].firstCCE; - L = dci_alloc[i].L; - } - if(i == (num_dci - 1)) { - CCE_max_used_index = firstCCE_max + (1<N_RB_DL*2)) if (CCE_max_used_index < get_nCCE(1, frame_parms, get_mi(frame_parms, subframe))) From 8e57a58dd632bef9b8534371709df25e080cb35f Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 19 May 2017 17:00:36 +0200 Subject: [PATCH 16/19] fix run_enb_ue_virt_noS1 and run_enb_ue_virt_s1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problems reported by Jorge Muñoz Castañer . - use Rel14 binaries (those are produced by default) - let -x option work to have graphical output - fix VCD missing 'echo' --- cmake_targets/tools/run_enb_ue_virt_noS1 | 11 ++++++++--- cmake_targets/tools/run_enb_ue_virt_s1 | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1 index a0f23ecb01..a5139d4b44 100755 --- a/cmake_targets/tools/run_enb_ue_virt_noS1 +++ b/cmake_targets/tools/run_enb_ue_virt_noS1 @@ -150,7 +150,7 @@ function main() # -u | --num-ue ) -V | --vcd) - "setting gtk-wave output" + echo "setting gtk-wave output" exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd" shift ; ;; @@ -164,6 +164,11 @@ function main() exe_arguments="$exe_arguments -n $2" shift 2; ;; + -x | --xforms) + echo "running with xforms" + exe_arguments="$exe_arguments --xforms" + shift 1; + ;; *) echo "Unknown option $1" help @@ -212,11 +217,11 @@ function main() fi if [ $run_gdb -eq 0 ]; then - exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt + exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt else touch ~/.gdb_enb_ue_nos1 chmod 777 ~/.gdb_enb_ue_nos1 - echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10" > ~/.gdb_enb_ue_nos1 + echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14" > ~/.gdb_enb_ue_nos1 echo "set args $exe_arguments" >> ~/.gdb_enb_ue_nos1 echo "run" >> ~/.gdb_enb_ue_nos1 cat ~/.gdb_enb_ue_nos1 diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1 index ff65946803..8e717f393a 100755 --- a/cmake_targets/tools/run_enb_ue_virt_s1 +++ b/cmake_targets/tools/run_enb_ue_virt_s1 @@ -174,7 +174,7 @@ function main() ;; -V | --vcd) - "setting gtk-wave output" + echo "setting gtk-wave output" exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd" shift ; ;; @@ -183,6 +183,11 @@ function main() exe_arguments="$exe_arguments -P wireshark" shift 2; ;; + -x | --xforms) + echo "running with xforms" + exe_arguments="$exe_arguments --xforms" + shift 1; + ;; *) echo "Unknown option $1" help @@ -258,11 +263,11 @@ function main() fi if [ $run_gdb -eq 0 ]; then - exec $OPENAIR_DIR/targets/bin/oaisim.Rel10 $exe_arguments | tee /tmp/enb_ue_s1.log.txt + exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt else touch ~/.gdb_enb_ue_s1 chmod 777 ~/.gdb_enb_ue_s1 - echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel10" > ~/.gdb_enb_ue_s1 + echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel14" > ~/.gdb_enb_ue_s1 echo "set args $exe_arguments" >> ~/.gdb_enb_ue_s1 echo "run" >> ~/.gdb_enb_ue_s1 cat ~/.gdb_enb_ue_s1 From c15a9a8294555c5591db0d4329b22d4ef99caf6a Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 May 2017 10:23:24 +0200 Subject: [PATCH 17/19] post-integration fix: remove compilation warnings --- openair1/PHY/TOOLS/lte_dfts.c | 12 +++++++++++ openair1/SIMULATION/TOOLS/random_channel.c | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c | 6 +++--- openair2/RRC/LITE/rrc_eNB.c | 4 ++-- targets/SIMU/USER/channel_sim.c | 2 +- targets/SIMU/USER/event_handler.c | 24 +++++++++++----------- targets/SIMU/USER/oaisim_config.c | 8 ++++---- targets/SIMU/USER/oaisim_functions.c | 12 +++++------ 8 files changed, 41 insertions(+), 29 deletions(-) diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c index 1ba997af17..0aaea70d7d 100644 --- a/openair1/PHY/TOOLS/lte_dfts.c +++ b/openair1/PHY/TOOLS/lte_dfts.c @@ -2510,6 +2510,8 @@ const static int16_t tw64[96] __attribute__((aligned(32))) = { -30273,12539,-25330,20787,-18205,27244,-9512,31356 }; +#if 0 +/* this is defined but not used, let's comment */ const static int16_t tw64rep[192] __attribute__((aligned(32))) = { 32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512, 30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788, @@ -2524,6 +2526,7 @@ const static int16_t tw64rep[192] __attribute__((aligned(32))) = { -23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211, -30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356 }; +#endif const static int16_t tw64a[96] __attribute__((aligned(32))) = { 32767,0,32609,3212,32137,6393,31356,9512, @@ -2539,6 +2542,8 @@ const static int16_t tw64a[96] __attribute__((aligned(32))) = { -23170,23170,-28898,15447,-32138,6393,-32610,-3211, -30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 }; +#if 0 +/* this is defined but not used, let's comment */ const static int16_t tw64arep[192] __attribute__((aligned(32))) = { 32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512, 30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788, @@ -2553,6 +2558,7 @@ const static int16_t tw64arep[192] __attribute__((aligned(32))) = { -23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211, -30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356 }; +#endif const static int16_t tw64b[96] __attribute__((aligned(32))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356, @@ -2569,6 +2575,8 @@ const static int16_t tw64b[96] __attribute__((aligned(32))) = { 12539,-30273,20787,-25330,27244,-18205,31356,-9512 }; +#if 0 +/* this is defined but not used, let's comment */ const static int16_t tw64brep[192] __attribute__((aligned(32))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356, -12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329, @@ -2583,6 +2591,7 @@ const static int16_t tw64brep[192] __attribute__((aligned(32))) = { -23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610, 12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512 }; +#endif const static int16_t tw64c[96] __attribute__((aligned(32))) = { 0,32767,3212,32609,6393,32137,9512,31356, @@ -2599,6 +2608,8 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = { -12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 }; +#if 0 +/* this is defined but not used, let's comment */ const static int16_t tw64crep[192] __attribute__((aligned(32))) = { 0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356, 12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329, @@ -2613,6 +2624,7 @@ const static int16_t tw64crep[192] __attribute__((aligned(32))) = { 23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610, -12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512 }; +#endif #if defined(__x86_64__) || defined(__i386__) diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c index ea8781e216..98988ea4cb 100644 --- a/openair1/SIMULATION/TOOLS/random_channel.c +++ b/openair1/SIMULATION/TOOLS/random_channel.c @@ -101,7 +101,7 @@ void fill_channel_desc(channel_desc_t *chan_desc, LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps); for (i = 0; ia[i],nb_tx*nb_rx * sizeof(struct complex)); + LOG_D(OCM,"tap %d (%p,%zu)\n",i,&chan_desc->a[i],nb_tx*nb_rx * sizeof(struct complex)); chan_desc->a[i] = (struct complex*) malloc(nb_tx*nb_rx * sizeof(struct complex)); } diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c index 0da894df82..2ebcf64cad 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c @@ -545,7 +545,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) pdcp_read_state_g = 0; // print_active_requests() #ifdef PDCP_DEBUG - LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %d \n", + LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %zu\n", nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr)); #endif @@ -603,7 +603,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) if (h_rc == HASH_TABLE_OK) { #ifdef PDCP_DEBUG - LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n", + LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n", ctxt.frame, pdcp_read_header_g.inst, len, @@ -693,7 +693,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) if (h_rc == HASH_TABLE_OK) { rab_id = pdcp_p->rb_id; #ifdef PDCP_DEBUG - LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n", + LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n", ctxt.frame, pdcp_read_header_g.inst, len, diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index da9d93c19a..3df39e62c6 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -2268,8 +2268,8 @@ rrc_eNB_process_MeasurementReport( LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult); LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult); #else - LOG_I(RRC, "RSRP of Source %d\n", measResults2->measResultServCell.rsrpResult); - LOG_I(RRC, "RSRQ of Source %d\n", measResults2->measResultServCell.rsrqResult); + LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultServCell.rsrpResult); + LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultServCell.rsrqResult); #endif if (ue_context_pP->ue_context.handover_info->ho_prepare != 0xF0) { diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c index 3913de6016..04d7e1d233 100644 --- a/targets/SIMU/USER/channel_sim.c +++ b/targets/SIMU/USER/channel_sim.c @@ -281,7 +281,7 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr %f dBm/RE (%f dBm RSSI)for subframe %d\n",UE_id, 10*log10(rx_pwr), 10*log10(rx_pwr*(double)frame_parms->N_RB_DL*12),subframe); - LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for slot %d (subframe %d)\n", + LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for subframe %d\n", UE_id, 10*log10(eNB2UE[eNB_id][UE_id][CC_id]->sampling_rate*1e6)-174, 10*log10(eNB2UE[eNB_id][UE_id][CC_id]->sampling_rate*1e6*12*frame_parms->N_RB_DL/(double)frame_parms->ofdm_symbol_size)-174, diff --git a/targets/SIMU/USER/event_handler.c b/targets/SIMU/USER/event_handler.c index f2199ca910..c140dab50b 100644 --- a/targets/SIMU/USER/event_handler.c +++ b/targets/SIMU/USER/event_handler.c @@ -513,7 +513,7 @@ void update_mac(Event_t event) if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) { oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer; UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer; - LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i); + LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i); LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer); } @@ -637,7 +637,7 @@ void update_mac(Event_t event) if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) { oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer; UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer; - LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i); + LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i); LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer); } @@ -903,13 +903,13 @@ void update_mac(Event_t event) for(i=UE_list->head; i>=0; i=UE_list->next[i]) { oai_emulation->mac_config[i].cqiSchedInterval= mac_config[i].cqiSchedInterval; UE_list->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval; - LOG_I(EMU,"cqiSchedInterval UE :\n", i); + LOG_I(EMU,"cqiSchedInterval UE %d:\n", i); LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].cqiSchedInterval); } } else { oai_emulation->mac_config[event.ue].cqiSchedInterval= mac_config[event.ue].cqiSchedInterval; UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval = oai_emulation->mac_config[event.ue].cqiSchedInterval; - LOG_I(EMU,"cqiSchedInterval UE :\n", event.ue); + LOG_I(EMU,"cqiSchedInterval UE %d:\n", event.ue); LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval); } } else if(!strcmp((char *) event.key, "mac_ContentionResolutionTimer") && event.value!=NULL && validate_mac(event)) { @@ -923,13 +923,13 @@ void update_mac(Event_t event) for(i=UE_list->head; i>=0; i=UE_list->next[i]) { oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer; UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer; - LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", i); + LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", i); LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer); } } else { oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer= mac_config[event.ue].mac_ContentionResolutionTimer; UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer = oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer; - LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", event.ue); + LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", event.ue); LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer); } } else if(!strcmp((char *) event.key, "max_allowed_rbs") && event.value!=NULL && validate_mac(event)) { @@ -1040,7 +1040,7 @@ void update_sys_model(Event_t event) LOG_I(EMU,"free_space_model_parameters.pathloss_exponent %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_exponent); LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB); - LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB); + LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB); //Antenna LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors); @@ -1103,7 +1103,7 @@ void update_sys_model(Event_t event) } else if(!strcmp((char *) event.key, "free_space_model_parameters.pathloss_0_dB")) { LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB); } else if(!strcmp((char *) event.key, "ricean_8tap.rice_factor_dB")) { - LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB); + LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB); } else if(!strcmp((char *) event.key, "antenna.eNB_antenna.number_of_sectors")) { LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors); } else if(!strcmp((char *) event.key, "antenna.eNB_antenna.beam_width_dB")) { @@ -1202,8 +1202,8 @@ void update_topo_model(Event_t event) LOG_I(EMU,"UE_moving_dynamics_max_speed_mps %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps); LOG_I(EMU,"UE_moving_dynamics_min_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms); LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms); - LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid); - LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid); + LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid); + LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid); LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option); LOG_I(EMU,"random_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.random_UE_distribution.number_of_nodes); LOG_I(EMU,"concentrated_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.concentrated_UE_distribution.number_of_nodes); @@ -1245,9 +1245,9 @@ void update_topo_model(Event_t event) } else if(!strcmp((char *) event.key, "UE_moving_dynamics_max_journey_time_ms")) { LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms); } else if(!strcmp((char *) event.key, "grid_map_horizontal_grid")) { - LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid); + LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid); } else if(!strcmp((char *) event.key, "grid_map_vertical_grid")) { - LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid); + LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid); } else if(!strcmp((char *) event.key, "UE_initial_distribution_selected_option")) { LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option); } else if(!strcmp((char *) event.key, "random_UE_distribution_number_of_nodes")) { diff --git a/targets/SIMU/USER/oaisim_config.c b/targets/SIMU/USER/oaisim_config.c index e3aac4f481..70728875f5 100644 --- a/targets/SIMU/USER/oaisim_config.c +++ b/targets/SIMU/USER/oaisim_config.c @@ -468,7 +468,7 @@ int ocg_config_env(void) oai_emulation.info.frame_type[CC_id] = map_str_to_int(frame_type_names, oai_emulation.info.frame_type_name[CC_id]); if (oai_emulation.info.frame_type[CC_id] == -1) { - LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name); + LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name[CC_id]); oai_emulation.info.frame_type[CC_id]=TDD; } else LOG_I(EMU,"Frame type is %s \n",oai_emulation.info.frame_type_name[CC_id]); @@ -478,7 +478,7 @@ int ocg_config_env(void) LOG_E(EMU,"TDD config %d out of range, set it to 3\n",oai_emulation.info.tdd_config[CC_id]); oai_emulation.info.tdd_config[CC_id]=3; } else - LOG_I(EMU,"TDD config is set to \n",oai_emulation.info.tdd_config[CC_id]); + LOG_I(EMU,"TDD config is set to %d\n",oai_emulation.info.tdd_config[CC_id]); } } } @@ -1087,8 +1087,8 @@ int ocg_config_app(void) oai_emulation.application_config.customized_traffic.holding_time_pe_off[customized_traffic_config_index]; - LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%d:%d) source = %d, dest = %d, dist type for size = %d start/duration %d/%d\n", source_id_start, source_id_end, source_id_index, - destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0], + LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%s:%s) source = %d, dest = %d, dist type for size = %d [TODO: check code, printed value may not be correct, checks the indexes of the arry access] start/duration %d/%d\n", source_id_start, source_id_end, source_id_index, + destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0][0], g_otg->flow_start[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]], g_otg->flow_duration[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]); per_source_id = strtok(NULL, comma); diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index f6fc55852a..71304aea8e 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -1050,15 +1050,15 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * *ptimestamp = last_eNB_rx_timestamp[eNB_id][CC_id]; - LOG_D(EMU,"eNB_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps, - (unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id], - (unsigned long long)last_eNB_rx_timestamp[eNB_id][CC_id], - (*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10); + LOG_D(EMU,"eNB_trx_read nsamps %d TS(%"PRId64",%"PRId64") => subframe %d\n",nsamps, + current_eNB_rx_timestamp[eNB_id][CC_id], + last_eNB_rx_timestamp[eNB_id][CC_id], + (int)((*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10)); // if we're at a subframe boundary generate UL signals for this eNB while (nsamps) { while (current_eNB_rx_timestamp[eNB_id][CC_id] == last) { - LOG_D(EMU,"eNB: current TS %llu, last TS %llu, sleeping\n",current_eNB_rx_timestamp[eNB_id][CC_id],last_eNB_rx_timestamp[eNB_id][CC_id]); + LOG_D(EMU,"eNB: current TS %"PRId64", last TS %"PRId64", sleeping\n",current_eNB_rx_timestamp[eNB_id][CC_id],last_eNB_rx_timestamp[eNB_id][CC_id]); usleep(500); } @@ -1126,7 +1126,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** usleep(500); } while (current_UE_rx_timestamp[UE_id][CC_id] == last) { - LOG_D(EMU,"UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]); + LOG_D(EMU,"UE_trx_read : current TS %"PRId64", last TS %"PRId64", sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]); usleep(500); } From 2237b431c2c7774655bde6a89d15e21ec7b76ab4 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 May 2017 10:34:55 +0200 Subject: [PATCH 18/19] integration fix: fix compilation warnings --- openair2/RRC/LITE/rrc_UE.c | 4 ++-- openair2/RRC/LITE/rrc_eNB.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index dd3690e2ac..6798212fb2 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -747,10 +747,10 @@ rrc_ue_establish_drb( # ifdef OAI_EMU oai_emulation.info.oai_ifup[ue_mod_idP]=1; # endif - LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n", + LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP, - (eNB_index * maxDRB) + DRB_config->drb_Identity); + (long int)((eNB_index * maxDRB) + DRB_config->drb_Identity)); rb_conf_ipv4(0,//add ue_mod_idP,//cx align with the UE index diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 3df39e62c6..659f1c57b0 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -3613,9 +3613,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete( dest_ip_offset = 8; # endif LOG_I(OIP, - "[eNB %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n", + "[eNB %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n", ctxt_pP->module_id, ctxt_pP->module_id, - (ue_context_pP->local_uid * maxDRB) + DRB_configList->list.array[i]->drb_Identity); + (long int)((ue_context_pP->local_uid * maxDRB) + DRB_configList->list.array[i]->drb_Identity)); ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid]; rb_conf_ipv4(0, //add ue_module_id, //cx From c98339e104c6bfb291eebd616e12543bed24be60 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 22 May 2017 10:41:33 +0200 Subject: [PATCH 19/19] integration fix: remove compilation warnings --- targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c index bb9435413d..f22206eec8 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c @@ -297,7 +297,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) { if (ret == -1) { fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno)); } else { - printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret)); + printf ("[ETHERNET] status of %s is %d\n", system_cmd, WEXITSTATUS(ret)); } printf("[ETHERNET] Coalesce parameters %s\n",system_cmd); } else { @@ -314,7 +314,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) { if (ret == -1) { fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno)); } else { - printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret)); + printf ("[ETHERNET] status of %s is %d\n", system_cmd, WEXITSTATUS(ret)); } printf("[ETHERNET] Pause parameters %s\n",system_cmd); } else { @@ -329,7 +329,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) { if (ret == -1) { fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno)); } else { - printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret)); + printf ("[ETHERNET] status of %s is %d\n", system_cmd, WEXITSTATUS(ret)); } printf("[ETHERNET] Ring parameters %s\n",system_cmd); } else {