From 73da898f9b7946f108e8f1a1093d0b3cd45c12c9 Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Fri, 7 Sep 2018 16:57:55 +0200
Subject: [PATCH] integration fix: fix bad merge conflict resolution + fix
 compilation error

---
 common/utils/ocp_itti/all_msg.h               |  1 +
 openair2/ENB_APP/enb_app.c                    |  2 +-
 .../ENB_APP/flexran_agent_common_internal.c   | 50 -------------------
 3 files changed, 2 insertions(+), 51 deletions(-)

diff --git a/common/utils/ocp_itti/all_msg.h b/common/utils/ocp_itti/all_msg.h
index e2965029095..f4395724009 100644
--- a/common/utils/ocp_itti/all_msg.h
+++ b/common/utils/ocp_itti/all_msg.h
@@ -12,3 +12,4 @@
 #include "openair2/COMMON/sctp_messages_def.h"
 #include "openair2/COMMON/udp_messages_def.h"
 #include "openair2/COMMON/gtpv1_u_messages_def.h"
+#include "openair2/COMMON/flexran_messages_def.h"
diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c
index 97645b39ccf..37bcd366533 100644
--- a/openair2/ENB_APP/enb_app.c
+++ b/openair2/ENB_APP/enb_app.c
@@ -414,7 +414,7 @@ void handle_reconfiguration(module_id_t mod_id)
 
   if (restart_L1L2(mod_id) < 0) {
     LOG_E(ENB_APP, "can not restart, killing lte-softmodem\n");
-    itti_terminate_tasks(TASK_PHY_ENB);
+    exit_fun("can not restart L1L2, killing lte-softmodem");
     return;
   }
 
diff --git a/openair2/ENB_APP/flexran_agent_common_internal.c b/openair2/ENB_APP/flexran_agent_common_internal.c
index d288ff5a181..9f1a1d3710a 100644
--- a/openair2/ENB_APP/flexran_agent_common_internal.c
+++ b/openair2/ENB_APP/flexran_agent_common_internal.c
@@ -31,58 +31,8 @@
 
 #include "flexran_agent_common_internal.h"
 #include "flexran_agent_mac_internal.h"
-/* needed to soft-restart the lte-softmodem */
-#include "targets/RT/USER/lte-softmodem.h"
 #include "enb_app.h"
 
-void handle_reconfiguration(mid_t mod_id)
-{
-  struct timespec start, end;
-  clock_gettime(CLOCK_MONOTONIC, &start);
-  flexran_agent_info_t *flexran = RC.flexran[mod_id];
-
-  if (ENB_WAIT == flexran->node_ctrl_state) {
-    /* this is already waiting, just release */
-    pthread_mutex_lock(&flexran->mutex_node_ctrl);
-    flexran->node_ctrl_state = ENB_NORMAL_OPERATION;
-    pthread_mutex_unlock(&flexran->mutex_node_ctrl);
-    pthread_cond_signal(&flexran->cond_node_ctrl);
-    return;
-  }
-
-  if (stop_L1L2(mod_id) < 0) {
-    LOG_E(ENB_APP, "can not stop lte-softmodem, aborting restart\n");
-    return;
-  }
-
-  /* node_ctrl_state should have value ENB_MAKE_WAIT only if this method is not
-   * executed by the FlexRAN thread */
-  if (ENB_MAKE_WAIT == flexran->node_ctrl_state) {
-    LOG_I(ENB_APP, " * eNB %d: Waiting for FlexRAN RTController command *\n", mod_id);
-    pthread_mutex_lock(&flexran->mutex_node_ctrl);
-    flexran->node_ctrl_state = ENB_WAIT;
-    while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state)
-      pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl);
-    pthread_mutex_unlock(&flexran->mutex_node_ctrl);
-  }
-
-  if (restart_L1L2(mod_id) < 0) {
-    LOG_F(ENB_APP, "can not restart, killing lte-softmodem\n");
-    exit_fun("can not restart L1L2, killing lte-softmodem");
-    return;
-  }
-
-  clock_gettime(CLOCK_MONOTONIC, &end);
-  end.tv_sec -= start.tv_sec;
-  if (end.tv_nsec >= start.tv_nsec) {
-    end.tv_nsec -= start.tv_nsec;
-  } else {
-    end.tv_sec -= 1;
-    end.tv_nsec = end.tv_nsec - start.tv_nsec + 1000000000;
-  }
-  LOG_I(ENB_APP, "lte-softmodem restart succeeded in %ld.%ld s\n", end.tv_sec, end.tv_nsec / 1000000);
-}
-
 int apply_reconfiguration_policy(mid_t mod_id, const char *policy, size_t policy_length) {
 
   yaml_parser_t parser;
-- 
GitLab