[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[o-du/l2.git] / src / 5gnrmac / lwr_mac_handle_phy.c
index 7e9d54e..5c22704 100644 (file)
@@ -20,7 +20,7 @@
 #include "common_def.h"
 #include "lrg.h"
 #ifdef INTEL_FAPI
-#include "fapi.h"
+#include "nr5g_fapi_internal.h"
 #include "fapi_vendor_extension.h"
 #endif
 
@@ -106,15 +106,14 @@ uint8_t procSlotInd(fapi_slot_ind_t *fapiSlotInd)
    /* fill Pst structure to send to lwr_mac to MAC */
    Pst pst;
    uint16_t ret = 0;
-   SlotIndInfo *slotInd = {0};
+   SlotTimingInfo *slotInd = {0};
 
-   MAC_ALLOC_SHRABL_BUF(slotInd, sizeof(SlotIndInfo));
+   MAC_ALLOC_SHRABL_BUF(slotInd, sizeof(SlotTimingInfo));
    if(slotInd)
    {
       slotInd->cellId = lwrMacCb.cellCb[0].cellId; 
       slotInd->sfn = fapiSlotInd->sfn;
       slotInd->slot = fapiSlotInd->slot;
-
       FILL_PST_LWR_MAC_TO_MAC(pst, EVENT_SLOT_IND_TO_MAC);
       pst.selector = ODU_SELECTOR_LWLC;
       ret = (*sendSlotIndOpts[pst.selector])(&pst, slotInd);
@@ -188,18 +187,18 @@ uint8_t procRachInd(fapi_rach_indication_t  *fapiRachInd)
    RachPduInfo  *rachPdu = NULLP;
    RachInd      *rachInd = NULLP;
 
-   MAC_ALLOC_SHRABL_BUF(rachInd, sizeof(RachInd));
-   if(!rachInd)
-   {
-      DU_LOG("\nERROR  -->  LWR_MAC : Memory Allocation failed in procRachInd");
-      return RFAILED;
-   }
    if(!fapiRachInd->numPdus)
    {
       DU_LOG("\nDEBUG  -->  LWR_MAC : No PDU in RACH.indication at [%d, %d]", fapiRachInd->sfn, fapiRachInd->slot);
       return ROK;
    }
 
+   MAC_ALLOC_SHRABL_BUF(rachInd, sizeof(RachInd));
+   if(!rachInd)
+   {
+      DU_LOG("\nERROR  -->  LWR_MAC : Memory Allocation failed in procRachInd");
+      return RFAILED;
+   }
    rachInd->cellId = lwrMacCb.cellCb[0].cellId;
    rachInd->timingInfo.sfn = fapiRachInd->sfn;
    rachInd->timingInfo.slot = fapiRachInd->slot;
@@ -477,6 +476,66 @@ uint8_t procUciInd(fapi_uci_indication_t  *fapiUciInd)
 }
 #endif /* FAPI */
 
+#ifdef CALL_FLOW_DEBUG_LOG 
+/*******************************************************************
+ * @brief Function prints src, dest, msg infor about all the msgs that
+ received.
+ *
+ * @details
+ *
+ *     Function :callFlowFromPhyToLwrMac 
+ *
+ *     Function call Flow From Phy To LwrMac
+ *
+ *  @param[in]  Pst     *pst, Post structure of the primitive.
+ *
+ *  @return  void
+ * ****************************************************************/
+void callFlowFromPhyToLwrMac(uint16_t msgId)
+{
+   char message[100];
+   switch(msgId)
+   {
+#ifdef INTEL_TIMER_MODE
+      case FAPI_VENDOR_EXT_UL_IQ_SAMPLES:
+         strcpy(message,"FAPI_VENDOR_EXT_UL_IQ_SAMPLES");
+         break;
+#endif
+      case FAPI_PARAM_RESPONSE:
+         strcpy(message,"FAPI_PARAM_RESPONSE");
+         break;
+      case FAPI_CONFIG_RESPONSE:
+         strcpy(message,"FAPI_CONFIG_RESPONSE");
+         break;
+      case FAPI_SLOT_INDICATION:
+         strcpy(message,"FAPI_SLOT_INDICATION");
+         break;
+      case FAPI_ERROR_INDICATION:
+         strcpy(message,"FAPI_ERROR_INDICATION");
+         break;
+      case FAPI_RX_DATA_INDICATION:
+         strcpy(message,"FAPI_RX_DATA_INDICATION");
+         break;
+      case FAPI_CRC_INDICATION:
+         strcpy(message,"FAPI_CRC_INDICATION");
+         break;
+      case FAPI_UCI_INDICATION:
+         strcpy(message,"FAPI_UCI_INDICATION");
+         break;
+      case FAPI_SRS_INDICATION:
+         strcpy(message,"FAPI_SRS_INDICATION");
+         break;
+      case FAPI_RACH_INDICATION:
+         strcpy(message,"FAPI_RACH_INDICATION");
+         break;
+      case FAPI_STOP_INDICATION:
+         strcpy(message,"FAPI_STOP_INDICATION");
+         break;
+   }
+   DU_LOG("\nCall Flow: PHY -> ENTLWRMAC : %s\n",message);
+}
+#endif
+
 /*******************************************************************
  *
  * @brief Processes message from PHY
@@ -499,6 +558,10 @@ void procPhyMessages(uint16_t msgType, uint32_t msgSize, void *msg)
    fapi_msg_t *header = NULLP;
    header = (fapi_msg_t *)msg;
 
+#ifdef CALL_FLOW_DEBUG_LOG 
+   callFlowFromPhyToLwrMac(header->msg_id);
+#endif
+
    switch(header->msg_id)
    {
 #ifdef INTEL_TIMER_MODE