From 39fe25a44dda1f0c17528ad6ab777efdfa995c17 Mon Sep 17 00:00:00 2001
From: Javier Morgade <javier.morgade@ieee.org>
Date: Wed, 27 Feb 2019 11:01:47 +0100
Subject: [PATCH] 	FeMBMS RRC->MAC config request protypes

---
 openair2/LAYER2/MAC/config.c    |  9 ++++
 openair2/LAYER2/MAC/mac.h       |  1 +
 openair2/LAYER2/MAC/mac_proto.h | 15 +++++++
 openair2/RRC/LTE/rrc_defs.h     |  2 +
 openair2/RRC/LTE/rrc_eNB.c      | 78 +++++++++++++++++++++++++++++++++
 5 files changed, 105 insertions(+)

diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c
index fb1aea48cc..bf079c216b 100644
--- a/openair2/LAYER2/MAC/config.c
+++ b/openair2/LAYER2/MAC/config.c
@@ -772,6 +772,15 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
 			   ,
 			   LTE_SystemInformationBlockType1_v1310_IEs_t *
 			   sib1_v13ext
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                       ,
+                       uint8_t FeMBMS_Flag,
+                       LTE_BCCH_DL_SCH_Message_MBMS_t * mib_fembms,
+                       LTE_SchedulingInfo_MBMS_r14_t * schedulingInfo_fembms,
+                       struct LTE_NonMBSFN_SubframeConfig_r14 * nonMBSFN_SubframeConfig,
+                       LTE_SystemInformationBlockType1_MBMS_r14_t *  sib1_mbms_r14_fembms,
+                       LTE_MBSFN_AreaInfoList_r9_t * mbsfn_AreaInfoList_fembms
 #endif
 			   ) {
   
diff --git a/openair2/LAYER2/MAC/mac.h b/openair2/LAYER2/MAC/mac.h
index 638738db32..ad16cf068f 100644
--- a/openair2/LAYER2/MAC/mac.h
+++ b/openair2/LAYER2/MAC/mac.h
@@ -1317,6 +1317,7 @@ typedef struct {
 #endif
 #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
     BCCH_PDU BCCH_MBMS_pdu;
+    uint8_t FeMBMS_flag;
 #endif
 
 } COMMON_channels_t;
diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h
index 6a6ead84be..d2c71300f1 100644
--- a/openair2/LAYER2/MAC/mac_proto.h
+++ b/openair2/LAYER2/MAC/mac_proto.h
@@ -972,6 +972,12 @@ int generate_dlsch_header(unsigned char *mac_header,
 @param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
 @param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
 @param sib1_ext_r13 SI Scheduling information for SI-BR UEs         
+@param mib_fembms pointer to FeMBMS MIB
+@param FeMBMS_Flag indicates FeMBMS transmission
+@param schedulingInfo_fembms pointer to FeMBMS SI Scheduling Information
+@param non_MBSFN_SubframeConfig pointer to FeMBMS Non MBSFN Subframe Config 
+@param sib1_mbms_r14_fembms pointer SI Scheduling infomration for SI-MBMS
+@param mbsfn_AreaInfoList_fembms pointer to FeMBMS MBSFN Area Info list from SIB1-MBMS
 */
 
 int rrc_mac_config_req_eNB(module_id_t module_idP,
@@ -1021,6 +1027,15 @@ int rrc_mac_config_req_eNB(module_id_t module_idP,
 			   ,
 			   LTE_SystemInformationBlockType1_v1310_IEs_t *
 			   sib1_ext_r13
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                           ,
+                           uint8_t FeMBMS_Flag,
+                           LTE_BCCH_DL_SCH_Message_MBMS_t * mib_fembms,
+                           LTE_SchedulingInfo_MBMS_r14_t * schedulingInfo_fembms,
+                           struct LTE_NonMBSFN_SubframeConfig_r14 * nonMBSFN_SubframeConfig,
+                           LTE_SystemInformationBlockType1_MBMS_r14_t *  sib1_mbms_r14_fembms,
+                           LTE_MBSFN_AreaInfoList_r9_t * mbsfn_AreaInfoList_fembms
 #endif
     );
 
diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h
index 4c790f2d43..318d212a88 100644
--- a/openair2/RRC/LTE/rrc_defs.h
+++ b/openair2/RRC/LTE/rrc_defs.h
@@ -665,6 +665,7 @@ typedef struct {
   LTE_SystemInformationBlockType2_t     *sib2_BR;
   LTE_SystemInformationBlockType1_MBMS_r14_t *sib1_MBMS;
   LTE_SystemInformationBlockType13_r9_t *sib13_MBMS;
+  uint8_t				FeMBMS_flag;
 #endif
 #if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
   LTE_SystemInformationBlockType13_r9_t *sib13;
@@ -801,6 +802,7 @@ typedef struct UE_RRC_INST_s {
 #endif
 #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
   LTE_SystemInformationBlockType13_r9_t *sib13_MBMS[NB_CNX_UE];
+  uint8_t 			  	FeMBMS_flag;
 #endif
 #ifdef CBA
   uint8_t                         num_active_cba_groups;
diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c
index 55f893be92..b0896a344b 100644
--- a/openair2/RRC/LTE/rrc_eNB.c
+++ b/openair2/RRC/LTE/rrc_eNB.c
@@ -61,6 +61,12 @@
 #include "LTE_SL-CommConfig-r12.h"
 #include "LTE_PeriodicBSR-Timer-r12.h"
 #include "LTE_RetxBSR-Timer-r12.h"
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+   #include "LTE_BCCH-BCH-Message-MBMS.h"
+   #include "LTE_BCCH-DL-SCH-Message-MBMS.h"
+   #include "LTE_SystemInformationBlockType1-MBMS-r14.h"
+   #include "LTE_NonMBSFN-SubframeConfig-r14.h"
+#endif
 #include "common/utils/LOG/vcd_signal_dumper.h"
 
 #include "T.h"
@@ -564,6 +570,15 @@ if(configuration->radioresourceconfig[CC_id].mbms_dedicated_serving_cell == TRUE
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
                          ,
                          sib1_v13ext
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        RC.rrc[ctxt_pP->module_id]->carrier[CC_id].FeMBMS_flag,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
                         );
 }
@@ -649,6 +664,15 @@ init_MCCH(
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
                          ,
                          (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        0,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
                         );
   //LOG_I(RRC,"DUY: lcid after rrc_mac_config_req is %02d\n",RC.rrc[enb_mod_idP]->mcch_message->pmch_InfoList_r9.list.array[0]->mbms_SessionInfoList_r9.list.array[0]->logicalChannelIdentity_r9);
@@ -1389,6 +1413,15 @@ rrc_eNB_generate_RRCConnectionReestablishment(
 #endif
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
                                ,(LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        0,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
                               );
         break;
@@ -4518,6 +4551,15 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
     ,
     (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        0,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
   );
   // Configure target eNB SRB2
@@ -5015,6 +5057,15 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
     ,
     (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        0,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
   );
   /*
@@ -5282,6 +5333,15 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
             ,
             (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        0,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
           );
         } else {        // remove LCHAN from MAC/PHY
@@ -5335,6 +5395,15 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
                                  ,
                                  (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        0,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
                                 );
         }
@@ -5464,6 +5533,15 @@ void rrc_eNB_generate_RRCConnectionSetup(const protocol_ctxt_t *const ctxt_pP,
 #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
 				 ,
 				 (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL
+#endif
+#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
+                        ,
+                        0,
+                        (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+                        (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+                        (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+                        (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+                        (LTE_MBSFN_AreaInfoList_r9_t *) NULL
 #endif
 				 );
 	  break;
-- 
GitLab