+/*******************************************************************
+*
+* @brief Fill and Send UE Reset response from MAC to DU APP
+*
+* @details
+*
+* Function : MacSendUeResetRsp
+*
+* Functionality: Fill and Send UE Reset response from MAC to DUAPP
+*
+* @params[in] MAC UE Reset result
+* SCH UE Reset response
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+
+uint8_t MacSendUeResetRsp(uint16_t cellId, uint16_t ueId, CauseOfResult status)
+{
+ MacUeResetRsp *ResetRsp;
+ Pst rspPst;
+
+ MAC_ALLOC_SHRABL_BUF(ResetRsp, sizeof(MacUeResetRsp));
+ if(!ResetRsp)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation for UE Reset response failed");
+ return RFAILED;
+ }
+
+ /* Filling UE Reset response */
+ ResetRsp->cellId = cellId;
+ ResetRsp->ueId = ueId;
+ ResetRsp->status = status;
+
+ /* Fill Post structure and send UE Reset response*/
+ memset(&rspPst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_DUAPP(rspPst, EVENT_MAC_UE_RESET_RSP);
+ return (*macDuUeResetRspOpts[rspPst.selector])(&rspPst, ResetRsp);
+}
+
+/*******************************************************************
+ *
+ * @brief Handles UE Reset request from DU APP
+ *
+ * @details
+ *
+ * Function : MacProcUeResetReq
+ *
+ * Functionality: Handles UE Reset requst from DU APP
+ *
+ * @params[in] Pst *pst, MacUeResetReq *ueReset
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t MacProcUeResetReq(Pst *pst, MacUeResetReq *ueReset)
+{
+ uint8_t cellIdx=0;
+ CauseOfResult status =SUCCESSFUL;
+ MacUeCb *ueCb = NULLP;
+ MacCellCb *cellCb = NULLP;
+
+ DU_LOG("\nINFO --> MAC : UE Reset Request received for ueId[%d]", ueReset->ueId);
+
+ if(ueReset)
+ {
+ GET_CELL_IDX(ueReset->cellId, cellIdx);
+ cellCb = macCb.macCell[cellIdx];
+ if(cellCb)
+ {
+ ueCb = &cellCb->ueCb[ueReset->ueId-1];
+ if(ueCb->ueId == ueReset->ueId)
+ {
+ /* TODO := complete the processing of UE reset request*/
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcUeResetReq(): UE ID [%d] not found in Cell Id [%d]", ueCb->ueId , ueReset->cellId);
+ status = UEID_INVALID;
+ }
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcUeResetReq(): Cell Id [%d] not found ",ueReset->cellId);
+ status = CELLID_INVALID;
+ }
+
+ MacSendUeResetRsp(ueReset->cellId, ueReset->ueId, status);
+ MAC_FREE_SHRABL_BUF(pst->region, pst->pool, ueReset, sizeof(MacUeResetReq));
+ }
+ else
+ {
+ DU_LOG("\nERROR --> MAC : MacProcUeResetReq(): MAC UE reset request processing failed");
+ return RFAILED;
+ }
+ return ROK;
+}