diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index f73d04ca96b1ab596086b1c95b4f69fecc373cac..715d4e65addb2cd631b12261aac5c14658ebef95 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1052,7 +1052,7 @@ uint8_t do_RRCConnectionRequest(uint8_t *buffer,uint8_t *rv) { } -uint8_t do_RRCConnectionSetupComplete(uint8_t *buffer, const int dedicatedInfoNASLength, const char *dedicatedInfoNAS) { +uint8_t do_RRCConnectionSetupComplete(uint8_t *buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength, const char *dedicatedInfoNAS) { asn_enc_rval_t enc_rval; @@ -1067,7 +1067,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t *buffer, const int dedicatedInfoNA ul_dcch_msg.message.choice.c1.present = UL_DCCH_MessageType__c1_PR_rrcConnectionSetupComplete; rrcConnectionSetupComplete = &ul_dcch_msg.message.choice.c1.choice.rrcConnectionSetupComplete; - rrcConnectionSetupComplete->rrc_TransactionIdentifier = 0x2; + rrcConnectionSetupComplete->rrc_TransactionIdentifier = Transaction_id; rrcConnectionSetupComplete->criticalExtensions.present = RRCConnectionSetupComplete__criticalExtensions_PR_c1; rrcConnectionSetupComplete->criticalExtensions.choice.c1.present = RRCConnectionSetupComplete__criticalExtensions__c1_PR_rrcConnectionSetupComplete_r8; @@ -1112,7 +1112,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t *buffer, const int dedicatedInfoNA } -uint8_t do_RRCConnectionReconfigurationComplete(uint8_t *buffer) { +uint8_t do_RRCConnectionReconfigurationComplete(uint8_t *buffer, const uint8_t Transaction_id) { asn_enc_rval_t enc_rval; @@ -1127,7 +1127,7 @@ uint8_t do_RRCConnectionReconfigurationComplete(uint8_t *buffer) { ul_dcch_msg.message.choice.c1.present = UL_DCCH_MessageType__c1_PR_rrcConnectionReconfigurationComplete; rrcConnectionReconfigurationComplete = &ul_dcch_msg.message.choice.c1.choice.rrcConnectionReconfigurationComplete; - rrcConnectionReconfigurationComplete->rrc_TransactionIdentifier = 0x2; + rrcConnectionReconfigurationComplete->rrc_TransactionIdentifier = Transaction_id; rrcConnectionReconfigurationComplete->criticalExtensions.present = RRCConnectionReconfigurationComplete__criticalExtensions_PR_rrcConnectionReconfigurationComplete_r8; rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8.nonCriticalExtension=NULL; diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.h b/openair2/RRC/LITE/MESSAGES/asn1_msg.h index a3a5adfefe5df661ffb6a1aa7da0d17b57fe1a38..9f3650f71028c8585238e23e502c7ad9f63263ea 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.h +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.h @@ -114,12 +114,12 @@ uint8_t do_RRCConnectionRequest(uint8_t *buffer,u8 *rv); /** \brief Generate an RRCConnectionSetupComplete UL-DCCH-Message (UE) @param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU @returns Size of encoded bit stream in bytes*/ -uint8_t do_RRCConnectionSetupComplete(uint8_t *buffer, const int dedicatedInfoNASLength, const char *dedicatedInfoNAS); +uint8_t do_RRCConnectionSetupComplete(uint8_t *buffer, const uint8_t Transaction_id, const int dedicatedInfoNASLength, const char *dedicatedInfoNAS); /** \brief Generate an RRCConnectionReconfigurationComplete UL-DCCH-Message (UE) @param buffer Pointer to PER-encoded ASN.1 description of UL-DCCH-Message PDU @returns Size of encoded bit stream in bytes*/ -uint8_t do_RRCConnectionReconfigurationComplete(uint8_t *buffer); +uint8_t do_RRCConnectionReconfigurationComplete(uint8_t *buffer, const uint8_t Transaction_id); /** \brief Generate an RRCConnectionSetup DL-CCCH-Message (eNB). This routine configures SRB_ToAddMod (SRB1/SRB2) and diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index 58e094b86761f266ee112108d6a0efbd4726609d..abedda0f0c0ee26c601e4ef73be9dfd400450e92 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -452,7 +452,7 @@ void rrc_ue_generate_RRCConnectionRequest(u8 Mod_id, u32 frame, u8 eNB_index); \param Mod_id Instance ID of UE \param frame Frame index \param eNB_index Index of corresponding eNB/CH*/ -void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id,u32 frame,u8 eNB_index); +void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id,u32 frame,u8 eNB_index, uint8_t Transaction_id); /** \brief process the received rrcConnectionReconfiguration message at UE \param Mod_id Instance ID of UE @@ -465,7 +465,7 @@ void rrc_ue_process_rrcConnectionReconfiguration(u8 Mod_id, u32 frame,RRCConnect \param Mod_id Instance ID of UE \param frame Frame index \param eNB_index Index of corresponding eNB/CH*/ -void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame, u8 eNB_index); +void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame, u8 eNB_index, uint8_t Transaction_id); /** \brief Establish SRB1 based on configuration in SRB_ToAddMod structure. Configures RLC/PDCP accordingly \param Mod_id Instance ID of UE diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index cb97ffd426b3a2e9beb8c9b7ed94c11670231ca8..030f053a0fb09bb3bb05effddacfbfcd914cf9f6 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -269,13 +269,13 @@ static const char nas_attach_req_guti[] = }; /*------------------------------------------------------------------------------*/ -void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_index){ +void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_index, uint8_t Transaction_id){ /*------------------------------------------------------------------------------*/ u8 buffer[100]; u8 size; - size = do_RRCConnectionSetupComplete(buffer, sizeof(nas_attach_req_guti), nas_attach_req_guti); + size = do_RRCConnectionSetupComplete(buffer, Transaction_id, sizeof(nas_attach_req_guti), nas_attach_req_guti); LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n", Mod_id,frame, size, eNB_index); @@ -290,11 +290,11 @@ void rrc_ue_generate_RRCConnectionSetupComplete(u8 Mod_id, u32 frame, u8 eNB_ind -void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame, u8 eNB_index) { +void rrc_ue_generate_RRCConnectionReconfigurationComplete(u8 Mod_id, u32 frame, u8 eNB_index, uint8_t Transaction_id) { u8 buffer[32], size; - size = do_RRCConnectionReconfigurationComplete(buffer); + size = do_RRCConnectionReconfigurationComplete(buffer, Transaction_id); LOG_I(RRC,"[UE %d] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionReconfigurationComplete (bytes %d, eNB_index %d)\n", Mod_id,frame, size, eNB_index); @@ -353,10 +353,10 @@ int rrc_ue_decode_ccch(u8 Mod_id, u32 frame, SRB_INFO *Srb_info, u8 eNB_index){ size_t message_string_size; message_string_size = strlen(message_string); - message_p = itti_alloc_new_message_sized (TASK_RRC_ENB, GENERIC_LOG, message_string_size); + message_p = itti_alloc_new_message_sized (TASK_RRC_UE, GENERIC_LOG, message_string_size); memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size); - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_UNKNOWN, Mod_id + NB_eNB_INST, message_p); free(message_string); } @@ -376,50 +376,59 @@ int rrc_ue_decode_ccch(u8 Mod_id, u32 frame, SRB_INFO *Srb_info, u8 eNB_index){ switch (dl_ccch_msg->message.choice.c1.present) { - case DL_CCCH_MessageType__c1_PR_NOTHING : - - LOG_I(RRC,"[UE%d] Frame %d : Received PR_NOTHING on DL-CCCH-Message\n",Mod_id,frame); - rval= 0; - break; - case DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishment: - LOG_D(RRC, "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (rrcConnectionReestablishment ENB %d) --->][RRC_UE][MOD %02d][]\n", - frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); - - LOG_I(RRC,"[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishment\n",Mod_id,frame); - rval= 0; - break; - case DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentReject: - LOG_D(RRC, "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (RRCConnectionReestablishmentReject ENB %d) --->][RRC_UE][MOD %02d][]\n", - frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); - LOG_I(RRC,"[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishmentReject\n",Mod_id,frame); - rval= 0; - break; - case DL_CCCH_MessageType__c1_PR_rrcConnectionReject: - LOG_D(RRC, "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (rrcConnectionReject ENB %d) --->][RRC_UE][MOD %02d][]\n", - frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); - - LOG_I(RRC,"[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReject \n",Mod_id,frame); - rval= 0; - break; - case DL_CCCH_MessageType__c1_PR_rrcConnectionSetup: - LOG_D(RRC, "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (rrcConnectionSetup ENB %d) --->][RRC_UE][MOD %02d][]\n", - frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); - - LOG_I(RRC,"[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup \n",Mod_id,frame); - // Get configuration - - // Release T300 timer - UE_rrc_inst[Mod_id].Info[eNB_index].T300_active=0; - rrc_ue_process_radioResourceConfigDedicated(Mod_id,frame,eNB_index, - &dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated); - - rrc_ue_generate_RRCConnectionSetupComplete(Mod_id,frame, eNB_index); - - rval= 0; - break; - default: - LOG_E(RRC,"[UE%d] Frame %d : Unknown message\n",Mod_id,frame); - rval= -1; + case DL_CCCH_MessageType__c1_PR_NOTHING: + LOG_I(RRC, "[UE%d] Frame %d : Received PR_NOTHING on DL-CCCH-Message\n", Mod_id, frame); + rval = 0; + break; + + case DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishment: + LOG_D(RRC, + "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (rrcConnectionReestablishment ENB %d) --->][RRC_UE][MOD %02d][]\n", frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); + + LOG_I(RRC, + "[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishment\n", Mod_id, frame); + rval = 0; + break; + + case DL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentReject: + LOG_D(RRC, + "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (RRCConnectionReestablishmentReject ENB %d) --->][RRC_UE][MOD %02d][]\n", frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); + LOG_I(RRC, + "[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReestablishmentReject\n", Mod_id, frame); + rval = 0; + break; + + case DL_CCCH_MessageType__c1_PR_rrcConnectionReject: + LOG_D(RRC, + "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (rrcConnectionReject ENB %d) --->][RRC_UE][MOD %02d][]\n", frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); + + LOG_I(RRC, + "[UE%d] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionReject \n", Mod_id, frame); + rval = 0; + break; + + case DL_CCCH_MessageType__c1_PR_rrcConnectionSetup: + LOG_D(RRC, + "[MSC_MSG][FRAME %05d][MAC_UE][MOD %02d][][--- MAC_DATA_IND (rrcConnectionSetup ENB %d) --->][RRC_UE][MOD %02d][]\n", frame, Mod_id+NB_eNB_INST, eNB_index, Mod_id+NB_eNB_INST); + + LOG_I(RRC, + "[UE%d][RAPROC] Frame %d : Logical Channel DL-CCCH (SRB0), Received RRCConnectionSetup \n", Mod_id, frame); + // Get configuration + + // Release T300 timer + UE_rrc_inst[Mod_id].Info[eNB_index].T300_active = 0; + rrc_ue_process_radioResourceConfigDedicated(Mod_id, frame, eNB_index, + &dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated); + + rrc_ue_generate_RRCConnectionSetupComplete(Mod_id, frame, eNB_index, dl_ccch_msg->message.choice.c1.choice.rrcConnectionSetup.rrc_TransactionIdentifier); + + rval = 0; + break; + + default: + LOG_E(RRC, "[UE%d] Frame %d : Unknown message\n", Mod_id, frame); + rval = -1; + break; } } } @@ -1128,6 +1137,7 @@ void rrc_ue_process_ueCapabilityEnquiry(uint8_t Mod_id,uint32_t frame,UECapabili ul_dcch_msg.message.present = UL_DCCH_MessageType_PR_c1; ul_dcch_msg.message.choice.c1.present = UL_DCCH_MessageType__c1_PR_ueCapabilityInformation; + ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier; ue_CapabilityRAT_Container.rat_Type = RAT_Type_eutra; OCTET_STRING_fromBuf(&ue_CapabilityRAT_Container.ueCapabilityRAT_Container, @@ -1145,22 +1155,20 @@ void rrc_ue_process_ueCapabilityEnquiry(uint8_t Mod_id,uint32_t frame,UECapabili for (i=0;i<UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.count;i++) { - if (*UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.array[i]==RAT_Type_eutra) { - // ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.rrc_TransactionIdentifier = UECapabilityEnquiry->rrc_TransactionIdentifier; - ASN_SEQUENCE_ADD(&ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, - &ue_CapabilityRAT_Container); + if (*UECapabilityEnquiry->criticalExtensions.choice.c1.choice.ueCapabilityEnquiry_r8.ue_CapabilityRequest.list.array[i] + == RAT_Type_eutra) { + ASN_SEQUENCE_ADD( + &ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list, + &ue_CapabilityRAT_Container); - enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, - (void*)&ul_dcch_msg, - buffer, - 100); + enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, (void*) &ul_dcch_msg, buffer, 100); #ifdef XER_PRINT - xer_fprint(stdout, &asn_DEF_UL_DCCH_Message, (void*)&ul_dcch_msg); + xer_fprint(stdout, &asn_DEF_UL_DCCH_Message, (void*)&ul_dcch_msg); #endif #ifdef USER_MODE - LOG_D(RRC,"UECapabilityInformation Encoded %d bits (%d bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); + LOG_D(RRC,"UECapabilityInformation Encoded %d bits (%d bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8); #endif for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) LOG_T(RRC, "%02x.", buffer[i]); @@ -1383,7 +1391,7 @@ void rrc_ue_decode_dcch(u8 Mod_id,u32 frame,u8 Srb_id, u8 *Buffer,u8 eNB_index) message_p = itti_alloc_new_message_sized (TASK_RRC_UE, GENERIC_LOG, message_string_size); memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size); - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_UNKNOWN, Mod_id + NB_eNB_INST, message_p); free(message_string); } @@ -1397,101 +1405,125 @@ void rrc_ue_decode_dcch(u8 Mod_id,u32 frame,u8 Srb_id, u8 *Buffer,u8 eNB_index) switch (dl_dcch_msg->message.choice.c1.present) { - case DL_DCCH_MessageType__c1_PR_NOTHING : - LOG_I(RRC,"[UE %d] Frame %d : Received PR_NOTHING on DL-DCCH-Message\n",Mod_id,frame); - return; + case DL_DCCH_MessageType__c1_PR_NOTHING: + LOG_I(RRC, "[UE %d] Frame %d : Received PR_NOTHING on DL-DCCH-Message\n", Mod_id, frame); + return; - case DL_DCCH_MessageType__c1_PR_csfbParametersResponseCDMA2000: - break; - case DL_DCCH_MessageType__c1_PR_dlInformationTransfer: - { + case DL_DCCH_MessageType__c1_PR_csfbParametersResponseCDMA2000: + break; + + case DL_DCCH_MessageType__c1_PR_dlInformationTransfer: { #if defined(ENABLE_ITTI) - DLInformationTransfer_t *dlInformationTransfer = &dl_dcch_msg->message.choice.c1.choice.dlInformationTransfer; - - if ((dlInformationTransfer->criticalExtensions.present == DLInformationTransfer__criticalExtensions_PR_c1) - && (dlInformationTransfer->criticalExtensions.choice.c1.present == DLInformationTransfer__criticalExtensions__c1_PR_dlInformationTransfer_r8) - && (dlInformationTransfer->criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType.present == DLInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS)) - { - /* This message hold a dedicated info NAS payload, forward it to NAS */ - struct DLInformationTransfer_r8_IEs__dedicatedInfoType *dedicatedInfoType = - &dlInformationTransfer->criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType; - uint32_t pdu_length; - uint8_t *pdu_buffer; - MessageDef *msg_p; - - pdu_length = dedicatedInfoType->choice.dedicatedInfoNAS.size; - pdu_buffer = dedicatedInfoType->choice.dedicatedInfoNAS.buf; - - msg_p = itti_alloc_new_message(TASK_RRC_UE, NAS_DOWNLINK_DATA_IND); - NAS_DOWNLINK_DATA_IND (msg_p).UEid = Mod_id; // TODO set the UEid to something else ? - NAS_DOWNLINK_DATA_IND (msg_p).nasMsg.length = pdu_length; - NAS_DOWNLINK_DATA_IND (msg_p).nasMsg.data = pdu_buffer; - - itti_send_msg_to_task(TASK_NAS_UE, Mod_id + NB_eNB_INST, msg_p); - } + DLInformationTransfer_t *dlInformationTransfer = &dl_dcch_msg->message.choice.c1.choice.dlInformationTransfer; + + if ((dlInformationTransfer->criticalExtensions.present == DLInformationTransfer__criticalExtensions_PR_c1) + && (dlInformationTransfer->criticalExtensions.choice.c1.present + == DLInformationTransfer__criticalExtensions__c1_PR_dlInformationTransfer_r8) + && (dlInformationTransfer->criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType.present + == DLInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS)) { + /* This message hold a dedicated info NAS payload, forward it to NAS */ + struct DLInformationTransfer_r8_IEs__dedicatedInfoType *dedicatedInfoType = + &dlInformationTransfer->criticalExtensions.choice.c1.choice.dlInformationTransfer_r8.dedicatedInfoType; + uint32_t pdu_length; + uint8_t *pdu_buffer; + MessageDef *msg_p; + + pdu_length = dedicatedInfoType->choice.dedicatedInfoNAS.size; + pdu_buffer = dedicatedInfoType->choice.dedicatedInfoNAS.buf; + + msg_p = itti_alloc_new_message(TASK_RRC_UE, NAS_DOWNLINK_DATA_IND); + NAS_DOWNLINK_DATA_IND(msg_p).UEid = Mod_id; // TODO set the UEid to something else ? + NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.length = pdu_length; + NAS_DOWNLINK_DATA_IND(msg_p).nasMsg.data = pdu_buffer; + + itti_send_msg_to_task(TASK_NAS_UE, Mod_id + NB_eNB_INST, msg_p); + } #endif - break; - } + break; + } + + case DL_DCCH_MessageType__c1_PR_handoverFromEUTRAPreparationRequest: + break; + + case DL_DCCH_MessageType__c1_PR_mobilityFromEUTRACommand: + break; + + case DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration: + // first check if mobilityControlInfo is present + if (dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo + != NULL) { + /* 36.331, 5.3.5.4 Reception of an RRCConnectionReconfiguration including the mobilityControlInfo by the UE (handover)*/ + if (UE_rrc_inst[Mod_id].HandoverInfoUe.targetCellId + != dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo->targetPhysCellId) { + LOG_W(RRC, + "[UE %d] Frame %d: Handover target (%d) is different from RSRP measured target (%d)..\n", Mod_id, frame, dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo->targetPhysCellId, UE_rrc_inst[Mod_id].HandoverInfoUe.targetCellId); + return; + } + else + if ((target_eNB_index = get_adjacent_cell_mod_id(UE_rrc_inst[Mod_id].HandoverInfoUe.targetCellId)) + == 0xFF) { + LOG_W(RRC, + "[UE %d] Frame %d: Mod_id of the target eNB not found, check the network topology\n", Mod_id, frame); + return; + } + else { + LOG_I(RRC, + "[UE% d] Frame %d: Received rrcConnectionReconfiguration with mobilityControlInfo \n", Mod_id, frame); + UE_rrc_inst[Mod_id].HandoverInfoUe.measFlag = 1; // Ready to send more MeasReports if required + } + } + rrc_ue_process_rrcConnectionReconfiguration(Mod_id, frame, + &dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration, eNB_index); + if (target_eNB_index != 0xFF) { + rrc_ue_generate_RRCConnectionReconfigurationComplete(Mod_id, frame, target_eNB_index, + dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier); + UE_rrc_inst[Mod_id].Info[eNB_index].State = RRC_HO_EXECUTION; + UE_rrc_inst[Mod_id].Info[target_eNB_index].State = RRC_RECONFIGURED; + LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n", Mod_id, target_eNB_index); + } + else { + rrc_ue_generate_RRCConnectionReconfigurationComplete(Mod_id, frame, eNB_index, + dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.rrc_TransactionIdentifier); + UE_rrc_inst[Mod_id].Info[eNB_index].State = RRC_RECONFIGURED; + LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n", Mod_id, eNB_index); + } + break; + + case DL_DCCH_MessageType__c1_PR_rrcConnectionRelease: + break; + + case DL_DCCH_MessageType__c1_PR_securityModeCommand: + LOG_I(RRC, "[UE %d] Received securityModeCommand (eNB %d)\n", Mod_id, eNB_index); + rrc_ue_process_securityModeCommand(Mod_id, frame, &dl_dcch_msg->message.choice.c1.choice.securityModeCommand, + eNB_index); + break; + + case DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry: + LOG_I(RRC, "[UE %d] Received Capability Enquiry (eNB %d)\n", Mod_id, eNB_index); + rrc_ue_process_ueCapabilityEnquiry(Mod_id, frame, &dl_dcch_msg->message.choice.c1.choice.ueCapabilityEnquiry, + eNB_index); + break; + + case DL_DCCH_MessageType__c1_PR_counterCheck: + break; - case DL_DCCH_MessageType__c1_PR_handoverFromEUTRAPreparationRequest: - break; - case DL_DCCH_MessageType__c1_PR_mobilityFromEUTRACommand: - break; - case DL_DCCH_MessageType__c1_PR_rrcConnectionReconfiguration: - // first check if mobilityControlInfo is present - if(dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo != NULL) { - /* 36.331, 5.3.5.4 Reception of an RRCConnectionReconfiguration including the mobilityControlInfo by the UE (handover)*/ - if(UE_rrc_inst[Mod_id].HandoverInfoUe.targetCellId != dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo->targetPhysCellId) { - LOG_W(RRC,"[UE %d] Frame %d: Handover target (%d) is different from RSRP measured target (%d)..\n",Mod_id, frame, - dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.mobilityControlInfo->targetPhysCellId,UE_rrc_inst[Mod_id].HandoverInfoUe.targetCellId); - return; - } else if ((target_eNB_index=get_adjacent_cell_mod_id(UE_rrc_inst[Mod_id].HandoverInfoUe.targetCellId)) == 0xFF ){ - LOG_W(RRC,"[UE %d] Frame %d: Mod_id of the target eNB not found, check the network topology\n",Mod_id, frame); - return; - } else { - LOG_I(RRC,"[UE% d] Frame %d: Received rrcConnectionReconfiguration with mobilityControlInfo \n", Mod_id, frame); - UE_rrc_inst[Mod_id].HandoverInfoUe.measFlag = 1; // Ready to send more MeasReports if required - } - } - rrc_ue_process_rrcConnectionReconfiguration(Mod_id,frame,&dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration,eNB_index); - if (target_eNB_index!=0xFF){ - rrc_ue_generate_RRCConnectionReconfigurationComplete(Mod_id,frame,target_eNB_index); - UE_rrc_inst[Mod_id].Info[eNB_index].State = RRC_HO_EXECUTION; - UE_rrc_inst[Mod_id].Info[target_eNB_index].State = RRC_RECONFIGURED; - LOG_I(RRC,"[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n",Mod_id,target_eNB_index); - }else { - rrc_ue_generate_RRCConnectionReconfigurationComplete(Mod_id,frame,eNB_index); - UE_rrc_inst[Mod_id].Info[eNB_index].State = RRC_RECONFIGURED; - LOG_I(RRC,"[UE %d] State = RRC_RECONFIGURED (eNB %d)\n",Mod_id,eNB_index); - } - break; - case DL_DCCH_MessageType__c1_PR_rrcConnectionRelease: - break; - case DL_DCCH_MessageType__c1_PR_securityModeCommand: - LOG_I(RRC,"[UE %d] Received securityModeCommand (eNB %d)\n",Mod_id,eNB_index); - rrc_ue_process_securityModeCommand(Mod_id,frame,&dl_dcch_msg->message.choice.c1.choice.securityModeCommand,eNB_index); - break; - case DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry: - LOG_I(RRC,"[UE %d] Received Capability Enquiry (eNB %d)\n",Mod_id,eNB_index); - rrc_ue_process_ueCapabilityEnquiry(Mod_id,frame,&dl_dcch_msg->message.choice.c1.choice.ueCapabilityEnquiry,eNB_index); - break; - case DL_DCCH_MessageType__c1_PR_counterCheck: - break; #ifdef Rel10 - case DL_DCCH_MessageType__c1_PR_ueInformationRequest_r9: - break; - case DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r10: - break; - case DL_DCCH_MessageType__c1_PR_rnReconfiguration_r10: - break; + case DL_DCCH_MessageType__c1_PR_ueInformationRequest_r9: + break; + case DL_DCCH_MessageType__c1_PR_loggedMeasurementConfiguration_r10: + break; + case DL_DCCH_MessageType__c1_PR_rnReconfiguration_r10: + break; #endif - case DL_DCCH_MessageType__c1_PR_spare1: - case DL_DCCH_MessageType__c1_PR_spare2: - case DL_DCCH_MessageType__c1_PR_spare3: - case DL_DCCH_MessageType__c1_PR_spare4: - break; - default: - break; + + case DL_DCCH_MessageType__c1_PR_spare1: + case DL_DCCH_MessageType__c1_PR_spare2: + case DL_DCCH_MessageType__c1_PR_spare3: + case DL_DCCH_MessageType__c1_PR_spare4: + break; + + default: + break; } } } @@ -1574,7 +1606,7 @@ int decode_BCCH_DLSCH_Message(u8 Mod_id,u32 frame,u8 eNB_index,u8 *Sdu,u8 Sdu_le message_p = itti_alloc_new_message_sized (TASK_RRC_UE, GENERIC_LOG, message_string_size); memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size); - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_UNKNOWN, Mod_id + NB_eNB_INST, message_p); free(message_string); } diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index a96514b211e58095eabfbc9f0ceb1055d8e204f3..3cbb0797f10376dbc8475db534263a6c4817e6b5 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -539,13 +539,11 @@ void rrc_eNB_process_RRCConnectionSetupComplete (u8 Mod_id, /*------------------------------------------------------------------------------*/ void rrc_eNB_generate_SecurityModeCommand (u8 Mod_id, u32 frame, u16 UE_index) { - uint8_t buffer[100]; uint8_t size; - size = do_SecurityModeCommand (Mod_id, buffer, UE_index, 0, - eNB_rrc_inst[Mod_id].ciphering_algorithm[UE_index], - eNB_rrc_inst[Mod_id].integrity_algorithm[UE_index]); + size = do_SecurityModeCommand(Mod_id, buffer, UE_index, rrc_eNB_get_next_transaction_identifier(Mod_id), + eNB_rrc_inst[Mod_id].ciphering_algorithm[UE_index], eNB_rrc_inst[Mod_id].integrity_algorithm[UE_index]); LOG_I (RRC, "[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate SecurityModeCommand (bytes %d, UE id %d)\n", @@ -2295,7 +2293,9 @@ void rrc_eNB_generate_RRCConnectionSetup (u8 Mod_id, u32 frame, u16 UE_index) { find_UE_RNTI (Mod_id, UE_index)), - UE_index, 0, mac_xface->lte_frame_parms, + UE_index, + rrc_eNB_get_next_transaction_identifier(Mod_id), + mac_xface->lte_frame_parms, SRB_configList, &eNB_rrc_inst[Mod_id]. physicalConfigDedicated[UE_index]); @@ -2528,7 +2528,7 @@ int rrc_eNB_decode_ccch (u8 Mod_id, u32 frame, SRB_INFO * Srb_info) message_p = itti_alloc_new_message_sized (TASK_RRC_ENB, GENERIC_LOG, message_string_size); memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size); - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, message_p); free(message_string); } @@ -2745,7 +2745,7 @@ int rrc_eNB_decode_dcch (u8 Mod_id, u32 frame, u8 Srb_id, u8 UE_index, message_p = itti_alloc_new_message_sized (TASK_RRC_ENB, GENERIC_LOG, message_string_size); memcpy(&message_p->ittiMsg.generic_log, message_string, message_string_size); - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); + itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, message_p); free(message_string); }