+}
+
+/*******************************************************************
+ *
+ * @brief Function to update SCH Dl Lc Cb
+ *
+ * @details
+ *
+ * Function : updateSchDlCb
+ *
+ * Functionality: Function to update SCH DL Lc Cb
+ *
+ * @returns void
+ *
+ * ****************************************************************/
+
+void updateSchDlCb(uint8_t delIdx, SchDlCb *dlInfo)
+{
+ uint8_t lcIdx = 0;
+
+ for(lcIdx = delIdx; lcIdx < dlInfo->numDlLc; lcIdx++)
+ {
+ memcpy(&dlInfo->dlLcCtxt[lcIdx], &dlInfo->dlLcCtxt[lcIdx+1], sizeof(SchDlLcCtxt));
+ memset(&dlInfo->dlLcCtxt[lcIdx+1], 0, sizeof(SchDlLcCtxt));
+ }
+}
+
+/*******************************************************************
+ *
+ * @brief Function to fill SchUeCb
+ *
+ * @details
+ *
+ * Function : fillSchUeCb
+ *
+ * Functionality: Function to fill SchUeCb
+ *
+ * @params[in] SchUeCb pointer,
+ * SchUeCfg pointer
+ * @return ROK/RFAILED
+ *
+ * ****************************************************************/
+
+uint8_t fillSchUeCb(SchUeCb *ueCb, SchUeCfg *ueCfg)
+{
+ uint8_t lcIdx, ueLcIdx;
+
+ ueCb->ueCfg.cellId = ueCfg->cellId;
+ ueCb->ueCfg.crnti = ueCfg->crnti;
+ if(ueCfg->macCellGrpCfgPres == true)
+ {
+ memcpy(&ueCb->ueCfg.macCellGrpCfg , &ueCfg->macCellGrpCfg, sizeof(SchMacCellGrpCfg));
+ ueCb->ueCfg.macCellGrpCfgPres = true;
+ }
+
+ if(ueCfg->phyCellGrpCfgPres == true)
+ {
+ memcpy(&ueCb->ueCfg.phyCellGrpCfg , &ueCfg->phyCellGrpCfg, sizeof(SchPhyCellGrpCfg));
+ ueCb->ueCfg.phyCellGrpCfgPres = true;
+ }
+
+ if(ueCfg->spCellCfgPres == true)
+ {
+ memcpy(&ueCb->ueCfg.spCellCfg , &ueCfg->spCellCfg, sizeof(SchSpCellCfg));
+ ueCb->ueCfg.spCellCfgPres = true;
+ }
+ ueCb->state = SCH_UE_STATE_ACTIVE;
+ if(ueCfg->ambrCfg != NULLP)
+ {
+ SCH_ALLOC(ueCb->ueCfg.ambrCfg , sizeof(SchAmbrCfg));
+ memcpy(&ueCb->ueCfg.ambrCfg->ulBr , &ueCfg->ambrCfg->ulBr, sizeof(SchAmbrCfg));
+ }
+
+ memcpy(&ueCb->ueCfg.dlModInfo, &ueCfg->dlModInfo , sizeof(SchModulationInfo));
+ memcpy(&ueCb->ueCfg.ulModInfo, &ueCfg->ulModInfo , sizeof(SchModulationInfo));
+
+ //Updating SchUlCb and SchDlCb DB in SchUeCb
+ for(lcIdx = 0; lcIdx < ueCfg->numLcs; lcIdx++)
+ {
+ if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_ADD)
+ {
+ fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueCb->ulInfo.numUlLc], &ueCfg->schLcCfg[lcIdx]);
+ ueCb->ulInfo.numUlLc++;
+ fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueCb->dlInfo.numDlLc], &ueCfg->schLcCfg[lcIdx]);
+ ueCb->dlInfo.numDlLc++;
+ }
+ else
+ {
+ for(ueLcIdx = 0; ueLcIdx < ueCb->ulInfo.numUlLc; ueLcIdx++) //searching for Lc to be Mod
+ {
+ if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].lcId == ueCfg->schLcCfg[lcIdx].lcId)
+ {
+ if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_MOD)
+ {
+ fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
+ fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
+ break;
+ }
+ if(ueCfg->schLcCfg[ueLcIdx].configType == CONFIG_DEL)
+ {
+ memset(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], 0, sizeof(SchUlLcCtxt));
+ ueCb->ulInfo.numUlLc--;
+ updateSchUlCb(ueLcIdx, &ueCb->ulInfo); //moving arr elements one idx ahead
+ memset(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], 0, sizeof(SchDlLcCtxt));
+ ueCb->dlInfo.numDlLc--;
+ updateSchDlCb(ueLcIdx, &ueCb->dlInfo); //moving arr elements one idx ahead
+ break;
+ }
+ }
+ }/*End of inner for loop */
+ }
+ }/* End of outer for loop */
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Function to get SCH Cell Cb
+ *
+ * @details
+ *
+ * Function : getSchCellCb
+ *
+ * Functionality: Function to get SCH Cell Cb
+ *
+ * @params[in] event, SchUeCfg pointer
+ * @return schUeCb pointer - success
+ * NULLP - failure
+ *
+ * ****************************************************************/
+
+SchCellCb *getSchCellCb(uint16_t srcEvent, Inst inst, SchUeCfg *ueCfg)
+{
+ uint8_t idx;
+ SchCellCb *cellCb = NULLP;
+ SchUeCfgRsp cfgRsp;
+ memset(&cfgRsp, 0, sizeof(SchUeCfgRsp));