From 1a4133cd6885e330b38d0efee05e100382338c44 Mon Sep 17 00:00:00 2001
From: wf <1090921944@qq.com>
Date: Tue, 24 Nov 2020 16:53:09 +0800
Subject: [PATCH] remove some log to test ping

---
 .../PHY/NR_UE_ESTIMATION/nr_ue_measurements.c    |  2 +-
 openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c     |  6 ++----
 openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c     |  2 +-
 openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c        | 14 +++++++-------
 openair2/RRC/NR_UE/rrc_UE.c                      | 16 ++++++++--------
 5 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
index 1dfdfc939f..c34915d3f9 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
@@ -284,7 +284,7 @@ void nr_ue_rsrp_measurements(PHY_VARS_NR_UE *ue,
 
       if (eNB_offset == 0)
 
-      LOG_I(PHY,"[UE %d] slot %d RRC Measurements (idx %d, Cell id %d) => rsrp: %3.1f dBm/RE (%d)\n",
+      LOG_D(PHY,"[UE %d] slot %d RRC Measurements (idx %d, Cell id %d) => rsrp: %3.1f dBm/RE (%d)\n",
             ue->Mod_id,
             slot,eNB_offset,
             (eNB_offset>0) ? ue->measurements.adj_cell_id[eNB_offset-1] : ue->frame_parms.Nid_cell,
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
index 7144299e39..67437c58b1 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
@@ -958,7 +958,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
                         void *pduP,
                         uint16_t cell_id)
 {
-  LOG_I(MAC,"[L2][MAC] decode mib\n");
+  LOG_D(MAC,"[L2][MAC] decode mib\n");
 
   NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
 
@@ -1065,7 +1065,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
       num_rbs     = table_38213_13_4_c2[index_4msb];
       num_symbols = table_38213_13_4_c3[index_4msb];
       rb_offset   = table_38213_13_4_c4[index_4msb];
-      LOG_I(MAC,"<<<<<<<<<index_4msb %d num_rbs %d num_symb %d rb_offset %d\n",index_4msb,num_rbs,num_symbols,rb_offset );
+      LOG_D(MAC,"<<<<<<<<<index_4msb %d num_rbs %d num_symb %d rb_offset %d\n",index_4msb,num_rbs,num_symbols,rb_offset );
     }else if(min_channel_bw & bw_40MHz){
       AssertFatal(index_4msb < 10, "38.213 Table 13-6 4 MSB out of range\n");
       mac->type0_pdcch_ss_mux_pattern = 1;
@@ -3922,8 +3922,6 @@ void nr_ue_send_sdu(module_id_t module_idP,
     LOG_T(MAC, "\n");
   #endif
 
-  log_dump(MAC, pduP, 16, LOG_DUMP_CHAR, "UE DLSCH payload : ");
-
   // Processing MAC PDU
   // it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs
   if (pduP != NULL)
diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c
index d367f2f034..c55323906c 100644
--- a/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c
+++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c
@@ -56,7 +56,7 @@ void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int si
   /* For now use padding for the MAC-I bytes (normally carrying message authentication code)
    * which come after the data payload bytes (38.323, section 6.2.2.1) */
   for (int i=size+2; i<size+6; i++)
-    buf[i] = 0x11*i;
+    buf[i] = 0x11*(i-size-1);
 
   entity->common.deliver_pdu(entity->common.deliver_pdu_data,
                              (nr_pdcp_entity_t *)entity, buf, size+6, sdu_id);
diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
index f331051133..749044186e 100644
--- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
@@ -295,9 +295,9 @@ printf("\n\n\n########## nas_sock_fd read returns len %d\n", len);
 
     ctxt.rnti = rnti;
 
-    // pdcp_data_req(&ctxt, SRB_FLAG_NO, lc_id, RLC_MUI_UNDEFINED,
-    //               RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
-    //               PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
+    pdcp_data_req(&ctxt, SRB_FLAG_NO, lc_id, RLC_MUI_UNDEFINED,
+                  RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
+                  PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
   }
 
   return NULL;
@@ -339,9 +339,9 @@ printf("\n\n\n########## nas_sock_fd read returns len %d\n", len);
 
     ctxt.rnti = rnti;
 
-    // pdcp_data_req(&ctxt, SRB_FLAG_NO, lc_id, RLC_MUI_UNDEFINED,
-    //               RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
-    //               PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
+    pdcp_data_req(&ctxt, SRB_FLAG_NO, lc_id, RLC_MUI_UNDEFINED,
+                  RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
+                  PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
   }
 
   return NULL;
@@ -466,7 +466,7 @@ static void deliver_sdu_drb(protocol_ctxt_t *ctxt_pP,void *_ue, nr_pdcp_entity_t
   int i;
 
   if (1) { //(IS_SOFTMODEM_NOS1){
-    #if 1
+    #if 0
     log_dump(PDCP,buf,size,LOG_DUMP_CHAR,"   PDCP Received SDU:\n");
     if (size > 4700)
     {
diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c
index 1c89fd540d..1063047f42 100755
--- a/openair2/RRC/NR_UE/rrc_UE.c
+++ b/openair2/RRC/NR_UE/rrc_UE.c
@@ -1445,14 +1445,14 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
           // Release T300 timer
           NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].T300_active = 0;
           
-          // nr_rrc_ue_process_masterCellGroup(
-          //   ctxt_pP,
-          //   gNB_index,
-          //   &dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup);
-          // nr_sa_rrc_ue_process_radioBearerConfig(
-          //   ctxt_pP,
-          //   gNB_index,
-          //   &dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
+          nr_rrc_ue_process_masterCellGroup(
+            ctxt_pP,
+            gNB_index,
+            &dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->masterCellGroup);
+          nr_sa_rrc_ue_process_radioBearerConfig(
+            ctxt_pP,
+            gNB_index,
+            &dl_ccch_msg->message.choice.c1->choice.rrcSetup->criticalExtensions.choice.rrcSetup->radioBearerConfig);
           nr_rrc_set_state (ctxt_pP->module_id, RRC_STATE_CONNECTED);
           nr_rrc_set_sub_state (ctxt_pP->module_id, RRC_SUB_STATE_CONNECTED);
           NR_UE_rrc_inst[ctxt_pP->module_id].Info[gNB_index].rnti = ctxt_pP->rnti;
-- 
2.26.2