From 1ab576c4943c5f364a1e93d73a943c1273c29aa6 Mon Sep 17 00:00:00 2001
From: winckel <winckel@eurecom.fr>
Date: Tue, 22 Oct 2013 13:50:17 +0000
Subject: [PATCH] Started ITTI integration into oaisim. Moved some local
 variable from "otg_kpi.h" into "otg_kpi.c". Clean-up some header issues.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4259 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair2/UTIL/OTG/otg_kpi.c    |  5 +++++
 openair2/UTIL/OTG/otg_kpi.h    | 10 +++++-----
 openair2/UTIL/OTG/otg_models.c |  1 +
 openair2/UTIL/OTG/otg_models.h |  3 +--
 openair2/UTIL/OTG/otg_tx.c     |  1 +
 openair2/UTIL/OTG/otg_tx.h     |  1 -
 targets/SIMU/USER/Makefile     |  2 +-
 targets/SIMU/USER/oaisim.c     | 21 ++++++++++++++++++---
 8 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c
index 867304586a..bdf391cb03 100644
--- a/openair2/UTIL/OTG/otg_kpi.c
+++ b/openair2/UTIL/OTG/otg_kpi.c
@@ -39,6 +39,11 @@
 
 */
 
+unsigned int start_log_latency=0;
+unsigned int start_log_latency_bg=0;
+unsigned int start_log_GP=0;
+unsigned int start_log_GP_bg=0;
+unsigned int start_log_jitter=0;
 
 #include"otg_kpi.h"
 #include"otg_externs.h"
diff --git a/openair2/UTIL/OTG/otg_kpi.h b/openair2/UTIL/OTG/otg_kpi.h
index 58100dab52..15de3bac82 100644
--- a/openair2/UTIL/OTG/otg_kpi.h
+++ b/openair2/UTIL/OTG/otg_kpi.h
@@ -49,11 +49,11 @@
 #include "otg_externs.h" // not needed, you should compute kpi from the pkt header
 
 
-unsigned int start_log_latency=0;
-unsigned int start_log_latency_bg=0;
-unsigned int start_log_GP=0;
-unsigned int start_log_GP_bg=0;
-unsigned int start_log_jitter=0;
+extern unsigned int start_log_latency;
+extern unsigned int start_log_latency_bg;
+extern unsigned int start_log_GP;
+extern unsigned int start_log_GP_bg;
+extern unsigned int start_log_jitter;
 
 /*! \fn void tx_throughput( int src, int dst, int application)
 * \brief compute the transmitter throughput in bytes per seconds
diff --git a/openair2/UTIL/OTG/otg_models.c b/openair2/UTIL/OTG/otg_models.c
index 6324cfbd87..098bdeec28 100644
--- a/openair2/UTIL/OTG/otg_models.c
+++ b/openair2/UTIL/OTG/otg_models.c
@@ -38,6 +38,7 @@
 * \warning
 */
 
+#include "UTIL/MATH/oml.h"
 #include "otg_models.h"
 #include "UTIL/LOG/log.h"
 
diff --git a/openair2/UTIL/OTG/otg_models.h b/openair2/UTIL/OTG/otg_models.h
index 29ab7ad7d7..de8aa8e561 100644
--- a/openair2/UTIL/OTG/otg_models.h
+++ b/openair2/UTIL/OTG/otg_models.h
@@ -49,7 +49,6 @@
 #include <math.h>
 #include <unistd.h>
 
-#include "UTIL/MATH/oml.h"
 
 
 
@@ -76,4 +75,4 @@ void backgroundUpdateStream(backgroundStream_t *stream, int ctime);
 double backgroundCalculateSize(backgroundStream_t *stream, int ctime, int idt);
 void backgroundPrintStream(backgroundStream_t *stream);
 
-#endif
\ No newline at end of file
+#endif
diff --git a/openair2/UTIL/OTG/otg_tx.c b/openair2/UTIL/OTG/otg_tx.c
index 0f7cbff361..4b34734640 100644
--- a/openair2/UTIL/OTG/otg_tx.c
+++ b/openair2/UTIL/OTG/otg_tx.c
@@ -39,6 +39,7 @@
 */
 
 
+#include "UTIL/MATH/oml.h"
 #include "otg_tx.h" 
 #include "otg_vars.h"
 
