diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c old mode 100644 new mode 100755 index b637a92a96..98a500a23d --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -501,7 +501,9 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, #endif { - if ((ra->Msg2_frame == frameP) && (ra->Msg2_subframe == subframeP)) { + // In case of nFAPI, sometimes timing of eNB and UE become different. + // So if nfapi_mode == 2(VNF) , this function don't check timing to avoid Attach failure. + if (((ra->Msg2_frame == frameP) && (ra->Msg2_subframe == subframeP)) || (nfapi_mode == 2)) { LOG_D(MAC, "[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, state %d\n", module_idP, CC_idP, frameP, subframeP, ra->state); @@ -1010,7 +1012,9 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP, { // This is normal LTE case LOG_D(MAC, "generate_Msg4 1 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR eNB_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP); - if ((ra->Msg4_frame == frameP) && (ra->Msg4_subframe == subframeP)) { + // In case of nFAPI, sometimes timing of eNB and UE become different. + // So if nfapi_mode == 2(VNF) , this function don't check timing to avoid Attach failure. + if (((ra->Msg4_frame == frameP) && (ra->Msg4_subframe == subframeP))||((nfapi_mode == 2)&&(cc->tdd_Config == NULL))) { // Get RRCConnectionSetup for Piggyback /*rrc_sdu_length = mac_rrc_data_req(module_idP, CC_idP, frameP, CCCH, 1, // 1 transport block @@ -1421,7 +1425,9 @@ schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) if (ra->state == MSG2) generate_Msg2(module_idP, CC_id, frameP, subframeP, ra); - else if (ra->state == MSG4 && ra->Msg4_frame == frameP && ra->Msg4_subframe == subframeP ) + // In case of nFAPI, sometimes timing of eNB and UE become different. + // So if nfapi_mode == 2(VNF) , this function don't check timing to avoid Attach failure. + else if ((ra->state == MSG4 && ra->Msg4_frame == frameP && ra->Msg4_subframe == subframeP ) || (nfapi_mode == 2)) generate_Msg4(module_idP, CC_id, frameP, subframeP, ra); else if (ra->state == WAITMSG4ACK) check_Msg4_retransmission(module_idP, CC_id, frameP,