From 0571020666695a04ab268751b6d695618f97a13a Mon Sep 17 00:00:00 2001
From: Raymond Knopp <raymond.knopp@eurecom.fr>
Date: Thu, 3 Dec 2020 10:44:12 +0100
Subject: [PATCH] minor modifications in T_defs.h and for constant power (i.e.
 no DTX in TX subframes for TDD)

---
 common/utils/T/T_defs.h                 | 4 ++--
 openair1/PHY/INIT/lte_init.c            | 9 ++++++---
 openair1/SCHED/phy_procedures_lte_eNb.c | 2 ++
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h
index 7b5304b1cb..2f7e6e7570 100644
--- a/common/utils/T/T_defs.h
+++ b/common/utils/T/T_defs.h
@@ -44,7 +44,7 @@
    /* let's have 100 RBs functional for the basic simulator */
 #  define T_BUFFER_MAX (1024*64*2)
 #else
-#  define T_BUFFER_MAX (1024*64)
+#  define T_BUFFER_MAX (1024*64*2)
 #endif
 
 /* size of the local cache for messages (must be pow(2,something)) */
@@ -52,7 +52,7 @@
    /* we don't need much space for the basic simulator */
 #  define T_CACHE_SIZE 1024
 #else
-#  define T_CACHE_SIZE (8192 * 2)
+#  define T_CACHE_SIZE (8192 )
 #endif
 
 /* maximum number of bytes a message can contain */
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 943e6cdddb..3603a5e672 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -361,13 +361,15 @@ void fill_subframe_mask(PHY_VARS_eNB *eNB) {
       proc.subframe_tx=sf;
       eNB->dlsch[0][0]->harq_ids[0][sf]=0;
       eNB->dlsch[0][0]->rnti=0x1234;
-      dlsch_harq->nb_rb=12;
-      dlsch_harq->rb_alloc[0]=0xfff;
+      dlsch_harq->nb_rb=48;
+      dlsch_harq->rb_alloc[0]=0xffffffffffff;
       dlsch_harq->Qm=2;
       dlsch_harq->Nl=1;
       dlsch_harq->pdsch_start=1;
       dlsch_harq->mimo_mode=(eNB->frame_parms.nb_antenna_ports_eNB>1) ? ALAMOUTI : SISO;
-      pdsch_procedures(eNB,&proc,0,eNB->dlsch[0][0]);
+      dlsch_harq->dl_power_off = 1;
+      computeRhoB_eNB(4,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,eNB->dlsch[0][0],dlsch_harq->dl_power_off);
+      pdsch_procedures(eNB,&proc,0,eNB->dlsch[0][0],NULL);
     }
   }
   eNB->common_vars.txdataF = dummy_tx;
@@ -422,6 +424,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
   eNB->first_run_I0_measurements =
     1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
 
+  eNB->use_DTX=0;
   if (NFAPI_MODE!=NFAPI_MODE_VNF) {
     common_vars->rxdata  = (int32_t **)NULL;
     common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t *));
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index a4e87d4981..a264ee31a2 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -480,6 +480,8 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
                    subframe<<1);
   stop_meas(&eNB->dlsch_scrambling_stats);
   start_meas(&eNB->dlsch_modulation_stats);
+  if (frame==0) LOG_I(PHY,"Generating pdsch for %d.%d starting in symbol %d, Qm %d, nb_rb %d, rbmask %x\n",
+	              frame,subframe,dlsch_harq->pdsch_start,dlsch_harq->Qm,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0]);
   dlsch_modulation(eNB,
                    eNB->common_vars.txdataF,
                    AMP,
-- 
2.26.2