From cc02e8a78290269a4d5e501f6b9d9171b136505c Mon Sep 17 00:00:00 2001
From: Navid Nikaein <navid.nikaein@eurecom.fr>
Date: Wed, 29 Apr 2015 15:05:17 +0000
Subject: [PATCH] minor updates for the eMBMS

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7294 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c   |  4 ++--
 openair2/LAYER2/MAC/config.c                  |  2 +-
 openair2/LAYER2/PDCP_v10.1.0/pdcp.c           |  4 ++--
 openair2/LAYER2/RLC/rlc_mac.c                 |  3 ++-
 openair2/Makefile                             | 12 ++++++------
 openair2/NETWORK_DRIVER/MESH/RB_TOOL/Makefile |  2 +-
 openair2/RRC/LITE/MESSAGES/asn1_msg.c         |  6 +++++-
 targets/SIMU/USER/Makefile                    | 12 ++++++------
 targets/SIMU/USER/oaisim_functions.c          |  6 +++---
 9 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
index 9146c7e2ad..8334266855 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
@@ -767,9 +767,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
 #ifdef DEBUG_DLSCH_DECODING
 
     for (i=0; i<dlsch_ue->harq_processes[0]->TBS>>3; i++)
-      LOG_T(PHY,"%x.",dlsch_eNB->harq_processes[0]->b[i]);
+      msg("%x.",dlsch_eNB->harq_processes[0]->b[i]);
 
-    LOG_T(PHY,"\n");
+    msg("\n");
 #endif
 
     /*
diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c
index ca97ecc1b0..5b3c8bd05e 100644
--- a/openair2/LAYER2/MAC/config.c
+++ b/openair2/LAYER2/MAC/config.c
@@ -457,7 +457,7 @@ rrc_mac_config_req(
       for (i =0; i< pmch_InfoList->list.count; i++) {
         eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
 
-        LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop at subframe  %ldth\n", i,
+        LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe  %ldth\n", i,
               eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9);
         LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", i,
               eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9);
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index d53ab03df2..569f1a77e7 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -1493,8 +1493,8 @@ pdcp_config_req_asn1 (
 
   case CONFIG_ACTION_MBMS_ADD:
   case CONFIG_ACTION_MBMS_MODIFY:
-    LOG_D(PDCP,PROTOCOL_PDCP_CTXT_FMT" %s service_id/mch index %d, session_id/lcid %d, rbid %d configured\n",
-          PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
+    LOG_D(PDCP," %s service_id/mch index %d, session_id/lcid %d, rbid %d configured\n",
+          //PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
           actionP == CONFIG_ACTION_MBMS_ADD ? "CONFIG_ACTION_MBMS_ADD" : "CONFIG_ACTION_MBMS_MODIFY",
           mch_idP,
           lc_idP,
diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c
index 9b77ef0bec..df555ddf88 100644
--- a/openair2/LAYER2/RLC/rlc_mac.c
+++ b/openair2/LAYER2/RLC/rlc_mac.c
@@ -169,7 +169,8 @@ tbs_size_t mac_rlc_data_req(
 
 #ifdef OAI_EMU
   CHECK_CTXT_ARGS(&ctxt);
-    AssertFatal (MBMS_flagP == MBMS_FLAG_NO ," MBMS FLAG SHOULD NOT BE SET IN mac_rlc_data_req in UE\n");
+  //printf("MBMS_flagP %d, MBMS_FLAG_NO %d \n",MBMS_flagP, MBMS_FLAG_NO);
+  //  AssertFatal (MBMS_flagP == MBMS_FLAG_NO ," MBMS FLAG SHOULD NOT BE SET IN mac_rlc_data_req in UE\n");
 
 #endif
 
diff --git a/openair2/Makefile b/openair2/Makefile
index db6150c600..19ce431a2e 100755
--- a/openair2/Makefile
+++ b/openair2/Makefile
@@ -146,13 +146,13 @@ nasmesh_netlink.ko:
 	(cd NETWORK_DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
 
 naslite_netlink_ether.ko:
-	(cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
+	(cd NETWORK_DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
 
 oai_nw_ether.ko:
-	(cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
+	(cd NETWORK_DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
 
 oai_nw_drv.ko:
-	(cd NAS/DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
+	(cd NETWORK_DRIVER/LITE && $(MAKE) -j$(NUM_CORES) $(SET_UM) OAI_NW_DRIVER_TYPE_ETHERNET=1 PDCP_USE_NETLINK=1 OAI_NW_DRIVER_USE_NETLINK=1 V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
 
 nasmesh_netlink_address_fix.ko:
 	(cd NETWORK_DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) PDCP_USE_NETLINK=1 ADDRESS_FIX=1  V=1 -C $(KERNEL_DIR)/build M=`pwd` modules)
@@ -230,9 +230,9 @@ emul_rt:
 
 clean:
 	(cd NETWORK_DRIVER/MESH && $(MAKE) clean)
-	(cd NAS/DRIVER/LITE && $(MAKE) clean)
+	(cd NETWORK_DRIVER/LITE && $(MAKE) clean)
 	rm -rf NETWORK_DRIVER/MESH/RB_TOOL/rb_tool
-	rm -rf NAS/DRIVER/LITE/RB_TOOL/rb_tool
+	rm -rf NETWORK_DRIVER/LITE/RB_TOOL/rb_tool
 
 cleanall:
 	find -name *.o -delete -print
@@ -240,7 +240,7 @@ cleanall:
 	find -name *~ -delete -print
 	find -name *.bak -delete -print
 	rm -rf NETWORK_DRIVER/MESH/RB_TOOL/rb_tool
-	rm -rf NAS/DRIVER/LITE/RB_TOOL/rb_tool
+	rm -rf NETWORK_DRIVER/LITE/RB_TOOL/rb_tool
 
 
 cleansvn:
diff --git a/openair2/NETWORK_DRIVER/MESH/RB_TOOL/Makefile b/openair2/NETWORK_DRIVER/MESH/RB_TOOL/Makefile
index 850a0ca5f5..f17e87b2bb 100644
--- a/openair2/NETWORK_DRIVER/MESH/RB_TOOL/Makefile
+++ b/openair2/NETWORK_DRIVER/MESH/RB_TOOL/Makefile
@@ -4,7 +4,7 @@ NAS_DIR = ..
 
 
 rb_tool: rb_tool.c 
-	$(CC) rb_tool.c -o rb_tool -I../../../mac/openair_wireless3g4free/openair_rrc/include -I../ -g -ggdb
+	$(CC) rb_tool.c -o rb_tool -I../ -g -ggdb
 
 all:    rb_tool
 
diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
index ad80536803..0eec5bbbc1 100644
--- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
@@ -2137,7 +2137,11 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
   pmch_Info_1 = CALLOC(1,sizeof(PMCH_Info_r9_t));
   memset((void*)pmch_Info_1,0,sizeof(PMCH_Info_r9_t));
 
-  pmch_Info_1->pmch_Config_r9.sf_AllocEnd_r9= 3;//take the value of last mbsfn subframe in this CSA period because there is only one PMCH in this mbsfn area
+  /*
+   * take the value of last mbsfn subframe in this CSA period because there is only one PMCH in this mbsfn area
+   * Note: this has to be set based on the subframeAllocation and CSA
+   */
+  pmch_Info_1->pmch_Config_r9.sf_AllocEnd_r9= 3;
   pmch_Info_1->pmch_Config_r9.dataMCS_r9= 7;
   pmch_Info_1->pmch_Config_r9.mch_SchedulingPeriod_r9= PMCH_Config_r9__mch_SchedulingPeriod_r9_rf16;
 
