From cc9db0f51edaccdef77db95c8dcfb339a8be9f10 Mon Sep 17 00:00:00 2001
From: Navid Nikaein <navid.nikaein@eurecom.fr>
Date: Fri, 4 Apr 2014 14:01:57 +0000
Subject: [PATCH] fix compilation issues for Rel10=1 and CBA=1

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5229 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair2/LAYER2/MAC/eNB_scheduler.c           |   2 +-
 openair2/LAYER2/MAC/ue_procedures.c           |   2 +-
 openair2/RRC/LITE/MESSAGES/asn1_msg.c         |   5 +-
 .../EUTRA-RRC-Definitions-a20-lola.asn        | 172 ++++++++++++++++--
 openair2/RRC/LITE/rrc_common.c                |   2 +-
 openair2/RRC/LITE/rrc_eNB.c                   |   4 +-
 6 files changed, 164 insertions(+), 23 deletions(-)

diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 0a2218fecd..c21c204ad6 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -2050,7 +2050,7 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera
 
 }
 #ifdef CBA
-void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, unsigned char subframeP, unsigned char sched_subframe, uint8_t granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, uint16_t *first_rb){
+void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, uint8_t granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, uint16_t *first_rb){
 
   DCI0_5MHz_TDD_1_6_t *ULSCH_dci_tdd16;
   DCI0_5MHz_FDD_t *ULSCH_dci_fdd;
diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c
index 13987dcb51..ab139fb4a2 100644
--- a/openair2/LAYER2/MAC/ue_procedures.c
+++ b/openair2/LAYER2/MAC/ue_procedures.c
@@ -1509,7 +1509,7 @@ double uniform_rngen(int min, int max) {
   return (max - min) * random + min;
 }
 
-int use_cba_access(module_id_t module_idP,frame_t frameP,uint8_t subframe, uint8_t eNB_index){
+int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index){
 
   if (( ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]<64))   ||
       ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]<64))   ||
diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
index 45e906c6e4..9a39caea84 100644
--- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
@@ -502,7 +502,8 @@ uint8_t do_SIB1(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer
 
   (*sib1)->cellSelectionInfo.q_RxLevMin=-65;
   (*sib1)->cellSelectionInfo.q_RxLevMinOffset=NULL;
-
+  //(*sib1)->p_Max = CALLOC(1, sizeof(P_Max_t));
+  //*((*sib1)->p_Max) = 23; 
   (*sib1)->freqBandIndicator =
 #if defined(ENABLE_ITTI)
           configuration->eutra_band;
@@ -738,7 +739,7 @@ uint8_t do_SIB2_AT4(uint8_t Mod_id,
   *((*sib2)->freqInfo.ul_CarrierFreq) = 38050;
   *((*sib2)->freqInfo.ul_Bandwidth) = SystemInformationBlockType2__freqInfo__ul_Bandwidth_n50;
   (*sib2)->mbsfn_SubframeConfigList = NULL;
-  (*sib2)->timeAlignmentTimerCommon=TimeAlignmentTimer_sf10240;
+  (*sib2)->timeAlignmentTimerCommon= TimeAlignmentTimer_infinity;//TimeAlignmentTimer_sf10240;
 
 
 #ifdef XER_PRINT
diff --git a/openair2/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn b/openair2/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn
index ca16960ed5..865f4b5ff4 100755
--- a/openair2/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn
+++ b/openair2/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn
@@ -1141,24 +1141,24 @@ SystemInformation ::=				SEQUENCE {
 	}
 }
 SystemInformation-r8-IEs ::=		SEQUENCE {
-	sib-TypeAndInfo						SEQUENCE (SIZE (1..maxSIB)) OF CHOICE {
-		sib2								SystemInformationBlockType2,
-		sib3								SystemInformationBlockType3,
-		sib4								SystemInformationBlockType4,
-		sib5								SystemInformationBlockType5,
-		sib6								SystemInformationBlockType6,
-		sib7								SystemInformationBlockType7,
-		sib8								SystemInformationBlockType8,
-		sib9								SystemInformationBlockType9,
-		sib10								SystemInformationBlockType10,
-		sib11								SystemInformationBlockType11,
-		...,
-		sib12-v920							SystemInformationBlockType12-r9,
-		sib13-v920							SystemInformationBlockType13-r9
-	},
+	sib-TypeAndInfo						SEQUENCE (SIZE (1..maxSIB)) OF SystemInformation-r8-IEs-sib-TypeAndInfo-Member,
 	nonCriticalExtension				SystemInformation-v8a0-IEs							OPTIONAL
 }
-
+SystemInformation-r8-IEs-sib-TypeAndInfo-Member ::=	CHOICE {
+	sib2								SystemInformationBlockType2,
+	sib3								SystemInformationBlockType3,
+	sib4								SystemInformationBlockType4,
+	sib5								SystemInformationBlockType5,
+	sib6								SystemInformationBlockType6,
+	sib7								SystemInformationBlockType7,
+	sib8								SystemInformationBlockType8,
+	sib9								SystemInformationBlockType9,
+	sib10								SystemInformationBlockType10,
+	sib11								SystemInformationBlockType11,
+	...,
+	sib12-v920							SystemInformationBlockType12-r9,
+	sib13-v920							SystemInformationBlockType13-r9
+}
 SystemInformation-v8a0-IEs ::= SEQUENCE {
 	lateNonCriticalExtension			OCTET STRING						OPTIONAL,	-- Need OP
 	nonCriticalExtension				SEQUENCE {}							OPTIONAL	-- Need OP
@@ -4099,6 +4099,146 @@ TMGI-r9 ::=						SEQUENCE {
 }
 
 
+HandoverCommand ::=					SEQUENCE {
+	criticalExtensions					CHOICE {
+		c1									CHOICE{
+			handoverCommand-r8					HandoverCommand-r8-IEs,
+			spare7 NULL,
+			spare6 NULL, spare5 NULL, spare4 NULL,
+			spare3 NULL, spare2 NULL, spare1 NULL
+		},
+		criticalExtensionsFuture			SEQUENCE {}
+	}
+}
+
+HandoverCommand-r8-IEs ::=			SEQUENCE {
+	handoverCommandMessage				OCTET STRING (CONTAINING DL-DCCH-Message),
+	nonCriticalExtension				SEQUENCE {}							OPTIONAL
+}
+
+
+HandoverPreparationInformation ::=	SEQUENCE {
+	criticalExtensions					CHOICE {
+		c1									CHOICE{
+			handoverPreparationInformation-r8	HandoverPreparationInformation-r8-IEs,
+			spare7 NULL,
+			spare6 NULL, spare5 NULL, spare4 NULL,
+			spare3 NULL, spare2 NULL, spare1 NULL
+		},
+		criticalExtensionsFuture			SEQUENCE {}
+	}
+}
+
+HandoverPreparationInformation-r8-IEs ::= SEQUENCE {
+	ue-RadioAccessCapabilityInfo		UE-CapabilityRAT-ContainerList,
+	as-Config							AS-Config					OPTIONAL, 		-- Cond HO
+	rrm-Config							RRM-Config					OPTIONAL,
+	as-Context							AS-Context				OPTIONAL, 		-- Cond HO
+	nonCriticalExtension				HandoverPreparationInformation-v920-IEs		OPTIONAL
+}
+
+HandoverPreparationInformation-v920-IEs	::= SEQUENCE {
+	ue-ConfigRelease-r9					ENUMERATED {
+										rel9, rel10, spare6, spare5, spare4, spare3,
+										spare2, spare1, ...} 			OPTIONAL, 	-- Cond HO2
+	nonCriticalExtension				SEQUENCE {}						OPTIONAL
+}
+
+
+UERadioAccessCapabilityInformation ::= SEQUENCE {
+	criticalExtensions					CHOICE {
+		c1									CHOICE{
+			ueRadioAccessCapabilityInformation-r8
+												UERadioAccessCapabilityInformation-r8-IEs,
+			spare7 NULL,
+			spare6 NULL, spare5 NULL, spare4 NULL,
+			spare3 NULL, spare2 NULL, spare1 NULL
+		},
+		criticalExtensionsFuture			SEQUENCE {}
+	}
+}
+
+UERadioAccessCapabilityInformation-r8-IEs ::= SEQUENCE {
+	ue-RadioAccessCapabilityInfo		OCTET STRING (CONTAINING UECapabilityInformation),
+	nonCriticalExtension				SEQUENCE {}							OPTIONAL
+}
+
+
+AS-Config ::=				SEQUENCE {
+	sourceMeasConfig					MeasConfig,
+	sourceRadioResourceConfig			RadioResourceConfigDedicated,
+	sourceSecurityAlgorithmConfig		SecurityAlgorithmConfig,
+	sourceUE-Identity					C-RNTI,
+	sourceMasterInformationBlock		MasterInformationBlock,
+	sourceSystemInformationBlockType1	SystemInformationBlockType1(WITH COMPONENTS
+											{..., nonCriticalExtension ABSENT}),
+	sourceSystemInformationBlockType2	SystemInformationBlockType2,
+	antennaInfoCommon					AntennaInfoCommon,
+	sourceDl-CarrierFreq				ARFCN-ValueEUTRA,
+	sourceSystemInformationBlockType1Ext	OCTET STRING (CONTAINING
+												SystemInformationBlockType1-v890-IEs)	OPTIONAL,
+		sourceOtherConfig-r9				OtherConfig-r9
+	,
+	sourceSCellConfigList-r10			SCellToAddModList-r10			OPTIONAL
+	
+}
+
+
+AS-Context ::=							SEQUENCE {
+	reestablishmentInfo						ReestablishmentInfo			OPTIONAL	-- Cond HO
+}
+
+
+ReestablishmentInfo ::=				SEQUENCE {
+	sourcePhysCellId					PhysCellId,
+	targetCellShortMAC-I				ShortMAC-I,
+	additionalReestabInfoList			AdditionalReestabInfoList				OPTIONAL,
+	...
+}
+
+AdditionalReestabInfoList ::=		SEQUENCE ( SIZE (1..maxReestabInfo) ) OF AdditionalReestabInfo
+
+AdditionalReestabInfo ::=	SEQUENCE{
+	cellIdentity						CellIdentity,
+	key-eNodeB-Star					Key-eNodeB-Star,
+	shortMAC-I							ShortMAC-I
+}
+
+Key-eNodeB-Star ::=					BIT STRING (SIZE (256))
+
+
+RRM-Config ::=				SEQUENCE {
+	ue-InactiveTime				ENUMERATED {
+									s1, s2, s3, s5, s7, s10, s15, s20,
+									s25, s30, s40, s50, min1, min1s20c, min1s40,
+									min2, min2s30, min3, min3s30, min4, min5, min6,
+									min7, min8, min9, min10, min12, min14, min17, min20,
+									min24, min28, min33, min38, min44, min50, hr1,
+									hr1min30, hr2, hr2min30, hr3, hr3min30, hr4, hr5, hr6,
+									hr8, hr10, hr13, hr16, hr20, day1, day1hr12, day2,
+									day2hr12, day3, day4, day5, day7, day10, day14, day19,
+									day24, day30, dayMoreThan30}		OPTIONAL,
+	...,
+		candidateCellInfoList-r10	CandidateCellInfoList-r10		OPTIONAL
+	
+}
+
+CandidateCellInfoList-r10 ::=	SEQUENCE (SIZE (1..maxFreq)) OF CandidateCellInfo-r10
+
+CandidateCellInfo-r10 ::=		SEQUENCE {
+	-- cellIdentification
+	physCellId-r10					PhysCellId,
+	dl-CarrierFreq-r10				ARFCN-ValueEUTRA,
+	-- available measurement results
+	rsrpResult-r10					RSRP-Range			OPTIONAL,
+	rsrqResult-r10					RSRQ-Range			OPTIONAL,
+	...
+}
+
+
+maxReestabInfo				INTEGER ::= 32	-- Maximum number of KeNB* and shortMAC-I forwarded
+											-- at handover for re-establishment preparation
+
 maxBandComb-r10				INTEGER ::=	128	-- Maximum number of band combinations.
 maxBands					INTEGER ::= 64	-- Maximum number of bands listed in EUTRA UE caps
 maxBandwidthClass-r10		INTEGER ::=	16	-- Maximum number of supported CA BW classes per band
diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c
index 971302cc82..f097d53d9a 100644
--- a/openair2/RRC/LITE/rrc_common.c
+++ b/openair2/RRC/LITE/rrc_common.c
@@ -256,7 +256,7 @@ void openair_rrc_top_init(int eMBMS_active, uint8_t cba_group_active,uint8_t HO_
 #endif 
 #ifdef CBA
     for (module_id=0;module_id<NB_eNB_INST;module_id++) {
-      eNB_rrc_inst[i].num_active_cba_groups = cba_group_active;
+      eNB_rrc_inst[module_id].num_active_cba_groups = cba_group_active;
     }
 #endif
     LOG_D(RRC,
diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c
index b455255d79..14cf458834 100644
--- a/openair2/RRC/LITE/rrc_eNB.c
+++ b/openair2/RRC/LITE/rrc_eNB.c
@@ -2131,7 +2131,7 @@ void rrc_eNB_generate_RRCConnectionReconfiguration_handover(
                        , 0, (MBSFN_AreaInfoList_r9_t *) NULL, (PMCH_InfoList_r9_t *) NULL
 #endif
 #ifdef CBA
-                       , 0, 0,
+                       , 0, 0
 #endif
         );
 
@@ -2302,7 +2302,7 @@ void rrc_eNB_process_RRCConnectionReconfigurationComplete(
                         rb_conf_ipv4(0, //add
                             ue_mod_idP,  //cx
                             enb_mod_idP,    //inst
-                            (ue_mod_idP * maxDRB) + DRB_configList->list.array[i]->drb_Identity,
+                            (ue_mod_idP * maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB
                             0,    //dscp
                             ipv4_address(enb_mod_idP + 1, enb_mod_idP + 1),  //saddr
                             ipv4_address(enb_mod_idP + 1, dest_ip_offset + ue_mod_idP + 1));  //daddr
-- 
GitLab