Commit 57755e27 authored by Bing-Kai Hong's avatar Bing-Kai Hong

Check node type for the MAC API calls (find_UE)

parent ba609ca9
...@@ -646,7 +646,7 @@ static void init_MBMS( ...@@ -646,7 +646,7 @@ static void init_MBMS(
#endif #endif
); );
} }
//rrc_mac_config_req(); //rrc_mac_config_req();
} }
} }
#endif #endif
...@@ -1399,18 +1399,21 @@ rrc_eNB_generate_RRCConnectionReestablishment( ...@@ -1399,18 +1399,21 @@ rrc_eNB_generate_RRCConnectionReestablishment(
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCConnectionReestablishment (bytes %d)\n", PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCConnectionReestablishment (bytes %d)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_p->Srb0.Tx_buffer.payload_size); ue_p->Srb0.Tx_buffer.payload_size);
if ( (RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) &&
int UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti); (RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU)&&
if(UE_id != -1){ (RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
// activate release timer, if RRCComplete not received after 100 frames, remove UE int UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti);
RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1; if(UE_id != -1){
// remove UE after 100 frames after RRCConnectionReestablishmentRelease is triggered // activate release timer, if RRCComplete not received after 100 frames, remove UE
RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres = 1000; RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1;
}else{ // remove UE after 100 frames after RRCConnectionReestablishmentRelease is triggered
LOG_E(RRC, RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres = 1000;
PROTOCOL_RRC_CTXT_UE_FMT" Generating RRCConnectionReestablishment without UE_id(MAC) rnti %x\n", }else{
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti); LOG_E(RRC,
} PROTOCOL_RRC_CTXT_UE_FMT" Generating RRCConnectionReestablishment without UE_id(MAC) rnti %x\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti);
}
}
// activate release timer, if RRCComplete not received after 100 frames, remove UE // activate release timer, if RRCComplete not received after 100 frames, remove UE
ue_context_pP->ue_context.ue_reestablishment_timer = 1; ue_context_pP->ue_context.ue_reestablishment_timer = 1;
// remove UE after 100 frames after RRCConnectionReestablishmentRelease is triggered // remove UE after 100 frames after RRCConnectionReestablishmentRelease is triggered
...@@ -2055,6 +2058,9 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject( ...@@ -2055,6 +2058,9 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
if ( (RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) &&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU)&&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
int UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti); int UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti);
if(UE_id != -1){ if(UE_id != -1){
RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1; RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1;
...@@ -2064,7 +2070,7 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject( ...@@ -2064,7 +2070,7 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
PROTOCOL_RRC_CTXT_UE_FMT" Generating RRCConnectionReestablishmentReject without UE_id(MAC) rnti %x\n", PROTOCOL_RRC_CTXT_UE_FMT" Generating RRCConnectionReestablishmentReject without UE_id(MAC) rnti %x\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti);
} }
}
T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti)); T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
...@@ -6248,24 +6254,26 @@ rrc_eNB_decode_ccch( ...@@ -6248,24 +6254,26 @@ rrc_eNB_decode_ccch(
rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP, ue_context_p, CC_id); rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP, ue_context_p, CC_id);
break; break;
} }
int UE_id = find_UE_id(ctxt_pP->module_id, c_rnti); if ( (RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) &&
if(UE_id == -1){ (RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU)&&
(RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
int UE_id = find_UE_id(ctxt_pP->module_id, c_rnti);
if(UE_id == -1){
LOG_E(RRC, LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionReestablishmentRequest without UE_id(MAC) rnti %x, let's reject the UE\n", PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionReestablishmentRequest without UE_id(MAC) rnti %x, let's reject the UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),c_rnti); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),c_rnti);
rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP, ue_context_p, CC_id); rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP, ue_context_p, CC_id);
break; break;
} }
if((RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer > 0) &&
if((RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer > 0) && (RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres > 20)){
(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres > 20)){ LOG_E(RRC,
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RCConnectionReestablishmentComplete(Previous) don't receive, delete the Previous UE\n",
PROTOCOL_RRC_CTXT_UE_FMT" RCConnectionReestablishmentComplete(Previous) don't receive, delete the Previous UE\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1000;
RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 1000; ue_context_p->ue_context.ue_reestablishment_timer = 0;
ue_context_p->ue_context.ue_reestablishment_timer = 0; }
} }
if(ue_context_p->ue_context.ue_reestablishment_timer > 0){ if(ue_context_p->ue_context.ue_reestablishment_timer > 0){
LOG_E(RRC, LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RRRCConnectionReconfigurationComplete(Previous) don't receive, delete the Previous UE\n", PROTOCOL_RRC_CTXT_UE_FMT" RRRCConnectionReconfigurationComplete(Previous) don't receive, delete the Previous UE\n",
...@@ -6790,28 +6798,40 @@ rrc_eNB_decode_dcch( ...@@ -6790,28 +6798,40 @@ rrc_eNB_decode_dcch(
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n", PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
//clear //clear
int16_t UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti); // FIX ME: MAC context does not exist in CU
if(UE_id == -1){ if ((RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) &&
LOG_E(RRC, (RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU)&&
PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionReconfigurationComplete without rnti %x, fault\n", (RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti); int16_t UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti);
break; if(UE_id == -1){
} LOG_E(RRC,
if(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag == 1){ PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionReconfigurationComplete without rnti %x, fault\n",
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti);
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld) C-RNTI Complete\n", break;
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); }
dedicated_DRB = 2;
RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 0; if(RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag == 1){
} LOG_I(RRC,
} else { PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld) C-RNTI Complete\n",
dedicated_DRB = 0; PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
ue_context_p->ue_context.Status = RRC_RECONFIGURED; dedicated_DRB = 2;
LOG_I(RRC, RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 0;
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %ld)\n", }
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); else {
} dedicated_DRB = 0;
ue_context_p->ue_context.reestablishment_xid = -1; ue_context_p->ue_context.Status = RRC_RECONFIGURED;
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
}
} else{
dedicated_DRB = 0;
ue_context_p->ue_context.Status = RRC_RECONFIGURED;
LOG_I(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
}
ue_context_p->ue_context.reestablishment_xid = -1;
} else { } else {
dedicated_DRB = 1; dedicated_DRB = 1;
ue_context_p->ue_context.Status = RRC_RECONFIGURED; ue_context_p->ue_context.Status = RRC_RECONFIGURED;
...@@ -6819,6 +6839,7 @@ rrc_eNB_decode_dcch( ...@@ -6819,6 +6839,7 @@ rrc_eNB_decode_dcch(
PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n", PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier);
} }
}
rrc_eNB_process_RRCConnectionReconfigurationComplete( rrc_eNB_process_RRCConnectionReconfigurationComplete(
ctxt_pP, ctxt_pP,
...@@ -6955,16 +6976,20 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) { ...@@ -6955,16 +6976,20 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
break; break;
} }
//clear //clear
int UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti); if ((RC.rrc[ctxt_pP->module_id]->node_type != ngran_eNB_CU) &&
if(UE_id == -1){ (RC.rrc[ctxt_pP->module_id]->node_type != ngran_ng_eNB_CU)&&
LOG_E(RRC, (RC.rrc[ctxt_pP->module_id]->node_type != ngran_gNB_CU) ) {
PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionReestablishmentComplete without UE_id(MAC) rnti %x, fault\n", int UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti);
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti); if(UE_id == -1){
break; LOG_E(RRC,
} PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionReestablishmentComplete without UE_id(MAC) rnti %x, fault\n",
RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0; PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ctxt_pP->rnti);
ue_context_p->ue_context.ue_reestablishment_timer = 0; break;
}
RC.mac[ctxt_pP->module_id]->UE_list.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer = 0;
ue_context_p->ue_context.ue_reestablishment_timer = 0;
}
if (ul_dcch_msg->message.choice.c1.choice.rrcConnectionReestablishmentComplete.criticalExtensions.present == if (ul_dcch_msg->message.choice.c1.choice.rrcConnectionReestablishmentComplete.criticalExtensions.present ==
RRCConnectionReestablishmentComplete__criticalExtensions_PR_rrcConnectionReestablishmentComplete_r8) { RRCConnectionReestablishmentComplete__criticalExtensions_PR_rrcConnectionReestablishmentComplete_r8) {
rrc_eNB_process_RRCConnectionReestablishmentComplete(ctxt_pP, reestablish_rnti, ue_context_p, rrc_eNB_process_RRCConnectionReestablishmentComplete(ctxt_pP, reestablish_rnti, ue_context_p,
......
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