[Task-ID: ODUHIGH-455] Changes to support new L1 20.11
[o-du/l2.git] / src / phy_stub / phy_stub_msg_hdl.c
index 8303333..1b1694d 100644 (file)
@@ -27,7 +27,7 @@
 #include "lwr_mac_fsm.h"
 #include "lwr_mac_phy.h"
 #ifdef INTEL_FAPI
-#include "fapi.h"
+#include "nr5g_fapi_internal.h"
 #include "fapi_vendor_extension.h"
 #endif
 #include "lwr_mac_upr_inf.h"
@@ -387,12 +387,17 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_
    GET_UE_ID(puschPdu.rnti, ueId);
    if(phyDb.ueDb.ueCb[ueId-1].isCFRA)
    {
-      /* In CF-RA in case of handover, RRC Reconfiguration Complete is sent
-       * by UE once RAR is received from DU */
-      phyDb.ueDb.ueCb[ueId-1].ueId = ueId;
-      phyDb.ueDb.ueCb[ueId-1].crnti = puschPdu.rnti;
-      phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp = true;
-      type = MSG_TYPE_RRC_RECONFIG_COMPLETE;
+      if(!phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp)
+      {
+         /* In CF-RA in case of handover, RRC Reconfiguration Complete is sent
+          * by UE once RAR is received from DU */
+         phyDb.ueDb.ueCb[ueId-1].ueId = ueId;
+         phyDb.ueDb.ueCb[ueId-1].crnti = puschPdu.rnti;
+         phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp = true;
+         type = MSG_TYPE_RRC_RECONFIG_COMPLETE;
+      }
+      else
+         return ROK; 
    }
    else
    {
@@ -430,7 +435,7 @@ uint16_t l1BuildAndSendRxDataInd(uint16_t slot, uint16_t sfn, fapi_ul_pusch_pdu_
          type = MSG_TYPE_RRC_RECONFIG_COMPLETE;
       }
       else
-         return RFAILED;
+         return ROK;
    }
 
    MAC_ALLOC(rxDataInd, sizeof(fapi_rx_data_indication_t));