[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-481] Adding Trigger for Ul/Dl data
[o-du/l2.git] / src / phy_stub / phy_stub_msg_hdl.c
index b88a260..e086982 100644 (file)
 #include "phy_stub_utils.h"
 #include "lwr_mac_phy_stub_inf.h"
 
+/*******************************************************************
+ *
+ * @brief start the uplink data
+ *
+ * @details
+ *
+ *    Function : startUlData 
+ *
+ *    Functionality: start the uplink data
+ *
+ * @params[in]   
+ *
+ * @return void
+ *
+ * ****************************************************************/
+
+void startUlData()
+{
+   uint8_t ueIdx=0, drbIdx=0;
+
+   /* Start Pumping data from PHY stub to DU */
+   for(ueIdx=0; ueIdx < phyDb.ueDb.numActvUe; ueIdx++)
+   {
+      for(drbIdx = 0; drbIdx < NUM_DRB_TO_PUMP_DATA; drbIdx++) //Number of DRB times the loop will run
+      {
+         DU_LOG("\nDEBUG  --> PHY STUB: Sending UL User Data[DrbId:%d] for UEIdx %d\n",drbIdx,ueIdx);
+         l1SendUlUserData(drbIdx,ueIdx);
+      }
+   } 
+}
+
 /*******************************************************************
  *
  * @brief Builds and sends param response to MAC CL
@@ -667,6 +698,13 @@ break;
    if(pduInfo->pdu_length)
       MAC_FREE(pduInfo->pduData, pduInfo->pdu_length);
    MAC_FREE(rxDataInd, sizeof(fapi_rx_data_indication_t));
+
+#ifdef START_DL_UL_DATA 
+      if(phyDb.ueDb.ueCb[ueId-1].msgRrcReconfigComp == true)
+      {
+         startUlData();
+      }
+#endif
    return ROK;
 }
 #endif
@@ -732,6 +770,7 @@ uint16_t l1BuildAndSendRachInd(uint16_t slot, uint16_t sfn, uint8_t raPreambleId
    return ROK;
 }
 
+
 /*******************************************************************
  *
  * @brief Builds and Send the Slot Indication message to MAC
@@ -799,6 +838,7 @@ uint16_t l1BuildAndSendSlotIndication()
       }
       CMCHKPK(oduPackPointer, (PTR)slotIndMsg, mBuf);
       ODU_POST_TASK(&pst, mBuf);
+
    }
 #endif
    return ROK;
@@ -1203,7 +1243,7 @@ S16 l1HdlUlTtiReq(uint16_t msgLen, void *msg)
          memset(&ulTtiSlotInd, 0, sizeof(fapi_ul_tti_req_t));
          ulTtiSlotInd.slot = ulTtiReq->slot;
          ulTtiSlotInd.sfn  = ulTtiReq->sfn;
-         ADD_DELTA_TO_TIME(ulTtiSlotInd, ulTtiSlotInd, SLOT_DELAY);
+         ADD_DELTA_TO_TIME(ulTtiSlotInd, ulTtiSlotInd, SLOT_DELAY, MAX_SLOTS);
          l1BuildAndSendUciInd(ulTtiSlotInd.slot, ulTtiSlotInd.sfn, ulTtiReq->pdus[numPdus-1].pdu.pucch_pdu);
       }
       numPdus--;
@@ -1442,7 +1482,7 @@ S16 l1HdlUlDciReq(uint16_t msgLen, void *msg)
    {
       if(ulDciReq->pdus[numPdus-1].pduType == 0)
       {
-        DU_LOG("\nINFO   -->  PHY STUB: Received UL DCI Request for PDCCH PDU");
+         DU_LOG("\nINFO   -->  PHY STUB: Received UL DCI Request for PDCCH PDU");
         //l1BuildAndSendMsg5(ulDciReq->sfn, ulDciReq->slot);
         //msg5Sent = true;
       }