From 13f4acd5b61c4c4717fa5b5584855ea189039cfa Mon Sep 17 00:00:00 2001
From: Francesco Mani <francesco.mani@eurecom.fr>
Date: Tue, 5 Nov 2019 10:59:15 +0100
Subject: [PATCH] Revert "disabling pdsch and ul"

This reverts commit 582ba0c922828c3feaf80b9125385be8128a4694.
---
 openair1/PHY/NR_TRANSPORT/nr_dci.c        | 8 ++++----
 openair1/SCHED_NR/phy_procedures_nr_gNB.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c
index b4524f4cef..8afdffdd3f 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c
@@ -276,8 +276,8 @@ uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
       k = cset_start_sc + 1;
 
       while (dmrs_idx<3*pdcch_params.n_rb) {
-        ((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1]       = (amp * mod_dmrs[l][dmrs_idx<<1]) >> 15;
-        ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (amp * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
+        ((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1]       = ((amp>>1) * mod_dmrs[l][dmrs_idx<<1]) >> 15;
+        ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = ((amp>>1) * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
 #ifdef DEBUG_PDCCH_DMRS
         printf("symbol %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
                ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
@@ -314,8 +314,8 @@ uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
     for (int m=0; m<NR_NB_SC_PER_RB; m++) {
       if ( m == (k_prime<<2)+1) { // DMRS if not already mapped
         if (pdcch_params.precoder_granularity == NFAPI_NR_CSET_SAME_AS_REG_BUNDLE) {
-          ((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1]       = (amp * mod_dmrs[l][dmrs_idx<<1]) >> 15;
-          ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (amp * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
+          ((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1]       = ((amp>>1) * mod_dmrs[l][dmrs_idx<<1]) >> 15;
+          ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = ((amp>>1) * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
 #ifdef DEBUG_PDCCH_DMRS
           printf("l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
                  ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index c717109939..1689a627fc 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -195,14 +195,14 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
       if (num_pdsch_rnti) {
 	VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
         LOG_D(PHY, "PDSCH generation started (%d)\n", num_pdsch_rnti);
-      /*  nr_generate_pdsch(gNB->dlsch[0][0],
+        nr_generate_pdsch(gNB->dlsch[0][0],
                           &gNB->pdcch_vars.dci_alloc[0],
                           gNB->nr_gold_pdsch_dmrs[slot],
                           gNB->common_vars.txdataF,
                           AMP, frame, slot, fp, cfg,
                           &gNB->dlsch_encoding_stats,
                           &gNB->dlsch_scrambling_stats,
-                          &gNB->dlsch_modulation_stats);*/
+                          &gNB->dlsch_modulation_stats);
 
 	VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
       }
@@ -356,11 +356,11 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx,
   uint8_t harq_pid = 0; // [hna] Previously in LTE, the harq_pid was obtained from the subframe number (Synchronous HARQ)
                         //       In NR, this should be signaled through uplink scheduling dci (i.e, DCI 0_0, 0_1) (Asynchronous HARQ)  
 
-/*  for (UE_id = 0; UE_id < 1; UE_id++) { // temporary set to 1 untill list of connected UEs is implemented
+  for (UE_id = 0; UE_id < 1; UE_id++) { // temporary set to 1 untill list of connected UEs is implemented
     for(symbol = symbol_start; symbol < symbol_end; symbol++) {
       nr_rx_pusch(gNB, UE_id, frame_rx, slot_rx, symbol, harq_pid);
     }
     nr_ulsch_procedures(gNB, frame_rx, slot_rx, UE_id, harq_pid);
     nr_fill_rx_indication(gNB, frame_rx, slot_rx, UE_id, harq_pid);  // indicate SDU to MAC
-  }*/
+  }
 }
-- 
2.26.2