diff --git a/openair2/UTIL/OTG/otg_tx.h b/openair2/UTIL/OTG/otg_tx.h
index fa65ee5e45..faf9e05a76 100644
--- a/openair2/UTIL/OTG/otg_tx.h
+++ b/openair2/UTIL/OTG/otg_tx.h
@@ -51,7 +51,6 @@
 
 
 #include "otg.h"
-#include "UTIL/MATH/oml.h"
 //#include "COMMON/platform_constants.h"
 
 
diff --git a/targets/SIMU/USER/Makefile b/targets/SIMU/USER/Makefile
index b0bffa1608..7cb73c8e10 100644
--- a/targets/SIMU/USER/Makefile
+++ b/targets/SIMU/USER/Makefile
@@ -369,7 +369,7 @@ $(LFDS_DIR)/bin/liblfds611.a:
 	$(MAKE) -C $(LFDS_DIR) -f makefile.linux
 
 oaisim_pad : $(ITTI_MESSAGES_H) $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1)
-	@echo "Linkin oaisim_pad ..."
+	@echo "Linking oaisim_pad ..."
 	@$(MPICC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim_pad $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1) \
 	 -lm -lblas -lpthread -llapack_atlas -lforms -lxml2 -lX11 -lXpm -lrt
 
diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c
index 5438d46138..33dc4ab2bf 100644
--- a/targets/SIMU/USER/oaisim.c
+++ b/targets/SIMU/USER/oaisim.c
@@ -20,11 +20,13 @@
 //#ifdef OPENAIR2
 #include "LAYER2/MAC/defs.h"
 #include "LAYER2/MAC/vars.h"
+#include "pdcp.h"
 #ifndef CELLULAR
 #include "RRC/LITE/vars.h"
 #endif
 #include "PHY_INTERFACE/vars.h"
 //#endif
+#include "RRC/NAS/nas_config.h"
 
 #include "ARCH/CBMIMO1/DEVICE_DRIVER/vars.h"
 
@@ -68,6 +70,11 @@ char smbv_ip[16];
 //#endif
 
 #include "UTIL/LOG/vcd_signal_dumper.h"
+#include "UTIL/OTG/otg_kpi.h"
+
+#if defined(ENABLE_ITTI)
+# include "intertask_interface_init.h"
+#endif
 
 #define RF
 
@@ -172,8 +179,7 @@ void terminate(void);
 
 void 
 help (void) {
-  printf
-      ("Usage: oaisim -h -a -F -C tdd_config -V -R N_RB_DL -e -x transmission_mode -m target_dl_mcs -r(ate_adaptation) -n n_frames -s snr_dB -k ricean_factor -t max_delay -f forgetting factor -A channel_model -z cooperation_flag -u nb_local_ue -U UE mobility -b nb_local_enb -B eNB_mobility -M ethernet_flag -p nb_master -g multicast_group -l log_level -c ocg_enable -T traffic model -D multicast network device\n");
+  printf ("Usage: oaisim -h -a -F -C tdd_config -V -R N_RB_DL -e -x transmission_mode -m target_dl_mcs -r(ate_adaptation) -n n_frames -s snr_dB -k ricean_factor -t max_delay -f forgetting factor -A channel_model -z cooperation_flag -u nb_local_ue -U UE mobility -b nb_local_enb -B eNB_mobility -M ethernet_flag -p nb_master -g multicast_group -l log_level -c ocg_enable -T traffic model -D multicast network device\n");
 
   printf ("-h provides this help message!\n");
   printf ("-a Activates PHY abstraction mode\n");
@@ -366,9 +372,14 @@ int main (int argc, char **argv) {
   strcpy(smbv_ip,DEFAULT_SMBV_IP);
 #endif
 
-  s32 UE_id=0, eNB_id=0, RN_id=0;
+  s32 UE_id=0, eNB_id=0;
+#ifdef Rel10
+  s32 RN_id=0;
+#endif
   
+#ifdef Rel10
   relaying_type_t r_type=no_relay; // no relaying 
+#endif
   // time calibration for soft realtime mode  
 
   lte_subframe_t direction;
@@ -452,6 +463,10 @@ int main (int argc, char **argv) {
     sinr_dB=-20;
  }
 
+#if defined(ENABLE_ITTI)
+  intertask_interface_init(THREAD_MAX, MESSAGES_ID_MAX, threads_name, messages_info, messages_definition_xml);
+#endif
+
 #ifdef OPENAIR2
   init_omv();
  #endif
-- 
GitLab