diff --git a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c index 51361be030..5cf0024ffc 100644 --- a/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c +++ b/openair2/RRC/LTE/MESSAGES/asn1_msg_NB_IoT.c @@ -1132,40 +1132,11 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT( buffer, RRC_BUF_SIZE); - asn_enc_rval_t enc_rval; - DL_CCCH_Message_NB_t dl_ccch_msg_NB_IoT; - RRCConnectionReestablishment_NB_t* rrcConnectionReestablishment_NB_IoT; - memset(&dl_ccch_msg_NB_IoT, 0, sizeof(DL_CCCH_Message_NB_t)); - - dl_ccch_msg_NB_IoT.message.present = DL_CCCH_MessageType_NB_PR_c1; - dl_ccch_msg_NB_IoT.message.choice.c1.present = DL_CCCH_MessageType_NB__c1_PR_rrcConnectionReestablishment_r13; - rrcConnectionReestablishment_NB_IoT = &dl_ccch_msg_NB_IoT.message.choice.c1.choice.rrcConnectionReestablishment_r13; - - //rrcConnectionReestablishment_NB - rrcConnectionReestablishment_NB_IoT->rrc_TransactionIdentifier = Transaction_id; - rrcConnectionReestablishment_NB_IoT->criticalExtensions.present = RRCConnectionReestablishment_NB__criticalExtensions_PR_c1; - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.present = RRCConnectionReestablishment_NB__criticalExtensions__c1_PR_rrcConnectionReestablishment_r13; - - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.srb_ToAddModList_r13 = SRB_list_NB_IoT; - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.drb_ToAddModList_r13 = NULL; - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.drb_ToReleaseList_r13 = NULL; - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.rlf_TimersAndConstants_r13= NULL; - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.mac_MainConfig_r13= NULL; - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13 = NULL; - - rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.nextHopChainingCount_r13=0; - - enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB, - NULL, - (void*)&dl_ccch_msg_NB_IoT, - buffer, - RRC_BUF_SIZE); - - if (enc_rval.encoded <= 0) { - LOG_F(RRC, "ASN1 message encoding failed (%s, %li)!\n", - enc_rval.failed_type->name, enc_rval.encoded); - } + if (enc_rval.encoded <= 0) { + LOG_F(RRC, "ASN1 message encoding failed (%s, %li)!\n", + enc_rval.failed_type->name, enc_rval.encoded); + } #ifdef XER_PRINT xer_fprint(stdout,&asn_DEF_DL_CCCH_Message_NB,(void *)&dl_ccch_msg_NB_IoT); diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index 498a004bd6..13b710fb5d 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -1577,8 +1577,8 @@ rrc_ue_process_radioResourceConfigDedicated( NULL, NULL #endif - - } + ); + } } } } @@ -2580,7 +2580,7 @@ rrc_ue_decode_dcch( #endif #endif } - } + //TTN test D2D (should not be here - in reality, this message will be triggered from ProSeApp) if (send_ue_information == 0) { @@ -3877,75 +3877,63 @@ uint64_t arfcn_to_freq(long arfcn) { break; - case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4: - if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&8) == 0) { - UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=8; - new_sib=1; - memcpy( UE_rrc_inst[ctxt_pP->module_id].sib4[eNB_index], &typeandinfo->choice.sib4, sizeof(SystemInformationBlockType4_t) ); - LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB4 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); - } - + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4: + if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&8) == 0) { + UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=8; + new_sib=1; + memcpy( UE_rrc_inst[ctxt_pP->module_id].sib4[eNB_index], &typeandinfo->choice.sib4, sizeof(SystemInformationBlockType4_t) ); + LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB4 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); + } + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5: if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&16) == 0) { UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=16; new_sib=1; - + memcpy( UE_rrc_inst[ctxt_pP->module_id].sib5[eNB_index], &typeandinfo->choice.sib5, sizeof(SystemInformationBlockType5_t) ); LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB5 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); dump_sib5(UE_rrc_inst[ctxt_pP->module_id].sib5[eNB_index]); } break; - + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6: if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&32) == 0) { UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=32; new_sib=1; - memcpy( UE_rrc_inst[ctxt_pP->module_id].sib6[eNB_index], &typeandinfo->choice.sib6, sizeof(SystemInformationBlockType6_t) ); LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB6 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); } - break; - - break; - - case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6: - if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&32) == 0) { - UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=32; - new_sib=1; - memcpy( UE_rrc_inst[ctxt_pP->module_id].sib6[eNB_index], &typeandinfo->choice.sib6, sizeof(SystemInformationBlockType6_t) ); - LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB6 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); - } - + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9: if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&256) == 0) { UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=256; new_sib=1; - + memcpy( UE_rrc_inst[ctxt_pP->module_id].sib9[eNB_index], &typeandinfo->choice.sib9, sizeof(SystemInformationBlockType9_t) ); LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB9 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); } break; - - case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7: - if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&64) == 0) { - UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=64; - new_sib=1; - memcpy( UE_rrc_inst[ctxt_pP->module_id].sib7[eNB_index], &typeandinfo->choice.sib7, sizeof(SystemInformationBlockType7_t) ); - LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB7 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); - } - - break; - - case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8: - if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&128) == 0) { - UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=128; - new_sib=1; - memcpy( UE_rrc_inst[ctxt_pP->module_id].sib8[eNB_index], &typeandinfo->choice.sib8, sizeof(SystemInformationBlockType8_t) ); - LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB8 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); - } - + + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7: + if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&64) == 0) { + UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=64; + new_sib=1; + memcpy( UE_rrc_inst[ctxt_pP->module_id].sib7[eNB_index], &typeandinfo->choice.sib7, sizeof(SystemInformationBlockType7_t) ); + LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB7 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); + } + + break; + + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8: + if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&128) == 0) { + UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=128; + new_sib=1; + memcpy( UE_rrc_inst[ctxt_pP->module_id].sib8[eNB_index], &typeandinfo->choice.sib8, sizeof(SystemInformationBlockType8_t) ); + LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB8 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); + } + #if (RRC_VERSION >= MAKE_VERSION(9, 2, 0)) - + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920: if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&2048) == 0) { UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=2048; @@ -3954,12 +3942,12 @@ uint64_t arfcn_to_freq(long arfcn) { LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB12 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); } break; - + case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920: if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&4096) == 0) { UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=4096; new_sib=1; - + memcpy( UE_rrc_inst[ctxt_pP->module_id].sib13[eNB_index], &typeandinfo->choice.sib13_v920, sizeof(SystemInformationBlockType13_r9_t) ); LOG_I( RRC, "[UE %"PRIu8"] Frame %"PRIu32" Found SIB13 from eNB %"PRIu8"\n", ctxt_pP->module_id, ctxt_pP->frame, eNB_index ); dump_sib13( UE_rrc_inst[ctxt_pP->module_id].sib13[eNB_index] ); @@ -4068,13 +4056,10 @@ uint64_t arfcn_to_freq(long arfcn) { #endif + default: break; } - - default: - break; - } } if (new_sib == 1) { @@ -4608,17 +4593,7 @@ void *rrc_ue_task( void *args_p ) LOG_D(RRC, "[UE %d] Received %s: eNB %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), RRC_MAC_CCCH_DATA_CNF (msg_p).enb_index); - case RRC_MAC_BCCH_DATA_IND: - LOG_D(RRC, "[UE %d] Received %s: frameP %d, eNB %d\n", ue_mod_id, msg_name, - RRC_MAC_BCCH_DATA_IND (msg_p).frame, RRC_MAC_BCCH_DATA_IND (msg_p).enb_index); - // PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, NOT_A_RNTI, RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0); - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, NOT_A_RNTI, RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0,RRC_MAC_BCCH_DATA_IND (msg_p).enb_index); - decode_BCCH_DLSCH_Message (&ctxt, - RRC_MAC_BCCH_DATA_IND (msg_p).enb_index, - RRC_MAC_BCCH_DATA_IND (msg_p).sdu, - RRC_MAC_BCCH_DATA_IND (msg_p).sdu_size, - RRC_MAC_BCCH_DATA_IND (msg_p).rsrq, - RRC_MAC_BCCH_DATA_IND (msg_p).rsrp); + break; case RRC_MAC_CCCH_DATA_IND: @@ -4753,11 +4728,11 @@ void *rrc_ue_task( void *args_p ) case RRC_STATE_INACTIVE: { /* Need to first activate lower layers */ MessageDef *message_p; - + message_p = itti_alloc_new_message(TASK_RRC_UE, ACTIVATE_MESSAGE); - + itti_send_msg_to_task(TASK_L2L1, UE_MODULE_ID_TO_INSTANCE(ue_mod_id), message_p); - + /* Save cell selection criterion */ { UE_rrc_inst[ue_mod_id].plmnID = NAS_CELL_SELECTION_REQ (msg_p).plmnID; @@ -4771,74 +4746,64 @@ void *rrc_ue_task( void *args_p ) UE_rrc_inst[ue_mod_id].plmnID.MNCdigit2, UE_rrc_inst[ue_mod_id].plmnID.MNCdigit3); } - + switch (rrc_get_state(ue_mod_id)) { - case RRC_STATE_INACTIVE: { - /* Need to first activate lower layers */ - MessageDef *message_p; - message_p = itti_alloc_new_message(TASK_RRC_UE, ACTIVATE_MESSAGE); - itti_send_msg_to_task(TASK_L2L1, UE_MODULE_ID_TO_INSTANCE(ue_mod_id), message_p); - rrc_set_state (ue_mod_id, RRC_STATE_IDLE); - /* Fall through to next case */ - } - - case RRC_STATE_IDLE: { - /* Ask to layer 1 to find a cell matching the criterion */ - MessageDef *message_p; - message_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_CELL_REQ); - PHY_FIND_CELL_REQ (message_p).earfcn_start = 1; - PHY_FIND_CELL_REQ (message_p).earfcn_end = 1; - itti_send_msg_to_task(TASK_PHY_UE, UE_MODULE_ID_TO_INSTANCE(ue_mod_id), message_p); - rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_SEARCHING); - break; - } - - case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id)); - break; - - default: - LOG_C(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); - break; + case RRC_STATE_INACTIVE: { + /* Need to first activate lower layers */ + MessageDef *message_p; + message_p = itti_alloc_new_message(TASK_RRC_UE, ACTIVATE_MESSAGE); + itti_send_msg_to_task(TASK_L2L1, UE_MODULE_ID_TO_INSTANCE(ue_mod_id), message_p); + rrc_set_state (ue_mod_id, RRC_STATE_IDLE); + /* Fall through to next case */ + } + + case RRC_STATE_IDLE: { + /* Ask to layer 1 to find a cell matching the criterion */ + MessageDef *message_p; + message_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_CELL_REQ); + PHY_FIND_CELL_REQ (message_p).earfcn_start = 1; + PHY_FIND_CELL_REQ (message_p).earfcn_end = 1; + itti_send_msg_to_task(TASK_PHY_UE, UE_MODULE_ID_TO_INSTANCE(ue_mod_id), message_p); + rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_SEARCHING); + break; + } + + case RRC_STATE_CONNECTED: + /* should not happen */ + LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); + break; + + default: + LOG_C(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); + break; } break; - - case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); - break; - - default: - LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); - break; - } - - case RRC_STATE_INACTIVE: - case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id)); - break; - - case NAS_CONN_ESTABLI_REQ: - LOG_D(RRC, "[UE %d] Received %s: cause %d, type %d, s_tmsi (mme code %"PRIu8", m-tmsi %"PRIu32"), plmnID (%d%d%d.%d%d%d)\n", ue_mod_id, ITTI_MSG_NAME (msg_p), NAS_CONN_ESTABLI_REQ (msg_p).cause, - NAS_CONN_ESTABLI_REQ (msg_p).type, - NAS_CONN_ESTABLI_REQ (msg_p).s_tmsi.MMEcode, - NAS_CONN_ESTABLI_REQ (msg_p).s_tmsi.m_tmsi, - NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit1, - NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit2, - NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit3, - NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit1, - NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit2, - NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit3); - - //PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, NOT_A_RNTI, 0, 0); - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, NOT_A_RNTI, 0, 0, 0); - - UE_rrc_inst[ue_mod_id].initialNasMsg = NAS_CONN_ESTABLI_REQ (msg_p).initialNasMsg; - - switch (rrc_get_state(ue_mod_id)) { + + case RRC_STATE_INACTIVE: + case RRC_STATE_CONNECTED: + /* should not happen */ + LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id)); + break; + + case NAS_CONN_ESTABLI_REQ: + LOG_D(RRC, "[UE %d] Received %s: cause %d, type %d, s_tmsi (mme code %"PRIu8", m-tmsi %"PRIu32"), plmnID (%d%d%d.%d%d%d)\n", ue_mod_id, ITTI_MSG_NAME (msg_p), NAS_CONN_ESTABLI_REQ (msg_p).cause, + NAS_CONN_ESTABLI_REQ (msg_p).type, + NAS_CONN_ESTABLI_REQ (msg_p).s_tmsi.MMEcode, + NAS_CONN_ESTABLI_REQ (msg_p).s_tmsi.m_tmsi, + NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit1, + NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit2, + NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MCCdigit3, + NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit1, + NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit2, + NAS_CONN_ESTABLI_REQ (msg_p).plmnID.MNCdigit3); + + //PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, NOT_A_RNTI, 0, 0); + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, NOT_A_RNTI, 0, 0, 0); + + UE_rrc_inst[ue_mod_id].initialNasMsg = NAS_CONN_ESTABLI_REQ (msg_p).initialNasMsg; + + switch (rrc_get_state(ue_mod_id)) { case RRC_STATE_IDLE: { if (rrc_get_sub_state(ue_mod_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) { rrc_ue_generate_RRCConnectionRequest(&ctxt, 0); @@ -4906,94 +4871,95 @@ void *rrc_ue_task( void *args_p ) case RRC_STATE_INACTIVE: { /* Need to first activate lower layers */ MessageDef *message_p; - + message_p = itti_alloc_new_message(TASK_RRC_UE, ACTIVATE_MESSAGE); - + itti_send_msg_to_task(TASK_L2L1, instance, message_p); - + rrc_set_state (ue_mod_id, RRC_STATE_IDLE); /* Fall through to next case */ } - + case RRC_STATE_IDLE: { if (rrc_get_sub_state(ue_mod_id) != RRC_SUB_STATE_IDLE_SEARCHING) { /* Ask to layer 1 to find a cell matching the criterion */ MessageDef *message_p; - - case RRC_STATE_IDLE: { - if (rrc_get_sub_state(ue_mod_id) != RRC_SUB_STATE_IDLE_SEARCHING) { - /* Ask to layer 1 to find a cell matching the criterion */ - MessageDef *message_p; - message_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_CELL_REQ); - rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_SEARCHING); - PHY_FIND_CELL_REQ (message_p).transaction_id = RRC_RAL_SCAN_REQ (msg_p).transaction_id; - PHY_FIND_CELL_REQ (message_p).earfcn_start = 1; - PHY_FIND_CELL_REQ (message_p).earfcn_end = 1; //44 - itti_send_msg_to_task(TASK_PHY_UE, instance, message_p); - } - - break; - } - - case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id)); - break; - - default: - LOG_C(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); - break; + + case RRC_STATE_IDLE: { + if (rrc_get_sub_state(ue_mod_id) != RRC_SUB_STATE_IDLE_SEARCHING) { + /* Ask to layer 1 to find a cell matching the criterion */ + MessageDef *message_p; + message_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_CELL_REQ); + rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_SEARCHING); + PHY_FIND_CELL_REQ (message_p).transaction_id = RRC_RAL_SCAN_REQ (msg_p).transaction_id; + PHY_FIND_CELL_REQ (message_p).earfcn_start = 1; + PHY_FIND_CELL_REQ (message_p).earfcn_end = 1; //44 + itti_send_msg_to_task(TASK_PHY_UE, instance, message_p); + } + + break; + } + + case RRC_STATE_CONNECTED: + /* should not happen */ + LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id)); + break; + + default: + LOG_C(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); + break; } - + break; - case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); - break; - - default: - LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); - break; + case RRC_STATE_CONNECTED: + /* should not happen */ + LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); + break; + + default: + LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); + break; } - - break; - - case PHY_FIND_CELL_IND: - LOG_D(RRC, "[UE %d] Received %s: state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); - - switch (rrc_get_state(ue_mod_id)) { - case RRC_STATE_IDLE: - switch (rrc_get_sub_state(ue_mod_id)) { - case RRC_SUB_STATE_IDLE_SEARCHING: { - MessageDef *message_p; - int i; - - message_p = itti_alloc_new_message(TASK_RRC_UE, RRC_RAL_SCAN_CONF); - - RRC_RAL_SCAN_CONF (message_p).transaction_id = PHY_FIND_CELL_IND(msg_p).transaction_id; - RRC_RAL_SCAN_CONF (message_p).num_scan_resp = PHY_FIND_CELL_IND(msg_p).cell_nb; - - rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE); - itti_send_msg_to_task(TASK_RAL_UE, instance, message_p); - break; - } - - default: - LOG_C(RRC, "[UE %d] Invalid RRC state %d substate %d\n", - ue_mod_id, - rrc_get_state(ue_mod_id), - rrc_get_sub_state(ue_mod_id)); - } - - break; - - case RRC_STATE_INACTIVE: - case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] indication %s in RRC state %d\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id)); - break; - + + break; + + case PHY_FIND_CELL_IND: + LOG_D(RRC, "[UE %d] Received %s: state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); + + switch (rrc_get_state(ue_mod_id)) { + case RRC_STATE_IDLE: + switch (rrc_get_sub_state(ue_mod_id)) { + case RRC_SUB_STATE_IDLE_SEARCHING: + { + MessageDef *message_p; + int i; + + message_p = itti_alloc_new_message(TASK_RRC_UE, RRC_RAL_SCAN_CONF); + + RRC_RAL_SCAN_CONF (message_p).transaction_id = PHY_FIND_CELL_IND(msg_p).transaction_id; + RRC_RAL_SCAN_CONF (message_p).num_scan_resp = PHY_FIND_CELL_IND(msg_p).cell_nb; + + rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE); + itti_send_msg_to_task(TASK_RAL_UE, instance, message_p); + break; + } + + default: + LOG_C(RRC, "[UE %d] Invalid RRC state %d substate %d\n", + ue_mod_id, + rrc_get_state(ue_mod_id), + rrc_get_sub_state(ue_mod_id)); + } + + break; + + case RRC_STATE_INACTIVE: + case RRC_STATE_CONNECTED: + /* should not happen */ + LOG_E(RRC, "[UE %d] indication %s in RRC state %d\n", ue_mod_id, msg_name, rrc_get_state(ue_mod_id)); + break; + default: LOG_E(RRC, "[UE %d] Invalid RRC state %d substate %d\n", ue_mod_id, @@ -5002,80 +4968,57 @@ void *rrc_ue_task( void *args_p ) } break; - - case RRC_STATE_INACTIVE: - case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] indication %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); - break; - - default: - LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); - break; - } - + case RRC_RAL_CONFIGURE_THRESHOLD_REQ: - rrc_ue_ral_handle_configure_threshold_request(ue_mod_id, msg_p); - break; - + rrc_ue_ral_handle_configure_threshold_request(ue_mod_id, msg_p); + break; + case RRC_RAL_CONNECTION_ESTABLISHMENT_REQ: - LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, msg_name); - - switch (rrc_get_state(ue_mod_id)) { - case RRC_STATE_IDLE: { - if (rrc_get_sub_state(ue_mod_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) { - PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0, 0); - rrc_ue_generate_RRCConnectionRequest(&ctxt, 0); - LOG_D(RRC, "not sending connection request\n"); - rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_CONNECTING); - } - - break; - } - - case RRC_RAL_CONNECTION_ESTABLISHMENT_REQ: - LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p)); - - default: - LOG_C(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); - break; - } - - break; - + LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, msg_name); + + switch (rrc_get_state(ue_mod_id)) { + case RRC_STATE_IDLE: { + if (rrc_get_sub_state(ue_mod_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) { + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0, 0); + rrc_ue_generate_RRCConnectionRequest(&ctxt, 0); + LOG_D(RRC, "not sending connection request\n"); + rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_CONNECTING); + } + + break; + } + + case RRC_RAL_CONNECTION_ESTABLISHMENT_REQ: + LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p)); + + default: + LOG_C(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); + break; + } + + break; + case RRC_STATE_INACTIVE: case RRC_STATE_CONNECTED: - /* should not happen */ - LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); - break; + /* should not happen */ + LOG_E(RRC, "[UE %d] request %s in RRC state %d\n", ue_mod_id, ITTI_MSG_NAME (msg_p), rrc_get_state(ue_mod_id)); + break; #endif - + default: - LOG_E(RRC, "[UE %d] Invalid RRC state %d\n", ue_mod_id, rrc_get_state(ue_mod_id)); - break; + LOG_E(RRC, "[UE %d] Received unexpected message %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p)); + break; } - - break; - - case RRC_RAL_CONNECTION_RELEASE_REQ: - LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p)); - break; -#endif - - default: - LOG_E(RRC, "[UE %d] Received unexpected message %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p)); - break; - } - - result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); - msg_p = NULL; - } + + result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); + msg_p = NULL; + } } #endif - - + + /*------------------------------------------------------------------------------*/ void diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 9e5030441e..ccedd5883e 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -345,7 +345,6 @@ init_SI( #endif -#endif LOG_D(RRC, PROTOCOL_RRC_CTXT_FMT" RRC_UE --- MAC_CONFIG_REQ (SIB1.tdd & SIB2 params) ---> MAC_UE\n", PROTOCOL_RRC_CTXT_ARGS(ctxt_pP)); diff --git a/openair3/S1AP/s1ap_eNB.c b/openair3/S1AP/s1ap_eNB.c index 0f3917dedd..4af2d3a476 100644 --- a/openair3/S1AP/s1ap_eNB.c +++ b/openair3/S1AP/s1ap_eNB.c @@ -99,10 +99,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, sctp_new_association_req_t *sctp_new_association_req_p = NULL; s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL; struct s1ap_eNB_mme_data_s *mme = NULL; -<<<<<<< HEAD -======= ->>>>>>> origin/develop DevAssert(instance_p != NULL); DevAssert(mme_ip_address != NULL); message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ); @@ -117,21 +114,6 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, memcpy(&sctp_new_association_req_p->local_address, local_ip_addr, sizeof(*local_ip_addr)); -<<<<<<< HEAD - S1AP_INFO("[eNB %d] check the mme registration state\n",instance_p->instance); - mme = s1ap_eNB_get_MME_from_instance(instance_p); - - if ( mme == NULL ) { - /* Create new MME descriptor */ - s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p)); - DevAssert(s1ap_mme_data_p != NULL); - s1ap_mme_data_p->cnx_id = s1ap_eNB_fetch_add_global_cnx_id(); - sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id; - s1ap_mme_data_p->assoc_id = -1; - s1ap_mme_data_p->s1ap_eNB_instance = instance_p; - STAILQ_INIT(&s1ap_mme_data_p->served_gummei); -======= - S1AP_INFO("[eNB %d] check the mme registration state\n",instance_p->instance); mme = s1ap_eNB_get_MME_from_instance(instance_p); @@ -150,7 +132,6 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, STAILQ_INIT(&s1ap_mme_data_p->served_gummei); ->>>>>>> origin/develop /* Insert the new descriptor in list of known MME * but not yet associated. */ @@ -165,10 +146,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, instance_p->instance, mme->state, mme->cnx_id, instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb); -<<<<<<< HEAD -======= ->>>>>>> origin/develop /*s1ap_mme_data_p->cnx_id = mme->cnx_id; sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id; @@ -419,16 +397,12 @@ static int s1ap_eNB_generate_s1_setup_request( uint8_t *buffer; uint32_t len; int ret = 0; -<<<<<<< HEAD - s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING; -======= DevAssert(instance_p != NULL); DevAssert(s1ap_mme_data_p != NULL); s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING; ->>>>>>> origin/develop /* Prepare the S1AP message to encode */ memset(&pdu, 0, sizeof(pdu)); pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage; @@ -436,11 +410,8 @@ static int s1ap_eNB_generate_s1_setup_request( pdu.choice.initiatingMessage.criticality = S1AP_Criticality_reject; pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_S1SetupRequest; out = &pdu.choice.initiatingMessage.value.choice.S1SetupRequest; -<<<<<<< HEAD -======= /* mandatory */ ->>>>>>> origin/develop ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_Global_ENB_ID; ie->criticality = S1AP_Criticality_reject; @@ -467,23 +438,12 @@ static int s1ap_eNB_generate_s1_setup_request( ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); } -<<<<<<< HEAD -======= + /* mandatory */ ->>>>>>> origin/develop ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_SupportedTAs; ie->criticality = S1AP_Criticality_reject; ie->value.present = S1AP_S1SetupRequestIEs__value_PR_SupportedTAs; -<<<<<<< HEAD - ta = (S1AP_SupportedTAs_Item_t *)calloc(1, sizeof(S1AP_SupportedTAs_Item_t)); - INT16_TO_OCTET_STRING(instance_p->tac, &ta->tAC); - plmn = (S1AP_PLMNidentity_t *)calloc(1, sizeof(S1AP_PLMNidentity_t)); - MCC_MNC_TO_TBCD(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); - ASN_SEQUENCE_ADD(&ta->broadcastPLMNs.list, plmn); - ASN_SEQUENCE_ADD(&ie->value.choice.SupportedTAs.list, ta); - ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); -======= { ta = (S1AP_SupportedTAs_Item_t *)calloc(1, sizeof(S1AP_SupportedTAs_Item_t)); INT16_TO_OCTET_STRING(instance_p->tac, &ta->tAC); @@ -497,7 +457,6 @@ static int s1ap_eNB_generate_s1_setup_request( ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); /* mandatory */ ->>>>>>> origin/develop ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_DefaultPagingDRX; ie->criticality = S1AP_Criticality_ignore; @@ -516,16 +475,10 @@ static int s1ap_eNB_generate_s1_setup_request( } /* optional */ -<<<<<<< HEAD - if (0) { - ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t)); - ie->id = S1AP_ProtocolIE_ID_id_UE_RetentionInformation ; -======= #if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0)) if (0) { ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t)); ie->id = S1AP_ProtocolIE_ID_id_UE_RetentionInformation; ->>>>>>> origin/develop ie->criticality = S1AP_Criticality_ignore; ie->value.present = S1AP_S1SetupRequestIEs__value_PR_UE_RetentionInformation; // ie->value.choice.UE_RetentionInformation = ;