Commit 7e4aacab authored by winckel's avatar winckel

Fixed an issue with RRC S1AP ids.

Change log level of ITTI message receiption.
Replace failure message by   S1AP_NAS_NON_DELIVERY_IND when processing S1AP_DOWNLINK_NAS.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4510 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent bb7f0252
......@@ -1297,7 +1297,7 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire
switch (ITTI_MSG_ID(msg_p)) {
case RRC_MAC_CCCH_DATA_REQ:
LOG_D(MAC, "Received %s from %s: instance %d, frame %d, eNB_index %d\n",
LOG_I(MAC, "Received %s from %s: instance %d, frame %d, eNB_index %d\n",
msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
RRC_MAC_CCCH_DATA_REQ (msg_p).frame, RRC_MAC_CCCH_DATA_REQ (msg_p).enb_index);
......
......@@ -508,7 +508,7 @@ void pdcp_run (u32_t frame, u8 eNB_flag, u8 UE_index, u8 eNB_index) {
switch (ITTI_MSG_ID(msg_p)) {
case RRC_DCCH_DATA_REQ:
LOG_D(PDCP, "Received %s from %s: instance %d, frame %d, eNB_flag %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
LOG_I(PDCP, "Received %s from %s: instance %d, frame %d, eNB_flag %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
msg_name, ITTI_MSG_ORIGIN_NAME(msg_p), instance,
RRC_DCCH_DATA_REQ (msg_p).frame, RRC_DCCH_DATA_REQ (msg_p).enb_flag, RRC_DCCH_DATA_REQ (msg_p).rb_id,
RRC_DCCH_DATA_REQ (msg_p).muip, RRC_DCCH_DATA_REQ (msg_p).confirmp, RRC_DCCH_DATA_REQ (msg_p).mode);
......
......@@ -182,7 +182,7 @@ typedef struct eNB_RRC_UE_INFO_s {
uint16_t ue_initial_id;
/* Information from S1AP initial_context_setup_req */
unsigned eNB_ue_s1ap_id :24;
uint32_t eNB_ue_s1ap_id :24;
/* Number of e_rab to be setup in the list */
uint8_t nb_of_e_rabs;
/* Index of e_rab to be setup in the list */
......@@ -197,7 +197,7 @@ typedef struct eNB_RRC_INFO_s {
uint8_t Nb_ue;
/* UE list for UE index allocation */
uint8_t UE_list[NUMBER_OF_UE_MAX][5];
uint64_t UE_list[NUMBER_OF_UE_MAX];
/* Information on UE */
eNB_RRC_UE_INFO UE[NUMBER_OF_UE_MAX];
......
......@@ -2272,12 +2272,12 @@ void *rrc_ue_task(void *args_p) {
break;
case MESSAGE_TEST:
LOG_D(RRC, "Received %s\n", msg_name);
LOG_I(RRC, "Received %s\n", msg_name);
break;
/* MAC messages */
case RRC_MAC_IN_SYNC_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
RRC_MAC_IN_SYNC_IND (msg_p).frame, RRC_MAC_IN_SYNC_IND (msg_p).enb_index);
UE_rrc_inst[Mod_id].Info[RRC_MAC_IN_SYNC_IND (msg_p).enb_index].N310_cnt = 0;
......@@ -2286,14 +2286,14 @@ void *rrc_ue_task(void *args_p) {
break;
case RRC_MAC_OUT_OF_SYNC_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
RRC_MAC_OUT_OF_SYNC_IND (msg_p).frame, RRC_MAC_OUT_OF_SYNC_IND (msg_p).enb_index);
UE_rrc_inst[Mod_id].Info[RRC_MAC_OUT_OF_SYNC_IND (msg_p).enb_index].N310_cnt ++;
break;
case RRC_MAC_BCCH_DATA_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
RRC_MAC_BCCH_DATA_IND (msg_p).frame, RRC_MAC_BCCH_DATA_IND (msg_p).enb_index);
decode_BCCH_DLSCH_Message (Mod_id, RRC_MAC_BCCH_DATA_IND (msg_p).frame,
......@@ -2302,7 +2302,7 @@ void *rrc_ue_task(void *args_p) {
break;
case RRC_MAC_CCCH_DATA_CNF:
LOG_D(RRC, "Received %s: instance %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, eNB %d\n", msg_name, instance,
RRC_MAC_CCCH_DATA_CNF (msg_p).enb_index);
// reset the tx buffer to indicate RRC that ccch was successfully transmitted (for example if contention resolution succeeds)
......@@ -2310,7 +2310,7 @@ void *rrc_ue_task(void *args_p) {
break;
case RRC_MAC_CCCH_DATA_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d\n", msg_name, instance,
RRC_MAC_CCCH_DATA_IND (msg_p).frame, RRC_MAC_CCCH_DATA_IND (msg_p).enb_index);
srb_info_p = &UE_rrc_inst[Mod_id].Srb0[RRC_MAC_CCCH_DATA_IND (msg_p).enb_index];
......@@ -2324,7 +2324,7 @@ void *rrc_ue_task(void *args_p) {
#ifdef Rel10
case RRC_MAC_MCCH_DATA_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d, eNB %d, mbsfn SA %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d, eNB %d, mbsfn SA %d\n", msg_name, instance,
RRC_MAC_MCCH_DATA_IND (msg_p).frame, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index, RRC_MAC_MCCH_DATA_IND (msg_p).mbsfn_sync_area);
decode_MCCH_Message (Mod_id, RRC_MAC_MCCH_DATA_IND (msg_p).frame, RRC_MAC_MCCH_DATA_IND (msg_p).enb_index,
......@@ -2335,7 +2335,7 @@ void *rrc_ue_task(void *args_p) {
/* PDCP messages */
case RRC_DCCH_DATA_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d, DCCH %d, UE %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d, DCCH %d, UE %d\n", msg_name, instance,
RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index, RRC_DCCH_DATA_IND (msg_p).ue_index);
rrc_ue_decode_dcch (Mod_id, RRC_DCCH_DATA_IND (msg_p).frame,
......@@ -2352,7 +2352,7 @@ void *rrc_ue_task(void *args_p) {
uint32_t length;
uint8_t *buffer;
LOG_D(RRC, "Received %s: instance %d, UEid %d\n", msg_name, instance, NAS_UPLINK_DATA_REQ (msg_p).UEid);
LOG_I(RRC, "Received %s: instance %d, UEid %d\n", msg_name, instance, NAS_UPLINK_DATA_REQ (msg_p).UEid);
/* Create message for PDCP (ULInformationTransfer_t) */
length = do_ULInformationTransfer(&buffer, NAS_UPLINK_DATA_REQ (msg_p).nasMsg.length, NAS_UPLINK_DATA_REQ (msg_p).nasMsg.data);
......
......@@ -479,19 +479,15 @@ uint8_t rrc_eNB_get_next_transaction_identifier(uint8_t Mod_id)
static uint8_t rrc_eNB_get_next_free_UE_index (uint8_t Mod_id, uint8_t *UE_identity)
{
uint8_t i, first_index = UE_INDEX_INVALID, reg = 0;
static const uint8_t null_identity[5] =
{0, 0, 0, 0, 0};
DevCheck(Mod_id < NB_eNB_INST, Mod_id, NB_eNB_INST, 0);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
if ((first_index == UE_INDEX_INVALID)
&& (memcmp (eNB_rrc_inst[Mod_id].Info.UE_list[i], null_identity, sizeof(eNB_rrc_inst[0].Info.UE_list[i])))
== 0) {
if ((first_index == UE_INDEX_INVALID) && (eNB_rrc_inst[Mod_id].Info.UE_list[i] == 0)) {
first_index = i; // save first free position
}
if (memcmp (eNB_rrc_inst[Mod_id].Info.UE_list[i], UE_identity, sizeof(eNB_rrc_inst[0].Info.UE_list[i])) == 0) {
if (memcmp (&eNB_rrc_inst[Mod_id].Info.UE_list[i], UE_identity, sizeof(eNB_rrc_inst[0].Info.UE_list[i])) == 0) {
// UE_identity already registered
reg = 1;
}
......@@ -511,9 +507,9 @@ void rrc_eNB_free_UE_index (uint8_t Mod_id, uint8_t UE_id)
DevCheck(Mod_id < NB_eNB_INST, Mod_id, UE_id, NB_eNB_INST);
DevCheck(UE_id < NUMBER_OF_UE_MAX, Mod_id, UE_id, NUMBER_OF_UE_MAX);
LOG_I (RRC, "Removing UE %d\n", UE_id);
LOG_I (RRC, "Removing UE %d 0x%" PRIx64 "\n", UE_id, eNB_rrc_inst[Mod_id].Info.UE_list[UE_id]);
eNB_rrc_inst[Mod_id].Info.UE[UE_id].Status = RRC_IDLE;
memset(eNB_rrc_inst[Mod_id].Info.UE_list[UE_id], 0, sizeof(eNB_rrc_inst[0].Info.UE_list[0]));
eNB_rrc_inst[Mod_id].Info.UE_list[UE_id] = 0;
}
/*------------------------------------------------------------------------------*/
......@@ -1155,7 +1151,7 @@ void rrc_eNB_generate_HandoverPreparationInformation (u8 Mod_id, u32 frame, u8 U
if (mod_id_target != 0xFF) {
//UE_id_target = rrc_find_free_ue_index(modid_target);
UE_id_target = rrc_eNB_get_next_free_UE_index(mod_id_target,(u8 *)eNB_rrc_inst[Mod_id].Info.UE_list[UE_index]); //this should return a new index
UE_id_target = rrc_eNB_get_next_free_UE_index(mod_id_target,(u8 *) &eNB_rrc_inst[Mod_id].Info.UE_list[UE_index]); //this should return a new index
if (UE_id_target!=0xFF) {
LOG_N(RRC,"[eNB %d] Frame %d : Emulate sending HandoverPreparationInformation msg from eNB source %d to eNB target %d: source UE_id %d target UE_id %d source_modId: %d target_modId: %d\n",Mod_id,frame,eNB_rrc_inst[Mod_id].physCellId,targetPhyId,UE_index,UE_id_target,Mod_id,mod_id_target);
......@@ -2576,14 +2572,9 @@ for (i = 0; i < 8; i++)
memcpy (&eNB_rrc_inst[Mod_id].Info.UE_list[UE_index],
(u8 *) rrcConnectionRequest->ue_Identity.choice.randomValue.buf, 5);
LOG_I (RRC,
"[eNB %d] Frame %d : Accept new connection from UE %d (%x%x%x%x%x)\n",
LOG_I (RRC, "[eNB %d] Frame %d : Accept new connection from UE %d (0x%" PRIx64 ")\n",
Mod_id, frame, UE_index,
eNB_rrc_inst[Mod_id].Info.UE_list[UE_index][0],
eNB_rrc_inst[Mod_id].Info.UE_list[UE_index][1],
eNB_rrc_inst[Mod_id].Info.UE_list[UE_index][2],
eNB_rrc_inst[Mod_id].Info.UE_list[UE_index][3],
eNB_rrc_inst[Mod_id].Info.UE_list[UE_index][4]);
eNB_rrc_inst[Mod_id].Info.UE_list[UE_index]);
//CONFIG SRB2 (DCCHs, ONE per User) //meas && lchan Cfg
//eNB_rrc_inst[Mod_id].Info.Dtch_bd_config[UE_index].Status=NEED_RADIO_CONFIG;
......@@ -3029,12 +3020,12 @@ void *rrc_enb_task(void *args_p) {
break;
case MESSAGE_TEST:
LOG_D(RRC, "Received %s\n", msg_name);
LOG_I(RRC, "Received %s\n", msg_name);
break;
/* Messages from MAC */
case RRC_MAC_CCCH_DATA_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d,\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d,\n", msg_name, instance,
RRC_MAC_CCCH_DATA_IND (msg_p).frame);
srb_info_p = &eNB_rrc_inst[instance].Srb0;
......@@ -3047,7 +3038,7 @@ void *rrc_enb_task(void *args_p) {
/* Messages from PDCP */
case RRC_DCCH_DATA_IND:
LOG_D(RRC, "Received %s: instance %d, frame %d, DCCH %d, UE %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, frame %d, DCCH %d, UE %d\n", msg_name, instance,
RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index, RRC_DCCH_DATA_IND (msg_p).ue_index);
rrc_eNB_decode_dcch (instance, RRC_DCCH_DATA_IND (msg_p).frame, RRC_DCCH_DATA_IND (msg_p).dcch_index,
......
......@@ -82,15 +82,15 @@ static uint16_t get_next_ue_initial_id(uint8_t mod_id) {
*/
static uint8_t get_UE_index_from_initial_id(uint8_t mod_id, uint16_t ue_initial_id) {
uint8_t ue_index;
static const uint8_t null_identity[5] =
{0, 0, 0, 0, 0};
DevCheck(mod_id < NB_eNB_INST, mod_id, NB_eNB_INST, 0);
LOG_I(RRC, "get_UE_index_from_initial_id eNB %d, ue_initial_id %d\n", mod_id, ue_initial_id);
for (ue_index = 0; ue_index < NUMBER_OF_UE_MAX; ue_index++) {
/* Check if this UE is in use */
if (memcmp (eNB_rrc_inst[mod_id].Info.UE_list[ue_index], null_identity,
sizeof(eNB_rrc_inst[0].Info.UE_list[ue_index])) != 0) {
LOG_I(RRC, " UE %d: 0x%" PRIx64 " %d\n", ue_index, eNB_rrc_inst[mod_id].Info.UE_list[ue_index], eNB_rrc_inst[mod_id].Info.UE[ue_index].ue_initial_id);
if (eNB_rrc_inst[mod_id].Info.UE_list[ue_index] != 0) {
/* Check if the initial id match */
if (eNB_rrc_inst[mod_id].Info.UE[ue_index].ue_initial_id == ue_initial_id) {
return ue_index;
......@@ -100,23 +100,23 @@ static uint8_t get_UE_index_from_initial_id(uint8_t mod_id, uint16_t ue_initial_
return UE_INDEX_INVALID;
}
/*! \fn uint8_t get_UE_index_from_eNB_ue_s1ap_id(uint8_t mod_id, uint16_t eNB_ue_s1ap_id)
/*! \fn uint8_t get_UE_index_from_eNB_ue_s1ap_id(uint8_t mod_id, uint32_t eNB_ue_s1ap_id)
*\brief retrieve UE index in the eNB from the eNB_ue_s1ap_id previously transmitted by S1AP.
*\param mod_id Instance ID of eNB.
*\param eNB_ue_s1ap_id The value sent by S1AP.
*\return the UE index or UE_INDEX_INVALID if not found.
*/
static uint8_t get_UE_index_from_eNB_ue_s1ap_id(uint8_t mod_id, uint16_t eNB_ue_s1ap_id) {
static uint8_t get_UE_index_from_eNB_ue_s1ap_id(uint8_t mod_id, uint32_t eNB_ue_s1ap_id) {
uint8_t ue_index;
static const uint8_t null_identity[5] =
{0, 0, 0, 0, 0};
DevCheck(mod_id < NB_eNB_INST, mod_id, NB_eNB_INST, 0);
LOG_I(RRC, "get_UE_index_from_eNB_ue_s1ap_id eNB %d, eNB_ue_s1ap_id %d\n", mod_id, eNB_ue_s1ap_id);
for (ue_index = 0; ue_index < NUMBER_OF_UE_MAX; ue_index++) {
/* Check if this UE is in use */
if (memcmp (eNB_rrc_inst[mod_id].Info.UE_list[ue_index], null_identity,
sizeof(eNB_rrc_inst[0].Info.UE_list[ue_index])) != 0) {
LOG_I(RRC, " UE %d: 0x%" PRIx64 " %d\n", ue_index, eNB_rrc_inst[mod_id].Info.UE_list[ue_index], eNB_rrc_inst[mod_id].Info.UE[ue_index].eNB_ue_s1ap_id);
if (eNB_rrc_inst[mod_id].Info.UE_list[ue_index] != 0) {
/* Check if the initial id match */
if (eNB_rrc_inst[mod_id].Info.UE[ue_index].eNB_ue_s1ap_id == eNB_ue_s1ap_id) {
return ue_index;
......@@ -126,7 +126,7 @@ static uint8_t get_UE_index_from_eNB_ue_s1ap_id(uint8_t mod_id, uint16_t eNB_ue_
return UE_INDEX_INVALID;
}
/*! \fn uint8_t get_UE_index_from_s1ap_ids(uint8_t mod_id, uint16_t ue_initial_id, uint16_t eNB_ue_s1ap_id)
/*! \fn uint8_t get_UE_index_from_s1ap_ids(uint8_t mod_id, uint16_t ue_initial_id, uint32_t eNB_ue_s1ap_id)
*\brief retrieve UE index in the eNB from the UE initial ID if not equal to UE_INDEX_INVALID or
*\brief from the eNB_ue_s1ap_id previously transmitted by S1AP.
*\param mod_id Instance ID of eNB.
......@@ -134,7 +134,7 @@ static uint8_t get_UE_index_from_eNB_ue_s1ap_id(uint8_t mod_id, uint16_t eNB_ue_
*\param eNB_ue_s1ap_id The value sent by S1AP.
*\return the UE index or UE_INDEX_INVALID if not found.
*/
static uint8_t get_UE_index_from_s1ap_ids(uint8_t mod_id, uint16_t ue_initial_id, uint16_t eNB_ue_s1ap_id) {
static uint8_t get_UE_index_from_s1ap_ids(uint8_t mod_id, uint16_t ue_initial_id, uint32_t eNB_ue_s1ap_id) {
uint8_t ue_index;
if (ue_initial_id == UE_INITIAL_ID_INVALID) {
......@@ -318,7 +318,7 @@ int rrc_eNB_process_S1AP_DOWNLINK_NAS(MessageDef *msg_p, const char *msg_name, i
ue_index = get_UE_index_from_s1ap_ids (instance, S1AP_DOWNLINK_NAS (msg_p).ue_initial_id,
S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id);
LOG_D(RRC, "Received %s: instance %d, ue_initial_id %d, eNB_ue_s1ap_id %d, ue_index %d\n", msg_name, instance,
LOG_I(RRC, "Received %s: instance %d, ue_initial_id %d, eNB_ue_s1ap_id %d, ue_index %d\n", msg_name, instance,
S1AP_DOWNLINK_NAS (msg_p).ue_initial_id, S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id, ue_index);
if (ue_index == UE_INDEX_INVALID) {
......@@ -328,8 +328,12 @@ int rrc_eNB_process_S1AP_DOWNLINK_NAS(MessageDef *msg_p, const char *msg_name, i
LOG_W(RRC, "In S1AP_DOWNLINK_NAS: unknown UE from S1AP ids (%d, %d) for eNB %d\n", S1AP_DOWNLINK_NAS (msg_p).ue_initial_id,
S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id, instance);
msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_INITIAL_CONTEXT_SETUP_FAIL); // TODO change message!
S1AP_INITIAL_CONTEXT_SETUP_FAIL (msg_fail_p).eNB_ue_s1ap_id = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).eNB_ue_s1ap_id;
msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_NAS_NON_DELIVERY_IND);
S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id;
S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.length = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length;
S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.buffer = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer;
// TODO add failure cause when defined!
itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p);
......@@ -356,7 +360,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
ue_index = get_UE_index_from_s1ap_ids (instance, S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).ue_initial_id,
S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).eNB_ue_s1ap_id);
LOG_D(RRC, "Received %s: instance %d, ue_initial_id %d, eNB_ue_s1ap_id %d, nb_of_e_rabs %d, ue_index %d\n",
LOG_I(RRC, "Received %s: instance %d, ue_initial_id %d, eNB_ue_s1ap_id %d, nb_of_e_rabs %d, ue_index %d\n",
msg_name, instance, S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).ue_initial_id,
S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).eNB_ue_s1ap_id, S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).nb_of_e_rabs, ue_index);
......
......@@ -450,7 +450,7 @@ void *l2l1_task(void *args_p) {
break;
case MESSAGE_TEST:
LOG_D(EMU, "Received %s\n", ITTI_MSG_NAME(message_p));
LOG_I(EMU, "Received %s\n", ITTI_MSG_NAME(message_p));
break;
default:
......
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