+}
+
+/*******************************************************************
+ *
+ * @brief Function for cellCb Deletion
+ *
+ * @details
+ *
+ * Function : deleteSchCellCb
+ *
+ * Functionality: Function for cellCb Deletion
+ *
+ * @params[in] SchCellDelete *cellDelete
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+void deleteSchCellCb(SchCellCb *cellCb)
+{
+ uint8_t sliceIdx=0, slotIdx=0, plmnIdx = 0;
+ CmLListCp *list=NULL;
+ CmLList *node=NULL, *next=NULL;
+ SchPageInfo *tempNode = NULLP;
+
+ if(cellCb->schDlSlotInfo)
+ {
+ for(slotIdx=0; slotIdx<cellCb->numSlots; slotIdx++)
+ {
+ list = &cellCb->schDlSlotInfo[slotIdx]->prbAlloc.freePrbBlockList;
+ node = list->first;
+ while(node)
+ {
+ next = node->next;
+ SCH_FREE(node->node, sizeof(FreePrbBlock));
+ deleteNodeFromLList(list, node);
+ node = next;
+ }
+ SCH_FREE(cellCb->schDlSlotInfo[slotIdx], sizeof(SchDlSlotInfo));
+ }
+ SCH_FREE(cellCb->schDlSlotInfo, cellCb->numSlots *sizeof(SchDlSlotInfo*));
+ }
+
+ if(cellCb->schUlSlotInfo)
+ {
+ for(slotIdx=0; slotIdx<cellCb->numSlots; slotIdx++)
+ {
+ list = &cellCb->schUlSlotInfo[slotIdx]->prbAlloc.freePrbBlockList;
+ node = list->first;
+ while(node)
+ {
+ next = node->next;
+ SCH_FREE(node->node, sizeof(FreePrbBlock));
+ deleteNodeFromLList(list, node);
+ node = next;
+ }
+ SCH_FREE(cellCb->schUlSlotInfo[slotIdx], sizeof(SchUlSlotInfo));
+ }
+ SCH_FREE(cellCb->schUlSlotInfo, cellCb->numSlots * sizeof(SchUlSlotInfo*));
+ }
+
+ for(plmnIdx = 0; plmnIdx < MAX_PLMN; plmnIdx++)
+ {
+ if(cellCb->cellCfg.plmnInfoList[plmnIdx].snssai)
+ {
+ for(sliceIdx=0; sliceIdx<cellCb->cellCfg.plmnInfoList[plmnIdx].numSliceSupport; sliceIdx++)
+ {
+ SCH_FREE(cellCb->cellCfg.plmnInfoList[plmnIdx].snssai[sliceIdx], sizeof(Snssai));
+ }
+ SCH_FREE(cellCb->cellCfg.plmnInfoList[plmnIdx].snssai, cellCb->cellCfg.plmnInfoList[plmnIdx].numSliceSupport*sizeof(Snssai*));
+ }
+ }
+
+ for(uint16_t idx =0; idx<MAX_SFN; idx++)
+ {
+ list = &cellCb->pageCb.pageIndInfoRecord[idx];
+ node = list->first;
+ while(node)
+ {
+ next = node->next;
+ if(node->node)
+ {
+ tempNode = (SchPageInfo*)(node->node);
+ SCH_FREE(tempNode->pagePdu, tempNode->msgLen);
+ SCH_FREE(node->node, sizeof(SchPageInfo));
+ }
+ deleteNodeFromLList(list, node);
+ node = next;
+ }
+ }
+
+ cellCb->api->SchCellDeleteReq(cellCb);
+
+ memset(cellCb, 0, sizeof(SchCellCb));
+}
+
+/*******************************************************************
+ *
+ * @brief Function for cell Delete request from MAC to SCH
+ *
+ * @details
+ *
+ * Function : SchProcCellDeleteReq
+ *
+ * Functionality: Function for cell Delete request from MAC to SCH
+ *
+ * @params[in] Pst *pst, SchCellDelete *cellDelete
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t SchProcCellDeleteReq(Pst *pst, SchCellDeleteReq *cellDelete)
+{
+ uint8_t cellIdx=0, ret = RFAILED;
+ Inst inst = pst->dstInst - SCH_INST_START;
+ SchMacRsp result= RSP_OK;
+
+ if(!cellDelete)
+ {
+ DU_LOG("\nERROR --> SCH : SchProcCellDeleteReq(): Ue Delete request failed");
+ }
+ else
+ {
+ GET_CELL_IDX(cellDelete->cellId, cellIdx);
+ if(schCb[inst].cells[cellIdx] == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH : SchProcCellDeleteReq(): cell Id[%d] is not available", cellDelete->cellId);
+ result = RSP_NOK;
+ }
+ else
+ {
+ if(schCb[inst].cells[cellIdx]->cellId == cellDelete->cellId)
+ {
+ deleteSchCellCb(schCb[inst].cells[cellIdx]);
+ result = RSP_OK;
+ ret = ROK;
+ SCH_FREE(schCb[inst].cells[cellIdx], sizeof(SchCellCb));
+ DU_LOG("\nINFO --> SCH : Sending Cell Delete response to MAC");
+ }
+ else
+ {
+ DU_LOG("\nERROR --> SCH : SchProcCellDeleteReq(): cell Id[%d] is not available",cellDelete->cellId);
+ result = RSP_NOK;
+ }
+ }