+/*******************************************************************
+ *
+ * @brief Initiates inter DU handover
+ *
+ * @details
+ *
+ * Function : initiateInterDuHandover
+ *
+ * Functionality: Initiates the first procedure of inter-DU
+ * handover i.eG GNB-DU configuration query to source DU
+ *
+ * @params[in] Source DU Id
+ * Target DU Id
+ * UE Id to be handed off
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void initiateInterDuHandover(uint32_t sourceDuId, uint32_t targetDuId, uint32_t ueId)
+{
+ uint8_t duIdx = 0;
+ DuDb *duDb = NULLP;
+ CuUeCb *ueCb = NULLP;
+
+ SEARCH_DU_DB(duIdx, sourceDuId, duDb);
+ if(duDb)
+ ueCb = &duDb->ueCb[ueId-1];
+ if(ueCb)
+ {
+ ueCb->state = UE_HANDOVER_IN_PROGRESS;
+ ueCb->hoInfo.sourceDuId = sourceDuId;
+ ueCb->hoInfo.targetDuId = targetDuId;
+ }
+
+ DU_LOG("\nINFO --> CU_STUB: Inter-DU Handover Started for ueId [%d] from DU ID [%d] to DU ID [%d]", \
+ ueId, sourceDuId, targetDuId);
+ BuildAndSendUeContextModificationReq(sourceDuId, ueCb, QUERY_CONFIG);
+}
+
+/*******************************************************************
+ *
+ * @brief start Dl data
+ *
+ * @details
+ *
+ * Function : startDlData
+ *
+ * Functionality: start the downlink data
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t startDlData()
+{
+ uint32_t teId = 0;
+ uint32_t duId;
+ uint8_t ret = ROK;
+ uint8_t cnt = 0;
+ int32_t totalNumOfTestFlow = 20;
+ EgtpTeIdCb *teidCb = NULLP;
+
+ while(totalNumOfTestFlow)
+ {
+ for(duId = 1; duId<=MAX_DU_SUPPORTED; duId++)
+ {
+ for(teId = 1; teId <= NUM_TUNNEL_TO_PUMP_DATA; teId++)
+ {
+ teidCb = NULLP;
+ cmHashListFind(&(egtpCb.dstCb[duId-1].teIdLst), (uint8_t *)&(teId), sizeof(uint32_t), 0, (PTR *)&teidCb);
+ if(teidCb)
+ {
+ cnt =0;
+ DU_LOG("\nDEBUG --> EGTP: Sending DL User Data(duId %d, teId:%d)\n", duId, teId);
+ while(cnt < NUM_DL_PACKETS)
+ {
+ ret = cuEgtpDatReq(duId, teId);
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> EGTP: Issue with teid=%d\n",teId);
+ break;
+ }
+ /* TODO : sleep(1) will be removed later once we will be able to
+ * support the continuous data pack transfer */
+ sleep(1);
+ cnt++;
+ }
+ }
+ else
+ {
+ DU_LOG("\nDEBUG --> EGTP: TunnelId Not Found for (duId %d, teId:%d)\n", duId, teId);
+ }
+ }
+ }
+ totalNumOfTestFlow--;
+ }
+
+ return ROK;
+}
+