diff --git a/openair-cn/S1AP/s1ap_eNB_nas_procedures.c b/openair-cn/S1AP/s1ap_eNB_nas_procedures.c index ad8b0ae86037f647e080c3fce1d9d5433f456177..4ea84070674f93e835c8192ce72b9879f2f2295d 100644 --- a/openair-cn/S1AP/s1ap_eNB_nas_procedures.c +++ b/openair-cn/S1AP/s1ap_eNB_nas_procedures.c @@ -122,9 +122,9 @@ int s1ap_eNB_handle_nas_first_req( DevAssert(ue_desc_p != NULL); /* Keep a reference to the selected MME */ - ue_desc_p->mme_ref = mme_desc_p; - ue_desc_p->rnti = s1ap_nas_first_req_p->rnti; - ue_desc_p->eNB_instance = instance_p; + ue_desc_p->mme_ref = mme_desc_p; + ue_desc_p->ue_initial_id = s1ap_nas_first_req_p->ue_initial_id; + ue_desc_p->eNB_instance = instance_p; do { struct s1ap_eNB_ue_context_s *collision_p; diff --git a/openair-cn/S1AP/s1ap_eNB_ue_context.h b/openair-cn/S1AP/s1ap_eNB_ue_context.h index 87cffac184958bdb1cfd2f8fa25cf8bbbf18957c..121bab37c1ad8545fcea137150a7c5bb3eefcdd0 100644 --- a/openair-cn/S1AP/s1ap_eNB_ue_context.h +++ b/openair-cn/S1AP/s1ap_eNB_ue_context.h @@ -60,8 +60,8 @@ typedef struct s1ap_eNB_ue_context_s { */ unsigned eNB_ue_s1ap_id:24; - /* RNTI of the UE as used on LTE-Uu interface */ - uint16_t rnti; + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; /* Uniquely identifies the UE within MME. Encoded on 32 bits. */ uint32_t mme_ue_s1ap_id; diff --git a/openair2/COMMON/s1ap_messages_types.h b/openair2/COMMON/s1ap_messages_types.h index d6028d336060bc863754122d3411912d773dd4af..f44fbe99923a0081e6f93a39f06912845f8ea905 100644 --- a/openair2/COMMON/s1ap_messages_types.h +++ b/openair2/COMMON/s1ap_messages_types.h @@ -222,8 +222,8 @@ typedef struct s1ap_register_eNB_s { * will be the unique identifier used between RRC and S1AP. */ typedef struct s1ap_nas_first_req_s { - /* RNTI of the mobile */ - uint16_t rnti; + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; /* Establishment cause as sent by UE */ rrc_establishment_cause_t establishment_cause; diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h index 35330c437e9b0e66e2f5676c6f6e7bd01c543993..ecf35ed4f61f19d8770cec75f11b634d043d4ce7 100644 --- a/openair2/RRC/LITE/defs.h +++ b/openair2/RRC/LITE/defs.h @@ -167,6 +167,9 @@ typedef struct{ UE_S_TMSI Initialue_identity_s_TMSI; EstablishmentCause_t establishment_cause; + /* UE id for initial connection to S1AP */ + uint16_t ue_initial_id; + /* Information from S1AP initial_context_setup_req */ unsigned eNB_ue_s1ap_id :24; /* Number of e_rab to be setup in the list */ diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index c36785f2f4831d2b137cdc5b4fc9fb755efdf66a..94be7e67e6d43a9bd097662c9be36a7407dd1c2b 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -450,6 +450,16 @@ static uint8_t get_next_rrc_transaction_identifier(u8 Mod_id) return rrc_transaction_identifier[Mod_id]; } +static uint16_t get_next_ue_initial_id(u8 Mod_id) +{ + static uint16_t ue_initial_id[NUMBER_OF_eNB_MAX]; + + ue_initial_id[Mod_id] = ue_initial_id[Mod_id] + 1; + + return ue_initial_id[Mod_id]; +} + + static u8 get_next_UE_index (u8 Mod_id, u8 *UE_identity) { u8 i, first_index = 255, reg = 0; @@ -1218,7 +1228,8 @@ void rrc_eNB_process_RRCConnectionSetupComplete (u8 Mod_id, MessageDef *message_p; message_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_NAS_FIRST_REQ); - S1AP_NAS_FIRST_REQ (message_p).rnti = eNB_mac_inst[Mod_id].UE_template[UE_index].rnti; // TODO check if this is the correct id to use + eNB_rrc_inst[Mod_id].Info.UE[UE_index].ue_initial_id = get_next_ue_initial_id(Mod_id); + S1AP_NAS_FIRST_REQ (message_p).ue_initial_id = eNB_rrc_inst[Mod_id].Info.UE[UE_index].ue_initial_id; /* Assume that cause is coded in the same way in RRC and S1ap, just check that the value is in S1ap range */ DevCheck(eNB_rrc_inst[Mod_id].Info.UE[UE_index].establishment_cause < RRC_CAUSE_LAST, eNB_rrc_inst[Mod_id].Info.UE[UE_index].establishment_cause, RRC_CAUSE_LAST, Mod_id);