From 7f70860c24f3a0adf50c12459f707eba8d8e4a18 Mon Sep 17 00:00:00 2001
From: Bing-Kai Hong <Bing-Kai.Hong@eurecom.fr>
Date: Mon, 24 Sep 2018 17:48:57 +0200
Subject: [PATCH] Fix tag typo of PROTO_AGENT

---
 common/utils/LOG/log.c                        |  1 +
 openair2/LAYER2/PDCP_v10.1.0/pdcp.c           | 22 ++++++++++++++++++-
 .../LAYER2/PROTO_AGENT/proto_agent_common.c   |  2 +-
 .../LAYER2/PROTO_AGENT/proto_agent_handler.c  |  2 +-
 targets/COMMON/create_tasks.c                 |  2 +-
 5 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c
index 6d602d7027..989f77ee9a 100644
--- a/common/utils/LOG/log.c
+++ b/common/utils/LOG/log.c
@@ -396,6 +396,7 @@ int logInit (void)
   register_log_component("mRAL","",RAL_UE); 
   register_log_component("ENB_APP","log",ENB_APP); 
   register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT); 
+  register_log_component("PROTO_AGENT","log",PROTO_AGENT);
   register_log_component("TMR","",TMR); 
   register_log_component("USIM","txt",USIM);   
   register_log_component("SIM","txt",SIM);  
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index 6194f9394d..8ea37cc5ff 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -126,6 +126,12 @@ boolean_t pdcp_data_req(
   CHECK_CTXT_ARGS(ctxt_pP);
 
 
+  if (srb_flagP == 0) 
+  LOG_I(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n", 
+              rb_idP, pdcp_pdu_size, ctxt_pP->rnti, RC.rrc[ctxt_pP->module_id]->node_type);
+
+
+
 #if T_TRACER
   if (ctxt_pP->enb_flag != ENB_FLAG_NO)
     T(T_ENB_PDCP_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP));
@@ -385,8 +391,14 @@ boolean_t pdcp_data_req(
 
     LOG_F(PDCP,"\n");
 #ifndef UETARGET
+
+   
     if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1))
     {
+
+       LOG_I(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n", 
+            rb_idP, pdcp_pdu_size, ctxt_pP->rnti, RC.rrc[ctxt_pP->module_id]->node_type);
+
       if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
           || RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
           || RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
@@ -396,6 +408,9 @@ boolean_t pdcp_data_req(
         /* assume good status */
         rlc_status = RLC_OP_STATUS_OK;
         ret = TRUE;
+        LOG_I(PDCP, "proto_agent_send_rlc_data_req for UE RNTI %x, rb %d, pdu size %d \n", 
+            ctxt_pP->rnti, rb_idP, pdcp_pdu_size);
+
       } else if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_DU
           || RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_DU){
         LOG_E(PDCP, "Can't be DU, bad node type %d \n", RC.rrc[ctxt_pP->module_id]->node_type);
@@ -838,11 +853,16 @@ pdcp_data_ind(
 #if defined(LINK_ENB_PDCP_TO_GTPV1U)
 
   if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
+    LOG_I(PDCP, "Sending packet to GTP, Calling GTPV1U_ENB_TUNNEL_DATA_REQ  ue %x rab %u len %u\n",
+            ctxt_pP->rnti,
+            rb_id + 4,
+            sdu_buffer_sizeP - payload_offset );
+
     MSC_LOG_TX_MESSAGE(
     		MSC_PDCP_ENB,
     		MSC_GTPU_ENB,
     		NULL,0,
-    		"0 GTPV1U_ENB_TUNNEL_DATA_REQ  ue %x rab %u len %u",
+    		"0 GTPV1U_ENB_TUNNEL_DATA_REQ  ue %x rab %u len %u\n",
     		ctxt_pP->rnti,
     		rb_id + 4,
     		sdu_buffer_sizeP - payload_offset);
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
index d6204fdfa1..800592c259 100644
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
+++ b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
@@ -619,7 +619,7 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
 //   if (xid == 1)
 //     pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p);
 //   else if (xid == 0)   // FIXME: USE a preprocessed definition
-  LOG_I(PROTO_AGETN, "[inst %d] Received PDCP PDU with size %d for UE RNTI %x RB %d, Calling pdcp_data_ind\n", ctxt_pP->instance, pdcp_pdu_size,ctxt_pP->rnti,rb_idP);
+  LOG_I(PROTO_AGENT, "[inst %d] Received PDCP PDU with size %d for UE RNTI %x RB %d, Calling pdcp_data_ind\n", ctxt_pP->instance, pdcp_pdu_size,ctxt_pP->rnti,rb_idP);
   result = pdcp_data_ind(ctxt_pP,
                          srb_flagP,
                          flag_MBMS,
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
index 5b38278704..cb65da2803 100644
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
+++ b/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
@@ -43,7 +43,7 @@ proto_agent_message_decoded_callback proto_agent_messages_callback[][3] = {
   {proto_agent_hello, 0, 0},                 /* agent hello */
   {proto_agent_echo_reply, 0, 0},            /* echo */
   {0, just_print, 0},                        /* just print */
-  {proto_agent_pdcp_data_req_process, 0, 0}, /* PDCP data REQ */
+  {proto_agent_pdcp_data_req_process, proto_agent_pdcp_data_req_process, 0}, /* PDCP data REQ */
   {0, proto_agent_get_ack_result, 0},        /* get ACK result */
   {proto_agent_pdcp_data_ind_process, proto_agent_pdcp_data_ind_process, 0}, /* PDCP data IND */
   {0, just_print, 0},                        /* just print */
diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c
index 793eb90740..fcc5eea4f8 100644
--- a/targets/COMMON/create_tasks.c
+++ b/targets/COMMON/create_tasks.c
@@ -102,7 +102,7 @@ int create_tasks(uint32_t enb_nb)
         rc = itti_create_task(TASK_UDP, udp_eNB_task, NULL);
         AssertFatal(rc >= 0, "Create task for UDP failed\n");
       }
-      rc = itti_create_task(TASK_GTPV1_U, &gtpv1u_eNB_task, NULL);
+      rc = itti_create_task(TASK_GTPV1_U, gtpv1u_eNB_task, NULL);
       AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
     }
 #endif
-- 
GitLab