From 390c648a81ee2b209b73dbdb5b5dce7a7d51a4e4 Mon Sep 17 00:00:00 2001
From: Francesco Mani <francesco.mani@eurecom.fr>
Date: Wed, 22 Jul 2020 09:13:04 +0200
Subject: [PATCH] bugfix in time domain assigment

---
 openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c | 5 +++--
 openair2/LAYER2/NR_MAC_gNB/mac_proto.h             | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
index 89de2da0e5..8841083796 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
@@ -474,6 +474,7 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
                   nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
                   dci_pdu_rel15_t *dci_pdu_rel15,
                   int *dci_formats, int *rnti_types,
+                  int time_domain_assignment,
                   int n_ubwp, int bwp_id) {
 
   switch(dci_formats[(pdcch_pdu_rel15->numDlDci)-1]) {
@@ -482,7 +483,7 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
                                                                                          pusch_pdu->rb_start,
 	                                                                                 NRRIV2BW(ubwp->bwp_Common->genericParameters.locationAndBandwidth,275));
 
-      dci_pdu_rel15->time_domain_assignment.val = 2; // row index used here instead of SLIV;
+      dci_pdu_rel15->time_domain_assignment.val = time_domain_assignment;
       dci_pdu_rel15->frequency_hopping_flag.val = pusch_pdu->frequency_hopping;
       dci_pdu_rel15->mcs = 9;
 
@@ -511,7 +512,7 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
       else
         AssertFatal(1==0,"Only frequency resource allocation type 1 is currently supported\n");
       // time domain assignment
-      dci_pdu_rel15->time_domain_assignment.val = 2;
+      dci_pdu_rel15->time_domain_assignment.val = time_domain_assignment;
       // mcs
       dci_pdu_rel15->mcs = pusch_pdu->mcs_index;
       // tpc command for pusch
diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
index 8b38c357c6..74c6841a3a 100644
--- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
@@ -137,6 +137,7 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
                   nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
                   dci_pdu_rel15_t *dci_pdu_rel15,
                   int *dci_formats, int *rnti_types,
+                  int time_domain_assignment,
                   int n_ubwp, int bwp_id);
 
 void configure_fapi_dl_Tx(module_id_t Mod_idP,
-- 
2.26.2