Commit 34a94281 authored by Stone WU's avatar Stone WU Committed by jperaldi

Add optimized code and some memory leak protection for multiple RRC configuration request

parent bdb4f0a8
...@@ -205,8 +205,9 @@ extern uint16_t slot_ahead; ...@@ -205,8 +205,9 @@ extern uint16_t slot_ahead;
void oai_create_enb(void) { void oai_create_enb(void) {
int bodge_counter=0; int bodge_counter=0;
/* MultiCell: Function modify for Multiple CC */ /* MultiCell: Function modify for Multiple CC */
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (int CC_id=0; CC_id<RC.nb_CC[0]; CC_id++) {
PHY_VARS_eNB *eNB = RC.eNB[0][CC_id]; PHY_VARS_eNB *eNB = RC.eNB[0][CC_id];
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag, NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] RC.eNB[0][0]. Mod_id:%d CC_id:%d nb_CC[0]:%d abstraction_flag:%d single_thread_flag:%d if_inst:%p\n", eNB->Mod_id, eNB->CC_id, RC.nb_CC[0], eNB->abstraction_flag,
eNB->single_thread_flag, eNB->if_inst); eNB->single_thread_flag, eNB->if_inst);
...@@ -214,7 +215,6 @@ void oai_create_enb(void) { ...@@ -214,7 +215,6 @@ void oai_create_enb(void) {
eNB->CC_id = CC_id; eNB->CC_id = CC_id;
eNB->abstraction_flag = 0; eNB->abstraction_flag = 0;
eNB->single_thread_flag = 0;//single_thread_flag; eNB->single_thread_flag = 0;//single_thread_flag;
RC.nb_CC[CC_id] = MAX_NUM_CCs;
if (eNB->if_inst==0) { if (eNB->if_inst==0) {
eNB->if_inst = IF_Module_init(bodge_counter); eNB->if_inst = IF_Module_init(bodge_counter);
...@@ -232,7 +232,7 @@ void oai_create_enb(void) { ...@@ -232,7 +232,7 @@ void oai_create_enb(void) {
usleep(50000); usleep(50000);
} while(eNB->configured != 1); } while(eNB->configured != 1);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() eNB is now configured\n", __FUNCTION__); NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() eNB Cell %d is now configured\n", __FUNCTION__,CC_id);
} }
} }
......
...@@ -821,7 +821,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -821,7 +821,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
ul_CarrierFreq, ul_CarrierFreq,
pbch_repetition pbch_repetition
); );
mac_init_cell_params(Mod_idP,CC_idP); //mac_init_cell_params(Mod_idP,CC_idP); //This would reset UE info but if UE is RRC_Connected, rnti shall not reset
if (schedulingInfoList!=NULL) { if (schedulingInfoList!=NULL) {
RC.mac[Mod_idP]->common_channels[CC_idP].tdd_Config = tdd_Config; RC.mac[Mod_idP]->common_channels[CC_idP].tdd_Config = tdd_Config;
...@@ -976,7 +976,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -976,7 +976,7 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
Mod_idP, nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0],nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[1], Mod_idP, nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0],nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[1],
nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0]<<1 | nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[1]>>7 ); nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0]<<1 | nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[1]>>7 );
//RC.mac[Mod_idP]->common_channels[0].non_mbsfn_SubframeConfig = (int)(nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0]<<1) | (int)(nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[1]>>7); //RC.mac[Mod_idP]->common_channels[0].non_mbsfn_SubframeConfig = (int)(nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[0]<<1) | (int)(nonMBSFN_SubframeConfig->subframeAllocation_r14.buf[1]>>7);
RC.mac[Mod_idP]->common_channels[0].non_mbsfn_SubframeConfig = nonMBSFN_SubframeConfig; RC.mac[Mod_idP]->common_channels[CC_idP].non_mbsfn_SubframeConfig = nonMBSFN_SubframeConfig;
nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP]; nfapi_config_request_t *cfg = &RC.mac[Mod_idP]->config[CC_idP];
cfg->fembms_config.non_mbsfn_config_flag.value = 1; cfg->fembms_config.non_mbsfn_config_flag.value = 1;
cfg->fembms_config.non_mbsfn_config_flag.tl.tag = NFAPI_FEMBMS_CONFIG_NON_MBSFN_FLAG_TAG; cfg->fembms_config.non_mbsfn_config_flag.tl.tag = NFAPI_FEMBMS_CONFIG_NON_MBSFN_FLAG_TAG;
...@@ -992,35 +992,35 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -992,35 +992,35 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
cfg->num_tlv++; cfg->num_tlv++;
//We need to reuse current MCH scheduler //We need to reuse current MCH scheduler
//TOCHECK whether we can simply reuse current mbsfn_SubframeConfig stuff //TOCHECK whether we can simply reuse current mbsfn_SubframeConfig stuff
RC.mac[Mod_idP]->common_channels[0].FeMBMS_flag = FeMBMS_Flag; RC.mac[Mod_idP]->common_channels[CC_idP].FeMBMS_flag = FeMBMS_Flag;
} }
if (mbsfn_AreaInfoList != NULL) { if (mbsfn_AreaInfoList != NULL) {
// One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time // One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count); LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
RC.mac[Mod_idP]->common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count; RC.mac[Mod_idP]->common_channels[CC_idP].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
for (i =0; i< mbsfn_AreaInfoList->list.count; i++) { for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i]; RC.mac[Mod_idP]->common_channels[CC_idP].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i, LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i,
RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9); RC.mac[Mod_idP]->common_channels[CC_idP].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
// config_sib13(Mod_idP,0,i,RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); // config_sib13(Mod_idP,0,i,RC.mac[Mod_idP]->common_channels[CC_idP].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
config_sib13(Mod_idP,0,i,RC.mac[Mod_idP]->common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9); config_sib13(Mod_idP,0,i,RC.mac[Mod_idP]->common_channels[CC_idP].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
} }
} }
if(mbms_AreaConfig != NULL) { if(mbms_AreaConfig != NULL) {
RC.mac[Mod_idP]->common_channels[0].commonSF_AllocPeriod_r9 = mbms_AreaConfig->commonSF_AllocPeriod_r9; RC.mac[Mod_idP]->common_channels[CC_idP].commonSF_AllocPeriod_r9 = mbms_AreaConfig->commonSF_AllocPeriod_r9;
LOG_I(MAC, "[eNB %d][CONFIG] LTE_MBSFNAreaConfiguration_r9_t(%p) commonSF_AllocPeriod_r9(%d)\n",Mod_idP,mbms_AreaConfig, RC.mac[Mod_idP]->common_channels[0].commonSF_AllocPeriod_r9); LOG_I(MAC, "[eNB %d][CONFIG] LTE_MBSFNAreaConfiguration_r9_t(%p) commonSF_AllocPeriod_r9(%d)\n",Mod_idP,mbms_AreaConfig, RC.mac[Mod_idP]->common_channels[0].commonSF_AllocPeriod_r9);
for(i=0; i < mbms_AreaConfig->commonSF_Alloc_r9.list.count; i++){ for(i=0; i < mbms_AreaConfig->commonSF_Alloc_r9.list.count; i++){
RC.mac[Mod_idP]->common_channels[0].commonSF_Alloc_r9_mbsfn_SubframeConfig[i] = mbms_AreaConfig->commonSF_Alloc_r9.list.array[i]; RC.mac[Mod_idP]->common_channels[0].commonSF_Alloc_r9_mbsfn_SubframeConfig[i] = mbms_AreaConfig->commonSF_Alloc_r9.list.array[i];
LOG_I(RRC,"[eNB %d][CONFIG] MBSFNArea[%d] commonSF_Alloc_r9: radioframeAllocationPeriod(%ldn),radioframeAllocationOffset(%ld), subframeAllocation(%x,%x,%x)\n" LOG_I(RRC,"[eNB %d][CONFIG] MBSFNArea[%d] commonSF_Alloc_r9: radioframeAllocationPeriod(%ldn),radioframeAllocationOffset(%ld), subframeAllocation(%x,%x,%x)\n"
,Mod_idP,i ,Mod_idP,i
,RC.mac[Mod_idP]->common_channels[0].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->radioframeAllocationPeriod ,RC.mac[Mod_idP]->common_channels[CC_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->radioframeAllocationPeriod
,RC.mac[Mod_idP]->common_channels[0].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->radioframeAllocationOffset ,RC.mac[Mod_idP]->common_channels[CC_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->radioframeAllocationOffset
,RC.mac[Mod_idP]->common_channels[0].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0] ,RC.mac[Mod_idP]->common_channels[CC_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]
,RC.mac[Mod_idP]->common_channels[0].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[1] ,RC.mac[Mod_idP]->common_channels[CC_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[1]
,RC.mac[Mod_idP]->common_channels[0].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[2]); ,RC.mac[Mod_idP]->common_channels[CC_idP].commonSF_Alloc_r9_mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[2]);
} }
} }
...@@ -1030,29 +1030,29 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP, ...@@ -1030,29 +1030,29 @@ int rrc_mac_config_req_eNB(module_id_t Mod_idP,
pmch_InfoList->list.count); pmch_InfoList->list.count);
for (i = 0; i < pmch_InfoList->list.count; i++) { for (i = 0; i < pmch_InfoList->list.count; i++) {
RC.mac[Mod_idP]->common_channels[0].pmch_Config[i] = RC.mac[Mod_idP]->common_channels[CC_idP].pmch_Config[i] =
&pmch_InfoList->list.array[i]->pmch_Config_r9; &pmch_InfoList->list.array[i]->pmch_Config_r9;
LOG_I(MAC, LOG_I(MAC,
"[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe %ldth\n", "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe %ldth\n",
i, i,
RC.mac[Mod_idP]->common_channels[0]. RC.mac[Mod_idP]->common_channels[CC_idP].
pmch_Config[i]->sf_AllocEnd_r9); pmch_Config[i]->sf_AllocEnd_r9);
LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n",
i, i,
RC.mac[Mod_idP]->common_channels[0]. RC.mac[Mod_idP]->common_channels[CC_idP].
pmch_Config[i]->mch_SchedulingPeriod_r9); pmch_Config[i]->mch_SchedulingPeriod_r9);
LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i, LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i,
RC.mac[Mod_idP]->common_channels[0]. RC.mac[Mod_idP]->common_channels[CC_idP].
pmch_Config[i]->dataMCS_r9); pmch_Config[i]->dataMCS_r9);
// MBMS session info list in each MCH // MBMS session info list in each MCH
RC.mac[Mod_idP]->common_channels[0].mbms_SessionList[i] = RC.mac[Mod_idP]->common_channels[CC_idP].mbms_SessionList[i] =
&pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9; &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n", i, LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n", i,
RC.mac[Mod_idP]->common_channels[0]. RC.mac[Mod_idP]->common_channels[CC_idP].
mbms_SessionList[i]->list.count); mbms_SessionList[i]->list.count);
for(int ii=0; ii < RC.mac[Mod_idP]->common_channels[0].mbms_SessionList[i]->list.count;ii++){ for(int ii=0; ii < RC.mac[Mod_idP]->common_channels[CC_idP].mbms_SessionList[i]->list.count;ii++){
LOG_I(MAC, "PMCH[%d] MBMS Session[%d] is: %lu\n", i,ii, LOG_I(MAC, "PMCH[%d] MBMS Session[%d] is: %lu\n", i,ii,
RC.mac[Mod_idP]->common_channels[0].mbms_SessionList[i]->list.array[ii]->logicalChannelIdentity_r9); RC.mac[Mod_idP]->common_channels[CC_idP].mbms_SessionList[i]->list.array[ii]->logicalChannelIdentity_r9);
} }
} }
} }
......
...@@ -722,7 +722,7 @@ void UL_indication(UL_IND_t *UL_info, void *proc) { ...@@ -722,7 +722,7 @@ void UL_indication(UL_IND_t *UL_info, void *proc) {
if (NFAPI_MODE != NFAPI_MODE_PNF) { if (NFAPI_MODE != NFAPI_MODE_PNF) {
/* MultiCell: Condition modified for Multiple CC */ /* MultiCell: Condition modified for Multiple CC */
if ((ifi->CC_mask==0)||(ifi->CC_mask==1)||(ifi->CC_mask==2)||(ifi->CC_mask==3)) { if (ifi->CC_mask < ((1<<MAX_NUM_CCs)-1)) {
ifi->current_frame = UL_info->frame; ifi->current_frame = UL_info->frame;
ifi->current_subframe = UL_info->subframe; ifi->current_subframe = UL_info->subframe;
} else { } else {
......
This diff is collapsed.
...@@ -163,13 +163,13 @@ init_SI( ...@@ -163,13 +163,13 @@ init_SI(
if(configuration->radioresourceconfig[CC_id].mbms_dedicated_serving_cell == TRUE) { if(configuration->radioresourceconfig[CC_id].mbms_dedicated_serving_cell == TRUE) {
LOG_A(RRC, "Configuring MIB FeMBMS (N_RB_DL %d)\n", LOG_A(RRC, "Configuring MIB FeMBMS (N_RB_DL %d)\n",
(int)configuration->N_RB_DL[CC_id]); (int)configuration->N_RB_DL[CC_id]);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].MIB_FeMBMS = (uint8_t *) malloc16(4); if(NULL==RC.rrc[ctxt_pP->module_id]->carrier[CC_id].MIB_FeMBMS){ RC.rrc[ctxt_pP->module_id]->carrier[CC_id].MIB_FeMBMS = (uint8_t *) malloc16(4); }
do_MIB_FeMBMS(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id], do_MIB_FeMBMS(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id],
configuration->N_RB_DL[CC_id], configuration->N_RB_DL[CC_id],
0, //additionalNonMBSFN 0, //additionalNonMBSFN
0); 0);
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_MBMS = 0; RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_MBMS = 0;
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_MBMS = (uint8_t *) malloc16(32); if(NULL==RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_MBMS) {RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_MBMS = (uint8_t *) malloc16(32);}
AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_MBMS!=NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1_MBMS allocated\n", AssertFatal(RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_MBMS!=NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1_MBMS allocated\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_MBMS = do_SIB1_MBMS(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id],ctxt_pP->module_id,CC_id, RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_MBMS = do_SIB1_MBMS(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id],ctxt_pP->module_id,CC_id,
...@@ -243,10 +243,12 @@ init_SI( ...@@ -243,10 +243,12 @@ init_SI(
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id]; eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
rrc_eNB_carrier_data_t *carrier=&rrc->carrier[CC_id]; rrc_eNB_carrier_data_t *carrier=&rrc->carrier[CC_id];
carrier->MIB = (uint8_t *) malloc16(4);
if(NULL==carrier->MIB) {carrier->MIB = (uint8_t *) malloc16(4);}
carrier->sizeof_SIB1 = 0; carrier->sizeof_SIB1 = 0;
carrier->sizeof_SIB23 = 0; carrier->sizeof_SIB23 = 0;
carrier->SIB1 = (uint8_t *) malloc16(32); if(NULL==carrier->SIB1) {carrier->SIB1 = (uint8_t *) malloc16(32);}
AssertFatal(carrier->SIB1!=NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1 allocated\n", AssertFatal(carrier->SIB1!=NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1 allocated\n",
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); PROTOCOL_RRC_CTXT_ARGS(ctxt_pP));
LOG_I(RRC,"[eNB %d] Node type %d \n ", ctxt_pP->module_id, rrc->node_type); LOG_I(RRC,"[eNB %d] Node type %d \n ", ctxt_pP->module_id, rrc->node_type);
...@@ -283,7 +285,7 @@ init_SI( ...@@ -283,7 +285,7 @@ init_SI(
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_BR = 0; RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_BR = 0;
if (configuration->schedulingInfoSIB1_BR_r13[CC_id] > 0) { if (configuration->schedulingInfoSIB1_BR_r13[CC_id] > 0) {
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_BR = (uint8_t *) malloc16(32); if(!RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_BR) { RC.rrc[ctxt_pP->module_id]->carrier[CC_id].SIB1_BR = (uint8_t *) malloc16(32);}
RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_BR = do_SIB1(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id], RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sizeof_SIB1_BR = do_SIB1(&RC.rrc[ctxt_pP->module_id]->carrier[CC_id],
ctxt_pP->module_id, ctxt_pP->module_id,
CC_id, TRUE, configuration); CC_id, TRUE, configuration);
...@@ -291,7 +293,7 @@ init_SI( ...@@ -291,7 +293,7 @@ init_SI(
} }
if (!NODE_IS_DU(rrc->node_type)) { if (!NODE_IS_DU(rrc->node_type)) {
carrier->SIB23 = (uint8_t *) malloc16(64); if(NULL== carrier->SIB23){ carrier->SIB23 = (uint8_t *) malloc16(64);}
AssertFatal(carrier->SIB23!=NULL,"cannot allocate memory for SIB"); AssertFatal(carrier->SIB23!=NULL,"cannot allocate memory for SIB");
carrier->sizeof_SIB23 = do_SIB23(ctxt_pP->module_id, carrier->sizeof_SIB23 = do_SIB23(ctxt_pP->module_id,
CC_id, CC_id,
...@@ -303,7 +305,7 @@ init_SI( ...@@ -303,7 +305,7 @@ init_SI(
carrier->sizeof_SIB23_BR = 0; carrier->sizeof_SIB23_BR = 0;
if (configuration->schedulingInfoSIB1_BR_r13[CC_id]>0) { if (configuration->schedulingInfoSIB1_BR_r13[CC_id]>0) {
carrier->SIB23_BR = (uint8_t *) malloc16(64); if(!carrier->SIB23_BR){ carrier->SIB23_BR = (uint8_t *) malloc16(64);}
AssertFatal(carrier->SIB23_BR!=NULL,"cannot allocate memory for SIB"); AssertFatal(carrier->SIB23_BR!=NULL,"cannot allocate memory for SIB");
carrier->sizeof_SIB23_BR = do_SIB23(ctxt_pP->module_id, CC_id, TRUE, configuration); carrier->sizeof_SIB23_BR = do_SIB23(ctxt_pP->module_id, CC_id, TRUE, configuration);
} }
...@@ -7264,6 +7266,7 @@ char openair_rrc_eNB_configuration( ...@@ -7264,6 +7266,7 @@ char openair_rrc_eNB_configuration(
{ {
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
int CC_id; int CC_id;
int need_init = 0;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, NOT_A_RNTI, 0, 0,enb_mod_idP); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, NOT_A_RNTI, 0, 0,enb_mod_idP);
LOG_I(RRC, LOG_I(RRC,
PROTOCOL_RRC_CTXT_FMT" Init...\n", PROTOCOL_RRC_CTXT_FMT" Init...\n",
...@@ -7271,6 +7274,8 @@ char openair_rrc_eNB_configuration( ...@@ -7271,6 +7274,8 @@ char openair_rrc_eNB_configuration(
AssertFatal(RC.rrc[enb_mod_idP] != NULL, "RC.rrc not initialized!"); AssertFatal(RC.rrc[enb_mod_idP] != NULL, "RC.rrc not initialized!");
AssertFatal(MAX_MOBILES_PER_ENB < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow"); AssertFatal(MAX_MOBILES_PER_ENB < (module_id_t)0xFFFFFFFFFFFFFFFF, " variable overflow");
AssertFatal(configuration!=NULL,"configuration input is null\n"); AssertFatal(configuration!=NULL,"configuration input is null\n");
if(!RC.rrc[ctxt.module_id]->cell_info_configured){
need_init = 1;
RC.rrc[ctxt.module_id]->Nb_ue = 0; RC.rrc[ctxt.module_id]->Nb_ue = 0;
pthread_mutex_init(&RC.rrc[ctxt.module_id]->cell_info_mutex,NULL); pthread_mutex_init(&RC.rrc[ctxt.module_id]->cell_info_mutex,NULL);
RC.rrc[ctxt.module_id]->cell_info_configured = 0; RC.rrc[ctxt.module_id]->cell_info_configured = 0;
...@@ -7291,16 +7296,22 @@ char openair_rrc_eNB_configuration( ...@@ -7291,16 +7296,22 @@ char openair_rrc_eNB_configuration(
LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" Rel14 RRC detected, MBMS flag %d\n", LOG_I(RRC, PROTOCOL_RRC_CTXT_FMT" Rel14 RRC detected, MBMS flag %d\n",
PROTOCOL_RRC_CTXT_ARGS(&ctxt), PROTOCOL_RRC_CTXT_ARGS(&ctxt),
RC.rrc[ctxt.module_id]->carrier[0].MBMS_flag); RC.rrc[ctxt.module_id]->carrier[0].MBMS_flag);
}
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
init_SI(&ctxt, CC_id, configuration); if(need_init) {
for (int ue_id = 0; ue_id < MAX_MOBILES_PER_ENB; ue_id++) { for (int ue_id = 0; ue_id < MAX_MOBILES_PER_ENB; ue_id++) {
RC.rrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0; RC.rrc[ctxt.module_id]->carrier[CC_id].sizeof_paging[ue_id] = 0;
RC.rrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t *) malloc16(256); RC.rrc[ctxt.module_id]->carrier[CC_id].paging[ue_id] = (uint8_t *) malloc16(256);
} }
} }
}
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
init_SI(&ctxt, CC_id, configuration);
}
if(need_init) {
rrc_init_global_param(); rrc_init_global_param();
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
...@@ -7330,12 +7341,13 @@ char openair_rrc_eNB_configuration( ...@@ -7330,12 +7341,13 @@ char openair_rrc_eNB_configuration(
init_MBMS(ctxt.module_id, CC_id, 0); init_MBMS(ctxt.module_id, CC_id, 0);
} }
openair_rrc_top_init_eNB(RC.rrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0); openair_rrc_top_init_eNB(CC_id,RC.rrc[ctxt.module_id]->carrier[CC_id].MBMS_flag,0);
}
} }
RC.rrc[ctxt.module_id]->nr_scg_ssb_freq = configuration->nr_scg_ssb_freq; RC.rrc[ctxt.module_id]->nr_scg_ssb_freq = configuration->nr_scg_ssb_freq;
openair_rrc_on(&ctxt); if(need_init) {openair_rrc_on(&ctxt);}
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++){ for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++){
if(configuration->ActiveParamPresent[CC_id] == true) if(configuration->ActiveParamPresent[CC_id] == true)
...@@ -7350,7 +7362,7 @@ char openair_rrc_eNB_configuration( ...@@ -7350,7 +7362,7 @@ char openair_rrc_eNB_configuration(
} }
} }
if (NODE_IS_CU(RC.rrc[ctxt.module_id]->node_type)) if (need_init && NODE_IS_CU(RC.rrc[ctxt.module_id]->node_type))
// msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, F1AP_SCTP_REQ); // msg_p = itti_alloc_new_message (TASK_ENB_APP, 0, F1AP_SCTP_REQ);
// RCconfig_CU_F1(msg_p, enb_id); // RCconfig_CU_F1(msg_p, enb_id);
setup_ngran_CU(RC.rrc[ctxt.module_id]); setup_ngran_CU(RC.rrc[ctxt.module_id]);
...@@ -10653,13 +10665,11 @@ rrc_enb_task( ...@@ -10653,13 +10665,11 @@ rrc_enb_task(
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void void
openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active) openair_rrc_top_init_eNB(int CC_id,int eMBMS_active,uint8_t HO_active)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
module_id_t module_id; module_id_t module_id;
int CC_id;
/* for no gcc warnings */
(void)CC_id;
LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_eNB_INST=%d\n", RC.nb_inst); LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_eNB_INST=%d\n", RC.nb_inst);
if (RC.nb_inst > 0) { if (RC.nb_inst > 0) {
...@@ -10672,11 +10682,9 @@ openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active) ...@@ -10672,11 +10682,9 @@ openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active)
LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active); LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
for (module_id=0; module_id<NB_eNB_INST; module_id++) { for (module_id=0; module_id<NB_eNB_INST; module_id++) {
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
RC.rrc[module_id]->carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active; RC.rrc[module_id]->carrier[CC_id].MBMS_flag = (uint8_t)eMBMS_active;
} }
} }
}
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -671,7 +671,7 @@ long binary_search_int(int elements[], long numElem, int value); ...@@ -671,7 +671,7 @@ long binary_search_int(int elements[], long numElem, int value);
long binary_search_float(float elements[], long numElem, float value); long binary_search_float(float elements[], long numElem, float value);
void openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active); void openair_rrc_top_init_eNB(int CC_id,int eMBMS_active,uint8_t HO_active);
void openair_rrc_top_init_ue( void openair_rrc_top_init_ue(
int eMBMS_active, int eMBMS_active,
......
...@@ -486,6 +486,9 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure) ...@@ -486,6 +486,9 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure)
RRC_CONFIGURATION_REQ(msg_p).intraFreqReselection[cell_index]=SIB1_CELL_ACCESS_REL_INFO.intraFreqReselection; RRC_CONFIGURATION_REQ(msg_p).intraFreqReselection[cell_index]=SIB1_CELL_ACCESS_REL_INFO.intraFreqReselection;
} }
} }
//store the modified cell config back
memcpy(&(RC.rrc[enb_id]->configuration), &RRC_CONFIGURATION_REQ(msg_p), sizeof(RRC_CONFIGURATION_REQ(msg_p)));
/* Active Parameters: only process ActiveParam when basic info availabe to avoid sending too many RRC_CONFIGURATION_REQ to RRC */ /* Active Parameters: only process ActiveParam when basic info availabe to avoid sending too many RRC_CONFIGURATION_REQ to RRC */
if (AddOrReconfigure->Active.d == true) if (AddOrReconfigure->Active.d == true)
{ {
...@@ -522,10 +525,7 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure) ...@@ -522,10 +525,7 @@ int sys_add_reconfig_cell(struct CellConfigInfo_Type *AddOrReconfigure)
{ {
RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index] = false; RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index] = false;
} }
LOG_A(ENB_APP, "SS: ActiveParamPresent: %d, RlcPduCCCH_Present: %d, RLC Container PDU size: %d \n",RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index],RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Present[cell_index],RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Size[cell_index]); LOG_A(ENB_APP, "SS: ActiveParamPresent: %d, RlcPduCCCH_Present: %d, RLC Container PDU size: %d \n",RRC_CONFIGURATION_REQ(msg_p).ActiveParamPresent[cell_index],RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Present[cell_index],RRC_CONFIGURATION_REQ(msg_p).RlcPduCCCH_Size[cell_index]);
//store the modified cell config back
memcpy(&(RC.rrc[enb_id]->configuration), &RRC_CONFIGURATION_REQ(msg_p), sizeof(RRC_CONFIGURATION_REQ(msg_p)));
LOG_A(ENB_SS, "Sending Cell configuration to RRC from SYSTEM_CTRL_REQ \n"); LOG_A(ENB_SS, "Sending Cell configuration to RRC from SYSTEM_CTRL_REQ \n");
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p); itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
......
...@@ -488,9 +488,8 @@ static void *L1_thread( void *param ) { ...@@ -488,9 +488,8 @@ static void *L1_thread( void *param ) {
if (oai_exit) break; if (oai_exit) break;
/* MultiCell: Condition modified for MultiCell case */ /* MultiCell: Condition modified for MultiCell case */
if ((eNB->CC_id==0) || (eNB->CC_id==1)) { /* This thread can only be wakeup for one cell SUBFRAME Ind under VNF as proxy would only send one SUBFRAME Ind for all cells. */
if (rxtx(eNB,proc,thread_name) < 0) break; if (rxtx(eNB,proc,thread_name) < 0) break;
}
LOG_D(PHY,"L1 RX %d.%d done\n",proc->frame_rx,proc->subframe_rx); LOG_D(PHY,"L1 RX %d.%d done\n",proc->frame_rx,proc->subframe_rx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment