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 *******************************************************************************/
19 /************************************************************************
25 Desc: C source code for L2 Measurement fucntions
29 **********************************************************************/
31 /** @file rg_sch_l2m.c
32 @brief This file implements the L2 Measurement feature code.
35 /* header include files -- defines (.h) */
36 #include "common_def.h"
43 #include "rg_sch_cmn.h"
44 #include "rg_sch_inf.h" /* typedefs for Scheduler */
45 #include "rg_sch_err.h"
46 #include "rl_interface.h"
47 #include "rl_common.h"
49 /* header/extern include files (.x) */
50 #include "tfu.x" /* TFU types */
51 #include "lrg.x" /* layer management typedefs for MAC */
52 #include "rgr.x" /* layer management typedefs for MAC */
53 #include "rgm.x" /* layer management typedefs for MAC */
54 #include "rg_sch_inf.x" /* typedefs for Scheduler */
55 #include "rg_sch.x" /* typedefs for Scheduler */
56 #include "rg_sch_cmn.x" /* typedefs for Scheduler */
61 static const char* RLOG_MODULE_NAME="MAC";
62 static int RLOG_MODULE_ID=4096;
63 static int RLOG_FILE_ID=166;
65 static S16 rgSchL2mInsertMeasCb ARGS((
67 RgSchL2MeasCb *measCb,
68 LrgSchMeasReqInfo *measInfo ));
70 static RgSchL2MeasCb * rgSchL2mAllocMeasCb ARGS((
72 LrgSchMeasReqInfo *measInfo,
75 /* Function definitions */
77 /** @brief This function fills the L2 measurement confirm structure
81 * Function: rgSchFillL2MeasCfm
83 * @param [in] RgSchCellCb *cell
84 * @param [in] RgSchL2MeasCb *measCb
85 * @param [out] LrgSchMeasCfmInfo *measCfm
86 * @param [in] measTime
89 S16 rgSchFillL2MeasCfm
92 RgSchL2MeasCb *measCb,
93 LrgSchMeasCfmInfo *cfm,
98 LrgSchMeasReqInfo *measInfo;
102 measInfo = &measCb->measReq;
104 cfm->hdr.transId = measInfo->hdr.transId;
105 cfm->measType = measInfo->measType;
106 cfm->cellId = measInfo->cellId;
107 cfm->cfm.status = LCM_PRIM_OK;
108 if((measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_DL) &&
111 cfm->avgPrbDl.prbPerc = ((cell->avgPrbDl.prbCount * 100) /
113 /* Resetting the prbCount to 0, fix for ccpu00125002 */
114 cell->avgPrbDl.prbCount = 0;
116 if((measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_UL) &&
119 cfm->avgPrbUl.prbPerc = ((cell->avgPrbUl.prbCount * 100) /
121 /* Resetting the prbCount to 0, fix for ccpu00125002 */
122 cell->avgPrbUl.prbCount = 0;
124 if((measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL) &&
127 cfm->avgPrbQciDlCfm.numQci = measCb->measReq.avgPrbQciDl.numQci;
128 for(idx = 0; idx < measCb->measReq.avgPrbQciDl.numQci; idx++)
130 qciVal = measCb->measReq.avgPrbQciDl.qci[idx];
131 cfm->avgPrbQciDlCfm.prbPercQci[idx].prbPercQci =
132 ((cell->qciArray[qciVal].dlPrbCount * 100) /
134 cfm->avgPrbQciDlCfm.prbPercQci[idx].qciValue = qciVal;
135 cell->qciArray[qciVal].dlPrbCount = 0;
138 if((measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL) &&
141 cfm->avgPrbQciUlCfm.numQci = measCb->measReq.avgPrbQciUl.numQci;
142 for(idx = 0; idx < measCb->measReq.avgPrbQciUl.numQci; idx++)
144 cfm->avgPrbQciUlCfm.prbPercQci[idx].qciValue =
145 measCb->avgPrbQciUl.prbUsage[idx].qciValue;
147 if(measCb->avgPrbQciUl.prbUsage[idx].prbUsage > measCb->ulTotalBw)
149 measCb->avgPrbQciUl.prbUsage[idx].prbUsage = measCb->ulTotalBw;
152 cfm->avgPrbQciUlCfm.prbPercQci[idx].prbPercQci =
153 ((measCb->avgPrbQciUl.prbUsage[idx].prbUsage * 100) /
157 if(measCb->measReq.measType & LRG_L2MEAS_RA_PREAMBLE)
159 cfm->raPrmbsCfm.dedPreambles = cell->raPrmbs.dedPream;
160 cfm->raPrmbsCfm.randSelPreLowRange = cell->raPrmbs.preamGrpA;
161 cfm->raPrmbsCfm.randSelPreHighRange = cell->raPrmbs.preamGrpB;
162 cell->raPrmbs.dedPream = 0;
163 cell->raPrmbs.preamGrpA = 0;
164 cell->raPrmbs.preamGrpB = 0;
166 if(measCb->measReq.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
168 cfm->numUeQciDlCfm.numQci = measInfo->nmbActvUeQciDl.numQci;
169 sampOc = (measTime / measInfo->nmbActvUeQciDl.sampPrd);
173 if (measCb->measReq.nmbActvUeQciDl.numQci)
175 for(idx = 0; idx < measCb->measReq.nmbActvUeQciDl.numQci; idx++)
177 qciVal = measCb->measReq.nmbActvUeQciDl.qci[idx];
179 cell->qciArray[qciVal].dlTotal_UeCount +=
180 cell->qciArray[qciVal].dlUeCount;
181 cfm->numUeQciDlCfm.numActvUeQci[idx].numActvUeQci =
182 cell->qciArray[qciVal].dlTotal_UeCount / sampOc;
183 cfm->numUeQciDlCfm.numActvUeQci[idx].qciValue = qciVal;
185 DU_LOG("\nDEBUG --> SCH : L2_MEAS:CFM DL QCI %u TOTAL Count %lu Active UE %d ",
186 qciVal,cell->qciArray[qciVal].dlTotal_UeCount,
187 cfm->numUeQciDlCfm.numActvUeQci[idx].numActvUeQci);
189 cell->qciArray[qciVal].dlTotal_UeCount = 0;
195 for(qciVal = 1; qciVal < LRG_MAX_QCI_PER_REQ; qciVal++)
198 cell->qciArray[qciVal].dlTotal_UeCount +=
199 cell->qciArray[qciVal].dlUeCount;
200 if (cell->qciArray[qciVal].dlTotal_UeCount)
202 cfm->numUeQciDlCfm.numActvUeQci[idx].numActvUeQci =
203 cell->qciArray[qciVal].dlTotal_UeCount / sampOc;
204 cfm->numUeQciDlCfm.numActvUeQci[idx].qciValue = qciVal;
206 DU_LOG("\nDEBUG --> SCH : L2_MEAS:CFM DL QCI %u TOTAL Count %lu Active UE %d ",
207 qciVal,cell->qciArray[qciVal].dlTotal_UeCount,
208 cfm->numUeQciDlCfm.numActvUeQci[idx].numActvUeQci);
210 cell->qciArray[qciVal].dlTotal_UeCount = 0;
214 cfm->numUeQciDlCfm.numQci = idx;
218 if(measCb->measReq.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
220 cfm->numUeQciUlCfm.numQci = measInfo->nmbActvUeQciUl.numQci;
221 sampOc = (measTime / measInfo->nmbActvUeQciUl.sampPrd);
226 if (measCb->measReq.nmbActvUeQciUl.numQci)
228 for(idx = 0; idx < measCb->measReq.nmbActvUeQciUl.numQci; idx++)
230 cell->qciArray[qciVal].ulTotal_UeCount +=
231 cell->qciArray[qciVal].ulUeCount;
232 qciVal = measCb->measReq.nmbActvUeQciUl.qci[idx];
233 cfm->numUeQciUlCfm.numActvUeQci[idx].numActvUeQci =
234 cell->qciArray[qciVal].ulTotal_UeCount/ sampOc;
235 cfm->numUeQciUlCfm.numActvUeQci[idx].qciValue = qciVal;
237 DU_LOG("\nDEBUG --> SCH : L2_MEAS:CFM UL QCI %d TOTAL Count %lu Active UE %d ",
238 qciVal,cell->qciArray[qciVal].ulTotal_UeCount,
239 cfm->numUeQciUlCfm.numActvUeQci[idx].numActvUeQci);
241 cell->qciArray[qciVal].ulTotal_UeCount = 0;
247 for(qciVal = 1; qciVal < LRG_MAX_QCI_PER_REQ; qciVal++)
249 cell->qciArray[qciVal].ulTotal_UeCount +=
250 cell->qciArray[qciVal].ulUeCount;
251 if (cell->qciArray[qciVal].ulTotal_UeCount)
253 cfm->numUeQciUlCfm.numActvUeQci[idx].numActvUeQci =
254 cell->qciArray[qciVal].ulTotal_UeCount/ sampOc;
255 cfm->numUeQciUlCfm.numActvUeQci[idx].qciValue = qciVal;
257 DU_LOG("\nDEBUG --> SCH : L2_MEAS:CFM UL QCI %d TOTAL Count %lu Active UE %d ",
258 qciVal,cell->qciArray[qciVal].ulTotal_UeCount,
259 cfm->numUeQciUlCfm.numActvUeQci[idx].numActvUeQci);
261 cell->qciArray[qciVal].ulTotal_UeCount = 0;
265 cfm->numUeQciUlCfm.numQci = idx;
269 if(measCb->measReq.measType & LRG_L2MEAS_TB_TRANS_DL_COUNT)
271 cfm->tbTransDlTotalCnt = cell->dlUlTbCnt.tbTransDlTotalCnt;
272 cell->dlUlTbCnt.tbTransDlTotalCnt = 0;
274 if(measCb->measReq.measType & LRG_L2MEAS_TB_TRANS_DL_FAULTY_COUNT)
276 cfm->tbTransDlFaulty = cell->dlUlTbCnt.tbTransDlFaulty;
277 cell->dlUlTbCnt.tbTransDlFaulty = 0;
279 if(measCb->measReq.measType & LRG_L2MEAS_TB_TRANS_UL_COUNT)
281 cfm->tbTransUlTotalCnt = cell->dlUlTbCnt.tbTransUlTotalCnt;
282 cell->dlUlTbCnt.tbTransUlTotalCnt = 0;
284 if(measCb->measReq.measType & LRG_L2MEAS_TB_TRANS_UL_FAULTY_COUNT)
286 cfm->tbTransUlFaulty = cell->dlUlTbCnt.tbTransUlFaulty;
287 cell->dlUlTbCnt.tbTransUlFaulty = 0;
290 measCb->dlTotalBw = 0;
291 measCb->ulTotalBw = 0;
294 } /* rgSchFillL2MeasCfm */
296 /** @brief This function sends the L2 measurement confirm to LM
301 * Function: rgSchL2mSndCfm
303 * @param [in] Pst *pst
304 * @param [in] RgSchL2MeasCb *measCb
305 * @param [in] Bool isErr
311 RgSchL2MeasCb *measCb,
312 LrgSchMeasReqInfo *measInfo,
316 LrgSchMeasCfmInfo cfm;
318 memset(&cfm, 0, sizeof(LrgSchMeasCfmInfo));
319 cfm.hdr.transId = measInfo->hdr.transId;
320 cfm.measType = measInfo->measType;
321 cfm.cellId = measInfo->cellId;
322 cfm.cfm.status = LCM_PRIM_OK;
325 cfm.cfm.status = LCM_PRIM_NOK;
326 cfm.cfm.reason = LCM_REASON_INVALID_PAR_VAL;
327 RgMiLrgSchL2MeasCfm(pst, &cfm);
331 } /* rgSchL2mSndCfm */
333 /** @brief This function fills the LM confirmation pst structure
337 * Function: rgSchL2mFillCfmPst
339 * @param [in] Pst *pst
340 * @param [out] Pst *cfmPst
341 * @param [in] LrgSchMeasReqInfo *measInfo
344 Void rgSchL2mFillCfmPst
348 LrgSchMeasReqInfo *measInfo
352 cfmPst->srcEnt = pst->dstEnt;
353 cfmPst->srcInst = pst->dstInst;
354 cfmPst->srcProcId = pst->dstProcId;
355 cfmPst->dstEnt = pst->srcEnt;
356 cfmPst->dstInst = pst->srcInst;
357 cfmPst->dstProcId = pst->srcProcId;
359 cfmPst->selector = measInfo->hdr.response.selector;
360 cfmPst->prior = measInfo->hdr.response.prior;
361 cfmPst->route = measInfo->hdr.response.route;
362 cfmPst->region = measInfo->hdr.response.mem.region;
363 cfmPst->pool = measInfo->hdr.response.mem.pool;
366 } /* rgSchL2mFillCfmPst */
368 /** @brief This function inserts the MeasCb in to data base
372 * Function: rgSchL2mInsertMeasCb
374 * @param [in] RgSchCellCb *cell
375 * @param [in] RgSchL2MeasCb *measCb
376 * @param [in] LrgSchMeasReqInfo *measInfo
381 static S16 rgSchL2mInsertMeasCb
384 RgSchL2MeasCb *measCb,
385 LrgSchMeasReqInfo *measInfo
389 RgSchL2MeasCb *oldMeasCb;
393 * 1. Check if l2mList has any entries.
395 * 1. Take the first entrie's time period and find the diff with
397 * 2. If the diff is > measInfo->timePeriod then insert before this
399 * 3. Else take the next entry in list
400 * 4. If reached without adding to list . Append at the end of list.
401 * 3. If no entries in l2mList add at the first.
403 lnk = cell->l2mList.first;
404 node = &measCb->measLnk;
405 node->node = (PTR)measCb;
408 oldMeasCb = (RgSchL2MeasCb *)lnk->node;
409 diffTime = (oldMeasCb->measReq.timePrd -
410 (RGSCH_CALC_SF_DIFF(cell->crntTime, oldMeasCb->startTime)));
411 if (diffTime > measInfo->timePrd)
413 cell->l2mList.crnt = lnk;
414 cmLListInsCrnt(&(cell->l2mList), node);
422 cmLListAdd2Tail(&(cell->l2mList), node);
424 } /* rgSchL2mInsertMeasCb */
426 /** @brief This function calculates the Down link prb count
431 * Function: rgSchL2CalDlPrbCount
433 * @param [in] RgSchCellCb *cell
435 static Void rgSchL2CalDlPrbCount(RgSchCellCb *cell)
438 RgSchDlSf *sf = NULLP;
443 frm = cell->crntTime;
444 RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
445 sf = rgSCHUtlSubFrmGet(cell, frm);
447 idx = (cell->crntTime.slot + RG_SCH_CMN_DL_DELTA) %
448 RGSCH_NUM_SUB_FRAMES;
449 if(RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, idx))
451 cell->avgPrbDl.prbCount += sf->bwAssigned;
452 dlPrbCnt += sf->bwAssigned;
455 cell->avgPrbDl.prbCount += sf->bwAssigned;
460 /** @brief This function calculates the up link prb count
465 * Function: rgSchL2CalUlPrbCount
467 * @param [in] RgSchCellCb *cell
469 static Void rgSchL2CalUlPrbCount(RgSchCellCb *cell)
471 RgSchUlSf *sf = NULLP;
472 RgSchCmnUlCell *cellUl = RG_SCH_CMN_GET_UL_CELL(cell);
478 idx = cellUl->schdIdx;
479 if(idx < cellUl->numUlSubfrms)
481 sf = &cellUl->ulSfArr[idx];
482 cell->avgPrbUl.prbCount += sf->totPrb;
485 sf = &cellUl->ulSfArr[cellUl->schdIdx];
486 cell->avgPrbUl.prbCount += sf->totPrb;
490 /** @brief This function allocates memory from the heap
494 * Function: rgSchL2mAllocMeasCb
496 * @param [in] RgSchCellCb *cell
497 * @param [in] RgSchL2MeasCb *measInfo
498 * @param [out] RgSchErrInfo *err
499 * @return RgSchL2MeasCb *
501 static RgSchL2MeasCb * rgSchL2mAllocMeasCb
504 LrgSchMeasReqInfo *measInfo,
508 RgSchL2MeasCb *measCb = NULLP;
509 Inst inst = cell->instIdx;
512 if((rgSCHUtlAllocSBuf(inst, (Data **)&measCb,
513 sizeof(RgSchL2MeasCb))) == RFAILED)
515 DU_LOG("\nERROR --> SCH : Allocation of RgSchL2MeasCb failed");
518 memcpy(&measCb->measReq, measInfo, sizeof(LrgSchMeasReqInfo));
519 RGSCHCPYTIMEINFO(cell->crntTime, measCb->startTime);
521 measCb->dlTotalBw = 0;
522 measCb->ulTotalBw = 0;
525 } /* rgSchL2mAllocMeasCb */
528 * @brief Layer Manager Measurement request handler.
532 * Function : rgSchL2mMeasReq
534 * This function handles measurement request received at scheduler instance
535 * from the Layer Manager.
536 * -# Measurement request will be stored in the list in ascending order of
539 * @param[in] Pst *pst, the post structure
540 * @param[in] LrgSchMeasReqInfo *measInfo, the measurement request structure
541 * @param[out] RgSchErrInfo *err, error information
549 LrgSchMeasReqInfo *measInfo,
553 RgSchL2MeasCb *measCb;
559 if ((measCb = rgSchL2mAllocMeasCb(cell, measInfo, err)) == NULLP)
561 RGSCHFILLERR(err, RGSCHERR_L2M_MEASREQ,
562 RGSCHERR_SCH_ALLOC_FAILED);
563 DU_LOG("\nERROR --> SCH : Allocation of RgSchL2MeasCb failed");
566 /*memcpy(&measCb->measReq, measInfo,\
567 sizeof(LrgSchMeasReqInfo));*/
568 rgSchL2mInsertMeasCb(cell, measCb, measInfo);
570 if (measInfo->timePrd == 0)
572 cell->sndL2Meas = FALSE;
573 if (measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_DL)
575 for (idx = 0; idx < measInfo->avgPrbQciDl.numQci; idx++)
577 qciVal = measInfo->avgPrbQciDl.qci[idx];
578 cell->qciArray[qciVal].qci = qciVal;
581 if (measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
583 for (idx = 0; idx < measInfo->nmbActvUeQciDl.numQci; idx++)
585 qciVal = measInfo->nmbActvUeQciDl.qci[idx];
586 cell->qciArray[qciVal].qci = qciVal;
589 if (measInfo->measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
591 for (idx = 0; idx < measInfo->nmbActvUeQciUl.numQci; idx++)
593 qciVal = measInfo->nmbActvUeQciUl.qci[idx];
594 cell->qciArray[qciVal].qci = qciVal;
598 /* Here post the message to MAC */
599 if(measInfo->measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL)
601 RgInfL2MeasReq measReq;
603 memset(&measReq, 0, sizeof(RgInfL2MeasReq));
604 measReq.transId = measInfo->hdr.transId;
605 measReq.measType = measInfo->measType;
606 measReq.timePrd = measInfo->timePrd;
607 measReq.cellId = measInfo->cellId;
608 measReq.t.prbReq.numQci = measInfo->avgPrbQciUl.numQci;
609 for (idx = 0; idx < measInfo->avgPrbQciUl.numQci; idx++)
611 measReq.t.prbReq.qci[idx] = measInfo->avgPrbQciUl.qci[idx];
613 /* Send measReq to MAC */
614 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], cell->macInst);
615 RgSchMacL2Meas(&pst, &measReq);
618 } /* rgSchL2mMeasReq */
621 * @brief This function calculates the measurement for differnt measurement type
622 * and send the end result to the layer manager
626 * Function : rgSCHL2Meas
628 * @param[in] RgSchCellCb *cell
639 CmLList *node = NULLP;
640 RgSchL2MeasCb *measCb = NULLP;
642 LrgSchMeasCfmInfo measCfm;
648 Bool isDlDataAllowed;
654 node = cell->l2mList.first;
655 memset(&measCfm, 0, sizeof(LrgSchMeasCfmInfo));
658 measCb = (RgSchL2MeasCb *)node->node;
660 if(cell->crntTime.sfn == 1023 && cell->crntTime.slot == 9)
662 /*calculates diff between crnt time and start time*/
663 meas = RGSCH_CALC_SFN_SF_DIFF(cell->crntTime,
664 measCb->sfnCycle, measCb->startTime);
669 /*calculates diff between crnt time and start time*/
670 meas = RGSCH_CALC_SFN_SF_DIFF(cell->crntTime,
671 measCb->sfnCycle, measCb->startTime);
674 if (cell->sndL2Meas || meas == measCb->measReq.timePrd)
677 rem = meas % RGSCH_NUM_SUB_FRAMES;
678 /* Get the total number of DL and UL subframes within the reporting period*/
679 numDlSf = (meas / RGSCH_NUM_SUB_FRAMES) * rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
680 numUlSf = (meas / RGSCH_NUM_SUB_FRAMES) * rgSchTddNumUlSubfrmTbl[cell->ulDlCfgIdx][RGSCH_NUM_SUB_FRAMES-1];
682 sfIdx = (measCb->startTime.slot + 1) % RGSCH_NUM_SUB_FRAMES;
686 isDlDataAllowed = RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, sfIdx);
691 else if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][sfIdx] ==
692 RG_SCH_TDD_UL_SUBFRAME)
696 sfIdx = (sfIdx + 1) % RGSCH_NUM_SUB_FRAMES;
700 measCb->dlTotalBw = numDlSf * cell->bwCfg.dlTotalBw;
701 measCb->ulTotalBw = numUlSf * cell->bwCfg.ulTotalBw;
704 measCb->dlTotalBw = meas * cell->bwCfg.dlTotalBw;
705 measCb->ulTotalBw = meas * cell->bwCfg.ulTotalBw;
707 if((measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_PER_QCI_UL))
711 rgSchFillL2MeasCfm(cell, measCb, &measCfm, meas);
720 rgSchFillL2MeasCfm(cell, measCb, &measCfm, meas);
722 RgMiLrgSchL2MeasCfm(&(rgSchCb[cell->instIdx].rgSchInit.lmPst),
724 memset(&measCfm, 0, sizeof(LrgSchMeasCfmInfo));
726 /* Delete this measCb from the list */
727 if(measCb->measReq.timePrd > 0)
729 cmLListDelFrm(&cell->l2mList, &measCb->measLnk);
730 rgSCHUtlFreeSBuf(cell->instIdx, (Data **)&measCb,
731 sizeof(RgSchL2MeasCb));
733 else/*do not delete measCb, will use for next measurement*/
735 measCb->startTime = cell->crntTime;
736 measCb->sfnCycle = 0;
737 measCb->cfmRcvd = FALSE;
738 memset(&measCb->avgPrbQciUl, 0, sizeof(LrgAvgPrbQCICfm));
739 cell->sndL2Meas = FALSE;
741 /* ccpu00117052 - MOD - Passing double pointer
742 for proper NULLP assignment*/
746 /* Just update the AVERAGE UL PRB counter here and return
747 * if the caller is CRCIndication() and the UL scheduling happens
749 #ifdef RG_ULSCHED_AT_CRC
752 if(measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_UL)
754 rgSchL2CalUlPrbCount(cell);
759 /* UL PRB counter gets updated as a part of CRC indication
760 * if the UL scheduling happens there */
761 if((measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_UL))
763 rgSchL2CalUlPrbCount(cell);
766 if((measCb->measReq.measType & LRG_L2MEAS_AVG_PRB_DL))
768 rgSchL2CalDlPrbCount(cell);
770 if(measCb->measReq.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_DL)
772 sfDiff = RGSCH_CALC_SF_DIFF(cell->crntTime, measCb->startTime);
774 if((sfDiff % measCb->measReq.nmbActvUeQciDl.sampPrd) == 0)
776 if (measCb->measReq.nmbActvUeQciDl.numQci)
778 for (idx = 0; idx < measCb->measReq.nmbActvUeQciDl.numQci;
781 qciVal = measCb->measReq.nmbActvUeQciDl.qci[idx];
782 cell->qciArray[qciVal].dlTotal_UeCount +=
783 cell->qciArray[qciVal].dlUeCount;
788 for (qciVal = 1; qciVal < LRG_MAX_QCI_PER_REQ; qciVal++)
790 cell->qciArray[qciVal].dlTotal_UeCount +=
791 cell->qciArray[qciVal].dlUeCount;
796 if(measCb->measReq.measType & LRG_L2MEAS_NMB_ACTV_UE_PER_QCI_UL)
798 sfDiff = RGSCH_CALC_SF_DIFF(cell->crntTime , measCb->startTime);
799 if((sfDiff % measCb->measReq.nmbActvUeQciUl.sampPrd) == 0)
801 if (measCb->measReq.nmbActvUeQciUl.numQci)
803 for (idx = 0; idx < measCb->measReq.nmbActvUeQciUl.numQci;
806 qciVal = measCb->measReq.nmbActvUeQciUl.qci[idx];
807 cell->qciArray[qciVal].ulTotal_UeCount +=
808 cell->qciArray[qciVal].ulUeCount;
813 for (qciVal = 1; qciVal < LRG_MAX_QCI_PER_REQ; qciVal++)
815 cell->qciArray[qciVal].ulTotal_UeCount +=
816 cell->qciArray[qciVal].ulUeCount;
825 #endif /* LTE_L2_MEAS */
826 /**********************************************************************
829 **********************************************************************/