From a7f212818b251cd74cf53b48e6f84535b250a8b9 Mon Sep 17 00:00:00 2001
From: Rohit Gupta <rohit.gupta@eurecom.fr>
Date: Thu, 18 Jan 2018 13:18:57 +0100
Subject: [PATCH] force instance 0 for PDCP netlink

---
 openair2/LAYER2/PDCP_v10.1.0/pdcp.c      | 16 ++--------------
 openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c |  5 +----
 2 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index 7fd33d5a43c..2b95c6a94d0 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -809,23 +809,11 @@ pdcp_data_ind(
       // set ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst for IP layer here
       if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
         ((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id;
-#if defined(OAI_EMU)
-        ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst  = ctxt_pP->module_id + oai_emulation.info.nb_enb_local - oai_emulation.info.first_ue_local;
-#else
-#  if defined(ENABLE_USE_MME)
-        /* for the UE compiled in S1 mode, we need 1 here
-         * for the UE compiled in noS1 mode, we need 0
-         * TODO: be sure of this
-         */
-        ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst  = 1;
-#  endif
-#endif
       } else {
         ((pdcp_data_ind_header_t*) new_sdu_p->data)->rb_id = rb_id + (ctxt_pP->module_id * maxDRB);
-#if defined(OAI_EMU)
-        ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst  = ctxt_pP->module_id - oai_emulation.info.first_enb_local;
-#endif
       }
+      ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst  = ctxt_pP->module_id;
+
 #ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
       static uint32_t pdcp_inst = 0;
       ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = pdcp_inst++;
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index 528a1d8f9de..9b9bd0ed13f 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -170,10 +170,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const  ctxt_pP)
             ((pdcp_data_ind_header_t*) sdu_p->data)->inst,
             ((pdcp_data_ind_header_t *) sdu_p->data)->data_size);
 #else
-#if ! defined(OAI_EMU)
-      /* TODO: do we have to reset to 0 or not? not for a scenario with 1 UE at least */
-      //    ((pdcp_data_ind_header_t *)(sdu_p->data))->inst = 0;
-#endif
+      ((pdcp_data_ind_header_t *)(sdu_p->data))->inst = 0;
 #endif
 
 #if defined(LINK_ENB_PDCP_TO_GTPV1U)
-- 
GitLab