diff --git a/targets/SIMU/USER/Makefile b/targets/SIMU/USER/Makefile
index 0cbe236c3e..bc8ab6da57 100644
--- a/targets/SIMU/USER/Makefile
+++ b/targets/SIMU/USER/Makefile
@@ -372,21 +372,21 @@ oai_nw_drv:
 oai_nw_drv_clean:
 	(cd $(OPENAIR2_DIR)/NAS/DRIVER/LITE && $(MAKE) clean)
 nasmesh_fix:
-	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE) clean && $(MAKE))
+	(cd $(OPENAIR2_DIR)/NETWORK_DRIVER/MESH/RB_TOOL && $(MAKE) clean && $(MAKE))
 	(cd $(OPENAIR2_DIR) && $(MAKE) clean && $(MAKE) nasmesh_netlink_address_fix.ko)
 nasmesh_fix_uninstall:	
 	(sudo rmmod nasmesh.ko)
 nasmesh_fix_install:	
-	(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)	
+	(sudo insmod $(OPENAIR2_DIR)/NETWORK_DRIVER/MESH/nasmesh.ko)	
 nasmesh_fix_reinstall:
 	(sudo rmmod nasmesh.ko)	
-	(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
+	(sudo insmod $(OPENAIR2_DIR)/NETWORK_DRIVER/MESH/nasmesh.ko)
 nasmesh_nl:
-	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
+	(cd $(OPENAIR2_DIR)/NETWORK_RIVER/MESH/RB_TOOL && $(MAKE))
 	(cd $(OPENAIR2_DIR) && $(MAKE) nasmesh_netlink.ko)
-	(sudo insmod $(OPENAIR2_DIR)/NAS/DRIVER/MESH/nasmesh.ko)
+	(sudo insmod $(OPENAIR2_DIR)/NETWORK_DRIVER/MESH/nasmesh.ko)
 rb_tool:
-	(cd $(OPENAIR2_DIR)/NAS/DRIVER/MESH/RB_TOOL && $(MAKE))
+	(cd $(OPENAIR2_DIR)/NETWORK_DRIVER/MESH/RB_TOOL && $(MAKE))
 
 nasmesh_install:
 	(sudo rmmod nasmesh)
diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c
index 47c2595144..11d52ad6c8 100644
--- a/targets/SIMU/USER/oaisim_functions.c
+++ b/targets/SIMU/USER/oaisim_functions.c
@@ -1312,7 +1312,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
     rb_id_t           rb_id;
 
     // MBSM multicast traffic
-    // if (frame >= 50) {// only generate when UE can receive MTCH (need to control this value)
+    if (ctime >= 500 ) {// only generate when UE can receive MTCH (need to control this value)
     for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
       for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
         if (pdcp_mbms_array_eNB[enb_module_idP][service_id][session_id].instanciated_instance == TRUE) { // this service/session is configured
@@ -1337,7 +1337,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
             free(otg_pkt);
             otg_pkt=NULL;
           }
-
+	
 
           // old version
           /*      // MBSM multicast traffic
@@ -1370,7 +1370,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
       }
     }
 
-    //    } // end multicast traffic
+    } // end multicast traffic
 #endif
   }
 
-- 
GitLab