From 9ba035500063a39e2b5a87892dac9cbf38bf35c1 Mon Sep 17 00:00:00 2001
From: jftt_wangshanshan <wang.shanshan@cn.fujitsu.com>
Date: Thu, 8 Feb 2018 18:04:23 +0800
Subject: [PATCH] add switch tdd config to Msg4 timing setting

---
 openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 70bc926e3c..68515b5bc5 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -661,8 +661,13 @@ rx_sdu(const module_id_t enb_mod_idP,
 
 
 		    if(mac->common_channels[CC_idP].tdd_Config!=NULL){
-		      ra->Msg4_frame = frameP + ((subframeP > 2) ? 1 : 0);
-		      ra->Msg4_subframe = (subframeP + 7) % 10; // TODO need to be complete for other tdd configs.
+		        switch(mac->common_channels[CC_idP].tdd_Config->subframeAssignment){
+		          case 1:
+		            ra->Msg4_frame = frameP + ((subframeP > 2) ? 1 : 0);
+		            ra->Msg4_subframe = (subframeP + 7) % 10;
+		            break;
+		          // TODO need to be complete for other tdd configs.
+		        }
 		    }else{
 		    // Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now, // Check if this is ok for BL/CE, or if the rule is different
 		      ra->Msg4_frame = frameP + ((subframeP > 5) ? 1 : 0);
-- 
GitLab