1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
18 /* This file contains UE management handling functionality for SCH */
20 #include "common_def.h"
27 #include "du_app_mac_inf.h"
28 #include "mac_sch_interface.h"
30 #include "sch_utils.h"
33 SchUeCfgRspFunc SchUeCfgRspOpts[] =
35 packSchUeCfgRsp, /* LC */
36 MacProcSchUeCfgRsp, /* TC */
37 packSchUeCfgRsp /* LWLC */
40 SchUeDeleteRspFunc SchUeDeleteRspOpts[] =
42 packSchUeDeleteRsp, /* LC */
43 MacProcSchUeDeleteRsp, /* TC */
44 packSchUeDeleteRsp /* LWLC */
47 SchCellDeleteRspFunc SchCellDeleteRspOpts[]=
49 packSchCellDeleteRsp, /* LC */
50 MacProcSchCellDeleteRsp, /* TC */
51 packSchCellDeleteRsp /* LWLC */
54 /*******************************************************************
56 * @brief Fill and send UE cfg response to MAC
60 * Function : SchSendUeCfgRspToMac
62 * Functionality: Fill and send UE cfg response to MAC
65 * @return ROK - success
68 * ****************************************************************/
69 void SchSendUeCfgRspToMac(uint16_t event, SchUeCfg *ueCfg, Inst inst,\
70 SchMacRsp result, SchUeCfgRsp *cfgRsp)
74 cfgRsp->cellId = ueCfg->cellId;
75 cfgRsp->ueId = ueCfg->ueId;
76 cfgRsp->crnti = ueCfg->crnti;
79 /* Filling response post */
80 memset(&rspPst, 0, sizeof(Pst));
81 FILL_PST_SCH_TO_MAC(rspPst, inst);
82 if(event == EVENT_ADD_UE_CONFIG_REQ_TO_SCH)
84 rspPst.event = EVENT_UE_CONFIG_RSP_TO_MAC;
85 DU_LOG("\nINFO --> SCH : Sending UE Config response to MAC");
87 else if(event == EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH)
89 rspPst.event = EVENT_UE_RECONFIG_RSP_TO_MAC;
90 DU_LOG("\nINFO --> SCH : Sending UE Reconfig response to MAC");
92 SchUeCfgRspOpts[rspPst.selector](&rspPst, cfgRsp);
95 /*******************************************************************
98 * @brief Function to fill Dl Lc Context in SCH Ue Cb
102 * Function : fillSchDlLcCtxt
104 * Functionality: Function to fill Dl Lc Context in SCH Ue Cb
106 * @params[in] SchDlLcCtxt pointer,
110 * ****************************************************************/
112 void fillSchDlLcCtxt(SchDlLcCtxt *ueCbLcCfg, SchLcCfg *lcCfg)
114 ueCbLcCfg->lcId = lcCfg->lcId;
115 ueCbLcCfg->lcp = lcCfg->dlLcCfg.lcp;
116 ueCbLcCfg->lcState = SCH_LC_STATE_ACTIVE;
120 ueCbLcCfg->pduSessionId = lcCfg->drbQos->pduSessionId;
124 if(ueCbLcCfg->snssai == NULLP)/*In CONFIG_MOD case, no need to allocate SNSSAI memory*/
126 SCH_ALLOC(ueCbLcCfg->snssai, sizeof(Snssai));
128 memcpy(ueCbLcCfg->snssai, lcCfg->snssai,sizeof(Snssai));
132 /*******************************************************************
134 * @brief Function to fill Ul Lc Context in SCH Ue Cb
138 * Function : fillSchUlLcCtxt
140 * Functionality: Function to fill Ul Lc Context in SCH Ue Cb
142 * @params[in] SchUlLcCtxt pointer,
146 * ****************************************************************/
148 void fillSchUlLcCtxt(SchUlLcCtxt *ueCbLcCfg, SchLcCfg *lcCfg)
150 ueCbLcCfg->lcId = lcCfg->lcId;
151 ueCbLcCfg->lcState = SCH_LC_STATE_ACTIVE;
152 ueCbLcCfg->priority = lcCfg->ulLcCfg.priority;
153 ueCbLcCfg->lcGroup = lcCfg->ulLcCfg.lcGroup;
154 ueCbLcCfg->schReqId = lcCfg->ulLcCfg.schReqId;
155 ueCbLcCfg->pbr = lcCfg->ulLcCfg.pbr;
156 ueCbLcCfg->bsd = lcCfg->ulLcCfg.bsd;
160 ueCbLcCfg->pduSessionId = lcCfg->drbQos->pduSessionId;
164 /*In CONFIG_MOD case, no need to allocate SNSSAI memory again*/
165 if(ueCbLcCfg->snssai == NULLP)
167 SCH_ALLOC(ueCbLcCfg->snssai, sizeof(Snssai));
169 memcpy(ueCbLcCfg->snssai, lcCfg->snssai,sizeof(Snssai));
173 /*******************************************************************
175 * @brief Function to update/allocate dedLC Info
179 * Function : updateDedLcInfo
181 * Functionality: Function to fill DLDedLcInfo
183 * @params[arg] scheduler instance,
185 * SchRrmPolicy pointer,
186 * SchLcPrbEstimate pointer , It will be filled
187 * isDedicated pointer,(Address of isDedicated flag in LC Context)
189 * @return ROK >> This LC is part of RRM MemberList.
190 * RFAILED >> FATAL Error
191 * ROKIGNORE >> This LC is not part of this RRM MemberList
193 * ****************************************************************/
195 uint8_t updateDedLcInfo(Inst inst, Snssai *snssai, SchLcPrbEstimate *lcPrbEst, bool *isDedicated)
197 uint8_t sliceCfgIdx =0;
198 SchSliceCfg sliceCfg = schCb[inst].sliceCfg;
200 if(sliceCfg.numOfSliceConfigured)
202 for(sliceCfgIdx = 0; sliceCfgIdx<sliceCfg.numOfSliceConfigured; sliceCfgIdx++)
204 if(memcmp(snssai, &(sliceCfg.listOfConfirguration[sliceCfgIdx]->snssai), sizeof(Snssai)) == 0)
206 if(lcPrbEst->dedLcInfo == NULLP)
208 SCH_ALLOC(lcPrbEst->dedLcInfo, sizeof(DedicatedLCInfo));
209 if(lcPrbEst->dedLcInfo == NULLP)
211 DU_LOG("\nINFO --> SCH : Memory Allocation Failed");
215 if(sliceCfg.listOfConfirguration[sliceCfgIdx]->rrmPolicyRatioInfo)
217 /*Updating latest RrmPolicy*/
218 lcPrbEst->dedLcInfo->rsvdDedicatedPRB = \
219 (uint16_t)(((sliceCfg.listOfConfirguration[sliceCfgIdx]->rrmPolicyRatioInfo->policyDedicatedRatio)*(MAX_NUM_RB))/100);
221 DU_LOG("\nINFO --> SCH : Updated RRM policy, reservedPOOL:%d",lcPrbEst->dedLcInfo->rsvdDedicatedPRB);
225 /*case: This LcCtxt is either a Default LC or this LC is part of someother RRM_MemberList*/
226 if(*isDedicated != TRUE)
228 DU_LOG("\nINFO --> SCH : This SNSSAI is not a part of this RRMPolicy");
234 /*******************************************************************
236 * @brief Function to fill SchUeCb
240 * Function : fillSchUeCb
242 * Functionality: Function to fill SchUeCb
244 * @params[in] Scheduler instance,
247 * @return ROK/RFAILED
249 * ****************************************************************/
251 uint8_t fillSchUeCb(Inst inst, SchUeCb *ueCb, SchUeCfg *ueCfg)
253 uint8_t lcIdx, ueLcIdx;
254 uint8_t freqDomainResource[FREQ_DOM_RSRC_SIZE] = {0};
255 SchPdschCfgCmn pdschCfg;
256 SchPucchDlDataToUlAck *dlDataToUlAck;
257 CmLListCp *lcLL = NULLP;
258 uint8_t retDL = ROK, retUL = ROK;
259 bool isLcIdValid = FALSE;
261 ueCb->ueCfg.cellId = ueCfg->cellId;
262 ueCb->ueCfg.ueId = ueCfg->ueId;
263 ueCb->ueCfg.crnti = ueCfg->crnti;
264 ueCb->ueCfg.dataTransmissionAction = ueCfg->dataTransmissionInfo;
265 if(ueCfg->macCellGrpCfgPres == true)
267 memcpy(&ueCb->ueCfg.macCellGrpCfg , &ueCfg->macCellGrpCfg, sizeof(SchMacCellGrpCfg));
268 ueCb->ueCfg.macCellGrpCfgPres = true;
271 if(ueCfg->phyCellGrpCfgPres == true)
273 memcpy(&ueCb->ueCfg.phyCellGrpCfg , &ueCfg->phyCellGrpCfg, sizeof(SchPhyCellGrpCfg));
274 ueCb->ueCfg.phyCellGrpCfgPres = true;
277 if(ueCfg->spCellCfgPres == true)
279 if(ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfgPres == true)
281 if(ueCb->ueCfg.spCellCfgPres && ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfgPres == true)
283 for(uint8_t idx = 0; idx < ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg.numTimeDomRsrcAlloc; idx++)
285 if(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg.timeDomRsrcAllociList[idx].k0 && ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg.timeDomRsrcAllociList[idx].k0)
287 SCH_FREE(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg.timeDomRsrcAllociList[idx].k0, sizeof(uint8_t));
292 memcpy(&ueCb->ueCfg.spCellCfg , &ueCfg->spCellCfg, sizeof(SchSpCellCfg));
294 covertFreqDomRsrcMapToIAPIFormat(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc,\
296 memset(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc, 0, FREQ_DOM_RSRC_SIZE);
297 memcpy(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0].freqDomainRsrc, freqDomainResource, FREQ_DOM_RSRC_SIZE);
299 ueCb->ueCfg.spCellCfgPres = true;
300 dlDataToUlAck = ueCfg->spCellCfg.servCellCfg.initUlBwp.pucchCfg.dlDataToUlAck;
305 BuildK0K1Table(ueCb->cellCb, &ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.k0K1InfoTbl, false, pdschCfg,\
306 ueCfg->spCellCfg.servCellCfg.initDlBwp.pdschCfg, dlDataToUlAck->dlDataToUlAckListCount,\
307 dlDataToUlAck->dlDataToUlAckList);
308 ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.k0K1TblPrsnt = true;
309 BuildK2InfoTable(ueCb->cellCb, ueCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.timeDomRsrcAllocList,\
310 ueCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
311 NULLP, &ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.k2InfoTbl);
312 ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.k2TblPrsnt = true;
319 SCH_FREE(ueCb->ueCfg.ambrCfg, sizeof(SchAmbrCfg));
320 ueCb->ueCfg.ambrCfg = ueCfg->ambrCfg;
322 memcpy(&ueCb->ueCfg.dlModInfo, &ueCfg->dlModInfo , sizeof(SchModulationInfo));
323 memcpy(&ueCb->ueCfg.ulModInfo, &ueCfg->ulModInfo , sizeof(SchModulationInfo));
325 //Updating SchUlCb and SchDlCb DB in SchUeCb
326 for(lcIdx = 0; lcIdx < ueCfg->numLcs; lcIdx++)
328 isLcIdValid = FALSE; /*Re-Initializing*/
330 ueLcIdx = ueCfg->schLcCfg[lcIdx].lcId;
331 CHECK_LCID(ueLcIdx, isLcIdValid);
332 if(isLcIdValid == FALSE)
334 DU_LOG("ERROR --> SCH: LCID:%d is not Valid",ueLcIdx);
337 if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_ADD)
339 fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
340 fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
342 /*Checking whether this LC belong to Dedicated S-NSSAI
343 * and Create the Dedicated LC List & Update the Reserve PRB number*/
344 if(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai != NULLP)
346 retDL = updateDedLcInfo(inst, ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, &(ueCb->dlLcPrbEst),\
347 &(ueCb->dlInfo.dlLcCtxt[ueLcIdx].isDedicated));
349 if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai != NULLP)
351 retUL = updateDedLcInfo(inst, ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, &(ueCb->ulLcPrbEst),\
352 &(ueCb->ulInfo.ulLcCtxt[ueLcIdx].isDedicated));
355 if(retUL == RFAILED || retDL == RFAILED)/*FATAL error*/
357 DU_LOG("\nERROR --> SCH : Failure in updateDedLcInfo");
363 if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].lcId == ueCfg->schLcCfg[lcIdx].lcId)
365 if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_MOD)
367 fillSchUlLcCtxt(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
368 /*Updating the RRM reserved pool PRB count*/
369 if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai != NULLP)
371 retUL = updateDedLcInfo(inst, ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, &(ueCb->ulLcPrbEst),\
372 &(ueCb->ulInfo.ulLcCtxt[ueLcIdx].isDedicated));
376 DU_LOG("\nERROR --> SCH : Failed in updating Ded Lc info");
380 if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_DEL)
382 /*Delete the LC node from the UL LC List*/
383 if(ueCb->ulInfo.ulLcCtxt[ueLcIdx].isDedicated)
385 if(ueCb->ulLcPrbEst.dedLcInfo != NULLP)
387 lcLL = &(ueCb->ulLcPrbEst.dedLcInfo->dedLcList);
388 handleLcLList(lcLL, ueCfg->schLcCfg[lcIdx].lcId, DELETE);
389 if(lcLL->count == 0)/*IF No Node in DedicateLCList to be deleted*/
391 /*Free the Dedicated LC Info structure*/
392 SCH_FREE(ueCb->ulLcPrbEst.dedLcInfo, sizeof(DedicatedLCInfo));
396 else/*Default LC list*/
398 lcLL = &(ueCb->ulLcPrbEst.defLcList);
399 handleLcLList(lcLL, ueCfg->schLcCfg[lcIdx].lcId, DELETE);
401 SCH_FREE(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
402 memset(&ueCb->ulInfo.ulLcCtxt[ueLcIdx], 0, sizeof(SchUlLcCtxt));
404 }/*End of UL LC Ctxt*/
406 if(ueCb->dlInfo.dlLcCtxt[ueLcIdx].lcId == ueCfg->schLcCfg[lcIdx].lcId)
408 if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_MOD)
410 fillSchDlLcCtxt(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], &ueCfg->schLcCfg[lcIdx]);
411 /*Updating the RRM policy*/
412 if(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai != NULLP)
414 retDL = updateDedLcInfo(inst, ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, &(ueCb->dlLcPrbEst), \
415 &(ueCb->dlInfo.dlLcCtxt[ueLcIdx].isDedicated));
419 DU_LOG("\nERROR --> SCH : Failed in updating Ded Lc info");
423 if(ueCfg->schLcCfg[lcIdx].configType == CONFIG_DEL)
425 /*Delete the LC node from the DL LC List*/
426 if(ueCb->dlInfo.dlLcCtxt[ueLcIdx].isDedicated)
428 if(ueCb->dlLcPrbEst.dedLcInfo != NULLP)
430 lcLL = &(ueCb->dlLcPrbEst.dedLcInfo->dedLcList);
431 handleLcLList(lcLL, ueCfg->schLcCfg[lcIdx].lcId, DELETE);
432 if(lcLL->count == 0)/*Last Node in DedicateLCList to be deleted*/
434 /*Free the Dedicated LC Info structure*/
435 SCH_FREE(ueCb->dlLcPrbEst.dedLcInfo, sizeof(DedicatedLCInfo));
441 lcLL = &(ueCb->dlLcPrbEst.defLcList);
442 handleLcLList(lcLL, ueCfg->schLcCfg[lcIdx].lcId, DELETE);
444 SCH_FREE(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
445 memset(&ueCb->dlInfo.dlLcCtxt[ueLcIdx], 0, sizeof(SchDlLcCtxt));
447 }/*End of DL LC ctxt*/
450 SCH_FREE(ueCfg->schLcCfg[lcIdx].drbQos, sizeof(SchDrbQosInfo));
451 SCH_FREE(ueCfg->schLcCfg[lcIdx].snssai, sizeof(Snssai));
453 }/* End of outer for loop */
457 /*******************************************************************
459 * @brief Function to get SCH Cell Cb
463 * Function : getSchCellCb
465 * Functionality: Function to get SCH Cell Cb
467 * @params[in] event, SchUeCfg pointer
468 * @return schUeCb pointer - success
471 * ****************************************************************/
473 SchCellCb *getSchCellCb(uint16_t srcEvent, Inst inst, SchUeCfg *ueCfg)
476 SchCellCb *cellCb = NULLP;
478 memset(&cfgRsp, 0, sizeof(SchUeCfgRsp));
480 /* Search of cell cb */
481 for(idx = 0; idx < MAX_NUM_CELL; idx++)
483 cellCb = schCb[inst].cells[idx];
484 if(cellCb->cellId == ueCfg->cellId)
487 if(idx == MAX_NUM_CELL)
489 DU_LOG("\nERROR --> SCH : Ue create request failed. Invalid cell id %d", ueCfg->cellId);
490 SchSendUeCfgRspToMac(srcEvent, ueCfg, inst, RSP_NOK, &cfgRsp);
494 /* Check if max number of UE configured */
495 if(cellCb->numActvUe > MAX_NUM_UE)
497 DU_LOG("\nERROR --> SCH : Max number of UE [%d] already configured", MAX_NUM_UE);
498 SchSendUeCfgRspToMac(srcEvent, ueCfg, inst, RSP_NOK, &cfgRsp);
505 /*******************************************************************
507 * @brief Function to Add Ue Config Request from MAC
511 * Function : MacSchAddUeConfigReq
513 * Functionality: Function to Add Ue config request from MAC
516 * @return ROK - success
519 * ****************************************************************/
520 uint8_t MacSchAddUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
522 uint8_t lcIdx = 0, ret = ROK;
523 SchCellCb *cellCb = NULLP;
524 SchUeCb *ueCb = NULLP;
526 Inst inst = pst->dstInst - SCH_INST_START;
527 memset(&cfgRsp, 0, sizeof(SchUeCfgRsp));
529 #ifdef CALL_FLOW_DEBUG_LOG
530 DU_LOG("\nCall Flow: ENTMAC -> ENTSCH : EVENT_ADD_UE_CONFIG_REQ_TO_SCH\n");
535 DU_LOG("\nERROR --> SCH : Adding UE Config Request failed at MacSchAddUeConfigReq()");
538 DU_LOG("\nDEBUG --> SCH : Adding UE Config Request for CRNTI[%d]", ueCfg->crnti);
539 cellCb = getSchCellCb(pst->event, inst, ueCfg);
541 /* Search if UE already configured */
542 ueCb = &cellCb->ueCb[ueCfg->ueId - 1];
544 if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE))
546 DU_LOG("\nDEBUG --> SCH : CRNTI %d already configured ", ueCfg->crnti);
547 SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_OK, &cfgRsp);
551 /* Fill received Ue Configuration in UeCb */
552 memset(ueCb, 0, sizeof(SchUeCb));
553 ueCb->ueId = ueCfg->ueId;
554 ueCb->crnti = ueCfg->crnti;
556 ret = fillSchUeCb(inst, ueCb, ueCfg);
559 /* If UE has initiated RACH and then UE context is created, it means UE is
561 * Else if UE context is created before RACH, this means that UE is being
562 * handed-in from source DU */
563 if(cellCb->raCb[ueCb->ueId-1].tcrnti == ueCb->crnti)
566 SET_ONE_BIT(ueCb->ueId, cellCb->actvUeBitMap);
567 ueCb->state = SCH_UE_STATE_ACTIVE;
571 ueCb->state = SCH_UE_HANDIN_IN_PROGRESS;
574 ueCb->cellCb = cellCb;
575 ueCb->srRcvd = false;
576 ueCb->bsrRcvd = false;
577 for(lcIdx=0; lcIdx<MAX_NUM_LOGICAL_CHANNEL_GROUPS; lcIdx++)
578 ueCb->bsrInfo[lcIdx].dataVol = 0;
580 SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_OK, &cfgRsp);
585 /*******************************************************************
587 * @brief Fills PUSCH UL allocation
591 * Function : schFillPuschAlloc
593 * Functionality: fills PUSCH info
596 * @return ROK - success
599 * ****************************************************************/
600 uint8_t schFillPuschAlloc(SchUeCb *ueCb, SlotTimingInfo puschTime, uint32_t tbSize,
601 uint8_t startSymb, uint8_t symbLen, uint16_t startPrb)
604 SchCellCb *cellCb = NULLP;
605 SchUlSlotInfo *schUlSlotInfo = NULLP;
606 SchPuschInfo puschInfo;
610 DU_LOG("\nERROR --> SCH: UE CB is empty");
614 cellCb = ueCb->cellCb;
617 DU_LOG("\nERROR --> SCH: CELL CB is empty");
621 tbSize += UL_TX_BUFFER_SIZE; /* 2 bytes header + some buffer */
622 numRb = schCalcNumPrb(tbSize, ueCb->ueCfg.ulModInfo.mcsIndex, symbLen);
623 allocatePrbUl(cellCb, puschTime, startSymb, symbLen, &startPrb, numRb);
625 puschInfo.crnti = ueCb->crnti;
626 puschInfo.harqProcId = SCH_HARQ_PROC_ID;
627 puschInfo.resAllocType = SCH_ALLOC_TYPE_1;
628 puschInfo.fdAlloc.startPrb = startPrb;
629 puschInfo.fdAlloc.numPrb = numRb;
630 puschInfo.tdAlloc.startSymb = startSymb;
631 puschInfo.tdAlloc.numSymb = symbLen;
632 puschInfo.tbInfo.qamOrder = ueCb->ueCfg.ulModInfo.modOrder;
633 puschInfo.tbInfo.mcs = ueCb->ueCfg.ulModInfo.mcsIndex;
634 puschInfo.tbInfo.mcsTable = ueCb->ueCfg.ulModInfo.mcsTable;
635 puschInfo.tbInfo.ndi = 1; /* new transmission */
636 puschInfo.tbInfo.rv = 0;
637 puschInfo.tbInfo.tbSize = tbSize;
638 puschInfo.dmrsMappingType = DMRS_MAP_TYPE_A; /* Setting Type-A */
639 puschInfo.nrOfDmrsSymbols = NUM_DMRS_SYMBOLS;
640 puschInfo.dmrsAddPos = DMRS_ADDITIONAL_POS;
642 schUlSlotInfo = cellCb->schUlSlotInfo[puschTime.slot];
643 SCH_ALLOC(schUlSlotInfo->schPuschInfo, sizeof(SchPuschInfo));
644 if(!schUlSlotInfo->schPuschInfo)
646 DU_LOG("\nERROR --> SCH: Memory allocation failed in schAllocMsg3Pusch");
649 memcpy(schUlSlotInfo->schPuschInfo, &puschInfo, sizeof(SchPuschInfo));
654 /*******************************************************************
656 * @brief Fills DCI for UL grant
660 * Function : schFillUlDci
662 * Functionality: fills DCI for UL grant in response to BSR
665 * @return ROK - success
668 * ****************************************************************/
669 uint8_t schFillUlDci(SchUeCb *ueCb, SchPuschInfo *puschInfo, DciInfo *dciInfo)
671 SchCellCb *cellCb = ueCb->cellCb;
672 SchControlRsrcSet coreset1 ;
674 memset(&coreset1, 0, sizeof(SchControlRsrcSet));
675 if(ueCb->ueCfg.spCellCfgPres == true)
677 coreset1 = ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdcchCfg.cRSetToAddModList[0];
680 dciInfo->cellId = cellCb->cellId;
681 dciInfo->crnti = ueCb->crnti;
684 dciInfo->bwpCfg.subcarrierSpacing = cellCb->cellCfg.sib1SchCfg.bwp.subcarrierSpacing;
685 dciInfo->bwpCfg.cyclicPrefix = cellCb->cellCfg.sib1SchCfg.bwp.cyclicPrefix;
686 dciInfo->bwpCfg.freqAlloc.startPrb = cellCb->cellCfg.schInitialDlBwp.bwp.freqAlloc.startPrb;
687 dciInfo->bwpCfg.freqAlloc.numPrb = cellCb->cellCfg.schInitialDlBwp.bwp.freqAlloc.numPrb;
689 /*fill coreset cfg */
690 //Considering number of RBs in coreset1 is same as coreset0
691 dciInfo->coresetCfg.coreSetSize = coresetIdxTable[0][1];
692 //Considering coreset1 also starts from same symbol as coreset0
693 dciInfo->coresetCfg.startSymbolIndex = searchSpaceIdxTable[0][3];
694 dciInfo->coresetCfg.durationSymbols = coreset1.duration;
695 memcpy(dciInfo->coresetCfg.freqDomainResource, coreset1.freqDomainRsrc, FREQ_DOM_RSRC_SIZE);
697 dciInfo->coresetCfg.cceRegMappingType = coreset1.cceRegMappingType; /* non-interleaved */
698 dciInfo->coresetCfg.regBundleSize = 6; /* must be 6 for non-interleaved */
699 dciInfo->coresetCfg.interleaverSize = 0; /* NA for non-interleaved */
700 dciInfo->coresetCfg.coreSetType = 1; /* non PBCH coreset */
701 dciInfo->coresetCfg.shiftIndex = cellCb->cellCfg.phyCellId;
702 dciInfo->coresetCfg.precoderGranularity = coreset1.precoderGranularity;
703 dciInfo->coresetCfg.cceIndex = 0; /* 0-3 for UL and 4-7 for DL */
704 dciInfo->coresetCfg.aggregationLevel = 4; /* same as for sib1 */
706 dciInfo->formatType = FORMAT0_0;
709 dciInfo->format.format0_0.resourceAllocType = puschInfo->resAllocType;
710 dciInfo->format.format0_0.freqAlloc.startPrb = puschInfo->fdAlloc.startPrb;
711 dciInfo->format.format0_0.freqAlloc.numPrb = puschInfo->fdAlloc.numPrb;
712 dciInfo->format.format0_0.timeAlloc.startSymb = puschInfo->tdAlloc.startSymb;
713 dciInfo->format.format0_0.timeAlloc.numSymb = puschInfo->tdAlloc.numSymb;
714 dciInfo->format.format0_0.rowIndex = 0; /* row Index */
715 dciInfo->format.format0_0.mcs = puschInfo->tbInfo.mcs;
716 dciInfo->format.format0_0.harqProcId = puschInfo->harqProcId;
717 dciInfo->format.format0_0.puschHopFlag = FALSE; /* disabled */
718 dciInfo->format.format0_0.freqHopFlag = FALSE; /* disabled */
719 dciInfo->format.format0_0.ndi = puschInfo->tbInfo.ndi; /* new transmission */
720 dciInfo->format.format0_0.rv = puschInfo->tbInfo.rv;
721 dciInfo->format.format0_0.tpcCmd = 0; //Sphoorthi TODO: check
722 dciInfo->format.format0_0.sUlCfgd = FALSE; /* SUL not configured */
724 /* Fill DCI Structure */
725 dciInfo->dciInfo.rnti = ueCb->crnti;
726 dciInfo->dciInfo.scramblingId = cellCb->cellCfg.phyCellId;
727 dciInfo->dciInfo.scramblingRnti = 0;
728 dciInfo->dciInfo.cceIndex = 0; /* 0-3 for UL and 4-7 for DL */
729 dciInfo->dciInfo.aggregLevel = 4;
730 dciInfo->dciInfo.beamPdcchInfo.numPrgs = 1;
731 dciInfo->dciInfo.beamPdcchInfo.prgSize = 1;
732 dciInfo->dciInfo.beamPdcchInfo.digBfInterfaces = 0;
733 dciInfo->dciInfo.beamPdcchInfo.prg[0].pmIdx = 0;
734 dciInfo->dciInfo.beamPdcchInfo.prg[0].beamIdx[0] = 0;
735 dciInfo->dciInfo.txPdcchPower.powerValue = 0;
736 dciInfo->dciInfo.txPdcchPower.powerControlOffsetSS = 0;
737 dciInfo->dciInfo.pdschCfg = NULL; /* No DL data being sent */
742 /*******************************************************************
744 * @brief Function to Modify Ue Config request from MAC
748 * Function : MacSchModUeConfigReq
750 * Functionality: Function to modify Ue Config request from MAC
753 * @return ROK - success
756 * ****************************************************************/
757 uint8_t MacSchModUeConfigReq(Pst *pst, SchUeCfg *ueCfg)
759 uint8_t ueId, lcIdx, ret = ROK;
760 SchCellCb *cellCb = NULLP;
761 SchUeCb *ueCb = NULLP;
763 Inst inst = pst->dstInst - SCH_INST_START;
764 memset(&cfgRsp, 0, sizeof(SchUeCfgRsp));
766 #ifdef CALL_FLOW_DEBUG_LOG
767 DU_LOG("\nCall Flow: ENTMAC -> ENTSCH : EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH\n");
772 DU_LOG("\nERROR --> SCH : Modifying Ue Config request failed at MacSchModUeConfigReq()");
775 DU_LOG("\nDEBUG --> SCH : Modifying Ue Config Request for CRNTI[%d]", ueCfg->crnti);
776 cellCb = getSchCellCb(pst->event, inst, ueCfg);
778 /* Search if UE already configured */
779 GET_UE_ID(ueCfg->crnti, ueId);
780 ueCb = &cellCb->ueCb[ueId -1];
784 DU_LOG("\nERROR --> SCH : SchUeCb not found at MacSchModUeConfigReq() ");
785 SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_NOK, &cfgRsp);
788 if((ueCb->crnti == ueCfg->crnti) && (ueCb->state == SCH_UE_STATE_ACTIVE))
790 /* Found the UeCb to Reconfig */
791 ret = fillSchUeCb(inst, ueCb, ueCfg);
794 ueCb->cellCb = cellCb;
795 ueCb->srRcvd = false;
796 ueCb->bsrRcvd = false;
797 for(lcIdx=0; lcIdx<MAX_NUM_LOGICAL_CHANNEL_GROUPS; lcIdx++)
798 ueCb->bsrInfo[lcIdx].dataVol = 0;
800 SchSendUeCfgRspToMac(pst->event, ueCfg, inst, RSP_OK, &cfgRsp);
806 /*******************************************************************
808 * @brief Fill and send UE delete response to MAC
812 * Function : SchSendUeDeleteRspToMac
814 * Functionality: Fill and send UE delete response to MAC
816 * @params[in] Inst inst, SchUeDelete *ueDelete, SchMacRsp result,
818 * @return ROK - success
821 * ****************************************************************/
822 void SchSendUeDeleteRspToMac(Inst inst, SchUeDelete *ueDelete, SchMacRsp result, ErrorCause cause)
825 SchUeDeleteRsp delRsp;
827 memset(&delRsp, 0, sizeof(SchUeDeleteRsp));
828 delRsp.cellId = ueDelete->cellId;
829 delRsp.crnti = ueDelete->crnti;
831 delRsp.cause = cause;
833 /* Filling response post */
834 memset(&rspPst, 0, sizeof(Pst));
835 FILL_PST_SCH_TO_MAC(rspPst, inst);
836 rspPst.event = EVENT_UE_DELETE_RSP_TO_MAC;
837 SchUeDeleteRspOpts[rspPst.selector](&rspPst, &delRsp);
840 /*******************************************************************
842 * @brief Function to delete Sch Pucch ResrcCfg
846 * Function : deleteSchPucchResrcCfg
848 * Functionality: Function to delete Sch Pucch ResrcCfg
850 * @params[in] SchPucchResrcCfg *resrc
853 * ****************************************************************/
855 void deleteSchPucchResrcCfg(SchPucchResrcCfg *resrc)
858 for(rsrcIdx=0; rsrcIdx < resrc->resrcToAddModListCount; rsrcIdx++)
860 switch(resrc->resrcToAddModList[rsrcIdx].pucchFormat)
864 SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format0,\
865 sizeof(SchPucchFormat0));
870 SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format1,\
871 sizeof(SchPucchFormat1));
876 SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format2,\
877 sizeof(SchPucchFormat2_3));
882 SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format3,\
883 sizeof(SchPucchFormat2_3));
888 SCH_FREE(resrc->resrcToAddModList[rsrcIdx].SchPucchFormat.format4,\
889 sizeof(SchPucchFormat4));
896 /*******************************************************************
898 * @brief Function to delete SCH Pdsch ServCellCfg
902 * Function : deleteSchPdschServCellCfg
904 * Functionality: Function to delete SCH Pdsch ServCellCfg
906 * @params[in] SchPdschServCellCfg *pdschServCellCfg
909 * ****************************************************************/
911 void deleteSchPdschServCellCfg(SchPdschServCellCfg *pdschServCellCfg)
913 SCH_FREE(pdschServCellCfg->maxMimoLayers, sizeof(uint8_t));
914 SCH_FREE(pdschServCellCfg->maxCodeBlkGrpPerTb, sizeof(SchMaxCodeBlkGrpPerTB));
915 SCH_FREE(pdschServCellCfg->codeBlkGrpFlushInd, sizeof(bool));
916 SCH_FREE(pdschServCellCfg->xOverhead, sizeof(SchPdschXOverhead));
919 /*******************************************************************
921 * @brief Function to delete SCH UeCb
925 * Function : deleteSchUeCb
927 * Functionality: Function to delete SCH UeCb
930 * @return ROK - success
933 * ****************************************************************/
934 void deleteSchUeCb(SchUeCb *ueCb)
936 uint8_t timeDomRsrcIdx = 0, ueLcIdx = 0;
937 SchPucchCfg *pucchCfg = NULLP;
938 SchPdschConfig *pdschCfg = NULLP;
939 CmLListCp *lcLL = NULLP;
943 SCH_FREE(ueCb->ueCfg.ambrCfg, sizeof(SchAmbrCfg));
944 if(ueCb->ueCfg.spCellCfgPres)
946 if(ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfgPres == true)
948 pdschCfg = &ueCb->ueCfg.spCellCfg.servCellCfg.initDlBwp.pdschCfg;
949 for(timeDomRsrcIdx = 0; timeDomRsrcIdx < pdschCfg->numTimeDomRsrcAlloc; timeDomRsrcIdx++)
950 SCH_FREE(pdschCfg->timeDomRsrcAllociList[timeDomRsrcIdx].k0, sizeof(uint8_t));
953 if(ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.pucchCfgPres == true)
955 pucchCfg = &ueCb->ueCfg.spCellCfg.servCellCfg.initUlBwp.pucchCfg;
956 SCH_FREE(pucchCfg->resrcSet,sizeof(SchPucchResrcSetCfg));
959 deleteSchPucchResrcCfg(pucchCfg->resrc);
960 SCH_FREE(pucchCfg->resrc, sizeof(SchPucchResrcCfg));
962 SCH_FREE(pucchCfg->format1, sizeof(SchPucchFormatCfg));
963 SCH_FREE(pucchCfg->format2, sizeof(SchPucchFormatCfg));
964 SCH_FREE(pucchCfg->format3, sizeof(SchPucchFormatCfg));
965 SCH_FREE(pucchCfg->format4, sizeof(SchPucchFormatCfg));
966 SCH_FREE(pucchCfg->schedReq, sizeof(SchPucchSchedReqCfg));
967 SCH_FREE(pucchCfg->multiCsiCfg, sizeof(SchPucchMultiCsiCfg));
968 SCH_FREE(pucchCfg->spatialInfo, sizeof(SchPucchSpatialCfg));
969 SCH_FREE(pucchCfg->dlDataToUlAck, sizeof(SchPucchDlDataToUlAck));
970 SCH_FREE(pucchCfg->powerControl,sizeof(SchPucchPowerControl));
972 SCH_FREE(ueCb->ueCfg.spCellCfg.servCellCfg.bwpInactivityTmr, sizeof(uint8_t));
973 deleteSchPdschServCellCfg(&ueCb->ueCfg.spCellCfg.servCellCfg.pdschServCellCfg);
975 /*Need to Free the memory allocated for S-NSSAI*/
976 for(ueLcIdx = 0; ueLcIdx < MAX_NUM_LC; ueLcIdx++)
978 SCH_FREE(ueCb->ulInfo.ulLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
979 SCH_FREE(ueCb->dlInfo.dlLcCtxt[ueLcIdx].snssai, sizeof(Snssai));
982 /*Clearing out Dedicated LC list*/
983 if(ueCb->dlLcPrbEst.dedLcInfo != NULLP)
985 lcLL = &(ueCb->dlLcPrbEst.dedLcInfo->dedLcList);
987 SCH_FREE(ueCb->dlLcPrbEst.dedLcInfo, sizeof(DedicatedLCInfo));
989 if(ueCb->ulLcPrbEst.dedLcInfo != NULLP)
991 lcLL = &(ueCb->ulLcPrbEst.dedLcInfo->dedLcList);
993 SCH_FREE(ueCb->ulLcPrbEst.dedLcInfo, sizeof(DedicatedLCInfo));
995 /*Deleteing the Default LC list*/
996 lcLL = &(ueCb->dlLcPrbEst.defLcList);
999 lcLL = &(ueCb->ulLcPrbEst.defLcList);
1002 memset(ueCb, 0, sizeof(SchUeCb));
1006 /*******************************************************************
1008 * @brief Function for Ue Delete request from MAC to SCH
1012 * Function : MacSchUeDeleteReq
1014 * Functionality: Function for Ue Delete request from MAC to SCH
1016 * @params[in] Pst *pst, SchUeDelete *ueDelete
1017 * @return ROK - success
1020 * ****************************************************************/
1021 uint8_t MacSchUeDeleteReq(Pst *pst, SchUeDelete *ueDelete)
1023 uint8_t idx=0, ueId=0, ueIdToDel=0, ret=ROK;
1025 SchCellCb *cellCb = NULLP;
1026 Inst inst = pst->dstInst - SCH_INST_START;
1027 CmLList *node = NULL, *next = NULL;
1029 #ifdef CALL_FLOW_DEBUG_LOG
1030 DU_LOG("\nCall Flow: ENTMAC -> ENTSCH : EVENT_UE_DELETE_REQ_TO_SCH\n");
1035 DU_LOG("\nERROR --> SCH : MacSchUeDeleteReq(): Ue Delete request failed");
1038 DU_LOG("\nDEBUG --> SCH : Ue Delete request received for crnti[%d]", ueDelete->crnti);
1040 cellCb = schCb[inst].cells[idx];
1042 if(cellCb->cellId != ueDelete->cellId)
1044 DU_LOG("\nERROR --> SCH : MacSchUeDeleteReq(): cell Id is not available");
1045 result = INVALID_CELLID;
1049 GET_UE_ID(ueDelete->crnti, ueId);
1050 if(( cellCb->ueCb[ueId-1].crnti == ueDelete->crnti) && ( cellCb->ueCb[ueId-1].state == SCH_UE_STATE_ACTIVE))
1052 deleteSchUeCb(&cellCb->ueCb[ueId-1]);
1054 /* Remove UE from ueToBeScheduled list */
1055 node = cellCb->ueToBeScheduled.first;
1059 ueId = *(uint8_t *)node->node;
1060 if(ueId == ueIdToDel)
1062 SCH_FREE(node->node, sizeof(uint8_t));
1063 deleteNodeFromLList(&cellCb->ueToBeScheduled, node);
1068 cellCb->numActvUe--;
1069 result = NOT_APPLICABLE;
1073 DU_LOG("\nERROR --> SCH : MacSchUeDeleteReq(): SchUeCb not found");
1074 result = INVALID_UEID;
1078 if(result == NOT_APPLICABLE)
1080 SchSendUeDeleteRspToMac(inst, ueDelete, RSP_OK, result);
1084 SchSendUeDeleteRspToMac(inst, ueDelete, RSP_NOK, result);
1090 /*******************************************************************
1092 * @brief Fill and send Cell delete response to MAC
1096 * Function : SchSendCellDeleteRspToMac
1098 * Functionality: Fill and send Cell delete response to MAC
1100 * @params[in] SchCellDelete *ueDelete, Inst inst, SchMacRsp result
1101 * @return ROK - success
1104 * ****************************************************************/
1105 uint8_t SchSendCellDeleteRspToMac(SchCellDelete *ueDelete, Inst inst, SchMacRsp result)
1110 SchCellDeleteRsp delRsp;
1112 DU_LOG("\nINFO --> SCH : Filling Cell Delete response");
1113 memset(&delRsp, 0, sizeof(SchCellDeleteRsp));
1114 delRsp.cellId = ueDelete->cellId;
1115 delRsp.rsp = result;
1117 /* Filling response post */
1118 memset(&rspPst, 0, sizeof(Pst));
1119 FILL_PST_SCH_TO_MAC(rspPst, inst);
1120 rspPst.event = EVENT_CELL_DELETE_RSP_TO_MAC;
1121 ret = SchCellDeleteRspOpts[rspPst.selector](&rspPst, &delRsp);
1124 DU_LOG("\nERROR --> SCH : SchSendCellDeleteRspToMac(): failed to send the Cell Delete response");
1130 /*******************************************************************
1132 * @brief Function for cellCb Deletion
1136 * Function : deleteSchCellCb
1138 * Functionality: Function for cellCb Deletion
1140 * @params[in] SchCellDelete *cellDelete
1141 * @return ROK - success
1144 * ****************************************************************/
1145 void deleteSchCellCb(SchCellCb *cellCb)
1147 uint8_t sliceIdx=0, slotIdx=0;
1148 CmLListCp *list=NULL;
1149 CmLList *node=NULL, *next=NULL;
1150 SchPageInfo *tempNode = NULLP;
1152 if(cellCb->schDlSlotInfo)
1154 for(slotIdx=0; slotIdx<cellCb->numSlots; slotIdx++)
1156 list = &cellCb->schDlSlotInfo[slotIdx]->prbAlloc.freePrbBlockList;
1161 SCH_FREE(node->node, sizeof(FreePrbBlock));
1162 deleteNodeFromLList(list, node);
1165 SCH_FREE(cellCb->schDlSlotInfo[slotIdx], sizeof(SchDlSlotInfo));
1167 SCH_FREE(cellCb->schDlSlotInfo, cellCb->numSlots *sizeof(SchDlSlotInfo*));
1170 if(cellCb->schUlSlotInfo)
1172 for(slotIdx=0; slotIdx<cellCb->numSlots; slotIdx++)
1174 list = &cellCb->schUlSlotInfo[slotIdx]->prbAlloc.freePrbBlockList;
1179 SCH_FREE(node->node, sizeof(FreePrbBlock));
1180 deleteNodeFromLList(list, node);
1183 SCH_FREE(cellCb->schUlSlotInfo[slotIdx], sizeof(SchUlSlotInfo));
1185 SCH_FREE(cellCb->schUlSlotInfo, cellCb->numSlots * sizeof(SchUlSlotInfo*));
1188 if(cellCb->cellCfg.plmnInfoList.snssai)
1190 for(sliceIdx=0; sliceIdx<cellCb->cellCfg.plmnInfoList.numSliceSupport; sliceIdx++)
1192 SCH_FREE(cellCb->cellCfg.plmnInfoList.snssai[sliceIdx], sizeof(Snssai));
1194 SCH_FREE(cellCb->cellCfg.plmnInfoList.snssai, cellCb->cellCfg.plmnInfoList.numSliceSupport*sizeof(Snssai*));
1197 for(uint16_t idx =0; idx<MAX_SFN; idx++)
1199 list = &cellCb->pageCb.pageIndInfoRecord[idx];
1206 tempNode = (SchPageInfo*)(node->node);
1207 SCH_FREE(tempNode->pagePdu, tempNode->msgLen);
1208 SCH_FREE(node->node, sizeof(SchPageInfo));
1210 deleteNodeFromLList(list, node);
1215 /* Remove all UE from ueToBeScheduled list and deallocate */
1216 node = cellCb->ueToBeScheduled.first;
1220 SCH_FREE(node->node, sizeof(uint8_t));
1221 cmLListDelFrm(&cellCb->ueToBeScheduled, node);
1222 SCH_FREE(node, sizeof(CmLList));
1226 memset(cellCb, 0, sizeof(SchCellCb));
1230 /*******************************************************************
1232 * @brief Function for cell Delete request from MAC to SCH
1236 * Function : MacSchCellDeleteReq
1238 * Functionality: Function for cell Delete request from MAC to SCH
1240 * @params[in] Pst *pst, SchCellDelete *cellDelete
1241 * @return ROK - success
1244 * ****************************************************************/
1246 uint8_t MacSchCellDeleteReq(Pst *pst, SchCellDelete *cellDelete)
1248 uint8_t cellIdx=0, ret = RFAILED;
1249 Inst inst = pst->dstInst - SCH_INST_START;
1250 SchMacRsp result= RSP_OK;
1252 #ifdef CALL_FLOW_DEBUG_LOG
1253 DU_LOG("\nCall Flow: ENTMAC -> ENTSCH : EVENT_CELL_DELETE_REQ_TO_SCH\n");
1258 DU_LOG("\nERROR --> SCH : MacSchCellDeleteReq(): Ue Delete request failed");
1262 GET_CELL_IDX(cellDelete->cellId, cellIdx);
1263 if(schCb[inst].cells[cellIdx] == NULLP)
1265 DU_LOG("\nERROR --> SCH : MacSchCellDeleteReq(): cell Id[%d] is not available", cellDelete->cellId);
1270 if(schCb[inst].cells[cellIdx]->cellId == cellDelete->cellId)
1272 deleteSchCellCb(schCb[inst].cells[cellIdx]);
1275 SCH_FREE(schCb[inst].cells[cellIdx], sizeof(SchCellCb));
1276 DU_LOG("\nINFO --> SCH : Sending Cell Delete response to MAC");
1280 DU_LOG("\nERROR --> SCH : MacSchCellDeleteReq(): cell Id[%d] is not available",cellDelete->cellId);
1285 if(SchSendCellDeleteRspToMac(cellDelete, inst, result)!=ROK)
1287 DU_LOG("\nERROR --> SCH : MacSchCellDeleteReq(): failed to send Cell Delete response");
1295 /**********************************************************************
1297 **********************************************************************/