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 Entry point fucntions
29 **********************************************************************/
31 /** @file rg_sch_tom.c
32 @brief This module does processing related to handling of lower interface APIs
33 invoked by PHY towards scheduler.
35 static const char* RLOG_MODULE_NAME="MAC";
36 static int RLOG_FILE_ID=228;
37 static int RLOG_MODULE_ID=4096;
39 /* header include files -- defines (.h) */
40 #include "common_def.h"
41 #include "tfu.h" /* RGU defines */
42 #include "lrg.h" /* layer management defines for LTE-MAC */
43 #include "rgr.h" /* layer management defines for LTE-MAC */
44 #include "rgm.h" /* layer management defines for LTE-MAC */
45 #include "rg_env.h" /* defines and macros for MAC */
46 #include "rg_sch_err.h" /* defines and macros for MAC */
47 #include "rg_sch_inf.h" /* defines and macros for MAC */
48 #include "rg_sch.h" /* defines and macros for MAC */
49 #include "rg_sch_cmn.h" /* typedefs for MAC */
50 #include "rl_interface.h"
51 #include "rl_common.h"
54 /* header/extern include files (.x) */
55 #include "tfu.x" /* RGU types */
56 #include "lrg.x" /* layer management typedefs for MAC */
57 #include "rgr.x" /* layer management typedefs for MAC */
58 #include "rgm.x" /* layer management typedefs for MAC */
59 #include "rg_sch_inf.x" /* typedefs for Scheduler */
60 #include "rg_sch.x" /* typedefs for MAC */
61 #include "rg_sch_cmn.x" /* typedefs for MAC */
63 #include "rg_sch_emtc_ext.x"
65 uint8_t rgSCHCmnCalcPcqiBitSz(RgSchUeCb *ueCb,uint8_t numTxAnt);
66 S16 rgSCHDhm5gtfHqFdbkInd(RgSchUeCb *ue,RgSchCellCb *cell,CmLteTimingInfo timingInfo,TfuHqFdbk fdbk,RgSchErrInfo *err);
69 Bool rgSCHEmtcChkEmtcUe ARGS(
74 Void rgSchTomTtiEmtcSched ARGS(
79 S16 rgSCHEmtcRamVldtProcRaReq
84 TfuRaReqIndInfo *raReqInd,
89 Void rgSCHEmtcUpdCqiInfo
95 Void rgSCHEmtcUpdSRInfo
100 Void rgSCHCmnEmtcHdlCrcFailInd
105 S16 rgSCHEmtcTomUtlProcAtCrc
108 CmLteTimingInfo crntHiDci0Frm,
109 TfuCntrlReqInfo *cntrlInfo,
112 Void rgSCHEmtcInitUeRecpReqLst
114 TfuRecpReqInfo *recpReqInfo
116 Void rgSCHEmtcFillPucchRecpInfo
119 RgSchDlHqProcCb *hqCb,
122 Bool rgSCHEmtcAddRecpInfoToLst
124 RgSchDlHqProcCb *hqCb,
125 TfuRecpReqInfo *recpReqInfo,
126 TfuUeRecpReqInfo *pucchRecpInfo,
129 Void rgSCHEmtcWillUeRptCqi
134 Void rgSchEmtcTomTtiCnsldtSfAlloc
139 S16 rgSchEmtcTomTtiL1DlAndUlCfg
142 RgTfuCntrlReqInfo *cntrlInfo
145 S16 rgSCHTomEmtcUtlFillDatRecpReq
147 TfuRecpReqInfo *recpReqInfo,
153 S16 rgSCHEmtcTomUtlFillHqFdbkRecpReq
155 TfuRecpReqInfo *recpReqInfo,
161 S16 rgSCHEmtcDhmRlsDlsfHqProc
164 CmLteTimingInfo timingInfo
167 Void rgSCHEmtcCmnUlSch
172 #ifdef RG_ULSCHED_AT_CRC
173 S16 rgSCHEmtcTomUtlProcDlSfAtCrc
176 CmLteTimingInfo crntUlFrm,
178 TfuCntrlReqInfo *cntrlInfo,
182 RgSchEmtcDlSf* rgSCHEmtcUtlSubFrmGet
189 uint32_t gDlMpdcchBlank;
190 uint32_t gUlMpdcchBlank;
191 S16 rgSCHUtlIotResPrcTti
198 RgSchUeCb* rgSCHCmnGetHoUe
203 RgSchUeCb* rgSCHCmnGetPoUe
207 CmLteTimingInfo timingInfo
209 S16 rgSCHTomUtlFillDatAperRecpReq ARGS(
214 TfuUeRecpReqInfo *datRecpInfo,
215 CmLteTimingInfo *timeInfo,
220 S16 rgSCHTomUtlFillDatPriRecpReq ARGS(
224 TfuUeRecpReqInfo *datRecpInfo,
225 CmLteTimingInfo *timeInfo,
230 S16 rgSCHTomUtlFillDatPCqiRecpReq ARGS(
234 TfuUeRecpReqInfo *datRecpInfo,
235 CmLteTimingInfo *timeInfo,
240 S16 rgSCHTomUtlFillDatSrsRecpReq ARGS(
244 TfuUeRecpReqInfo *datRecpInfo,
245 CmLteTimingInfo *timeInfo,
249 void schFillCrntTime( SlotIndInfo slotInd,Inst schInst);
252 uint32_t delayedApiCnt;
253 uint32_t gPCellTb1AckCount=0,gPCellTb2AckCount=0,gPCellTb1NackCount=0,gPCellTb2NackCount=0;
254 uint32_t gSCellSchedCount=0,gPrimarySchedCount=0;
255 uint32_t gSCellTb1AckCount=0,gSCellTb2AckCount=0,gSCellTb1NackCount=0,gSCellTb2NackCount=0;
256 uint32_t gPCellTb1DtxCount = 0, gPCellTb2DtxCount = 0, gSCellTb1DtxCount = 0, gSCellTb2DtxCount = 0;
257 uint32_t gHqFdbkCount = 0;
261 uint32_t gCqiRecpCount = 0;
262 uint32_t gCqiRecpPuschCount = 0;
263 uint32_t gCqiRcvdCount = 0;
264 Bool gF1bCsPres = FALSE;
265 uint32_t gRiReqCount = 0;
266 uint32_t gCqiReqCount = 0;
267 uint32_t gF1bCsCount = 0;
268 uint32_t gACqiRcvdCount = 0;
269 uint32_t gCqiReptToAppCount = 0;
270 uint32_t gRawACqiCount= 0;
271 uint32_t gCqiDropCount,gPucchDropCount;
272 uint32_t gCqiPucchLowSnrDropCount,gCqiPucchConfMaskDropCount,gCqiPuschConfMaskDropCount;
273 uint32_t gDci0Count = 0;
274 uint32_t gUlCrcFailCount = 0;
275 uint32_t gUlCrcPassCount = 0;
276 uint32_t gPuschCqiDropCount = 0;
277 uint32_t gCaDbgCaFrmt = 0;
278 uint32_t gCaDbgNonCaFrmt = 0;
279 uint32_t gPcellZeroBoOcc=0,gScellZeroBoOcc=0, dbgDelayedDatReqInMac=0,gDropDatReqCnt=0, gIccPktRcvrMemDropCnt=0;
283 uint32_t gUlCrcFailCounter = 0;
284 uint32_t gUlCrcPassCounter = 0;
288 uint32_t gUl5gtfPdcchSend;
293 static S16 rgSCHTomUtlFillCqiSrsWithSr ARGS
297 TfuRecpReqInfo *recpReqInfo,
298 TfuUeRecpReqInfo *pucchRecpInfo,
301 static Bool rgSCHTomUtlFillDatHarqRecpReq ARGS
305 TfuUeRecpReqInfo *datRecpInfo,
306 TfuRecpReqInfo *recpReqInfo
308 static S16 rgSCHTomUtlFillSrRecpReq ARGS((
309 TfuRecpReqInfo *recpReq,
313 static S16 rgSCHTomUtlFillRiRecpReq ARGS((
314 TfuRecpReqInfo *recpReq,
318 static S16 rgSCHTomUtlFillPcqiRecpReq ARGS((
319 TfuRecpReqInfo *recpReq,
323 static S16 rgSCHTomUtlFillSrsRecpReq ARGS((
324 TfuRecpReqInfo *recpReq,
328 static S16 rgSCHTomUtlGenIndices ARGS((
333 TfuSubbandInfo* sbInfo));
335 static S16 rgSCHTomUtlFillCqiRiRecpReq ARGS(
337 TfuRecpReqInfo *recpReqInfo,
342 static Void rgSchTomFillCellTtiInfo ARGS
344 TfuTtiIndInfo *ttiInd,
352 uint32_t rgBwAlloInfo[RGSCH_NUM_SUB_FRAMES]; /* Num of Rbs Allocated in each SF */
353 uint32_t rgBwAlcnt[RGSCH_NUM_SUB_FRAMES]; /*Num of times Allocation done in each Subframe */
356 /* rg006.201: [ccpu000111706, ccpu00112394]: Separated UL and DL TTI
359 uint64_t glblTtiCnt = 0;
363 uint32_t gDlNumUePerTti[20] = {0};
364 uint32_t gUlNumUePerTti[20] = {0};
365 static S16 rgSCHTomUtlProcDlSf ARGS((
369 RgTfuCntrlReqInfo *cntrlInfo,
371 #ifdef RG_ULSCHED_AT_CRC
372 static S16 rgSCHTomUtlProcDlSfAtCrc ARGS((
374 CmLteTimingInfo crntUlFrm,
376 TfuCntrlReqInfo *cntrlInfo,
378 #endif /* RG_ULSCHED_AT_CRC */
381 static S16 rgSCHTomUtlPrcUlTddSpclSf ARGS((
384 #endif /* TFU_UPGRADE */
386 static S16 rgSCHTomUtlFillPhich ARGS((
388 TfuCntrlReqInfo *cntrlInfo,
392 static S16 rgSCHTomUtlFillDlPdcch ARGS((
394 TfuCntrlReqInfo *cntrlInfo,
397 static S16 rgSCHTomUtlFillUlPdcch ARGS((
399 TfuCntrlReqInfo *cntrlInfo,
403 static S16 rgSCHTomUtlProcTA ARGS((
406 static S16 rgSCHTomUtlFillHqFdbkRecpReq ARGS((
407 TfuRecpReqInfo *recpReq,
412 static S16 rgSCHTomUtlFillHqFdbkRecpReq ARGS((
413 TfuRecpReqInfo *recpReq,
419 S16 rgSCHTomFillOnlySrsRecpReq ARGS
423 TfuUeRecpReqInfo *datRecpInfo
425 static S16 rgSCHTomUtlFillCqiSrSrsWithHq ARGS
428 TfuRecpReqInfo *recpReqInfo,
430 TfuUeRecpReqInfo *pucchRecpInfo,
432 Bool isDatPresOnSecCell
435 S16 rgSCHTomUtlFillRiBitWidthInfo ARGS
440 uint8_t rgSCHTomUtlFetchPcqiBitSz ARGS
447 uint8_t rgSCHTomUtlFetchPcqiBitSzPucchMode21 ARGS
450 TfuCqiPucchMode21 *mode21Info,
455 S16 rgSCHTomUtlMoveNxtOccasion ARGS
462 static S16 rgSCHTomUtlMovePcqiNxtOccasion ARGS
469 static S16 rgSCHTomUtlMovePriNxtOccasion ARGS
476 static S16 rgSCHTomUtlMoveSrNxtOccasion ARGS
482 static S16 rgSCHTomUtlMoveSrsNxtOccasion ARGS
487 static S16 rgSCHTomUtlWillUeRprtCqiRi ARGS((
489 Bool *willueRprtCqiRii));
492 static S16 rgSCHTomUtlFillDatRecpReq ARGS((
493 TfuRecpReqInfo *recpReq,
498 static S16 rgSCHTomUtlFillDatRecpReq ARGS((
499 TfuRecpReqInfo *recpReq,
506 static S16 rgSCHTomUtlFillSfRepHqFdbk ARGS((
507 TfuRecpReqInfo *recpReqInfo,
518 static S16 rgSCHTomUtlFillSfRepHqFdbk ARGS((
519 TfuRecpReqInfo *recpReqInfo,
530 static S16 rgSCHTomUtlFillSfHqFdbk ARGS((
531 TfuRecpReqInfo *recpReqInfo,
542 static S16 rgSCHTomUtlFillSfHqFdbk ARGS((
543 TfuRecpReqInfo *recpReqInfo,
554 static S16 rgSCHTomUtlFillSfHqFdbkForOneUe ARGS((
555 RgSchDlHqProcCb *hqCb,
556 TfuRecpReqInfo *recpReqInfo,
565 RgrTddAckNackMode ackNackMode,
566 RgSchUePucchRecpInfo **pucchInfoRef,
568 TknUInt16 n1PucchTkn,
574 Void rgSCHCmnDlSpsSch (RgSchCellCb *cell);
578 static S16 rgSCHTomCnsdrRelPdcch ARGS
582 TfuRecpReqInfo *recpReqInfo,
587 static S16 rgSCHTomCnsdrRelPdcch ARGS
591 TfuRecpReqInfo *recpReqInfo,
599 static Void rgSchTomTtiMiscFunctions ARGS
604 static Void rgSchTomTtiUlAndDlCmnChSch ARGS
609 static Void rgSchTomTtiDlSch ARGS
614 static Void rgSchTomTtiCnsldtSfAlloc ARGS
619 static Void rgSchTomTtiL1DlAndUlCfg ARGS
622 RgTfuCntrlReqInfo *cntrlInfo
626 static Void rgSCHTomUtlSendSfnTick ARGS
632 static Void rgSchTomUtlTddRlsSfAndHarq ARGS
636 static Void rgSCHTomUtlProcTddUlSf ARGS
641 static Void rgSCHTomUtlGethqRes ARGS
649 static Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1 ARGS
651 RgSchDlHqProcCb *hqCb,
652 TfuUePucchRecpReq *hqRecpReq,
658 static Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234 ARGS
660 RgSchDlHqProcCb *hqCb,
661 TfuUePucchRecpReq *hqRecpReq,
671 uint32_t rgDlCqiRptCnt[16], rgTotDlCqiRpt;
674 uint32_t rgSch5gtfCqi2Mcs[15] =
675 {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
677 /* forward references */
679 /*HARQ Feedback interpretation in accordance with Femto Forum.
680 Note: There is no value as '0' in Femto Forum Spec but in order to retain
681 the existing usage in MAC (and its Acceptance), its being considered*/
682 //const static uint8_t rgSchTomHqFbkMap[8] = {0,1,0,0,4,4,4,4};
683 /*added #defines instead of magic numbers*/
684 /*const static uint32_t rgSCHTomBinCoe[RG_SCH_MAX_NUM_UE_SEL_SUBBANDS][RG_SCH_MAX_TOT_NUM_SUBBANDS]={
685 {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28},
686 {0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253,276,300,325,351,378},
687 {0,0,1,4,10,20,35,56,84,120,165,220,286,364,455,560,680,816,969,1140,1330,1540,1771,2024,2300,2600,2925,3276},
688 {0,0,0,1,5,15,35,70,126,210,330,495,715,1001,1365,1820,2380,3060,3876,4845,5985,7315,8855,10626,12650,14950,17550,20475},
689 {0,0,0,0,1,6,21,56,126,252,462,792,1287,2002,3003,4368,6188,8568,11628,15504,20349,26334,33649,42504,53130,65780,80730,98280},
690 {0,0,0,0,0,1,7,28,84,210,462,924,1716,3003,5005,8008,12376,18564,27132,38760,54264,74613,100947,134596,177100,230230,296010,376740}
694 /*ccpu00116923 - ADD - SRS present support*/
695 /*Tables Derived from 3GPP TS 36.211 Section 5.5.3.3 */
696 /* Table 5.5.3.3-1 */
698 const RgSchFddCellSpSrsSubfrmTbl rgSchFddCellSpSrsSubfrmTbl = {
699 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE},
700 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE},
701 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE},
702 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE},
703 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
704 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE},
705 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE},
706 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE},
707 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE},
708 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
709 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
710 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
711 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
712 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE},
713 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE},
714 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}
717 /* Table 5.5.3.3-2 */
718 const RgSchTddCellSpSrsSubfrmTbl rgSchTddCellSpSrsSubfrmTbl = {
719 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
720 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE},
721 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE},
722 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE},
723 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE},
724 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE},
725 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE},
726 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE},
727 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
728 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
729 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE},
730 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE},
731 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE},
732 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE},
733 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
734 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}
737 S8 rgSchCmnAper20n22DiffCqi[4] = {1, 2, 3, 4};
738 S8 rgSchCmnAper30n31DiffCqi[4] = {0, 1, 2, -1};
742 * @brief get Ue for dedicated preamble rach
746 * Function: rgSCHGetDedPrmUe
748 * Invoked by: rgSCHTomRaReqInd
750 * @param[in] RgSchCellCb *cell
751 * @param[in] TfuRaReqIndInfo *raReqInd
760 CmLteTimingInfo timingInfo,
764 RgSchCmnCell *cellSch = (RgSchCmnCell *)(cell->sc.sch);
766 printf("rapId[%d] cellSch->rachCfg.dedPrmStart[%d] cellSch->rachCfg.numDedPrm[%d]\n",rapId,cellSch->rachCfg.dedPrmStart,cellSch->rachCfg.numDedPrm);
767 /* Finding UE in handOver List */
768 if ((rapId < cellSch->rachCfg.dedPrmStart) ||
769 (rapId > cellSch->rachCfg.dedPrmStart +
770 cellSch->rachCfg.numDedPrm - 1))
772 /* This ded Preamble corresponds to handover */
773 *ue = rgSCHCmnGetHoUe(cell, rapId);
774 printf(" his ded Preamble corresponds to hando\n");
776 else/* Finding UE from PDCCH Order Mappings */
778 /* Get the UE which has transmitted this RaReq */
779 *ue = rgSCHCmnGetPoUe(cell, rapId, timingInfo);
780 printf(" ==== inding UE from PDCCH Order Mapping\n");
785 * @brief Handler for processing Random Access request indication
790 * Function: rgSCHTomRaReqInd
792 * Handler for processing Random Access request indication recieved from
795 * Invoked by: RgLiTfuRaReqInd of LIM
798 * - Validate the information received: cellId value and raRnti values
799 * - Process the request: Call rgSCHRamProcRaReq (cell, raRnti, raReqInd)
801 * @param[in] RgSchCellCb *cell
802 * @param[in] TfuRaReqIndInfo *raReqInd
810 TfuRaReqIndInfo *raReqInd
817 Bool isEmtcUe = FALSE;
819 RgSchUeCb *ue = NULLP;
821 if(cell->cellId != raReqInd->cellId)
823 err.errType = RGSCHERR_TOM_RAREQIND;
824 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
825 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
826 "rgSCHTomRaReqInd(): No cell found with raReq cellId = (%d) errorType (%d)"
827 " errorCause(%d)",raReqInd->cellId, err.errType, err.errCause);
831 for (raRntiCnt = 0; raRntiCnt < raReqInd->nmbOfRaRnti; raRntiCnt++)
833 for (raReqCnt = 0; raReqCnt < raReqInd->rachInfoArr->numRaReqInfo; raReqCnt++)
835 rapId = raReqInd->rachInfoArr[raRntiCnt].raReqInfoArr[raReqCnt].rapId;
837 if(RGSCH_IS_DEDPRM(cell, rapId))
839 rgSCHGetDedPrmUe(cell, rapId, raReqInd->timingInfo, &ue);
842 /* Since rapId is within dedicated range and No ue context
843 * is found means it is a spurious rach. So ignore it.*/
848 if(FALSE == isEmtcUe)
850 #if (ERRCLASS & ERRCLS_DEBUG)
851 if(raReqInd->rachInfoArr[raRntiCnt].raRnti > RGSCH_MAX_RA_RNTI)
853 RGSCHLOGERROR(cell->instIdx, ERRCLS_INT_PAR, ERG013,
854 (ErrVal)raReqInd->rachInfoArr[raRntiCnt].raRnti,
855 ("rgSCHTomRaReqInd(): raRnti is out of range\n"));
859 ret = rgSCHRamProcRaReq(raReqCnt, cell, raReqInd->rachInfoArr[raRntiCnt].raRnti,
860 (TfuRachInfo *)&raReqInd->rachInfoArr[raRntiCnt],
861 raReqInd->timingInfo, ue, &err);
864 err.errType = RGSCHERR_TOM_RAREQIND;
865 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
866 "RARNTI:%d rgSCHTomRaReqInd(): RAM processing failed errType(%d) "
867 "errCause(%d)", raReqInd->rachInfoArr[raRntiCnt].raRnti,
868 err.errType, err.errCause);
875 } /* rgSCHTomRaReqInd */
879 * @brief Handler for processing uplink CQI indication recieved from PHY.
883 * Function: rgSCHTomUlCqiInd
885 * Handler for processing uplink CQI indication recieved from PHY.
887 * Invoked by: RgLiTfuUlCqiInd
891 * - Invoke scheduler to push reported CQI info rgSCHUtlUlCqiInd
893 * @param[in] RgSchCellCb *cell
894 * @param[in] TfuUlCqiIndInfo *ulCqiInd
902 TfuUlCqiIndInfo *ulCqiInd
907 TfuUlCqiRpt *ulCqiInfo;
909 node = ulCqiInd->ulCqiRpt.first;
910 if(cell->cellId != ulCqiInd->cellId)
912 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
913 "rgSCHTomUlCqiInd() Unable to get the ulCqiInd cell with id(%d)",
918 for (;node; node=node->next)
920 ulCqiInfo = (TfuUlCqiRpt *)node->node;
921 #if (ERRCLASS & ERRCLS_DEBUG)
922 if(ulCqiInfo->numSubband == 0)
924 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Num Subband is"
925 "out of range RNTI:%d",ulCqiInfo->rnti);
929 if((ue = rgSCHDbmGetUeCb(cell, ulCqiInfo->rnti)) == NULLP)
932 if((ue = rgSCHDbmGetSpsUeCb(cell, ulCqiInfo->rnti)) == NULLP)
935 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get "
936 "the ue for RNTI:%d", ulCqiInfo->rnti);
940 /* wideband cqi is directly reported now. and also isTxPort0 */
941 rgSCHUtlUlCqiInd(cell, ue, ulCqiInfo);
944 } /* rgSCHTomUlCqiInd */
947 * @brief Handler for processing PUCCH power adjustment indication
951 * Function: rgSCHTomPucchDeltaPwrInd
953 * Handler for processing PUCCH power adjustment indication
956 * Invoked by: RgLiTfuPucchDeltaPwrInd
960 * - Invoke scheduler to push reported CQI info rgSCHUtlPucchDeltaPwrInd
962 * @param[in] RgSchCellCb *cell
963 * @param[in] TfuPucchDeltaPwrIndInfo *pucchDeltaPwr
968 S16 rgSCHTomPucchDeltaPwrInd
971 TfuPucchDeltaPwrIndInfo *pucchDeltaPwr
976 TfuPucchDeltaPwr *ueElem;
978 if(cell->cellId != pucchDeltaPwr->cellId)
980 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
981 "rgSCHTomPucchDeltaPwrInd() Unable to get the pucchDeltaPwr cell with id(%d)",
982 pucchDeltaPwr->cellId);
986 node = pucchDeltaPwr->pucchDeltaPwrLst.first;
987 for (;node; node=node->next)
989 ueElem = (TfuPucchDeltaPwr *)node->node;
990 if((ue = rgSCHDbmGetUeCb(cell, ueElem->rnti)) == NULLP)
993 if((ue = rgSCHDbmGetSpsUeCb(cell, ueElem->rnti)) == NULLP)
996 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d "
997 "rgSCHTomPucchDeltaPwrInd() Unable to get the ue ",
1002 rgSCHUtlPucchDeltaPwrInd(cell, ue, ueElem->pucchDeltaPwr);
1005 } /* rgSCHTomPucchDeltaPwrInd */
1008 * @brief Handler for processing harq ACK/NACK indication recieved from PHY.
1012 * Function: rgSCHTomHarqAckInd
1014 * Handler for processing harq ACK/NACK indication recieved from PHY.
1016 * Invoked by: RgLiTfuHqInd
1019 * For each HqAckInfo received
1021 * - If UE doesnt exist look for a RaCb and invoke rgSCHRamMsg4FdbkInd
1022 * - Invoke HARQ module to pass HARQ-ACK info rgSCHDhmHqFdbkInd
1024 * @param[in] TfuHqIndInfo *harqAckInd
1029 S16 rgSCHTomHarqAckInd
1032 TfuHqIndInfo *harqAckInd
1043 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1045 RgSchCellCb *iterCellP;
1047 if(cell->cellId != harqAckInd->cellId)
1049 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() Unable to get"
1050 " the cell for cellId (%d)", harqAckInd->cellId);
1051 err.errType = RGSCHERR_TOM_HARQACKIND;
1052 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
1056 node = harqAckInd->hqIndLst.first;
1057 for (;node; node=node->next)
1059 hqInfo = (TfuHqInfo *)node->node;
1061 rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1062 TfuHqFdbk fdbk = hqInfo->isAck[0];
1063 raCb = rgSCHDbmGetRaCb (cell, hqInfo->rnti);
1064 ue = rgSCHDbmGetUeCb (cell, hqInfo->rnti);
1065 if (ue != NULLP && raCb == NULLP)
1067 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, harqAckInd->timingInfo, fdbk, &err)) != ROK)
1069 err.errType = RGSCHERR_TOM_HARQACKIND;
1070 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1071 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1072 err.errType, err.errCause);
1080 if ((rgSCHDhmRlsDlsfHqProc (cell, harqAckInd->timingInfo)) != ROK)
1082 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
1083 "subframe for cellId (%d) ", cell->cellId);
1084 err.errType = RGSCHERR_TOM_HARQACKIND;
1087 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
1089 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
1091 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
1093 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
1094 if(rlsHqBufs->numUes)
1096 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
1097 RgSchMacRlsHq (&pst, rlsHqBufs);
1099 rlsHqBufs->numUes = 0;
1103 rlsHqBufs->numUes = 0;
1104 node = harqAckInd->hqIndLst.first;
1105 for (;node; node=node->next)
1107 hqInfo = (TfuHqInfo *)node->node;
1108 for(tbCnt=0; tbCnt<TFU_MAX_HARQ_FDBKS; tbCnt++)
1110 hqInfo->isAck[tbCnt]=(TfuHqFdbk)rgSchTomHqFbkMap[hqInfo->isAck[tbCnt]];
1112 raCb = rgSCHDbmGetRaCb (cell, hqInfo->rnti);
1113 ue = rgSCHDbmGetUeCb (cell, hqInfo->rnti);
1114 if (ue == NULLP && raCb != NULLP)
1117 rgSCHRamMsg4FdbkInd (raCb);
1119 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1120 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1122 err.errType = RGSCHERR_TOM_HARQACKIND;
1123 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1124 " feedback processing failed errType(%d) errCause(%d)",
1125 err.errType, err.errCause);
1130 else if (ue != NULLP && raCb == NULLP)
1132 /* Get the Downlink HARQ entity from ue */
1133 if ((rgSCHDhmHqFdbkInd (ue, RGSCH_HQ_FDB_IND_CB_TYPE_HQ_ENT,
1134 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1136 err.errType = RGSCHERR_TOM_HARQACKIND;
1137 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1138 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1139 err.errType, err.errCause);
1143 else if (ue != NULLP && raCb != NULLP)
1145 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1146 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1148 err.errType = RGSCHERR_TOM_HARQACKIND;
1149 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1150 " feedback processing failed errType(%d) errCause(%d).",
1151 err.errType, err.errCause);
1157 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1158 "UE CB or RA CB ", hqInfo->rnti);
1159 err.errType = RGSCHERR_TOM_HARQACKIND;
1164 /* Check with TDD call DHM*/
1165 if ((rgSCHDhmRlsDlsfHqProc (cell, harqAckInd->timingInfo)) != ROK)
1167 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
1168 "subframe for cellId (%d) ", harqAckInd->cellId);
1169 err.errType = RGSCHERR_TOM_HARQACKIND;
1172 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
1174 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
1176 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
1178 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
1179 if(rlsHqBufs->numUes)
1181 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
1182 RgSchMacRlsHq (&pst, rlsHqBufs);
1184 rlsHqBufs->numUes = 0;
1189 } /* rgSCHTomHarqAckInd */
1193 * @brief Handler for processing Scheduling Request indication
1194 * recieved from PHY for a list of UEs.
1198 * Function: rgSCHTomSrInd
1200 * Handler for processing Scheduling Request indication recieved from PHY
1203 * Invoked by: RgLiTfuSrInd
1207 * - Invoke scheduler to indicate SR rgSCHUtlSrRcvd
1209 * @param[in] TfuSrIndInfo *srInd
1226 if(cell->cellId != srInd->cellId)
1228 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for srcInd cellId"
1229 ":%d ", srInd->cellId);
1230 err.errType = RGSCHERR_TOM_SRIND;
1231 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
1236 node = srInd->srLst.first;
1237 for (;node; node=node->next)
1241 srInfo = (TfuSrInfo *)node->node;
1242 ue = rgSCHDbmGetUeCb (cell, srInfo->rnti);
1245 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
1249 rgSCHUtlHdlUlTransInd(cell, ue, srInd->timingInfo);
1250 /*Need to activate UE as SR received*/
1251 if (ue->isDrxEnabled)
1253 rgSCHDrxSrInd(cell, ue);
1255 ret = rgSCHUtlSrRcvd (cell, ue, srInd->timingInfo, &err);
1258 err.errType = RGSCHERR_TOM_SRIND;
1259 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Scheduler processing failed "
1260 "errType(%d) errCause(%d) RNTI:%d", err.errType, err.errCause,srInfo->rnti);
1265 } /* end of rgSCHTomSrInd */
1268 * @brief Handler for processing downlink CQI indication recieved from
1273 * Function: rgSCHTomDoaInd
1275 * Handler for processing DOA recieved from PHY
1278 * Invoked by: RgLiTfuDoaInd
1282 * - Invoke scheduler to indicate DOA rgSCHUtlDoaInd
1284 * @param[in] TfuDoaIndInfo *doaInd
1292 TfuDoaIndInfo *doaInd
1299 if(cell->cellId != doaInd->cellId)
1301 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for doaInd cellId"
1302 ":%d", doaInd->cellId);
1307 node = doaInd->doaRpt.first;
1308 for (;node; node=node->next)
1310 doaInfo = (TfuDoaRpt *)node->node;
1311 ue = rgSCHDbmGetUeCb (cell, doaInfo->rnti);
1314 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
1318 rgSCHUtlDoaInd(cell, ue, doaInfo);
1321 } /* rgSCHTomDoaInd */
1323 * @brief Handler for processing downlink CQI indication recieved from
1328 * Function: rgSCHTomDlCqiInd
1330 * Handler for processing downlink CQI indication recieved from PHY
1333 * Invoked by: RgLiTfuDlCqiInd
1337 * - Invoke scheduler to indicate DL CQI rgSCHUtlDlCqiInd
1339 * @param[in] TfuDlCqiIndInfo *dlCqiInd
1344 S16 rgSCHTomDlCqiInd
1347 TfuDlCqiIndInfo *dlCqiInd
1352 TfuDlCqiRpt *dlCqiInfo;
1354 if(cell->cellId != dlCqiInd->cellId)
1356 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1357 ":%d", dlCqiInd->cellId);
1362 node = dlCqiInd->dlCqiRptsLst.first;
1363 for (;node; node=node->next)
1365 dlCqiInfo = (TfuDlCqiRpt *)node->node;
1366 ue = rgSCHDbmGetUeCb (cell, dlCqiInfo->rnti);
1369 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%dUnable to get the UE CB",
1373 rgSCHUtlDlCqiInd(cell, ue, dlCqiInfo, dlCqiInd->timingInfo);
1374 rgSCHUtlHdlUlTransInd(cell, ue, dlCqiInd->timingInfo);
1377 } /* rgSCHTomDlCqiInd */
1380 * @brief Handler for moving PCQI instance for the next periodic occasion
1384 * Function: rgSCHTomUtlMovePcqiNxtOccasion
1386 * Handler for moving PCQI instance for the next periodic occasion
1388 * Invoked by: rgSCHTomUtlFill*
1391 * - For a UE move its occurence instance to next occasion
1392 * depending on its periodicity
1393 * - Remove it from the current list and insert it to the list
1394 * having the index matching with the derived number.
1396 * @param[in] RgSchCellCb *cell,
1397 * [in] RgSchUeCb *ue
1402 static S16 rgSCHTomUtlMovePcqiNxtOccasion
1406 RgSchUePCqiCb *cqiCb
1409 uint16_t cqiIdx = 0;
1411 CmLteTimingInfo timingInfo;
1413 if(cqiCb->cqiCfg.cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP)
1416 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, timingInfo, TFU_DELTA);
1418 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, timingInfo,
1419 TFU_RECPREQ_DLDELTA);
1421 RG_SCH_ADD_TO_CRNT_TIME(timingInfo,timingInfo,cqiCb->cqiPeri);
1422 rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ue,cqiCb);
1424 /* Compute Next Transmission Instance */
1425 cqiIdx = cqiCb->cqiPeri + cqiCb->nCqiTrIdx;
1426 cqiIdx = cqiIdx%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1427 /* Delete from current List and move to new list */
1428 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
1431 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1434 cqiCb->nCqiTrIdx = cqiIdx;
1435 cmLListAdd2Tail(&(cell->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst),
1436 &(cqiCb->cqiLstEnt));
1438 rgSCHUtlSCellHndlCqiCollsn(cqiCb);
1442 } /* rgSCHTomUtlMovePcqiNxtOccasion */
1445 * @brief Handler for moving RI instance for the next periodic occasion
1449 * Function: rgSCHTomUtlMovePriNxtOccasion
1451 * Handler for moving PCQI instance for the next periodic occasion
1453 * Invoked by: rgSCHTomUtlFill*
1456 * - For a UE move its occurence instance to next occasion
1457 * depending on its periodicity
1458 * - Remove it from the current list and insert it to the list
1459 * having the index matching with the derived number.
1461 * @param[in] RgSchCellCb *cell,
1462 * [in] RgSchUeCb *ue
1467 static S16 rgSCHTomUtlMovePriNxtOccasion
1476 uint16_t effPeriodicity;
1477 uint16_t riTrInsTime;
1481 crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
1482 +(cell->crntTime.slot);
1483 #ifdef XEON_SPECIFIC_CHANGES
1484 RGSCHCPYTIMEINFO(cell->crntTime, ue->riRecpTime);
1486 /* Compute Next Transmission Instance */
1487 if (riCb->cqiCfg.cqiSetup.cqiRepType == RGR_UE_PCQI_WB_REP)
1489 effPeriodicity = riCb->cqiPeri * riCb->riPeri;
1490 tempIdx = effPeriodicity + riCb->nRiTrIdx;
1494 effPeriodicity = (riCb->h * riCb->cqiPeri * riCb->riPeri);
1495 /* In case of SFN wraparound, the SB CQI reporting cycle breaks
1496 * and RI->WB CQI->SBCQI.. should resume. RI is repositioned
1497 * accordingly. WBCQI handling is naturally accomplished */
1498 if ((crntTime + TFU_RECPREQ_DLDELTA + effPeriodicity) >
1499 (RGSCH_MAX_SUBFRM_5G - 1))
1501 riTrInsTime = (effPeriodicity - riCb->cqiOffset + riCb->riOffset) % effPeriodicity;
1502 tempIdx = RGSCH_MAX_SUBFRM_5G + (effPeriodicity - riTrInsTime);
1503 /* In case of SFN wraparound, riDist should be distance from crntTime
1504 * + TFU_RECPREQ_DLDELTA to tempIdx. Updating effPeriodicity
1505 * to make riDist calculation consistent for both SFN wraparound
1506 * case and normal case */
1507 effPeriodicity = tempIdx - TFU_RECPREQ_DLDELTA - crntTime;
1511 tempIdx = effPeriodicity + riCb->nRiTrIdx;
1514 riIdx = tempIdx % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1515 if (effPeriodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
1517 riDist = rgSCHUtlFindDist((uint16_t)(crntTime + TFU_RECPREQ_DLDELTA),
1518 (uint16_t)(crntTime + TFU_RECPREQ_DLDELTA + effPeriodicity));
1525 /* ccpu00138306- If Periodicity is equal to Queue Size or multiple of it
1526 * then the next occasion idx will be same as current Idx, Hence need not
1529 if((effPeriodicity%RG_SCH_PCQI_SRS_SR_TRINS_SIZE) != 0)
1531 /* Delete from current List and move to new list */
1532 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[riCb->nRiTrIdx].riLst,
1535 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"[%d]UEID:Unable to remove node",
1538 RG_SCH_RECORD(&riCb->histElem,RGSCH_ACTION_DEL, &cell->pCqiSrsSrLst[riCb->nRiTrIdx].riLst);
1539 cmLListAdd2Tail(&cell->pCqiSrsSrLst[riIdx].riLst,
1541 RG_SCH_RECORD(&riCb->histElem,RGSCH_ACTION_ADD, &cell->pCqiSrsSrLst[riIdx].riLst);
1550 riCb->nRiTrIdx = riIdx;
1551 riCb->riDist = riDist;
1554 rgSCHUtlSCellHndlRiCollsn(riCb);
1557 } /* rgSCHTomUtlMovePriNxtOccasion */
1560 * @brief Handler for moving SR instance for the next periodic occasion
1564 * Function: rgSCHTomUtlMoveSrNxtOccasion
1566 * Handler for moving SR instance for the next periodic occasion
1568 * Invoked by: rgSCHTomUtlFill*
1571 * - For a UE move its occurence instance to next occasion
1572 * depending on its periodicity
1573 * - Remove it from the current list and insert it to the list
1574 * having the index matching with the derived number.
1576 * @param[in] RgSchCellCb *cell,
1577 * [in] RgSchUeCb *ue
1582 static S16 rgSCHTomUtlMoveSrNxtOccasion
1590 /* Compute Next Transmission Instance */
1591 srIdx = ue->srCb.peri + ue->srCb.nSrTrIdx;
1592 srIdx = srIdx%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1593 /* Delete from current List and move to new list */
1594 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[ue->srCb.nSrTrIdx].srLst,
1595 &ue->srCb.srLstEnt))
1597 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1600 ue->srCb.nSrTrIdx = srIdx;
1601 cmLListAdd2Tail(&cell->pCqiSrsSrLst[ue->srCb.nSrTrIdx].srLst,
1602 &ue->srCb.srLstEnt);
1605 } /* rgSCHTomUtlMoveSrNxtOccasion */
1608 * @brief Handler for moving SRS instance for the next periodic occasion
1612 * Function: rgSCHTomUtlMoveSrsNxtOccasion
1614 * Handler for moving SRS instance for the next periodic occasion
1616 * Invoked by: rgSCHTomUtlFill*
1619 * - For a UE move its occurence instance to next occasion
1620 * depending on its periodicity
1621 * - Remove it from the current list and insert it to the list
1622 * having the index matching with the derived number.
1624 * @param[in] RgSchCellCb *cell,
1625 * [in] RgSchUeCb *ue
1630 static S16 rgSCHTomUtlMoveSrsNxtOccasion
1642 crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
1643 +(cell->crntTime.slot);
1645 /* Compute Next Transmission Instance */
1646 tempIdx = ue->srsCb.peri + ue->srsCb.nSrsTrIdx;
1647 srsIdx = tempIdx %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1648 if (ue->srsCb.peri > RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
1650 srsDist = rgSCHUtlFindDist((uint16_t)(crntTime + TFU_RECPREQ_DLDELTA),
1651 (uint16_t)(crntTime + TFU_RECPREQ_DLDELTA + ue->srsCb.peri));
1658 /* ccpu00138306- If Periodicity is equal to Queue Size or multiple of it
1659 * then the next occasion idx will be same as current Idx, Hence need not
1662 if((ue->srsCb.peri%RG_SCH_PCQI_SRS_SR_TRINS_SIZE) != 0)
1664 /* Delete from current List and move to new list */
1665 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[ue->srsCb.nSrsTrIdx].srsLst,
1666 &ue->srsCb.srsLstEnt))
1668 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1671 cmLListAdd2Tail(&cell->pCqiSrsSrLst[srsIdx].srsLst,
1672 &ue->srsCb.srsLstEnt);
1681 ue->srsCb.nSrsTrIdx = srsIdx;
1682 ue->srsCb.srsDist = srsDist;
1684 } /* rgSCHTomUtlMoveSrsNxtOccasion */
1688 * @brief Handler for processing RAW CQI indication recieved from
1693 * Function: rgSCHTomRawCqiInd
1695 * Handler for processing RAW CQI indication recieved from PHY
1698 * Invoked by: RgLiTfuRawCqiInd
1702 * - Invoke scheduler to indicate Raw CQI rgSCHUtlRawCqiInd
1704 * @param[in] TfuRawCqiIndInfo *rawCqiInd
1709 S16 rgSCHTomRawCqiInd
1712 TfuRawCqiIndInfo *rawCqiInd
1717 TfuRawCqiRpt* rawCqiInfo;
1721 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1722 RgSchCellCb *iterCellP;
1733 if(cell->cellId != rawCqiInd->cellId)
1735 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1736 ":%d", rawCqiInd->cellId);
1741 node = rawCqiInd->rawCqiRpt.first;
1742 for (;node; node=node->next)
1744 rawCqiInfo = (TfuRawCqiRpt *)node->node;
1745 ue = rgSCHDbmGetUeCb (cell, rawCqiInfo->crnti);
1746 raCb = rgSCHDbmGetRaCb (cell, rawCqiInfo->crnti);
1750 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"CRNTI:%d Unable to get the UECB",
1757 if (rawCqiInfo->numBits >= 5)
1758 printf("cellId [%d] crnti [%d] numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n",
1759 cell->cellId, rawCqiInfo->crnti, rawCqiInfo->numBits, rawCqiInfo->uciPayload,
1760 rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.slot);
1762 if (rawCqiInfo->numBits == 1)
1764 rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1765 uint8_t fdbk = TFU_HQFDB_NACK;
1766 /* Process HARQ FdbkInd */
1767 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1770 fdbk = TFU_HQFDB_ACK;
1771 hqInfo.isAck[0] = fdbk;
1773 if (ue != NULLP && raCb == NULLP)
1775 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
1777 err.errType = RGSCHERR_TOM_HARQACKIND;
1778 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1779 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1780 err.errType, err.errCause);
1784 else if (ue == NULLP && raCb != NULLP)
1786 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1787 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1789 err.errType = RGSCHERR_TOM_HARQACKIND;
1790 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1791 " feedback processing failed errType(%d) errCause(%d)",
1792 err.errType, err.errCause);
1797 else if (ue != NULLP && raCb != NULLP)
1799 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1800 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1802 err.errType = RGSCHERR_TOM_HARQACKIND;
1803 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1804 " feedback processing failed errType(%d) errCause(%d).",
1805 err.errType, err.errCause);
1811 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1812 "UE CB or RA CB ", rawCqiInfo->crnti);
1813 err.errType = RGSCHERR_TOM_HARQACKIND;
1817 printf("rawCqiInfo->numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n", rawCqiInfo->numBits,
1818 rawCqiInfo->uciPayload, rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.slot);
1821 else if (rawCqiInfo->numBits == 5)
1823 /* Process CQI-RI Ind*/
1824 ri = (rawCqiInfo->uciPayload >> 27) & 0x1;
1825 cqi = (rawCqiInfo->uciPayload >> 28) & 0xF;
1829 printf("\n UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1832 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1833 ue->ue5gtfCb.rank = ri + 1;
1835 if (rawCqiInfo->numBits > 1)
1837 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1838 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1839 ueDl->cqiFlag = TRUE;
1840 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1841 // rgSCHCheckAndSetTxScheme(cell, ue);
1846 printf("UE[%d] CQI[%d] MCS[%d] RI[%d]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri);
1849 else if (rawCqiInfo->numBits == 6)
1851 rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1852 TfuHqFdbk fdbk = TFU_HQFDB_NACK;
1853 /* Process both HARQ and CQI-RI Ind*/
1854 ri = (rawCqiInfo->uciPayload >> 26) & 0x1;
1855 cqi = (rawCqiInfo->uciPayload >> 27) & 0xF;
1856 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1859 printf("UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1862 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1863 ue->ue5gtfCb.rank = ri + 1;
1865 if (rawCqiInfo->numBits > 1)
1867 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1868 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1869 ueDl->cqiFlag = TRUE;
1870 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1871 // rgSCHCheckAndSetTxScheme(cell, ue);
1876 fdbk = TFU_HQFDB_ACK;
1877 hqInfo.isAck[0] = fdbk;
1879 if (ue != NULLP && raCb == NULLP)
1881 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
1883 err.errType = RGSCHERR_TOM_HARQACKIND;
1884 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1885 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1886 err.errType, err.errCause);
1890 else if (ue == NULLP && raCb != NULLP)
1892 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1893 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1895 err.errType = RGSCHERR_TOM_HARQACKIND;
1896 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1897 " feedback processing failed errType(%d) errCause(%d)",
1898 err.errType, err.errCause);
1903 else if (ue != NULLP && raCb != NULLP)
1905 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1906 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1908 err.errType = RGSCHERR_TOM_HARQACKIND;
1909 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1910 " feedback processing failed errType(%d) errCause(%d).",
1911 err.errType, err.errCause);
1917 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1918 "UE CB or RA CB ", rawCqiInfo->crnti);
1919 err.errType = RGSCHERR_TOM_HARQACKIND;
1924 printf("\nUE[%u] CQI[%u] MCS[%u] RI[%u] HQ[%u]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri, hqAck);
1929 if ((rgSCHDhmRlsDlsfHqProc (cell, rawCqiInd->timingInfo)) != ROK)
1931 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
1932 "subframe for cellId (%d) ", cell->cellId);
1933 err.errType = RGSCHERR_TOM_HARQACKIND;
1936 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
1938 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
1940 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
1942 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
1943 if(rlsHqBufs->numUes)
1945 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
1946 RgSchMacRlsHq (&pst, rlsHqBufs);
1948 rlsHqBufs->numUes = 0;
1952 } /* rgSCHTomRawCqiInd */
1955 * @brief Handler for processing SRS indication recieved from
1960 * Function: rgSCHTomSrsInd
1962 * Handler for SRS indication recieved from PHY
1965 * Invoked by: RgLiTfuSrsInd
1969 * - Invoke scheduler to indicate UL SRS rgSCHUtlSrsInd
1971 * @param[in] TfuSrsIndInfo *srsInd
1979 TfuSrsIndInfo *srsInd
1986 if(cell->cellId != srsInd->cellId)
1988 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1989 ":%d", srsInd->cellId);
1993 node = srsInd->srsRpt.first;
1994 for (;node; node=node->next)
1996 srsInfo = (TfuSrsRpt *)node->node;
1997 ue = rgSCHDbmGetUeCb (cell, srsInfo->ueId);
2000 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
2001 "UE CB", srsInfo->ueId);
2004 rgSCHUtlSrsInd(cell, ue, srsInfo, srsInd->timingInfo);
2005 rgSCHUtlHdlUlTransInd(cell, ue, srsInd->timingInfo);
2008 } /* rgSCHTomSrsInd */
2012 * Fun: rgSCHTomUtlGenIndices
2014 * Desc: This function reconstructs the Subband Indices for
2015 * of M selected Subbands conveyed by the UE for APeriodic Modes
2016 * 2-0 and 2-2. It decodes the Label which uniquely encodes M out
2024 * File: rg_sch_utl.c
2028 static S16 rgSCHTomUtlGenIndices
2034 TfuSubbandInfo* sbInfo
2037 uint8_t idx, kval, xval, xmin;
2040 for(kval=0; kval<posM;kval++)
2043 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe, (posM-kval-1));
2044 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2045 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2049 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2050 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2053 sbInfo[kval].numRb = valK;
2054 sbInfo[kval].rbStart = idx*valK;
2056 label = label-binCoe;
2059 } /* end of rgSCHTomUtlGenIndices*/
2063 * @brief Handler for processing decode failure indication recieved from
2068 * Function: rgSCHTomCrcInd
2070 * Handler for processing decode failure indication recieved from
2071 * PHY for a set of UEs.
2073 * Invoked by: RgLiTfuCrcInd of rg_sch.x
2076 * - Validate the information received and retrieve cell and ue.
2077 * - Process Decode failure Indication: Call rgSCHUhmProcHqFailure().
2079 * @param[in] TfuCrcIndInfo *crcInd
2087 TfuCrcIndInfo *crcInd
2090 RgSchUeCb *ue = NULLP;
2091 RgSchRaCb *raCb = NULLP;
2093 TfuCrcInfo *crcInfo;
2094 #ifdef RG_ULSCHED_AT_CRC
2097 CmLteTimingInfo crntHiDci0Frm;
2098 //RgSchCmnUlCell *cellUl;
2099 Inst inst = cell->instIdx;
2100 TfuCntrlReqInfo *cntrlInfo;
2108 RgSchUlHqProcCb *hqProc;
2112 RgSchUlHqProcCb *ulHqProc;
2115 if(cell->cellId != crcInd->cellId)
2117 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2118 ":%d", crcInd->cellId);
2121 #ifdef RG_ULSCHED_AT_CRC
2124 static CmLteTimingInfo lastCrc = {2000,0};
2125 CmLteTimingInfo crntCrc = cell->crntTime;
2126 if (RGSCH_TIMEINFO_SAME(lastCrc, crntCrc))
2128 /*Removed the WA to drop 2nd CRC*/
2129 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"Recieved CRC "
2130 "twice per TTI @(%u,%u)", cell->crntTime.sfn,
2131 cell->crntTime.slot);
2137 node = crcInd->crcLst.first;
2138 for (;node; node=node->next)
2140 crcInfo = (TfuCrcInfo*)node->node;
2141 ue = rgSCHDbmGetUeCb (cell, crcInfo->rnti);
2145 /* Fetch from SPS List */
2146 ue = rgSCHDbmGetSpsUeCb(cell, crcInfo->rnti);
2150 raCb = rgSCHDbmGetRaCb (cell, crcInfo->rnti);
2157 /* Added Ul TB count for Uplink data scheduled*/
2161 ulHqProc = &(raCb->msg3HqProc);
2162 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2164 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2169 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2170 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2172 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2177 if (crcInfo->isFailure == FALSE)
2181 rgSCHRamMsg3DatInd(raCb);
2183 /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
2184 hqProc = &(raCb->msg3HqProc);
2185 RGSCH_UPD_PHICH(cell->ulDlCfgIdx, crcInd->timingInfo.slot,
2193 gUlCrcPassCounter++;
2198 RGSCHCPYTIMEINFO(crcInd->timingInfo, ue->datIndTime);
2199 #ifndef MAC_SCH_STATS
2200 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo);
2203 /** Stats update over here
2206 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2208 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo, cmnUe->ul.crntUlCqi[0]);
2210 #endif /* MAC_SCH_STATS */
2212 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2214 rgSCHUtlHdlCrcInd(cell, ue, crcInd->timingInfo);
2222 /* SR_RACH_STATS : MSG3 Nack / DTX*/
2223 if (crcInfo->isDtx == TRUE)
2229 rgNumMsg3CrcFailed++;
2231 rgSCHRamMsg3FailureInd(raCb);
2233 rgSCHCmnEmtcHdlCrcFailInd(cell, raCb);
2235 /* Added Ul TB count for CRC Failure of MSG3 */
2237 ulHqProc = &(raCb->msg3HqProc);
2238 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2240 cell->dlUlTbCnt.tbTransUlFaulty++;
2248 gUlCrcFailCounter++;
2253 #ifndef MAC_SCH_STATS
2254 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv);
2257 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2259 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv, cmnUe->ul.crntUlCqi[0]);
2261 #endif /* MAC_SCH_STATS */
2262 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2264 rgSCHUtlHdlCrcFailInd(cell, ue, crcInd->timingInfo);
2266 /* Added Ul TB count for CRC Failure of Uplink data */
2268 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2269 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2271 cell->dlUlTbCnt.tbTransUlFaulty++;
2278 /* ccpu00132653-ADD Added Sched_At_Crc Changes for TDD and optimized here
2279 the codebase across TDD and FDD*/
2280 #ifdef RG_ULSCHED_AT_CRC
2281 /* Changes to do uplink scheduling at CRC Indication */
2282 //cellUl = RG_SCH_CMN_GET_UL_CELL(cell);
2283 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, crntHiDci0Frm, TFU_ULCNTRL_DLDELTA);
2286 rgSCHCmnRlsUlSf(cell,0);
2289 /* Allocating memory for CntrlReq as it required for both EMTC and
2291 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&cntrlInfo,
2292 sizeof(TfuCntrlReqInfo))) != ROK)
2294 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuCntrlReqInfo "
2298 rgSCHCmnUlSch(cell);
2300 rgSCHL2Meas(cell,TRUE);
2302 /* Also, sending UL DCI and PHICH for just scheduled subframe */
2303 ulSf = rgSCHUtlSubFrmGet (cell, crntHiDci0Frm);
2305 if ((rgSCHTomUtlProcDlSfAtCrc (ulSf, crntHiDci0Frm, cell, cntrlInfo, &err)) != ROK)
2307 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomCrcInd() Unable to process"
2308 " downlink subframe for cellId %d", crcInd->cellId);
2309 err.errType = RGSCHERR_TOM_TTIIND;
2312 #endif /* RG_ULSCHED_AT_CRC */
2314 } /* rgSCHTomCrcInd */
2317 * @brief Handler for processing timing Advance indication recieved from
2322 * Function: rgSCHTomTimingAdvInd
2324 * Handler for processing timing advance indication recieved from PHY
2327 * Invoked by: RgLiTfuTimingAdvInd
2331 * - Call DHM to update value of Timing Advance rgSCHDhmUpdTa.
2333 * @param[in] TfuTimingAdvIndInfo *timingAdvInd
2338 S16 rgSCHTomTimingAdvInd
2341 TfuTimingAdvIndInfo *timingAdvInd
2346 TfuTimingAdvInfo *timingAdvInfo;
2348 if(cell->cellId != timingAdvInd->cellId)
2350 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2351 "=(%d)", timingAdvInd->cellId);
2356 node = timingAdvInd->timingAdvLst.first;
2357 for (;node; node=node->next)
2359 timingAdvInfo = (TfuTimingAdvInfo *)node->node;
2360 ue = rgSCHDbmGetUeCb (cell, timingAdvInfo->rnti);
2363 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
2364 timingAdvInfo->rnti);
2367 rgSCHDhmUpdTa (cell, ue, timingAdvInfo->timingAdv);
2370 } /* rgSCHTomTimingAdvInd */
2373 * @brief Handler for processing TTI indication recieved from
2374 * PHY for 'n' cells.
2378 * Function: rgSCHTomTtiInd
2380 * Handler for processing slot indication recieved from MAC
2381 * for a cell. This is split into the below Steps.
2383 * 1: Complete the Uplink and Common Channel Scheduling for each Cell
2384 * 2: Complete the UE specific Scheduling for each Cell / across Cells.
2385 * 3: Consolidate the subframe allocations and send to each MAC instance
2386 * 4: Fill the Tfu structures for DL and UL Config requests
2387 * 5: Handle the RGR Config messages per Cell
2389 * @param[in] SlotIndInfo *slotInd
2390 * @param[in] Inst schInst
2395 SlotIndInfo *slotInd,
2399 RgInfSfAlloc *subfrmAlloc;
2400 RgTfuCntrlReqInfo *cntrlInfo = NULLP;
2404 RgSchCellCb *cell[CM_LTE_MAX_CELLS];
2405 RgSchCellCb *cellLst[CM_LTE_MAX_CELLS];
2411 //rgSchTomFillCellTtiInfo(slotInd, schInst, &nCell, &cell[0]);
2413 schFillCrntTime(*slotInd,schInst);
2414 for (i = 0; i < nCell; i++)
2416 /* Perform UL and DL Common Channel scheduling */
2417 rgSchTomTtiUlAndDlCmnChSch (cell[i]);
2420 /* Perform scheduling in Order of
2424 for (i = 0; i < nCell; i++)
2427 if (cell[i]->isDlDataAllwd && (cell[i]->stopDlSch == FALSE))
2429 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell[i]);
2430 /* Perform DL Retx scheduling */
2431 cellSch->apisDl->rgSCHDlRetxSched(cell[i], &cellSch->allocInfo);
2435 rgSchCmnPreDlSch(cell, nCell, cellLst);
2436 for (i = 0; i < nCell; i++)
2438 /* Perform DL scheduling */
2439 rgSchTomTtiDlSch (cellLst[i]);
2441 rgSchCmnPstDlSch(cell[0]);
2443 for (i = 0; i < nCell; i++)
2446 #ifndef RG_ULSCHED_AT_CRC
2447 /* Perform UL scheduling for TDD */
2448 rgSCHCmnUlSch (cell[i]);
2452 /* Init SF Alloc info per Cell */
2453 for (i = 0; i < nCell; i++)
2455 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2456 rgSCHUtlResetSfAlloc(subfrmAlloc,FALSE,TRUE);
2458 for (i = 0; i < nCell; i++)
2460 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2462 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2464 * TFU_DLDATA_DLDELTA is used in this calculation because the subfrmAlloc
2465 * timingInfo which is being calculated here will be used by MAC
2467 RG_SCH_ADD_TO_CRNT_TIME(cell[i]->crntTime, subfrmAlloc->timingInfo,
2468 RG_DL_DELTA - TFU_DLDATA_DLDELTA);
2469 /* Consolidate the Allocations and send response to MAC instances */
2470 rgSchTomTtiCnsldtSfAlloc (cell[i]);
2474 for (i = 0; i < nCell; i++)
2476 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2478 /* Send the consolidated Alloc Info to MAC instances */
2479 rgSCHCmnSndCnsldtInfo (cell[i]);
2483 for (i = 0; i < nCell; i++)
2485 /* Fill control data from scheduler to PHY */
2486 if ((ret = rgSCHUtlAllocEventMem((cell[i]->instIdx), (Ptr *)&cntrlInfo,
2487 sizeof(RgTfuCntrlReqInfo))) != ROK)
2489 RLOG_ARG0(L_ERROR,DBG_CELLID,cell[i]->cellId,"Unable to Allocate TfuCntrlReqInfo"
2495 /* Fill the TFU structures and send to CL */
2496 if(TRUE == cell[i]->emtcEnable)
2498 ret = rgSchEmtcTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2502 && (NULLP != cntrlInfo))
2504 /* Fill the TFU structures and send to CL */
2505 rgSchTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2509 rgSCHTomUtlSendSfnTick(cell[0]);
2512 for (i = 0; i < nCell; i++)
2514 /* Invoke non critical functions like measurements, etc */
2515 rgSchTomTtiMiscFunctions (cell[i]);
2520 uint32_t dbgUeIdChngAndDatReqInClCnt = 0;
2521 static uint32_t gTtiCount = 0;
2524 if(gTtiCount == 3000)
2526 #ifdef XEON_SPECIFIC_CHANGES
2527 printf("SChed:: (P/S)::(%u/%u) \n",
2528 gPrimarySchedCount,gSCellSchedCount);
2530 printf("\n HQFDBK :: %u\n",gHqFdbkCount);
2535 total = gPCellTb1AckCount + gPCellTb1NackCount + gPCellTb1DtxCount;
2536 total2 = gPCellTb2AckCount + gPCellTb2NackCount + gPCellTb2DtxCount;
2538 printf("\n PCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2539 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2540 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2541 if ((total != 0 ) && total2 != 0)
2543 printf("\n PCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2544 (float)gPCellTb1AckCount/total * 100,(float)gPCellTb1NackCount/total * 100,(float)gPCellTb1DtxCount/total * 100,
2545 (float)gPCellTb2AckCount/total2 *100 ,(float)gPCellTb2NackCount/total2 *100 ,(float)gPCellTb2DtxCount/total2 *2);
2548 total = gSCellTb1AckCount + gSCellTb1NackCount + gSCellTb1DtxCount;
2549 total2 = gSCellTb2AckCount + gSCellTb2NackCount + gSCellTb2DtxCount;
2552 printf("\n SCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2553 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2554 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2555 if ((total != 0 ) && total2 != 0)
2557 printf("\n SCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2558 (float)gSCellTb1AckCount/total * 100,(float)gSCellTb1NackCount/total * 100,(float)gSCellTb1DtxCount/total * 100,
2559 (float)gSCellTb2AckCount/total2 *100 ,(float)gSCellTb2NackCount/total2 *100 ,(float)gSCellTb2DtxCount/total2 *2);
2563 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%u/%u):(%u/%u/%u/%u)\n",
2564 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2565 gACqiRcvdCount,gCqiReptToAppCount);
2567 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%u/%u/%u/%u/%u/%u)\n",
2568 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2570 printf("UL::(DCI0/CrcPass/CrcFail)::(%u/%u/%u)\n"
2571 "gPcellZeroBoOcc:%u\t gScellZeroBoOcc:%u dbgUeIdChngAndDatReqInClCnt: %u\n"
2572 "DelayedDatReqInMac: %u DelayedDatReqInCl : %u gIccPktRcvrMemDropCnt :%u\n",
2578 dbgUeIdChngAndDatReqInClCnt,
2579 dbgDelayedDatReqInMac,
2580 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2582 printf("SChed:: (P/S)::(%ld/%ld) \n",
2583 gPrimarySchedCount,gSCellSchedCount);
2585 printf("\n HQFDBK :: %ld\n",gHqFdbkCount);
2587 printf("\n PCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2588 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2589 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2591 printf("\n SCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2592 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2593 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2595 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%ld/%ld):(%ld/%ld/%ld/%ld)\n",
2596 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2597 gACqiRcvdCount,gCqiReptToAppCount);
2598 printf("\n CQI:: PucchCqiSnrDropCnt/PucchCqiConfBitMaskDropCnt/PuschCqiConfMaskDropCount :: (%ld/%ld/%ld) \n",gCqiPucchLowSnrDropCount,gCqiPucchConfMaskDropCount,gCqiPuschConfMaskDropCount);
2600 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%ld/%ld/%ld/%ld/%ld/%ld)\n",
2601 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2603 printf("UL::(DCI0/CrcPass/CrcFail)::(%ld/%ld/%ld)\n"
2604 "gPcellZeroBoOcc:%ld\t gScellZeroBoOcc:%ld dbgUeIdChngAndDatReqInClCnt: %ld\n"
2605 "DelayedDatReqInMac: %ld DelayedDatReqInCl : %ld gIccPktRcvrMemDropCnt :%ld\n",
2611 dbgUeIdChngAndDatReqInClCnt,
2612 dbgDelayedDatReqInMac,
2613 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2614 //printf ("\n delayedApiCnt:%ld",delayedApiCnt);
2618 rgSCHLaaPrintStats();
2620 gCaDbgNonCaFrmt = gIccPktRcvrMemDropCnt = 0;
2632 gCqiPucchLowSnrDropCount = 0;
2633 gCqiPucchConfMaskDropCount = 0;
2634 gCqiPuschConfMaskDropCount = 0;
2635 gPuschCqiDropCount = 0;
2638 gUlCrcPassCount = 0;
2639 gUlCrcFailCount = 0;
2642 gCqiRecpPuschCount = 0;
2645 gCqiReptToAppCount = 0;
2650 gPrimarySchedCount = 0;
2651 gSCellSchedCount = 0;
2652 gSCellTb1AckCount = 0;
2653 gSCellTb2AckCount = 0;
2654 gSCellTb2AckCount = 0;
2655 gSCellTb2NackCount = 0;
2656 gPCellTb1AckCount = 0;
2657 gPCellTb1NackCount = 0;
2658 gPCellTb2AckCount = 0;
2659 gPCellTb2NackCount = 0;
2660 gSCellTb1NackCount=0;
2662 gPCellTb1DtxCount = 0;
2663 gPCellTb2DtxCount = 0;
2664 gSCellTb1DtxCount = 0;
2665 gSCellTb2DtxCount = 0;
2666 gPcellZeroBoOcc = 0;
2667 gScellZeroBoOcc = 0;
2675 } /* rgSCHTomTtiInd */
2677 /** @brief This function does the TTI processin for the uplink subframe,
2678 * already populated by the scheduler.
2682 * Function: rgSCHTomUtlProcUlSf
2685 * - Loop through the Uplink allocations present in the uplink subframe.
2686 * - For each allocation Fill a data reception request to be sent to PHY
2687 * - Also fills the harq reception requests for the expected HQ feedbacks.
2690 * @param [in] RgSchCellCb *cell
2691 * @param [out] RgSchErrInfo *err
2697 static S16 rgSCHTomUtlProcUlSf
2704 TfuRecpReqInfo *recpReqInfo;
2706 uint16_t validIdx = 0; /* Index computed from recreq's timing info*/
2708 Inst inst = cell->instIdx;
2710 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2711 sizeof(TfuRecpReqInfo))) != ROK)
2713 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuRecpReqInfo "
2715 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2718 recpReqInfo->cellId = cell->cellId;
2719 cmLListInit(&recpReqInfo->ueRecpReqLst);
2721 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo,
2722 TFU_RECPREQ_DLDELTA);
2724 /* Filling data Reception requests */
2725 ret = rgSCHTomUtlFillDatRecpReq(recpReqInfo, cell,
2730 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Data recption "
2731 "requests for cell");
2732 RGSCH_FREE_MEM(recpReqInfo);
2735 /* Filling HARQ Reception requests */
2736 ret = rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, validIdx,err);
2739 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Harq Feedback "
2740 "reception requests for cell");
2741 RGSCH_FREE_MEM(recpReqInfo);
2744 /* sending the RecpReq to Phy */
2745 //if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
2747 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for cell");
2750 } /* end of rgSCHTomUtlProcUlSf */
2754 /** @brief This function does the TTI processin for the uplink subframe,
2755 * already populated by the scheduler.
2759 * Function: rgSCHTomUtlPrcUlTddSpclSf
2762 * - Fill the SRS Info for the Special Subframe in Reception Req.
2763 * - Send the Reception Req to TFU
2766 * @param [in] RgSchCellCb *cell
2767 * @param [out] RgSchErrInfo *err
2772 static S16 rgSCHTomUtlPrcUlTddSpclSf
2779 TfuRecpReqInfo *recpReqInfo;
2780 uint16_t validIdx; /* Index computed from recreq's timing info*/
2781 Inst inst = cell->instIdx;
2783 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2784 sizeof(TfuRecpReqInfo))) != ROK)
2786 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to "
2787 "Allocate TfuRecpReqInfo for cell");
2788 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2791 recpReqInfo->cellId = cell->cellId;
2792 cmLListInit(&recpReqInfo->ueRecpReqLst);
2794 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo, TFU_RECPREQ_DLDELTA);
2796 RG_SCH_GET_IDX_PCQISRSSR(recpReqInfo->timingInfo, validIdx);
2799 if(cell->srsCfg.isSrsCfgPres &&
2800 rgSchTddCellSpSrsSubfrmTbl[cell->srsCfg.srsSubFrameCfg][recpReqInfo->timingInfo.slot])
2802 recpReqInfo->srsPres = TRUE;
2806 recpReqInfo->srsPres = FALSE;
2809 /* Filling SRS Reception requests */
2810 ret = rgSCHTomUtlFillSrsRecpReq (recpReqInfo, cell, validIdx, err);
2813 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to fill"
2814 " SRS recption requests for cell");
2815 RGSCH_FREE_MEM(recpReqInfo);
2818 /* sending the RecpReq to Phy */
2819 //if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
2821 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to send "
2822 "Cntrl info for cell");
2825 } /* end of rgSCHTomUtlPrcUlTddSpclSf */
2828 /** @brief This function does all the processing related to a single downlink
2833 * Function: rgSCHTomUtlProcDlSf
2836 * - collate control data for all UEs and send to PHY
2837 * - collate data buffers for all UEs and send to PHY
2839 * @param [in] RgSchDlSf *dlSf
2840 * @param [in] RgSchDlSf *ulSf
2841 * @param [in] RgSchCellCb *cell
2842 * @param [out] RgSchErrInfo *err
2845 static S16 rgSCHTomUtlProcDlSf
2850 RgTfuCntrlReqInfo *cntrlInfo,
2854 Inst inst = cell->instIdx;
2856 uint8_t sfTyp = 1; /* Dl Subframe */
2858 cmLListInit(&cntrlInfo->phichLst);
2859 cmLListInit(&cntrlInfo->dlPdcchLst);
2860 cmLListInit(&cntrlInfo->ulPdcchLst);
2862 #ifdef TFU_ALLOC_EVENT_NO_INIT
2863 cntrlInfo->ulTiming.sfn = cntrlInfo->ulTiming.subframe = 0;
2865 cntrlInfo->dlTiming = cell->dlDciTime;
2866 cntrlInfo->cellId = cell->cellId;
2867 cntrlInfo->ulTiming = cell->hiDci0Time;
2868 if((0 == (cntrlInfo->dlTiming.sfn % 30)) && (0 == cntrlInfo->dlTiming.slot))
2870 //printf("5GTF_CHECK rgSCHTomUtlProcDlSf Cntrl dl (%d : %d) ul (%d : %d)\n", cntrlInfo->dlTiming.sfn, cntrlInfo->dlTiming.subframe, cntrlInfo->ulTiming.sfn, cntrlInfo->ulTiming.subframe);
2872 /* Fill PCFICH info */
2873 /* Fix for DCFI FLE issue: when DL delta is 1 and UL delta is 0 and CFI
2874 *change happens in that SF then UL PDCCH allocation happens with old CFI
2875 *but CFI in control Req goes updated one since it was stored in the CELL
2877 cntrlInfo->cfi = dlSf->pdcchInfo.currCfi;
2878 #ifndef RG_ULSCHED_AT_CRC
2881 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
2882 [cell->hiDci0Time.subframe];
2883 if(dlSf->sfType == RG_SCH_SPL_SF_DATA)
2885 RGSCH_GET_SPS_SF_CFI(cell->bwCfg.dlTotalBw, cntrlInfo->cfi);
2890 /* Fill PHICH info */
2891 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
2893 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PHICH info "
2894 "for cellId (%d)\n", cell->cellId));
2895 RGSCH_FREE_MEM(cntrlInfo);
2898 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) !=
2901 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
2902 "for cellId (%d)\n", cell->cellId));
2903 RGSCH_FREE_MEM(cntrlInfo);
2908 if(0 == cntrlInfo->ulMpdcchLst.count)
2915 sfTyp = rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
2916 [cell->dlDciTime.subframe];
2918 if (sfTyp != 2) /* Uplink subframe */
2920 /* Fill PDCCH info */
2921 if ((ret = rgSCHTomUtlFillDlPdcch(cell,cntrlInfo, dlSf, err)) != ROK)
2923 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
2924 "for cellId (%d)\n", cell->cellId));
2925 RGSCH_FREE_MEM(cntrlInfo);
2928 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
2929 rgBwAlcnt[dlSf->sfNum] ++;
2932 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
2933 cntrlInfo->isSPSOcc = dlSf->isSPSOcc;
2935 cntrlInfo->numDlActvUes += dlSf->numDlActvUes; /* 4UE_TTI_DELTA */
2936 dlSf->numDlActvUes = 0;
2938 if(0 == cntrlInfo->dlMpdcchLst.count)
2943 /* Now always sending down a cntrl req */
2944 /* sending the cntrl data to Phy */
2945 //if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
2948 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info "
2956 /** @brief This function handles sending of the PHICH information for the
2957 * downlink subframe to be sent in the next TTI.
2964 * - Loop through the PHICH information present in the downlink
2965 * subframe and fill the information in cntrlInfo.
2967 * @param [out] TfuCntrlReqInfo *cntrlInfo
2968 * @param [in] RgSchDlSf *dlSf
2969 * @param [out] RgSchErrInfo *err
2974 static S16 rgSCHTomUtlFillPhich
2977 TfuCntrlReqInfo *cntrlInfo,
2985 TfuPhichInfo *harqAck;
2987 RgSchCmnDlCell *cellDl = RG_SCH_CMN_GET_DL_CELL(cell);
2991 /* Traversing the list of Phichs */
2992 node = dlSf->phichInfo.phichs.first;
2995 phich = (RgSchPhich*)node->node;
2996 if ((ret = rgSCHUtlGetEventMem((Ptr *)&harqAck, sizeof(TfuPhichInfo),
2997 &(cntrlInfo->memCp))) != ROK)
2999 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3002 #ifdef TFU_ALLOC_EVENT_NO_INIT
3003 harqAck->txPower = 0;
3005 /* fill in the tfu structure from the information present in the
3007 harqAck->rbStart = phich->rbStart;
3008 harqAck->nDmrs = phich->nDmrs;
3009 harqAck->isAck = phich->hqFeedBack;
3010 harqAck->isForMsg3 = phich->isForMsg3; /*SR_RACH_STATS : PHICH ACK/NACK for MSG3 */
3012 /* Changes for passing iPhich at TFU interface*/
3013 harqAck->iPhich = phich->iPhich;
3015 /* ccpu00138898 - Added Tx pwr offset for PHICH Tx*/
3017 harqAck->txPower = cellDl->phichTxPwrOffset;
3019 cmLListAdd2Tail(&cntrlInfo->phichLst, &(harqAck->lnk));
3020 harqAck->lnk.node = (PTR)harqAck;
3022 } /* end of while */
3028 /** @brief This function is a utility function to restart
3029 * deactivation timer.
3033 * Function: rgSCHTmrRestartScellDeactTmr
3036 * - Starts timer at scheduler
3038 * @param[in] RgSchCellCb *cell
3039 * @param[in] CmLteRnti rnti
3042 static Void rgSCHTmrRestartScellDeactTmr
3048 RgSchUeCellInfo *sCellInfo = NULLP;
3052 if(RG_SCH_IS_CELL_SEC(ueCb, cell))
3054 sCellInfo = ueCb->cellInfo[(ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)])];
3056 if(sCellInfo->deactTmr.tmrEvnt != TMR_NONE)
3058 rgSCHTmrStopTmr(cell, RG_SCH_TMR_SCELL_DEACT, sCellInfo);
3060 if(PRSNT_NODEF == ueCb->sCellDeactTmrVal.pres)
3063 rgSCHTmrStartTmr(cell,sCellInfo,RG_SCH_TMR_SCELL_DEACT,
3064 ueCb->sCellDeactTmrVal.val);
3069 }/*end of rgSCHTmrRestartScellDeactTmr*/
3072 /** @brief This function will send all the PDCCH's for the given downlink
3080 * - Loop through all the scheduled HARQ processes and fill
3081 * the PDCCH information in cntrlInfo.
3083 * @param [out] TfuCntrlReqInfo *cntrlInfo
3084 * @param [in] RgSchDlSf *dlSf
3085 * @param [out] RgSchErrInfo *err
3090 uint32_t numdlSpsRelSentToTf;
3091 static S16 rgSCHTomUtlFillDlPdcch
3094 TfuCntrlReqInfo *cntrlInfo,
3102 TfuPdcchInfo *tfuPdcch;
3103 uint8_t isDcivld = FALSE;
3104 uint8_t numUePerTti = 0;
3107 /* Traversing the scheduled Harq processes */
3108 node = dlSf->pdcchInfo.pdcchs.first;
3111 pdcch = (RgSchPdcch*)node->node;
3112 switch(pdcch->dci.dciFormat)
3114 case TFU_DCI_FORMAT_3:
3115 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? TRUE : FALSE;
3118 case TFU_DCI_FORMAT_3A:
3119 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? TRUE : FALSE;
3132 /*ccpu00117179 - ADD - Build only non DCI format-0 messages */
3133 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_0) ||
3134 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A1) ||
3135 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A2))
3142 #ifdef RGSCH_SPS_STATS
3143 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_1A) &&
3144 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.mcs == 0x1F) &&
3145 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.type == TFU_ALLOC_TYPE_RIV) &&
3146 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.u.riv == 0xFFFFFFFF))
3148 numdlSpsRelSentToTf++;
3152 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3153 &(cntrlInfo->memCp))) != ROK)
3155 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3159 tfuPdcch->crnti = pdcch->crnti;
3160 tfuPdcch->isSpsRnti = pdcch->isSpsRnti;
3162 tfuPdcch->rnti = pdcch->rnti;
3165 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3167 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3169 tfuPdcch->nCce = pdcch->nCce;
3170 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3171 tfuPdcch->dci = pdcch->dci;
3173 //TODO_SID: Need to check these values during INT
3174 tfuPdcch->sectorId = 0;
3175 tfuPdcch->sccIdx = 0;
3178 /* SR_RACH_STATS : Reset isTBMsg4 */
3179 pdcch->dci.u.format1aInfo.t.pdschInfo.isTBMsg4 = FALSE;
3180 /* To be enhanced later for 2.1 */
3181 cmLListAdd2Tail(&cntrlInfo->dlPdcchLst, &(tfuPdcch->lnk));
3182 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3184 if((pdcch->rnti > 60) && (pdcch->rnti < 5000))
3186 #if defined (TENB_STATS) && defined (RG_5GTF)
3187 cell->tenbStats->sch.dl5gtfPdcchSend++;
3191 } /* end of while */
3193 if((numUePerTti) && (numUePerTti < RG_MAX_NUM_UE_PER_TTI ))
3195 cell->dlNumUeSchedPerTti[numUePerTti-1]++;
3197 gDlNumUePerTti[numUePerTti-1]++;
3201 } /* end of rgSCHTomUtlFillDlPdcch*/
3203 #ifdef RGSCH_SPS_STATS
3204 uint32_t rgSchSpsRelSentToTf;
3205 uint32_t rgSchSpsRelPdcchAllocd;
3207 /** @brief This function will send all the UL PDCCH's for the given
3215 * - Loop through all the scheduled HARQ processes and fill
3216 * the PDCCH information in cntrlInfo.
3218 * @param [out] TfuCntrlReqInfo *cntrlInfo
3219 * @param [in] RgSchDlSf *dlSf
3220 * @param [out] RgSchErrInfo *err
3225 static S16 rgSCHTomUtlFillUlPdcch
3228 TfuCntrlReqInfo *cntrlInfo,
3236 TfuPdcchInfo *tfuPdcch;
3237 uint8_t isDcivld = FALSE;
3240 /* Traversing the scheduled Harq processes */
3241 node = dlSf->pdcchInfo.pdcchs.first;
3244 pdcch = (RgSchPdcch*)node->node;
3246 /*ccpu00116712- Function should pick only UL allocation related control
3248 switch(pdcch->dci.dciFormat)
3250 case TFU_DCI_FORMAT_A1:
3254 case TFU_DCI_FORMAT_A2:
3258 case TFU_DCI_FORMAT_3:
3259 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? FALSE : TRUE;
3262 case TFU_DCI_FORMAT_3A:
3263 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? FALSE : TRUE;
3278 /*ccpu00116712- Function should pick only UL allocation related control
3280 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3281 &(cntrlInfo->memCp))) != ROK)
3283 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3286 tfuPdcch->rnti = pdcch->rnti;
3288 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3290 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3292 tfuPdcch->nCce = pdcch->nCce;
3293 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3294 tfuPdcch->dci = pdcch->dci;
3296 //TODO_SID: Need to check these values during INT
3297 tfuPdcch->sectorId = 0;
3298 tfuPdcch->sccIdx = 0;
3301 /* To be enhanced later for 2.1 */
3303 #if defined (TENB_STATS) && defined (RG_5GTF)
3304 cell->tenbStats->sch.ul5gtfPdcchSend++;
3306 cmLListAdd2Tail(&cntrlInfo->ulPdcchLst, &(tfuPdcch->lnk));
3307 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3308 } /* end of while */
3310 #ifdef RGSCH_SPS_STATS
3311 if (rgSchSpsRelSentToTf != rgSchSpsRelPdcchAllocd)
3317 } /* end of rgSCHTomUtlFillUlPdcch*/
3319 /** @brief This function does the processing for Timing adjustment.
3326 * - Loop through the ue present ueTimeLst, decrement the remaining
3330 * @param [in] RgSchCellCb *cell
3335 static S16 rgSCHTomUtlProcTA(RgSchCellCb *cell)
3340 node = cell->taUeLst.first;
3343 ue = (RgSchUeCb *)node->node;
3345 if (ue->dl.taCb.numRemSf == 0)
3347 ue->dl.taCb.state = RGSCH_TA_IDLE;
3348 /* If Outstanding Ta is present, schedule it */
3349 if(ue->dl.taCb.outStndngTa == TRUE)
3351 rgSCHUtlReTxTa(cell, ue);
3355 /* We need to reset state and also value of TA,
3356 * then we start the timer */
3357 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
3358 /* Start the timer only if TA is cfgd as FINITE value */
3359 if (ue->dl.taCb.cfgTaTmr)
3361 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
3364 /* need to delete from the link list */
3365 cmLListDelFrm(&(cell->taUeLst), &(ue->taLnk));
3366 ue->taLnk.node = NULLP;
3370 ue->dl.taCb.numRemSf--;
3372 } /* end of taUeLst */
3374 } /* end of rgSCHTomUtlProcTA */
3376 /** @brief This function handles filling of Hq reception request to
3390 S16 rgSCHTomUtlFillHqFdbkInfo
3392 TfuRecpReqInfo *recpReqInfo,
3395 RgSchDlHqProcCb *hqCb,
3397 TfuUeRecpReqInfo *pucchRecpInfo,
3398 RgSchDlHqProcCb *prvHqCb,
3402 S16 rgSCHTomUtlFillHqFdbkInfo
3404 TfuRecpReqInfo *recpReqInfo,
3406 RgSchDlHqProcCb *hqCb,
3408 TfuUeRecpReqInfo *pucchRecpInfo,
3409 RgSchDlHqProcCb *prvHqCb,
3415 RgSchDlHqTbCb *tbCb;
3417 Bool isAddToLst = FALSE;
3419 for (idx = 0 ;idx < 2; idx++)
3421 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
3423 tbCb = &hqCb->tbInfo[idx];
3425 /* FOR ACK NAK REP */
3426 if ((hqCb->hqE->ue != NULLP) &&
3427 (hqCb->hqE->ue->measGapCb.isMeasuring == TRUE))
3429 if ((tbCb->fbkRecpRepCntr) &&
3430 (--tbCb->fbkRecpRepCntr))
3432 /* Add to next subfarme */
3433 /* Add this hqCb to the next dlSf's ackNakRepQ */
3434 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3435 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3436 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3437 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3440 rgSCHTomUtlMoveNxtOccasion(cell, hqCb->hqE->ue, validIdx);
3448 /* Go to the next node */
3454 //if (hqCb != prvHqCb)
3456 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3457 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3460 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
3461 "TfuUeRecpReqInfo for cell");
3462 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3465 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3466 if ((hqCb->hqE->ue != NULLP) /*&&
3467 ((tbCb->lchSchdData[0].lcId != 0) || (tbCb->taSnt ==
3471 pucchRecpInfo->rnti = hqCb->hqE->ue->ueId;
3475 if (hqCb->hqE->raCb)
3477 pucchRecpInfo->rnti = hqCb->hqE->raCb->tmpCrnti;
3483 if (!hqCb->spsN1PucchRes.pres)
3486 pucchRecpInfo->t.pucchRecpReq.hqType =
3487 TFU_HQ_RECP_REQ_NORMAL;
3488 pucchRecpInfo->t.pucchRecpReq.t.nCce =
3494 pucchRecpInfo->t.pucchRecpReq.hqType =
3495 TFU_HQ_RECP_REQ_N1PUCCH;
3496 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch =
3497 hqCb->spsN1PucchRes.val;
3501 /* Handling of other types */
3502 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
3503 #else /* TFU_UPGRADE */
3504 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
3505 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
3506 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
3508 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 2; /* MIMO */
3512 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 1; /* NON-MIMO */
3516 /* PucchRecpReq needs to be filled up for n1Pucch resource for SPS
3518 if (hqCb->spsN1PucchRes.pres)
3520 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
3523 #endif /* LTEMAC_SPS */
3525 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
3526 cell->pucchCfg.n1PucchAn);
3529 rgSCHEmtcFillPucchRecpInfo(cell, hqCb, &(pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0]));
3532 #endif/*TFU_UPGRADE*/
3535 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, hqCb->hqE->ue,
3536 pucchRecpInfo, validIdx,FALSE);
3539 /* Passing last parameter as FALSE in this case as it will be verified from hqCb*/
3540 isAddToLst = rgSCHEmtcAddRecpInfoToLst(hqCb,recpReqInfo, pucchRecpInfo,FALSE);
3544 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3546 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3549 if ((tbCb->fbkRecpRepCntr) &&
3550 (--tbCb->fbkRecpRepCntr))
3552 /* Add to next subfarme */
3553 /* Add this hqCb to the next dlSf's ackNakRepQ */
3554 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3555 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3556 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3557 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3563 }/* end of rgSCHTomUtlFillHqFdbkInfo */
3566 /** @brief This function handles filling of Hq reception request to
3571 * Function:rgSCHTomUtlFillHqFdbkFor5gtf
3575 * @param [out] TfuRecpReqInfo *recpReqInfo
3576 * @param [in] RgSchCellCb *cell
3577 * @param [in] uint16_t validIdx,
3578 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3579 * @param [in] RgSchDlSf *dlSf,
3580 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3581 * @param [out] RgSchErrInfo *err
3587 static S16 rgSCHTomUtlFillHqFdbkFor5gtf
3589 TfuRecpReqInfo *recpReqInfo,
3592 RgSchDlHqInfo *dlSfHqInfo,
3594 TfuUeRecpReqInfo *pucchRecpInfo,
3599 Inst inst = cell->instIdx;
3603 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3605 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
3611 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3612 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3615 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
3616 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
3617 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3620 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3621 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
3622 * instead of SPS-CRNTI */
3624 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
3626 pucchReqInfo->uciInfo = TFU_XPUCCH_UCI_INFO;
3628 /* 5gtf TODO : Hardcoded nPUCCHIdx */
3629 pucchReqInfo->uciPduInfo.pucchIndex = 0;
3631 pucchReqInfo->uciPduInfo.numBits = 1;
3633 /* 5gtf TODO : CQI Periodicity Hardcoded to (n,0)*/
3634 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
3636 pucchReqInfo->uciPduInfo.numBits += 5;
3637 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
3638 ue->ue5gtfCb.cqiRiPer);
3641 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3642 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3644 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
3648 /** @brief This function handles filling of Hq reception request to
3653 * Function:rgSCHTomUtlFillHqFdbkForFrmt1B
3656 * Allocates the N1Pucch Resources based on teh A Value
3658 * @param [out] TfuRecpReqInfo *recpReqInfo
3659 * @param [in] RgSchCellCb *cell
3660 * @param [in] uint16_t validIdx,
3661 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3662 * @param [in] RgSchDlSf *dlSf,
3663 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3664 * @param [out] RgSchErrInfo *err
3671 static S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3673 TfuRecpReqInfo *recpReqInfo,
3676 RgSchDlHqInfo *dlSfHqInfo,
3678 TfuUeRecpReqInfo *pucchRecpInfo,
3682 static S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3684 TfuRecpReqInfo *recpReqInfo,
3686 RgSchDlHqInfo *dlSfHqInfo,
3688 TfuUeRecpReqInfo *pucchRecpInfo,
3694 Inst inst = cell->instIdx;
3698 RgSchDlHqProcCb *hqCb = NULLP;
3700 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3701 Bool isDatPresOnSecCell = FALSE;
3702 uint8_t primCellTbCount = 0;
3704 hqPNode = dlSfHqInfo->hqPLst.first;
3705 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
3711 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3712 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3715 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
3716 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
3717 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3720 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3721 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
3722 * instead of SPS-CRNTI */
3724 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
3727 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
3728 /* Handling of other types */
3729 pucchReqInfo->type = TFU_UCI_HARQ;
3730 #else /* TFU_UPGRADE */
3731 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
3732 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
3733 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
3734 /* Fill HqSz by using totalTbCnt based on the TM mode and
3735 * the number of serv cells configured*/
3737 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
3738 pucchReqInfo->hqInfo.pucchResCnt = ue->f1bCsAVal;
3740 memset(pucchReqInfo->hqInfo.hqRes,0xff,sizeof(uint16_t)*TFU_MAX_HQ_RES);
3742 /* Two Resources needs to be configured if the
3743 * serving cell is in mimo mode else single
3745 if ((dlSf->relPdcch != NULLP) &&
3746 (RGSCH_TIMEINFO_SAME(recpReqInfo->timingInfo, ue->relPdcchFbkTiming)))
3747 {/* Pcell is having sps rel pdcch present */
3748 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
3749 {/* prim cell is in mimo mode, use 0 and 1 */
3750 pucchReqInfo->hqInfo.hqRes[0] = (dlSf->relPdcch->nCce +
3751 cell->pucchCfg.n1PucchAn);
3752 pucchReqInfo->hqInfo.hqRes[1] = pucchReqInfo->hqInfo.hqRes[0] + 1;
3757 pucchReqInfo->hqInfo.hqRes[2] = (dlSf->relPdcch->nCce +
3758 cell->pucchCfg.n1PucchAn);
3760 /* Release the pdcch so that it will not further processed */
3761 rgSCHUtlPdcchPut(ue->cell,&dlSf->pdcchInfo, dlSf->relPdcch);
3762 dlSf->relPdcch = NULLP;/* only one UE will be scheduled for release pdcch order in one tti */
3764 #endif/*LTEMAC_SPS*/
3765 #endif/*TFU_UPGRADE*/
3768 hqCb = (RgSchDlHqProcCb *)hqPNode->node;
3769 hqPNode = hqPNode->next;
3770 /* In case of CSI + 1BCS , CSI will be
3771 * dropped if scheduling is present on
3772 * seconday cell.36.213 10.1.1
3774 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
3776 isDatPresOnSecCell = TRUE;
3779 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
3780 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
3782 primCellTbCount = 2;
3785 primCellTbCount = 1;
3789 pucchReqInfo->t.nCce = hqCb->pdcch->nCce;
3792 switch(ue->f1bCsAVal)
3794 case RG_SCH_A_VAL_2:
3795 /* harq(0) is primary harq(1) is secondary) */
3796 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
3798 pucchReqInfo->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.\
3799 cw1N1Res[hqCb->tpc].n1PucchIdx;
3801 else/* primary cell */
3804 /* Need to consider only sps occasions */
3805 if (hqCb->spsN1PucchRes.pres)
3807 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
3810 #endif /* LTEMAC_SPS */
3813 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
3814 cell->pucchCfg.n1PucchAn);
3818 case RG_SCH_A_VAL_3:
3819 /* Serving cell in mimo mode should be
3820 * in 0 and 1 and the serving cell in siso
3821 * mode should be in 2 indices */
3822 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
3824 uint8_t cellIdx = ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(hqCb->hqE->cell)];
3825 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[cellIdx]->txMode.txModeEnum) > 1)
3826 {/* Sec cell is in mimo mode, use 0 and 1 */
3827 pucchReqInfo->hqInfo.hqRes[0] =
3828 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
3830 pucchReqInfo->hqInfo.hqRes[1] =
3831 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
3834 {/* Sec cell is in siso mode, use 2 */
3835 pucchReqInfo->hqInfo.hqRes[2] =
3836 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
3840 {/* primary cell hq */
3841 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
3842 {/* prim cell is in mimo mode, use 0 and 1 */
3844 if (hqCb->spsN1PucchRes.pres)
3845 {/* SPS occasions */
3846 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
3847 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
3850 #endif /* LTEMAC_SPS */
3852 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
3853 cell->pucchCfg.n1PucchAn);
3854 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
3855 cell->pucchCfg.n1PucchAn + 1);
3859 {/* prim cell is in siso mode use 2 */
3861 /* Need to consider only sps occasions */
3862 if (hqCb->spsN1PucchRes.pres)
3864 pucchReqInfo->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
3867 #endif /* LTEMAC_SPS */
3870 pucchReqInfo->hqInfo.hqRes[2] = (hqCb->pdcch->nCce +
3871 cell->pucchCfg.n1PucchAn);
3877 case RG_SCH_A_VAL_4:
3879 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
3880 {/* 2 and 3 for sec cell */
3881 pucchReqInfo->hqInfo.hqRes[2] =
3882 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
3883 pucchReqInfo->hqInfo.hqRes[3] =
3884 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
3886 else/* primary cell */
3887 {/* 0 and 1 are for primary cell */
3889 /* Need to consider only sps occasions */
3890 if (hqCb->spsN1PucchRes.pres)
3892 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
3893 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
3896 #endif /* LTEMAC_SPS */
3899 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
3900 cell->pucchCfg.n1PucchAn);
3901 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
3902 cell->pucchCfg.n1PucchAn + 1);
3909 /* TOD:: Add error print */
3913 #endif/*TFU_UPGRADE*/
3924 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
3925 pucchRecpInfo, validIdx,isDatPresOnSecCell);
3927 /* Channel selection wil not be used in case of
3928 * CQI + HARQ. if the data was present only on
3930 if((isDatPresOnSecCell == FALSE) &&
3931 (dlSfHqInfo->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
3932 {/* Data is present only on primary cell */
3934 switch(pucchReqInfo->uciInfo)
3936 case TFU_PUCCH_HARQ_SRS:
3937 case TFU_PUCCH_HARQ_CQI:
3938 case TFU_PUCCH_HARQ_SR_SRS:
3939 case TFU_PUCCH_HARQ_SR_CQI:
3941 dlSfHqInfo->uciFrmtTyp = RG_SCH_UCI_FORMAT1A_1B;
3942 pucchReqInfo->hqInfo.hqSz = primCellTbCount;
3943 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
3952 #endif/*TFU_UPGRADE*/
3953 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3954 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3956 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
3957 /** @brief This function handles filling of Hq reception request to
3962 * Function:rgSCHTomUtlFillHqFdbkForFrmt3
3965 * Allocates the N1Pucch Resources based on teh A Value
3967 * @param [out] TfuRecpReqInfo *recpReqInfo
3968 * @param [in] RgSchCellCb *cell
3969 * @param [in] uint16_t validIdx,
3970 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3971 * @param [in] RgSchDlSf *dlSf,
3972 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3973 * @param [out] RgSchErrInfo *err
3980 static S16 rgSCHTomUtlFillHqFdbkForFrmt3
3982 TfuRecpReqInfo *recpReqInfo,
3985 RgSchDlHqInfo *dlSfHqInfo,
3987 TfuUeRecpReqInfo *pucchRecpInfo,
3991 static S16 rgSCHTomUtlFillHqFdbkForFrmt3
3993 TfuRecpReqInfo *recpReqInfo,
3995 RgSchDlHqInfo *dlSfHqInfo,
3997 TfuUeRecpReqInfo *pucchRecpInfo,
4003 Inst inst = cell->instIdx;
4008 TfuUePucchRecpReq *pucchReqInfo = NULLP;
4010 //hqPNode = dlSfHqInfo->hqPLst.first;
4011 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
4017 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4018 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
4021 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
4022 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
4023 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4026 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4027 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
4028 * instead of SPS-CRNTI */
4030 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
4033 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
4034 /* Handling of other types */
4035 pucchReqInfo->type = TFU_UCI_HARQ;
4036 #else /* TFU_UPGRADE */
4037 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
4038 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
4039 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4040 /* Fill HqSz by using totalTbCnt based on the TM mode and
4041 * the number of serv cells configured*/
4043 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
4044 pucchReqInfo->hqInfo.pucchResCnt = 1;
4046 memset(pucchReqInfo->hqInfo.hqRes,0xff,sizeof(uint16_t)*TFU_MAX_HQ_RES);
4047 #endif/*TFU_UPGRADE*/
4048 pucchReqInfo->hqInfo.hqRes[0] = dlSfHqInfo->n3ScellPucch.n3PucchIdx;
4050 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
4051 pucchRecpInfo, validIdx,TRUE);
4052 #endif/*TFU_UPGRADE*/
4053 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4054 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4056 }/* end of rgSCHTomUtlFillHqFdbkForFrmt3 */
4060 /** @brief This function handles filling of HARQ feedback recption request to
4069 * @param [out] TfuRecpReqInfo *recpReqInfo
4070 * @param [in] RgSchCellCb *cell
4071 * @param [out] RgSchErrInfo *err
4077 static S16 rgSCHTomUtlFillHqFdbkRecpReq
4079 TfuRecpReqInfo *recpReqInfo,
4085 static S16 rgSCHTomUtlFillHqFdbkRecpReq
4087 TfuRecpReqInfo *recpReqInfo,
4094 RgSchDlHqProcCb *hqCb;
4095 CmLteTimingInfo futTime;
4098 TfuUeRecpReqInfo *pucchRecpInfo = NULLP;
4100 RgSchDlHqProcCb *prvHqCb=NULLP;
4107 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper output
4108 * if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME() as it is
4109 * serving the purpose */
4110 RGSCHDECRFRMCRNTTIME(cell->crntTime, futTime, (RG_SCH_CMN_HARQ_INTERVAL -
4111 TFU_RECPREQ_DLDELTA));
4112 dlSf = rgSCHUtlSubFrmGet (cell, futTime);
4113 /* Get the next dlsf as well */
4114 RG_SCH_ADD_TO_CRNT_TIME(futTime, futTime, 1)
4115 nxtDlsf = rgSCHUtlSubFrmGet (cell, futTime);
4119 if (dlSf->ueLst.count != 0)
4121 node = dlSf->ueLst.first;
4124 ue = (RgSchUeCb *)(node->node);
4127 if(ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx].isPuschHarqRecpPres == TRUE)
4128 {/* This UE is already considered for PUSCH
4132 rgSCHTomUtlFillHqFdbkFor5gtf(recpReqInfo, cell, validIdx,
4133 &ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx], dlSf, pucchRecpInfo, err);
4134 } /* end of while */
4135 } /* If hq is expected */
4137 if (dlSf->msg4HqPLst.count != 0)
4140 node = dlSf->msg4HqPLst.first;
4143 hqCb = (RgSchDlHqProcCb*)(node->node);
4145 //TODO_SID: need to check validIdx
4146 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, validIdx, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err);
4148 } /* end of while */
4151 /* Check with TDD Code */
4152 /* FOR ACK NACK REP */
4154 } /* end of rgSCHTomUtlFillHqFdbkRecpReq */
4156 /** @brief This function handles filling of SR reception request to
4165 * @param [out] TfuRecpReqInfo *recpReqInfo
4166 * @param [in] RgSchCellCb *cell
4167 * @param [out] RgSchErrInfo *err
4173 static S16 rgSCHTomUtlFillSrRecpReq
4175 TfuRecpReqInfo *recpReqInfo,
4182 TfuUeRecpReqInfo *pucchRecpInfo;
4188 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
4194 node = cell->pCqiSrsSrLst[validIdx].srLst.first;
4197 ue = (RgSchUeCb *)(node->node);
4198 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4204 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4205 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4207 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4208 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4209 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4212 #ifdef TFU_ALLOC_EVENT_NO_INIT
4213 memset(&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4214 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4220 /* Should we check for Rel8 and above???
4221 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
4223 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
4224 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
4225 if((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
4226 (ulSpsUe->isUlSpsActv))
4228 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4233 pucchRecpInfo->rnti = ue->ueId;
4234 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
4235 ue->srCb.srCfg.srSetup.srResIdx;
4236 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR;
4237 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4238 rgSCHTomUtlFillCqiSrsWithSr(cell, ue, recpReqInfo,
4239 pucchRecpInfo, validIdx);
4241 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4245 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4247 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4250 }/* end of rgSCHTomUtlFillSrRecpReq */
4253 /** @brief This function tells will the UE has a periodic CQI/PMI/RI
4262 * @param [in] RgSchUeCb *ue
4263 * @param [out] Bool *willueRprtCqiRi
4269 static S16 rgSCHTomUtlWillUeRprtCqiRi
4272 Bool *willueRprtCqiRi
4275 /* Intialising Reporting probability as TRUE */
4276 *willueRprtCqiRi = TRUE;
4278 /* Checking the cases in which UE will not report CQIPMI/RI */
4279 if(ue->isDrxEnabled && ue->drxCb)
4282 if(ue->drxCb->cqiMask.pres && ue->drxCb->cqiMask.val == RGR_DRX_SETUP)
4283 {/*cqiMask is setup by upper layers */
4284 if((ue->drxCb->drxUlInactvMask & RG_SCH_DRX_ONDUR_BITMASK) ==
4285 RG_SCH_DRX_ONDUR_BITMASK)
4286 {/*onDuration NOT running, do not expect cqi/pmi/ri*/
4287 *willueRprtCqiRi = FALSE;
4291 #endif /*end of LTEMAC_R9*/
4292 /* ccpu00134258: Fix for CQI DRX issue*/
4293 if(ue->drxCb->onDurTmrLen > 2)
4295 if ( !RG_SCH_DRX_UL_IS_UE_ACTIVE(ue->drxCb) )
4296 {/*UE is not active, do not expect cqi/pmi/ri*/
4297 *willueRprtCqiRi = FALSE;
4300 }/*ue->isDrxEnabled*/
4302 } /*End of rgSCHTomUtlWillUeRprtCqiRi*/
4304 /** @brief This function handles filling of RI reception request to
4313 * @param [out] TfuRecpReqInfo *recpReqInfo
4314 * @param [in] RgSchCellCb *cell
4315 * @param [in] uint16_t validIdx
4316 * @param [out] RgSchErrInfo *err
4322 static S16 rgSCHTomUtlFillRiRecpReq
4324 TfuRecpReqInfo *recpReqInfo,
4331 TfuUeRecpReqInfo *pucchRecpInfo;
4334 Bool willUeRprtCqi; /* Flag set due to CQI Mask
4335 and UE inactive state (DRX) */
4336 RgSchUePCqiCb *riCb = NULLP;
4338 node = cell->pCqiSrsSrLst[validIdx].riLst.first;
4341 riCb = (RgSchUePCqiCb *)(node->node);
4342 ue = riCb->servCellInfo->ue;
4343 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4345 if(riCb->riRecpPrcsd)
4347 /*ccpu00140578:: RI Proecssing is already done for this TTI
4348 * as part of PUSCH reception process or HARQ
4349 * Reception processing. Hence skipping this UE
4351 riCb->riRecpPrcsd = FALSE;
4354 if(riCb->riDist ==0)
4356 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4357 #ifdef XEON_SPECIFIC_CHANGES
4358 if(RGSCH_TIMEINFO_SAME(cell->crntTime, ue->riRecpTime))
4364 if((TRUE == riCb->isRiIgnoByCollsn)
4365 || (willUeRprtCqi == FALSE))
4367 if(willUeRprtCqi == FALSE)
4370 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4373 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4374 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4376 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4377 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4378 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4381 #ifdef TFU_ALLOC_EVENT_NO_INIT
4382 memset(&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4383 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4386 pucchRecpInfo->rnti = ue->ueId;
4387 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4388 riCb->cqiCfg.cqiSetup.cqiPResIdx;
4389 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = riCb->riNumBits;
4390 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4391 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4393 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4394 riCb->servCellInfo->sCellIdx;
4396 rgSCHTomUtlFillRiBitWidthInfo(ue);
4397 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4398 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
4400 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
4402 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4404 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4406 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4407 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4415 }/* end of rgSCHTomUtlFillRiRecpReq */
4418 /** @brief This function handles filling of 5GTF CQI-RI reception request to
4427 * @param [out] TfuRecpReqInfo *recpReqInfo
4428 * @param [in] RgSchCellCb *cell
4429 * @param [in] uint16_t validIdx
4430 * @param [out] RgSchErrInfo *err
4437 static S16 rgSCHTomUtlFillCqiRiRecpReq
4439 TfuRecpReqInfo *recpReqInfo,
4445 TfuUeRecpReqInfo *pucchRecpInfo;
4446 RgSchUeCb *ue = NULLP;
4449 while ((ue = rgSCHDbmGetNextUeCb(cell, ue)) != NULLP)
4451 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
4453 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4454 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4456 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4457 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4458 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4461 #ifdef TFU_ALLOC_EVENT_NO_INIT
4462 memset(&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4463 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4465 pucchRecpInfo->rnti = ue->ueId;
4466 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_XPUCCH_UCI_INFO;
4467 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.pucchIndex = 0;
4468 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.numBits = 5;
4470 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
4471 ue->ue5gtfCb.cqiRiPer);
4472 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4473 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4477 }/* end of rgSCHTomUtlFillCqiRiRecpReq */
4480 /** @brief This function handles filling of PCQI reception request to
4489 * @param [out] TfuRecpReqInfo *recpReqInfo
4490 * @param [in] RgSchCellCb *cell
4491 * @param [in] uint16_t validIdx
4492 * @param [out] RgSchErrInfo *err
4498 static S16 rgSCHTomUtlFillPcqiRecpReq
4500 TfuRecpReqInfo *recpReqInfo,
4507 TfuUeRecpReqInfo *pucchRecpInfo;
4510 uint8_t ri; /*RI value*/
4511 Bool willUeRprtCqi; /* Flag set due to CQI Mask and UE Inactive state (DRX)*/
4513 RgSchUePCqiCb *cqiCb = NULLP;
4514 Bool isAddToLst = FALSE;
4516 node = cell->pCqiSrsSrLst[validIdx].cqiLst.first;
4519 cqiCb = (RgSchUePCqiCb*)(node->node);
4520 ue = cqiCb->servCellInfo->ue;
4521 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4523 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4525 if ((cqiCb->isCqiIgnoByCollsn == TRUE) ||
4526 (willUeRprtCqi == FALSE))
4528 if(willUeRprtCqi == FALSE)
4531 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4535 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4537 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4538 cqiCb->servCellInfo->sCellIdx;
4540 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
4543 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to Fill CqiPmi "
4548 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4549 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4551 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4552 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4553 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4556 #ifdef TFU_ALLOC_EVENT_NO_INIT
4557 memset(&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4558 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4561 /*Fill PCQI params*/
4562 pucchRecpInfo->rnti = ue->ueId;
4563 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4564 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
4565 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = cqiPmiSz;
4566 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4567 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4568 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4570 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4573 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4577 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4579 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4582 }/* end of rgSCHTomUtlFillPcqiRecpReq */
4583 /** @brief This function handles filling of SRS reception request to
4592 * @param [out] TfuRecpReqInfo *recpReqInfo
4593 * @param [in] RgSchCellCb *cell
4594 * @param [in] uint16_t validIdx
4595 * @param [out] RgSchErrInfo *err
4600 static S16 rgSCHTomUtlFillSrsRecpReq
4602 TfuRecpReqInfo *recpReqInfo,
4609 TfuUeRecpReqInfo *pucchRecpInfo;
4613 node = cell->pCqiSrsSrLst[validIdx].srsLst.first;
4616 ue = (RgSchUeCb *)(node->node);
4617 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4619 if(ue->srsCb.srsRecpPrcsd)
4621 /* ccpu00140578::SRS Proecssing is already done for this TTI
4622 * as part of PUSCH or HARQ reception process and
4623 * hence skipping this UE */
4624 ue->srsCb.srsRecpPrcsd = FALSE;
4628 if(ue->srsCb.srsDist ==0)
4630 /* We need to add the recp request to be sent on the pucchANRep value. */
4631 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4632 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4634 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4635 "TfuUeRecpReqInfo for RNTI:%d ",ue->ueId);
4636 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4640 #ifdef TFU_ALLOC_EVENT_NO_INIT
4641 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4645 pucchRecpInfo->rnti = ue->ueId;
4646 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
4647 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
4648 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
4649 ue->srsCb.srsCfg.srsSetup.fDomPosi;
4650 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
4651 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
4652 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
4653 ue->srsCb.srsCfg.srsSetup.txComb;
4654 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
4655 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
4656 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
4657 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
4659 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SRS;
4660 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4661 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4662 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4666 ue->srsCb.srsDist--;
4670 }/* end of rgSCHTomUtlFillSrsRecpReq */
4673 /** @brief This function handles filling of data reception requests for
4682 * @param [out] TfuRecpReqInfo *recpReqInfo
4683 * @param [in] RgSchCellCb *cell
4684 * @param [out] RgSchErrInfo *err
4689 static S16 rgSCHTomUtlFillDatRecpReq
4691 TfuRecpReqInfo *recpReqInfo,
4697 RgSchUlAlloc *alloc;
4698 TfuUeRecpReqInfo *datRecpInfo;
4701 /* processing steps are
4702 * - Run through the UL allocations going out in this subframe.
4703 * - Run through the UL receptions expected the next subframe.
4705 alloc = rgSCHUtlFirstRcptnReq (cell);
4708 /* FOR ACK NACK REP */
4709 if (NULLP != alloc->ue)
4711 /* If measuring or ackNakRep we shall not send dat RecpReq */
4712 if ((alloc->ue->measGapCb.isMeasuring == TRUE) ||
4713 (alloc->ue->ackNakRepCb.isAckNakRep == TRUE))
4715 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
4720 if ((ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
4721 sizeof(TfuUeRecpReqInfo),
4722 &(recpReqInfo->memCp))) != ROK)
4724 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4725 "TfuUeRecpReqInfo for RNTI:%d ", alloc->ue->ueId);
4726 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4729 if (!alloc->forMsg3)
4731 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
4732 rgSCHUtlAllocRcptInfo (alloc,
4734 &datRecpInfo->t.puschRecpReq.mcs,
4735 &datRecpInfo->t.puschRecpReq.rbStart,
4736 &datRecpInfo->t.puschRecpReq.numRb,
4737 &datRecpInfo->t.puschRecpReq.rv,
4738 &datRecpInfo->t.puschRecpReq.size,
4739 &datRecpInfo->t.puschRecpReq.modType,
4740 &datRecpInfo->t.puschRecpReq.isRtx,
4741 &datRecpInfo->t.puschRecpReq.nDmrs,
4742 &datRecpInfo->t.puschRecpReq.ndi,
4743 &datRecpInfo->t.puschRecpReq.harqProcId
4748 datRecpInfo->type = TFU_RECP_REQ_MSG3;
4749 rgSCHUtlAllocRcptInfo (alloc,
4751 &datRecpInfo->t.msg3RecpReq.mcs,
4752 &datRecpInfo->t.msg3RecpReq.rbStart,
4753 &datRecpInfo->t.msg3RecpReq.numRb,
4754 /*ccpu00128993 - MOD - fix for msg3 softcombining bug*/
4755 &datRecpInfo->t.msg3RecpReq.rv,
4756 &datRecpInfo->t.msg3RecpReq.size,
4757 &datRecpInfo->t.msg3RecpReq.modType,
4758 &datRecpInfo->t.msg3RecpReq.isRtx,
4759 &datRecpInfo->t.msg3RecpReq.nDmrs,
4760 &datRecpInfo->t.msg3RecpReq.ndi,
4761 &datRecpInfo->t.msg3RecpReq.harqProcId
4765 /* Other fields of datRecpInfo shall be filled
4766 * here for new features */
4767 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
4768 datRecpInfo->lnk.node = (PTR)datRecpInfo;
4770 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
4771 } /* end of while */
4773 } /* end of rgSCHTomUtlFillDatRecpReq */
4776 /** @brief This function handles filling of data reception requests for
4785 * @param [out] TfuRecpReqInfo *recpReqInfo
4786 * @param [in] RgSchCellCb *cell
4787 * @param [in] uint16_t validIdx
4788 * @param [out] RgSchErrInfo *err
4793 static S16 rgSCHTomUtlFillDatRecpReq
4795 TfuRecpReqInfo *recpReqInfo,
4801 CmLteTimingInfo dci0Time;
4804 RgSchUlAlloc *alloc;
4805 TfuUeRecpReqInfo *datRecpInfo;
4807 Bool isAperiodic = FALSE; /*Set when Aperiodic CQI is expected */
4808 uint8_t numUePerTti = 0;
4810 if((0 == (recpReqInfo->timingInfo.sfn % 30)) && (0 == recpReqInfo->timingInfo.slot))
4812 //printf("5GTF_CHECK rgSCHTomUtlFillDatRecpReq (%d : %d)\n", recpReqInfo->timingInfo.sfn, recpReqInfo->timingInfo.slot);
4814 /* processing steps are
4815 * - Run through the UL allocations going out in this subframe.
4816 * - Run through the UL receptions expected the next subframe.
4819 alloc = rgSCHUtlFirstRcptnReq (cell);
4822 isAperiodic = FALSE;
4823 ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
4824 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
4827 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4828 "TfuUeRecpReqInfo for RNTI:%d ", alloc->rnti);
4829 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4832 #ifdef TFU_ALLOC_EVENT_NO_INIT
4833 datRecpInfo->t.puschRecpReq.initialNSrs.pres = FALSE;
4834 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
4836 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
4837 /* Check if this if for MSG3 - no scope for feedback along with it. */
4838 if ((FALSE == alloc->forMsg3))
4840 /* Check if any DL HARQ processes has a feedback coming at the time of
4841 * this reception request.
4846 RGSCHDECRFRMCRNTTIME(cell->crntTime,dci0Time,(RGSCH_ULCTRL_RECP_DIST));
4848 idx = (dci0Time.sfn * RGSCH_NUM_SUB_FRAMES_5G + dci0Time.slot)%
4849 RGSCH_ULCTRL_RECP_DIST;
4851 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
4852 datRecpInfo->rnti = alloc->rnti;
4853 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
4854 &datRecpInfo->t.puschRecpReq.ulSchInfo);
4857 else /*Enters for Msg3 == TRUE condition*/
4859 /* ccpu00130884 - ADD - HO case when Msg3 alloc and Cqi/Ri/SRS opportunity
4860 * occur at same time */
4861 if(NULLP != alloc->ue)
4864 /* Only DATA is expected */
4865 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
4866 datRecpInfo->rnti = alloc->rnti;
4867 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
4868 &datRecpInfo->t.puschRecpReq.ulSchInfo);
4873 if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA &&
4874 datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_SRS &&
4875 isAperiodic == FALSE)
4877 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = TRUE;
4878 datRecpInfo->t.puschRecpReq.initialNumRbs.val = alloc->ue->initNumRbs;
4882 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
4885 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
4886 datRecpInfo->lnk.node = (PTR)datRecpInfo;
4887 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
4889 } /* end of while */
4891 if(numUePerTti && (numUePerTti < RG_MAX_NUM_UE_PER_TTI))
4893 cell->ulNumUeSchedPerTti[numUePerTti-1]++;
4894 gUlNumUePerTti[numUePerTti - 1]++;
4897 } /* end of rgSCHTomUtlFillDatRecpReq */
4899 /* rg009.201. Added changes of TFU_UPGRADE */
4901 /***********************************************************
4903 * Func : rgSCHTomUtlFillRiBitWidthInfo
4906 * Desc : Fills the RI BitWidth and stores it for decoding.
4915 **********************************************************/
4916 S16 rgSCHTomUtlFillRiBitWidthInfo
4921 RgSchUePCqiCb *riCb = ueCb->nPRiCb;
4923 if (ueCb->mimoInfo.txMode != RGR_UE_TM_3 &&
4924 ueCb->mimoInfo.txMode != RGR_UE_TM_4)
4929 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
4930 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
4931 (TfuDlCqiPucchMode)riCb->cqiCfg.cqiSetup.prdModeEnum;
4932 switch(ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode)
4934 case TFU_PUCCH_CQI_MODE10:
4935 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.type = TFU_RPT_RI;
4936 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.u.ri =
4939 case TFU_PUCCH_CQI_MODE11:
4940 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.type = TFU_RPT_RI;
4941 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.u.ri =
4944 case TFU_PUCCH_CQI_MODE20:
4945 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.type = TFU_RPT_RI;
4946 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.u.ri =
4949 case TFU_PUCCH_CQI_MODE21:
4950 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.type = TFU_RPT_RI;
4951 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.u.ri =
4958 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
4962 /***********************************************************
4964 * Func : rgSCHTomUtlFetchPcqiBitSz
4967 * Desc : Fetch the CQI/PMI bits for a UE based on the mode, periodicity.
4976 **********************************************************/
4977 uint8_t rgSCHTomUtlFetchPcqiBitSz
4984 uint8_t confRepMode;
4986 TfuCqiPucchMode10 *mode10Info;
4987 TfuCqiPucchMode11 *mode11Info;
4988 TfuCqiPucchMode20 *mode20Info;
4989 TfuCqiPucchMode21 *mode21Info;
4990 RgSchUePCqiCb *cqiCb = ueCb->nPCqiCb;
4993 confRepMode = cqiCb->cqiCfg.cqiSetup.prdModeEnum;
4994 if((ueCb->mimoInfo.txMode != RGR_UE_TM_3) &&
4995 (ueCb->mimoInfo.txMode != RGR_UE_TM_4))
5001 *ri = cqiCb->perRiVal;
5003 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
5004 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
5005 (TfuDlCqiPucchMode)confRepMode;
5008 case RGR_PRD_CQI_MOD10:
5010 mode10Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info;
5012 mode10Info->type = TFU_RPT_CQI;
5013 mode10Info->u.cqi = 4;
5017 case RGR_PRD_CQI_MOD11:
5019 mode11Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info;
5020 mode11Info->type = TFU_RPT_CQI;
5026 mode11Info->u.cqi.cqi = 4;
5027 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5028 mode11Info->u.cqi.pmi = 2;
5033 mode11Info->u.cqi.cqi = 4;
5034 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5035 mode11Info->u.cqi.wideDiffCqi.val = 3;
5036 mode11Info->u.cqi.pmi = 1;
5039 else if(numTxAnt == 4)
5044 mode11Info->u.cqi.cqi = 4;
5045 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5046 mode11Info->u.cqi.pmi = 4;
5051 mode11Info->u.cqi.cqi = 4;
5052 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5053 mode11Info->u.cqi.wideDiffCqi.val = 3;
5054 mode11Info->u.cqi.pmi = 4;
5059 /* This is number of antenna case 1.
5060 * This is not applicable for Mode 1-1.
5061 * So setting it to invalid value */
5067 case RGR_PRD_CQI_MOD20:
5069 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info;
5070 mode20Info->type = TFU_RPT_CQI;
5074 mode20Info->u.cqi.isWideband = TRUE;
5075 mode20Info->u.cqi.u.wideCqi = 4;
5079 pcqiSz = 4 + cqiCb->label;
5080 mode20Info->u.cqi.isWideband = FALSE;
5081 mode20Info->u.cqi.u.subCqi.cqi = 4;
5082 mode20Info->u.cqi.u.subCqi.l = cqiCb->label;
5087 case RGR_PRD_CQI_MOD21:
5089 mode21Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info;
5090 mode21Info->type = TFU_RPT_CQI;
5091 //pcqiSz = rgSCHTomUtlFetchPcqiBitSzPucchMode21(ueCb,
5092 // mode21Info, numTxAnt, ri);
5100 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5105 /***********************************************************
5107 * Func : rgSCHTomUtlPcqiSbCalcBpIdx
5110 * Desc : Determines the BP index from the timing info
5119 **********************************************************/
5120 S16 rgSCHTomUtlPcqiSbCalcBpIdx
5122 CmLteTimingInfo crntTimInfo,
5124 RgSchUePCqiCb *cqiCb
5127 uint16_t tti = (crntTimInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTimInfo.slot);
5128 uint16_t prdNum = tti/cqiCb->cqiPeri;
5130 if((prdNum % cqiCb->h) == 0)
5134 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
5139 cqiCb->isWb = FALSE;
5140 cqiCb->bpIdx = ((prdNum % cqiCb->h) - 1) % cqiCb->J;
5142 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_0;
5150 * @brief Function which moves PCQI, RI, SR and SRS to next periodicity
5151 * Occasions as that needs to be done in case of Ack/Nack repetition
5152 * reception request occasions or during Measurement Gap occasions.
5156 * Function: rgSCHTomUtlMoveNxtOccasion
5158 * Function which moves PCQI, RI, SR and SRS to next perodicity
5159 * Occasions as that needs to be done in case of Ack/Nack repetition
5160 * reception request occasions or during Measurement Gap occasions.
5162 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5165 * - Check whether the current Tx Instance matches with the rec req time
5166 * - If true, then move them to their next Tx Instance
5168 * @param[in] RgSchCellCb *cell,
5175 S16 rgSCHTomUtlMoveNxtOccasion
5182 RgSchUePCqiCb *cqiCb = ue->nPCqiCb;
5183 RgSchUePCqiCb *riCb = ue->nPRiCb;
5185 /* ccpu00140578::Skip the UE if already RI recpetion
5186 * is processed in the same subframe */
5187 if ((riCb->nRiTrIdx == validIdx) &&
5188 (riCb->riRecpPrcsd == FALSE))
5190 if(riCb->riDist ==0)
5192 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
5198 /* ccpu00140578:: As this UE is considered for this TTI
5199 * Same UE should not get processed for RI reception
5200 * or for updating th RI distance.*/
5201 if(riCb->nRiTrIdx == validIdx)
5203 riCb->riRecpPrcsd = TRUE;
5206 if (cqiCb->nCqiTrIdx == validIdx)
5208 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
5211 /* ccpu00140578::Skip the UE if SRS recpetion
5212 * is already processed in the same subframe */
5213 if ((ue->srsCb.nSrsTrIdx == validIdx) &&
5214 (ue->srsCb.srsRecpPrcsd == FALSE))
5216 if(ue->srsCb.srsDist ==0)
5218 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
5222 ue->srsCb.srsDist--;
5224 /* ccpu00140578:: As this UE is considered for this TTI
5225 * Same UE should not get processed for SRS reception
5226 * or for updating th SRS distance.*/
5227 if(ue->srsCb.nSrsTrIdx == validIdx)
5229 ue->srsCb.srsRecpPrcsd = TRUE;
5232 if (ue->srCb.nSrTrIdx == validIdx)
5234 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
5237 } /* rgSCHTomUtlMoveNxtOccasion */
5240 /***********************************************************
5242 * Func : rgSCHTomPrepareAcqiRecp
5245 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
5246 * for decoding. Fill RECP request and prepare the scartchpad
5247 * to aid decoding of Aperiodic CQI.
5256 **********************************************************/
5257 Void rgSCHTomPrepareAcqiRecp
5261 TfuUePuschCqiRecpInfo *cqiRecpReqInfo,
5265 uint8_t confRepMode;
5266 RgSchCqiRawPuschMode12 *mode12Info;
5267 RgSchCqiRawPuschMode20 *mode20Info;
5268 RgSchCqiRawPuschMode22 *mode22Info;
5269 RgSchCqiRawPuschMode30 *mode30Info;
5270 RgSchCqiRawPuschMode31 *mode31Info;
5271 uint8_t numTxAnt = cell->numTxAntPorts;
5272 uint8_t sCellIdx = ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)];
5273 uint8_t numOfCells = 0;
5274 RgSchUeACqiCb *acqiCb = &ueCb->cellInfo[sCellIdx]->acqiCb;
5277 cqiRecpReqInfo->reportType = TFU_APERIODIC_CQI_TYPE; /* Aperiodic */
5278 if (ueCb->mimoInfo.txMode == RGR_UE_TM_3 ||
5279 ueCb->mimoInfo.txMode == RGR_UE_TM_4)
5281 cqiRecpReqInfo->riSz[ccIdx].pres = TRUE;
5282 cqiRecpReqInfo->riSz[ccIdx].val = acqiCb->riNumBits;
5284 /* This flag will be rmeoved after making changes in BRDCM CL
5285 * Sachin is doing the change
5287 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
5289 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5290 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5292 if(ueCb->nPCqiCb->perRiVal == 1)
5294 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5298 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5301 /* Fill scratchpad to aid decoding of aper CQI upon
5303 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
5304 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUSCH;
5306 numOfCells = ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells;
5308 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5309 puschRawCqiInfo.mode = (TfuDlCqiPuschMode)confRepMode;
5311 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5312 puschRawCqiInfo.ri.pres = cqiRecpReqInfo->riSz[ccIdx].pres;
5314 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5315 puschRawCqiInfo.ri.val = cqiRecpReqInfo->riSz[ccIdx].val;
5317 /* Setting the sCellIdx */
5318 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5319 sCellIdx = sCellIdx;
5323 case RGR_APRD_CQI_MOD12:
5325 mode12Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5326 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode12Info;
5327 mode12Info->wideBCqiCw0 = 4;
5328 mode12Info->r1WideBCqiCw1 = 0;
5329 mode12Info->rg1WideBCqiCw1 = 4;
5332 mode12Info->r1TotalPmiBitLen = 2*acqiCb->N;
5333 mode12Info->rg1TotalPmiBitLen = acqiCb->N;
5335 else if(numTxAnt == 4)
5337 mode12Info->r1TotalPmiBitLen = 4*acqiCb->N;
5338 mode12Info->rg1TotalPmiBitLen = 4*acqiCb->N;
5343 case RGR_APRD_CQI_MOD20:
5345 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5346 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode20Info;
5347 mode20Info->wideBCqiCw = 4;
5348 mode20Info->subBandDiffCqi = 2;
5349 mode20Info->posOfM = acqiCb->L;
5353 case RGR_APRD_CQI_MOD22:
5355 mode22Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5356 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode22Info;
5357 mode22Info->wideBCqiCw0 = 4;
5358 mode22Info->sBDiffCqiCw0 = 2;
5359 mode22Info->r1WideBCqiCw1 = 0;
5360 mode22Info->r1SbDiffCqiCw1 = 0;
5361 mode22Info->rg1WideBCqiCw1 = 4;
5362 mode22Info->rg1SbDiffCqiCw1 = 2;
5363 mode22Info->posOfM = acqiCb->L;
5366 mode22Info->r1PmiBitLen = 4;
5367 mode22Info->rg1PmiBitLen = 2;
5369 else if(numTxAnt == 4)
5371 mode22Info->r1PmiBitLen = 8;
5372 mode22Info->rg1PmiBitLen = 8;
5377 case RGR_APRD_CQI_MOD30:
5379 mode30Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5380 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode30Info;
5381 mode30Info->wideBCqiCw = 4;
5382 mode30Info->totLenSbDiffCqi = 2*acqiCb->N;
5386 case RGR_APRD_CQI_MOD31:
5388 mode31Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5389 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode31Info;
5390 mode31Info->wideBCqiCw0 = 4;
5391 mode31Info->totLenSbDiffCqiCw0 = 2*acqiCb->N;
5392 mode31Info->r1WideBCqiCw1 = 0;
5393 mode31Info->r1TotLenSbDiffCqiCw1 =0;
5394 mode31Info->rg1WideBCqiCw1 = 4;
5395 mode31Info->rg1TotLenSbDiffCqiCw1 = 2*acqiCb->N;
5398 mode31Info->r1PmiBitLen = 2;
5399 mode31Info->rg1PmiBitLen = 1;
5401 else if(numTxAnt == 4)
5403 mode31Info->r1PmiBitLen = 4;
5404 mode31Info->rg1PmiBitLen = 4;
5415 * @brief Function which handles the filling of Aperiodic CQI/RI reception
5420 * Function: rgSCHTomUtlFillDatAperRecpReq
5422 * Function which handles the filling of Aperiodic CQI/RI reception
5425 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5428 * - Fill the reception request for the data arriving on the ULSCH
5429 * - Fill the reception request information for the Aperiodic CQI/PMI/RI
5431 * @param[in] RgSchCellCb *cell,
5432 * RgSchUlAlloc *alloc,
5433 * TfuUeRecpReqInfo *datRecpInfo,
5434 * CmLteTimingInfo *timeInfo,
5440 S16 rgSCHTomUtlFillDatAperRecpReq
5444 RgSchUlAlloc *alloc,
5445 TfuUeRecpReqInfo *datRecpInfo,
5446 CmLteTimingInfo *timeInfo,
5451 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5452 RgSchUeCb *ueCb = alloc->ue;
5454 uint8_t triggerSet = 0;
5458 /*Fill RI Reception Params*/
5459 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
5460 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
5461 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
5464 cqiRecpReqInfo->cCNum = 0;
5465 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells = 0;
5468 rgSCHTomUtlGetTrigSet(cell, ueCb, cqiReq, &triggerSet);
5469 for (sIdx = 0; sIdx < CM_LTE_MAX_CELLS; sIdx++)
5471 /* The Aperiodic request for SCell index sIdx */
5472 if ((triggerSet >> (7 - sIdx)) & 0x01)
5474 /* The Aperiodic request for SCell index sIdx */
5475 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[sIdx]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5476 cqiRecpReqInfo->cCNum++;
5477 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5481 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[0]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5482 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5485 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5487 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
5489 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
5490 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
5494 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
5496 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
5500 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
5502 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
5504 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
5506 datRecpInfo->rnti = alloc->rnti;
5507 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
5508 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5510 } /* rgSCHTomUtlFillDatAperRecpReq */
5515 * @brief Function which handles the filling of Periodic RI reception
5516 * request values which arrives along with UL Data on ULSCH
5520 * Function: rgSCHTomUtlFillDatPriRecpReq
5522 * Function which handles the filling of Periodic RI reception
5523 * request values which arrives along with UL Data on ULSCH
5525 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5528 * - Fill the reception request for the data arriving on the ULSCH
5529 * - Fill the reception request information for the Periodic RI
5531 * @param[in] RgSchCellCb *cell,
5532 * RgSchUlAlloc *alloc,
5533 * TfuUeRecpReqInfo *datRecpInfo,
5534 * CmLteTimingInfo *timeInfo,
5540 S16 rgSCHTomUtlFillDatPriRecpReq
5543 RgSchUlAlloc *alloc,
5544 TfuUeRecpReqInfo *datRecpInfo,
5545 CmLteTimingInfo *timeInfo,
5550 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5552 /*Fill RI Reception Params*/
5553 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
5554 #ifdef TFU_ALLOC_EVENT_NO_INIT
5555 cqiRecpReqInfo->cqiBetaOff = 0;
5556 /* Fill only the first RI index since Periodic can come
5558 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
5559 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
5561 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* periodic */
5562 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
5564 /* Fill only the first RI index since Periodic can come
5566 cqiRecpReqInfo->cCNum = 1;
5567 cqiRecpReqInfo->riSz[0].pres = TRUE;
5568 cqiRecpReqInfo->riSz[0].val = alloc->ue->nPRiCb->riNumBits;
5570 rgSCHTomUtlFillRiBitWidthInfo(alloc->ue);
5571 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
5573 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
5574 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
5578 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
5580 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
5584 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
5586 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
5588 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
5590 datRecpInfo->rnti = alloc->rnti;
5591 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
5592 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5594 } /* rgSCHTomUtlFillDatPriRecpReq */
5598 * @brief Function which handles the filling of Periodic CQI/PMI reception
5599 * request values which arrives along with UL Data on ULSCH
5603 * Function: rgSCHTomUtlFillDatPCqiRecpReq
5605 * Function which handles the filling of Periodic CQI/PMI reception
5606 * request values which arrives along with UL Data on ULSCH
5608 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5611 * - Fill the reception request for the data arriving on the ULSCH
5612 * - Fill the reception request information for the Periodic CQI/PMI
5614 * @param[in] RgSchCellCb *cell,
5615 * RgSchUlAlloc *alloc,
5616 * TfuUeRecpReqInfo *datRecpInfo,
5617 * CmLteTimingInfo *timeInfo,
5624 S16 rgSCHTomUtlFillDatPCqiRecpReq
5627 RgSchUlAlloc *alloc,
5628 TfuUeRecpReqInfo *datRecpInfo,
5629 CmLteTimingInfo *timeInfo,
5634 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5635 uint8_t cqiPmiSz; /*Raw CQI/PMI Size*/
5638 /*Fill CQI Reception Params*/
5639 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
5640 #ifdef TFU_ALLOC_EVENT_NO_INIT
5641 cqiRecpReqInfo->riBetaOff = 0;
5643 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
5644 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(alloc->ue, cell->numTxAntPorts, &ri);
5647 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Fill "
5648 "CqiPmi size RNTI:%d",alloc->rnti);
5652 /* Fill only the first RI index since Periodic can come
5654 cqiRecpReqInfo->cCNum = 1;
5655 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* Periodic */
5656 /* This flags will be removed once Sachin does changes
5658 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
5659 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
5660 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
5664 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
5665 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
5669 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
5670 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
5673 cqiRecpReqInfo->riSz[0].pres = FALSE;
5675 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
5677 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
5678 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
5681 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
5683 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
5687 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
5689 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
5691 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
5693 datRecpInfo->rnti = alloc->rnti;
5694 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
5695 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5697 } /* rgSCHTomUtlFillDatPCqiRecpReq */
5700 * @brief Function which handles the filling of SRS reception
5701 * request values which arrives along with UL Data on ULSCH
5705 * Function: rgSCHTomUtlFillDatSrsRecpReq
5707 * Function which handles the filling of SRS reception
5708 * request values which arrives along with UL Data on ULSCH
5710 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5713 * - Fill the reception request for the data arriving on the ULSCH
5714 * - Fill the reception request information for the SRS
5716 * @param[in] RgSchCellCb *cell,
5717 * RgSchUlAlloc *alloc,
5718 * TfuUeRecpReqInfo *datRecpInfo,
5719 * CmLteTimingInfo *timeInfo,
5725 S16 rgSCHTomUtlFillDatSrsRecpReq
5728 RgSchUlAlloc *alloc,
5729 TfuUeRecpReqInfo *datRecpInfo,
5730 CmLteTimingInfo *timeInfo,
5734 datRecpInfo->rnti = alloc->rnti;
5735 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
5738 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_HARQ_SRS;
5742 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_SRS;
5744 datRecpInfo->rnti = alloc->rnti;
5745 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
5746 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5748 } /* rgSCHTomUtlFillDatSrsRecpReq */
5751 * @brief Function which handles the filling of only SRS reception
5752 * request values on ULSCH
5756 * Function: rgSCHTomFillOnlySrsRecpReq
5758 * Function which handles the filling of SRS reception
5759 * request values which arrives along with UL Data on ULSCH
5761 * Invoked by: rgSCHTomUtlFillDatSrsRecpReq of rg_sch_tom.c
5764 * - Fill the reception request for the data arriving on the ULSCH
5765 * - Fill the reception request information for the SRS
5767 * @param[in] RgSchCellCb *cell,
5768 * RgSchUlAlloc *alloc,
5769 * TfuUeRecpReqInfo *datRecpInfo,
5774 S16 rgSCHTomFillOnlySrsRecpReq
5777 RgSchUlAlloc *alloc,
5778 TfuUeRecpReqInfo *datRecpInfo
5781 TfuUePuschSrsRecpInfo *srsRecpReqInfo;
5783 srsRecpReqInfo = &datRecpInfo->t.puschRecpReq.srsInfo;
5784 srsRecpReqInfo->srsBw = (TfuUlSrsBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsBw;
5785 srsRecpReqInfo->nRrc = alloc->ue->srsCb.srsCfg.srsSetup.fDomPosi;
5786 srsRecpReqInfo->srsHopBw = (TfuUlSrsHoBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsHopBw;
5787 srsRecpReqInfo->transComb = alloc->ue->srsCb.srsCfg.srsSetup.txComb;
5788 srsRecpReqInfo->srsCfgIdx = alloc->ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
5789 srsRecpReqInfo->srsCyclicShft = (TfuUlSrsCycShiftInfo)alloc->ue->srsCb.srsCfg.srsSetup.cycShift;
5791 /* ccpu00117050 - ADD - nSrs setting
5792 * Refer Section 5.2.2.6 of TS 36.212 V8.5.0*/
5793 datRecpInfo->t.puschRecpReq.ulSchInfo.nSrs = 1;
5796 } /* rgSCHTomFillOnlySrsRecpReq */
5799 * @brief Function which handles the filling of PCQI/RI, SRS and SR
5800 * Reception Request Information along
5801 * with the HARQ reception Request
5805 * Function: rgSCHTomUtlFillCqiSrSrsWithHq
5807 * Function which handles the filling of PCQI/RI, SRS ans SR
5808 * Reception Request Information along
5809 * with the HARQ reception Request
5812 * Invoked by: rgSCHTomUtlFillHqFdbkRecpReq &
5813 * rgSCHTomUtlFillSfHqFdbk of rg_sch_tom.c
5816 * - Fill the reception request for the Control Info arriving on the PUCCH
5817 * - Fill the reception request information for the SR, RI, CQI, SRS
5819 * @param[in] RgSchCellCb *cell,
5820 * TfuRecpReqInfo *recpReqInfo,
5821 * RgSchDlHqProcCb *hqCb,
5822 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
5823 * @param[in] uint16_t validIdx
5828 static S16 rgSCHTomUtlFillCqiSrSrsWithHq
5831 TfuRecpReqInfo *recpReqInfo,
5833 TfuUeRecpReqInfo *pucchRecpInfo,
5835 Bool isDatPresOnSecCell
5838 RgSchUePCqiCb *cqiCb;
5839 RgSchUePCqiCb *riCb;
5840 uint8_t ri; /*To fetch RI value*/
5841 Bool willUeRprtCqi; /* Flag set due to CQI Mask and UE Inactive state (DRX)*/
5842 Bool willUeRprtSr = TRUE;
5843 TfuAckNackMode hqFdbkMode;
5845 uint8_t totalPucchBits;
5846 Bool dropCqi = FALSE;
5848 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
5851 RgSchEmtcUeInfo *emtcUe = NULLP;
5856 /*Changes for PUCCH Format3 */
5857 hqFdbkMode = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqFdbkMode;
5858 numCqiBit = rgSCHCmnCalcPcqiBitSz (ue,cell->numTxAntPorts);
5859 totalPucchBits = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz + numCqiBit;
5862 emtcUe = RG_GET_EMTC_UE_CB(ue);
5864 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
5865 #ifdef EMTC_ENABLE /*VINU*/
5868 if((emtcUe->pucchRepNumFr1 > 1) || (emtcUe->pucchRepNumFr2 > 1))
5870 willUeRprtCqi = FALSE;
5871 willUeRprtSr = FALSE;
5875 if(ue->srCb.nSrTrIdx == validIdx)
5879 /* Should we check for Rel8 and above???
5880 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
5882 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
5883 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
5884 if(!((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
5885 (ulSpsUe->isUlSpsActv)))
5892 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
5893 ue->srCb.srCfg.srSetup.srResIdx;
5894 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
5895 /* FORMAT3: If SR is present it will be appended after HARQ */
5896 totalPucchBits = totalPucchBits + 1;
5903 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
5905 /* LTE_ADV:: UE will drop CSI during CSI+1BCS if data is present
5906 * on sec cell(isDatPresOnSecCell)*/
5908 if (hqFdbkMode == TFU_ACK_NACK_CHANNEL_SELECTION)
5910 if (hqFdbkMode == TFU_UCI_FORMAT_1B_CS)
5913 if (isDatPresOnSecCell == TRUE)
5920 /* Format 3 Changes : If Hq + SR + CQI bits < 22 and simultaneousAckNackAndCQI-Format3
5921 is enabled then CQI will be multiplexed with HQ otherwise CQI will be dropped
5922 Spec 36.213 Sec 10.1.1 */
5923 else if (hqFdbkMode == TFU_UCI_FORMAT_3)
5925 if ((isDatPresOnSecCell == TRUE) &&
5926 ((!ue->simulAckNackCQIFormat3) || (totalPucchBits > 22)))
5934 cqiCb = ue->nPCqiCb;
5935 if(riCb->nRiTrIdx == validIdx)
5937 /*ccpu00140578:: Skip the UE if the RI is already processed
5939 if(riCb->riRecpPrcsd == FALSE)
5941 if(riCb->riDist == 0)
5943 if((riCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
5944 (isDatPresOnSecCell == FALSE))
5947 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
5948 riCb->cqiCfg.cqiSetup.cqiPResIdx;
5949 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
5951 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
5953 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
5957 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
5959 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
5961 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
5962 ue->nPRiCb->servCellInfo->sCellIdx;
5964 rgSCHTomUtlFillRiBitWidthInfo(ue);
5965 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
5967 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
5982 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
5988 /* Skip the UE for RI processing on PUCCH
5989 * in the same subframe as it already processed */
5990 if(riCb->nRiTrIdx == validIdx)
5992 /* As the new idx is same is current idx
5993 * then PUCCH reception processing will consider
5994 * RI also in the same subframe. To block this
5995 * below flag is used*/
5996 riCb->riRecpPrcsd = TRUE;
6000 else if(cqiCb->nCqiTrIdx == validIdx)
6002 if((cqiCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
6003 (isDatPresOnSecCell == FALSE))
6006 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6007 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6009 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6011 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6012 cqiCb->servCellInfo->sCellIdx;
6014 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6015 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6016 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6018 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d "
6019 "Unable to Fill CqiPmi size", ue->ueId);
6022 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
6024 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
6028 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
6041 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6043 if(ue->srsCb.nSrsTrIdx == validIdx)
6045 /* ccpu00140578::Skip the UE for SRS reception processing
6046 * if already done as part of PUSCH recpetion
6048 if(ue->srsCb.srsRecpPrcsd == FALSE)
6050 if(ue->srsCb.srsDist ==0 )
6052 if((pucchRecpInfo->t.pucchRecpReq.uciInfo != TFU_PUCCH_HARQ_CQI)
6053 && (ue->srsCb.srsCfg.srsSetup.sANSrs)
6054 && (isDatPresOnSecCell == FALSE))
6057 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6058 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6059 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6060 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6061 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6062 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6063 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6064 ue->srsCb.srsCfg.srsSetup.txComb;
6065 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6066 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6067 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6068 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6069 /* ccpu00116923 - ADD - New Reception Request types for CQI and SRS with SR */
6070 switch(pucchRecpInfo->t.pucchRecpReq.uciInfo)
6072 case TFU_PUCCH_HARQ_SR:
6073 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
6075 case TFU_PUCCH_HARQ_SR_CQI:
6076 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI_SRS;
6079 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SRS;
6083 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6087 ue->srsCb.srsDist--;
6089 /* Skip the UE for SRS processing on PUCCH
6090 * in the same subframe as it already processed */
6091 if(ue->srsCb.nSrsTrIdx == validIdx)
6093 /* As the new idx is same is current idx
6094 * then PUCCH reception processing will consider
6095 * SRS also in the same subframe. To block this
6096 * below flag is used*/
6097 ue->srsCb.srsRecpPrcsd = TRUE;
6105 } /* rgSCHTomUtlFillCqiSrSrsWithHq */
6108 * @brief Function which handles the filling of PCQI/RI, SRS
6109 * Reception Request Information along with SR reception
6114 * Function: rgSCHTomUtlFillCqiSrsWithSr
6116 * Function which handles the filling of PCQI/RI, SRS
6117 * Reception Request Information along
6118 * with the SR reception Request
6121 * Invoked by: rgSCHTomUtlFillSrRecpReq of rg_sch_tom.c
6124 * - Fill the reception request for CQI/RI, SRS if they occur
6125 * in the same instance as of SR.
6127 * @param[in] RgSchCellCb *cell,
6129 * TfuRecpReqInfo *recpReqInfo,
6130 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
6131 * @param[in] uint16_t validIdx
6137 static S16 rgSCHTomUtlFillCqiSrsWithSr
6141 TfuRecpReqInfo *recpReqInfo,
6142 TfuUeRecpReqInfo *pucchRecpInfo,
6146 RgSchUePCqiCb *cqiCb;
6147 RgSchUePCqiCb *riCb;
6148 uint8_t ri; /*To fetch RI value*/
6149 Bool willUeRprtCqi; /* Flag set due to CQI Mask and
6150 UE Inactive state (DRX)*/
6152 cqiCb = ue->nPCqiCb;
6153 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
6155 rgSCHEmtcWillUeRptCqi(ue, &willUeRprtCqi);
6157 if(riCb->nRiTrIdx == validIdx)
6159 /*ccpu00140578:: Skip the UE if the RI is already processed
6161 if(riCb->riRecpPrcsd == FALSE)
6163 if(riCb->riDist == 0)
6165 if(willUeRprtCqi == TRUE)
6168 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6169 riCb->cqiCfg.cqiSetup.cqiPResIdx;
6170 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6173 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6174 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6176 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6177 ue->nPRiCb->servCellInfo->sCellIdx;
6179 rgSCHTomUtlFillRiBitWidthInfo(ue);
6180 /* TODO:: syed Shouldn't this be done outside this if condition */
6181 if (cqiCb->nCqiTrIdx == validIdx)
6183 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6186 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
6192 if(riCb->nRiTrIdx == validIdx)
6193 {/* Need to skip this UE during PUCCH RI recpetion process
6194 in the current subframe */
6195 riCb->riRecpPrcsd = TRUE;
6199 else if(cqiCb->nCqiTrIdx == validIdx)
6201 if(willUeRprtCqi == TRUE)
6204 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6205 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6207 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6210 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6211 cqiCb->servCellInfo->sCellIdx;
6213 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6214 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6215 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6217 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d"
6218 " Unable to Fill CqiPmi size", ue->ueId);
6222 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6224 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6226 if(ue->srsCb.nSrsTrIdx == validIdx)
6228 /* ccpu00140578:: Cnsider the SRS processing
6229 * only if not done in the same TTI
6230 * as part of PUSCH or HARQ reception process*/
6231 if(ue->srsCb.srsRecpPrcsd == FALSE)
6233 if(ue->srsCb.srsDist ==0 )
6235 if(ue->srsCb.srsCfg.srsSetup.sANSrs)
6238 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6239 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6240 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6241 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6242 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6243 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6244 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6245 ue->srsCb.srsCfg.srsSetup.txComb;
6246 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6247 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6248 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6249 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6250 /* ccpu00116923 - ADD - New Reception Request types for CQI and
6252 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_SR_CQI)
6254 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI_SRS;
6258 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_SRS;
6262 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6266 ue->srsCb.srsDist--;
6268 /* Skip the UE for SRS processing on PUCCH
6269 * in the same subframe as it already processed */
6270 if(ue->srsCb.nSrsTrIdx == validIdx)
6272 /* As the new idx is same is current idx
6273 * then PUCCH reception processing will consider
6274 * SRS also in the same subframe. To block this
6275 * below flag is used*/
6276 ue->srsCb.srsRecpPrcsd = TRUE;
6282 } /* rgSCHTomUtlFillCqiSrsWithSr */
6288 /** @brief This function handles filling of HARQ feedback repetition
6289 * recption request for each subframe
6293 * Function: rgSCHTomUtlFillSfRepHqFdbk
6297 * @param [out] TfuRecpReqInfo *recpReqInfo
6298 * @param [in] RgSchCellCb *cell
6299 * @param [out] RgSchErrInfo *err
6300 * @param [in] RgSchDlSf *dlSf
6301 * @param [in] uint8_t noFdbks
6302 * @param [in] CmMemListCp *memCp
6303 * @param [in] uint8_t elemIdx
6304 * @param [in] RgSchDlSf *nxtDlsf
6310 static S16 rgSCHTomUtlFillSfRepHqFdbk
6312 TfuRecpReqInfo *recpReqInfo,
6313 RgSchCellCb *cellCb,
6323 static S16 rgSCHTomUtlFillSfRepHqFdbk
6325 TfuRecpReqInfo *recpReqInfo,
6326 RgSchCellCb *cellCb,
6336 RgSchDlHqProcCb *hqCb;
6340 TfuUeRecpReqInfo *pucchRecpInfo;
6342 TfuUePucchHqRecpInfo *hqRecpReq;
6344 RgSchDlHqTbCb *tbCb;
6345 RgSchDlHqProcCb *prvHqCb = NULLP;
6347 node = dlSf->ackNakRepQ.first;
6350 tbCb = (RgSchDlHqTbCb *)(node->node);
6352 ueCb = hqCb->hqE->ue;
6354 if (--tbCb->fbkRecpRepCntr)
6356 /* Add to next subfarme */
6357 /* Add this hqCb to the next dlSf's ackNakRepQ */
6358 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
6359 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
6360 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
6361 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
6368 /* Go to the next node */
6373 if ((hqCb->hqE->ue != NULLP) &&
6374 (hqCb->hqE->ue->measGapCb.isMeasuring != TRUE)
6375 && (hqCb != prvHqCb)
6378 /* We need to add the recp request to be sent on the pucchANRep
6381 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
6382 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
6385 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to"
6386 "Allocate TfuUeRecpReqInfo for RNTI:%d ", ueCb->ueId);
6387 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
6390 pucchRecpInfo->rnti = ueCb->ueId;
6392 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
6394 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
6397 /* FOR repetition Feedback shall come on n1PucchAnRep Configured per
6401 pucchRecpInfo->t.pucchRecpReq.hqType = TFU_HQ_RECP_REQ_N1PUCCH;
6402 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = ueCb->ackNakRepCb.pucchRes;
6404 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
6405 hqRecpReq = &(pucchRecpInfo->t.pucchRecpReq.hqInfo);
6406 /* ACK NACK rep works only in bundling mode . */
6407 hqRecpReq->hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_BUNDL;
6408 if ((hqCb->hqPSfLnk.node != NULLP) &&
6409 (hqCb->hqPSfLnk.node != NULLP))
6412 hqRecpReq->hqSz = 2;
6416 hqRecpReq->hqSz = 1;
6418 hqRecpReq->pucchResCnt = 1;
6419 hqRecpReq->hqRes[0] = ueCb->ackNakRepCb.pucchRes;
6421 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
6422 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
6424 /* In a given dlSf, if there is 2 TBs context
6425 * stored for a given harq, then they are added
6426 * adjacent to each other in the subframe. To avoid
6427 * adding duplicate recpnInfo for each TB, store this
6428 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
6429 * do not add reception req info.*/
6432 RGSCH_NULL_CHECK(cellCb->instIdx, hqCb->hqE->ue);
6433 rgSCHTomUtlMoveNxtOccasion(cellCb, hqCb->hqE->ue, validIdx);
6435 /* Go to the next node */
6441 /** @brief This function handles filling of HARQ feedback recption request
6446 * Function: rgSCHTomUtlFillSfHqFdbkInfo
6450 * @param [out] TfuRecpReqInfo *recpReqInfo
6451 * @param [in] RgSchCellCb *cell
6452 * @param [out] RgSchErrInfo *err
6453 * @param [in] RgSchDlSf *dlSf
6454 * @param [in] uint8_t noFdbks
6455 * @param [in] CmMemListCp *memCp
6456 * @param [in] uint8_t elemIdx
6457 * @param [in] RgSchDlSf *nxtDlsf
6458 * @param [in] uint16_t validIdx;
6464 static S16 rgSCHTomUtlFillSfHqFdbkInfo
6466 TfuRecpReqInfo *recpReqInfo,
6467 RgSchCellCb *cellCb,
6475 RgSchDlHqProcCb *hqCb,
6476 RgSchUePucchRecpInfo *pucchInfo,
6478 RgSchDlHqProcCb *prvHqCb
6481 static S16 rgSCHTomUtlFillSfHqFdbkInfo
6483 TfuRecpReqInfo *recpReqInfo,
6484 RgSchCellCb *cellCb,
6491 RgSchDlHqProcCb *hqCb,
6492 RgSchUePucchRecpInfo *pucchInfo,
6494 RgSchDlHqProcCb *prvHqCb
6499 RgSchUeCb *ueCb = hqCb->hqE->ue;
6501 CmLteTimingInfo futTime;
6502 RgSchTddANInfo *anInfo;
6505 RgrTddAckNackMode ackNackMode;
6506 RgSchDlHqTbCb *tbCb;
6512 RG_SCH_ADD_TO_CRNT_TIME(cellCb->crntTime, futTime, TFU_RECPREQ_DLDELTA);
6516 for (idx = 0 ;idx < 2; idx++)
6518 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
6521 tbCb = &hqCb->tbInfo[idx];
6525 ackNackMode = ueCb->dl.ackNackMode;
6527 if(ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL)
6529 anInfo = rgSCHUtlGetUeANFdbkInfo(ueCb, &futTime);
6530 /* Only the last scheduled TB for the UE is for HARQ
6531 * ACK/NACK reception in Bundling case */
6532 if((anInfo == NULLP) ||
6533 (anInfo->latestMIdx != dlSf->dlFdbkInfo.m))
6540 /* Get the TFU reception request pointer, if present */
6541 cmHashListFind(&cellCb->ueTfuPendLst, (uint8_t*) &ueCb->ueId,
6542 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
6545 /* For upgrade we shall use the existing logic of pending list. */
6546 cmHashListFind(&cellCb->ueTfuPendLst, (uint8_t*) &ueCb->ueId,
6547 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
6550 else if(hqCb->hqE->raCb != NULLP)
6552 /* For RACH it is set to Bundling */
6553 ackNackMode = RGR_TDD_ACKNACK_MODE_BUNDL;
6554 rnti = hqCb->hqE->raCb->tmpCrnti;
6561 /* Do not proceed if PUSCH
6562 reception req is already filled*/
6567 /* Go to the next node */
6571 if(((ueCb == NULLP) || (ueCb->measGapCb.isMeasuring != TRUE))
6575 TknUInt16 n1PucchTkn = {FALSE, 0};
6578 pdcch = tbCb->hqP->pdcch;
6580 n1PucchTkn = hqCb->spsN1PucchRes;
6582 for (tbIndx = 0; tbIndx < TFU_MAX_TB; tbIndx++)
6584 if (hqCb->tbInfo[tbIndx].state == HQ_TB_WAITING &&
6585 (RGSCH_TIMEINFO_SAME(hqCb->tbInfo[tbIndx].fdbkTime,
6586 recpReqInfo->timingInfo)))
6589 hqCb->tbInfo[tbIndx].pucchFdbkIdx = hqCb->ulDai;
6592 ret = rgSCHTomUtlFillSfHqFdbkForOneUe(hqCb,recpReqInfo, cellCb, err, dlSf, noFdbks,
6593 memCp, elemIdx, nxtDlsf, rnti, ackNackMode, &pucchInfo, pdcch,
6594 n1PucchTkn, &alloc, hqSz);
6599 /* TODO:: In case of F1BCS and CSI in same subframe
6600 * UE shall drop the CSI if there was at least one
6601 * PDSCH transmission in any of the DL subframe
6602 * mapping to this UL subframe
6605 rgSCHTomUtlFillCqiSrSrsWithHq(cellCb,recpReqInfo, hqCb->hqE->ue,
6606 pucchInfo->pucchRecpInfo, validIdx,FALSE);
6608 if((hqCb->hqE->ue) &&
6609 (hqCb->hqE->ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
6612 if(RG_SCH_IS_CELL_SEC(hqCb->hqE->ue,hqCb->hqE->cell))
6614 switch(pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo)
6616 case TFU_PUCCH_HARQ_SR_CQI:
6617 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
6618 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
6620 case TFU_PUCCH_HARQ_CQI:
6621 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
6622 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
6624 case TFU_PUCCH_HARQ_SR_CQI_SRS:
6625 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
6626 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
6628 case TFU_PUCCH_HARQ_SR_SRS:
6629 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
6631 case TFU_PUCCH_HARQ_SRS:
6632 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
6643 /* TODO antz - pushing the following code (under TFU_UPGRADE)
6644 * into the above function (...ForOneUe) did not work (caused
6645 * two additional TCs to fail). Don't know why. If this
6646 * is done later, make sure that the code branch
6647 * for relPdcch (later in this func) is also modified appropriately.
6649 /* Now add to the recp request or pending list */
6650 //if((elemIdx != (noFdbks - 1)))
6652 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
6653 (uint8_t *)&rnti ,(uint16_t) sizeof(CmLteRnti));
6657 } /* If measuring */
6658 /* Go to the next node */
6659 if ((tbCb->fbkRecpRepCntr) && (--tbCb->fbkRecpRepCntr))
6661 /* Add to next subfarme */
6662 /* Add this hqCb to the next dlSf's ackNakRepQ */
6663 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
6664 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
6665 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
6666 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
6668 /* In a given dlSf, if there is 2 TBs context
6669 * stored for a given harq, then they are added
6670 * adjacent to each other in the subframe. To avoid
6671 * adding duplicate recpnInfo for each TB, store this
6672 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
6673 * do not add reception req info.*/
6681 /** @brief This function calculates the pucch resource idx
6682 * that is to be filled in harq reception request
6686 * Function: rgSCHTomUtlGethqRes
6689 * -Calculate the pucch resource idx
6690 * Harq Reception Request for Format 1B with
6693 * @param [in] uint8_t noFdbks
6694 * @param [in] RgSchDlSf *dlSf
6695 * @param [in] RgSchPdcch *pdcch
6696 * @param [in] RgSchCellCb *cellCb
6697 * @param [out]uint16_t *hqRes
6700 static Void rgSCHTomUtlGethqRes
6705 RgSchCellCb *cellCb,
6717 m = dlSf->dlFdbkInfo.m;
6719 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
6720 nP = cellCb->rgSchTddNpValTbl[P];
6721 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
6722 *hqRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
6723 cellCb->pucchCfg.n1PucchAn;
6728 /** @brief This function fills the harq reception request for
6729 * TDD in case of Fomat 1B with CS for M=1
6733 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
6736 * -Fill Harq Reception Request for Format 1B with
6739 * @param [in] RgSchDlHqProcCb *hqCb
6740 * @param [in] TfuUePucchRecpReq *hqRecpReq
6741 * @param [in] uint8_t noFdbks
6742 * @param [in] RgSchDlSf *dlSf
6743 * @param [in] RgSchPdcch *pdcch
6744 * @param [in] RgSchCellCb *cellCb
6747 static Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
6749 RgSchDlHqProcCb *hqCb,
6750 TfuUePucchRecpReq *hqRecpReq,
6757 RgSchUeCb *ue = NULLP;
6758 Bool isCellSec = FALSE;
6761 /*ccpu00147920: UeCb is NULL for SPS activation*/
6762 if(pdcch && pdcch->ue)
6763 {/* SPS Release pdcch or dynamic data */
6770 /* This is not supposed to happen
6771 * Error case. hqCB has to be ter
6772 * when pdcch is present . Adding
6773 * if check bcs of kwork*/
6780 if((hqCb != NULLP) &&
6781 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
6786 switch(ue->f1bCsAVal)
6788 case RG_SCH_A_VAL_2:
6789 /* harq(0) is primary harq(1) is secondary) */
6792 hqRecpReq->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.
6793 cw1N1Res[hqCb->tpc].n1PucchIdx;
6795 else/* primary cell */
6798 /* hqCb will be null in case of sps rel pdcch */
6799 if ((hqCb) && hqCb->spsN1PucchRes.pres)
6800 {/* SPS occasion or dyn sched*/
6801 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
6804 #endif /* LTEMAC_SPS */
6805 {/* dyn data or sps release */
6809 /* This is not supposed to happen
6810 * Error case. hqCB has to be ter
6811 * when pdcch is present . Adding
6812 * if check bcs of kwork*/
6817 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
6818 hqRecpReq->hqInfo.hqRes[0] = hqRes;
6822 case RG_SCH_A_VAL_3:
6824 /* Serving cell in mimo mode should be
6825 * in 0 and 1 and the serving cell in siso
6826 * mode should be in 2 indices */
6829 uint8_t servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
6830 hqCb->hqE->cell->cellId,
6833 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
6834 {/* Sec cell is in mimo mode, use 0 and 1 */
6835 hqRecpReq->hqInfo.hqRes[0] =
6836 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
6837 hqRecpReq->hqInfo.hqRes[1] =
6838 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
6841 {/* Sec cell is in siso mode, use 2 */
6842 hqRecpReq->hqInfo.hqRes[2] =
6843 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
6847 {/* primary cell hq */
6849 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
6850 {/* prim cell is in mimo mode, use 0 and 1 */
6852 if (hqCb && hqCb->spsN1PucchRes.pres)
6853 {/* Not sps release */
6854 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
6857 #endif /* LTEMAC_SPS */
6858 {/* sps rel or dyn */
6862 /* This is not supposed to happen
6863 * Error case. hqCB has to be ter
6864 * when pdcch is present . Adding
6865 * if check bcs of kwork*/
6870 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
6871 hqRecpReq->hqInfo.hqRes[0] = hqRes;
6872 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
6876 {/* prim cell is in siso mode use 2 */
6878 /* Consider sps occasions */
6879 if (hqCb && hqCb->spsN1PucchRes.pres)
6880 {/* Not sps release */
6881 hqRecpReq->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
6884 #endif /* LTEMAC_SPS */
6889 /* This is not supposed to happen
6890 * Error case. hqCB has to be ter
6891 * when pdcch is present . Adding
6892 * if check bcs of kwork*/
6897 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
6898 hqRecpReq->hqInfo.hqRes[2] = hqRes;
6904 case RG_SCH_A_VAL_4:
6905 {/* Both the serv cells are in mimo mode */
6907 {/* 2 and 3 for sec cell */
6908 hqRecpReq->hqInfo.hqRes[2] =
6909 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
6910 hqRecpReq->hqInfo.hqRes[3] =
6911 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
6913 else/* primary cell */
6914 {/* 0 and 1 are for primary cell */
6916 if (hqCb && hqCb->spsN1PucchRes.pres)
6917 {/* Not sps release */
6918 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
6921 #endif /* LTEMAC_SPS */
6926 /* This is not supposed to happen
6927 * Error case. hqCB has to be ter
6928 * when pdcch is present . Adding
6929 * if check bcs of kwork*/
6934 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
6935 hqRecpReq->hqInfo.hqRes[0] = hqRes;
6936 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
6947 /** @brief This function fills the harq reception request for
6948 * TDD in case of Fomat 1B with CS for M>=2
6952 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
6955 * -Fill Harq Reception Request for Format 1B with
6958 * @param [in] RgSchDlHqProcCb *hqCb
6959 * @param [in] TfuUePucchRecpReq *hqRecpReq
6960 * @param [in] uint8_t noFdbks
6961 * @param [in] RgSchDlSf *dlSf
6962 * @param [in] RgSchPdcch *pdcch
6963 * @param [in] RgSchCellCb *cellCb
6964 * @param [in] uint8_t elemIdx
6967 static Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
6969 RgSchDlHqProcCb *hqCb,
6970 TfuUePucchRecpReq *hqRecpReq,
6974 RgSchCellCb *cellCb,
6979 Bool isCellSec = FALSE;
6981 uint8_t servCellIdx;
6984 {/* SPS Release pdcch or dynamic data */
6991 /* This is not supposed to happen
6992 * Error case. hqCB has to be ter
6993 * when pdcch is present . Adding
6994 * if check bcs of kwork*/
7001 if((hqCb != NULLP) && (ue != NULLP) &&
7002 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7008 {/* Sec Cell indices are 2 and 3*/
7009 servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
7010 hqCb->hqE->cell->cellId,
7013 hqRecpReq->hqInfo.hqRes[2] =
7014 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7016 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
7018 hqRecpReq->hqInfo.hqRes[3] =
7019 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7023 {/* Primary cell indices are 0 and 1 */
7025 * M > 2 if SPS occasion is present in any of the
7026 * DL subframe in the bundle, the n1Pucch(0) is
7027 * the SPS resource and n1Pucch(1) is the resource
7028 * derived from pdcch with DAI = 1
7029 * If No SPS Occasion
7030 * Then n1Pucch(0) is from pdcch with DAI =1
7031 * and n1Pucch(1) is from pdcch with DAI = 2
7035 {/* this is not sps release pdcch */
7036 if(hqCb->spsN1PucchRes.pres == TRUE)
7038 hqRes = hqCb->spsN1PucchRes.val;
7043 {/*Dynamic scheduling or SPS Release
7044 Derive from pdcch */
7045 if(pdcch->dlDai < 3)
7046 {/* No need to calcualte from DAI > 2 */
7047 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7053 hqRecpReq->hqInfo.hqRes[elemIdx] = hqRes;
7056 {/* Pdcch with DAI = 1 and 2 needs to be used
7057 for resource calculation*/
7058 if(hqCb && hqCb->spsN1PucchRes.pres == TRUE)
7059 {/* dyn or sps occasion */
7060 /* Shift the hqRes[0] if it was filled
7061 * if there was a pdcch with DAI 1 before to this
7064 {/* SPS occasion happened in the middle
7066 /* shifting the non SPS resource to n1Pucch(1) */
7067 hqRecpReq->hqInfo.hqRes[1] = hqRecpReq->hqInfo.hqRes[0];
7070 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7073 else if(pdcch && pdcch->dlDai < 3)
7075 else if(pdcch->dlDai < 3)
7077 {/* sps rel or dyn sched */
7078 /* hqCb wil not be present for sps release pdcch */
7079 if(hqCb && (pdcch->dlDai != hqCb->ulDai))
7080 {/* there was a SPS occasion before to this */
7081 if(pdcch->dlDai == 1)
7083 hqRecpReq->hqInfo.hqRes[1] = hqRes;
7084 }/* ignore the DAI 2 in this case */
7086 {/* There was no SPS occasion before to this */
7090 {/* Added check to ignore kwork warning */
7091 hqRecpReq->hqInfo.hqRes[(pdcch->dlDai)-1] = hqRes;
7100 /** @brief This function fills the harq reception request for
7101 * TDD in case of Fomat 1B with CS
7105 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7108 * -Fill Harq Reception Request for Format 1B with
7111 * @param [in] RgSchDlSf *ulSf
7112 * @param [in] RgSchCellCb *cell
7113 * @param [out]TfuUePucchRecpReq *hqRecpReq
7116 static S16 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7118 RgSchDlHqProcCb *hqCb,
7119 TfuUePucchRecpReq *hqRecpReq,
7127 /* Update teh fdbk mode if something different is present
7128 * in L1 API file for F1BS *//* 1 --> F1BCS */
7129 hqRecpReq->hqInfo.hqFdbkMode = TFU_ACK_NACK_CHANNEL_SELECTION;
7133 case RG_SCH_M_VAL_1:
7136 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1(hqCb,hqRecpReq,
7137 noFdbks,dlSf,pdcch,cellCb);
7140 case RG_SCH_M_VAL_2:
7141 case RG_SCH_M_VAL_3:
7142 case RG_SCH_M_VAL_4:
7144 /* Spatial bundling will be applied */
7145 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234(hqCb,hqRecpReq,
7146 noFdbks,dlSf,pdcch,cellCb,elemIdx);
7156 /***********************************************************
7158 * Func : rgSCHTomUtlFillSfHqFdbkForOneUe
7160 * Desc : Fill HARQ feedback info for one UE/entry
7168 **********************************************************/
7169 static S16 rgSCHTomUtlFillSfHqFdbkForOneUe
7171 RgSchDlHqProcCb *hqCb,
7172 TfuRecpReqInfo *recpReqInfo,
7173 RgSchCellCb *cellCb,
7181 RgrTddAckNackMode ackNackMode,
7182 RgSchUePucchRecpInfo **pucchInfoRef,
7184 TknUInt16 n1PucchTkn,
7189 RgSchUePucchRecpInfo *pucchInfo = *pucchInfoRef;
7192 TfuUePucchRecpReq *hqRecpReq;
7207 Bool isFirstFdbk = FALSE;
7209 if(pucchInfo == NULLP)
7211 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchInfo,
7212 sizeof(RgSchUePucchRecpInfo), memCp)) != ROK)
7214 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7215 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7216 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7220 #ifdef TFU_ALLOC_EVENT_NO_INIT
7221 pucchInfo->hashLstEnt.hashVal = 0;
7222 pucchInfo->hashLstEnt.keyLen = 0;
7223 pucchInfo->hashLstEnt.key = 0;
7224 pucchInfo->hashLstEnt.list.prev = pucchInfo->hashLstEnt.list.next = 0;
7226 if ((ret = rgSCHUtlGetEventMem((Ptr *)&(pucchInfo->pucchRecpInfo),
7227 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp))) != ROK)
7229 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7230 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7231 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7234 memset(pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes,0xff,sizeof(uint16_t)*TFU_MAX_HQ_RES);
7235 #ifdef TFU_ALLOC_EVENT_NO_INIT
7236 memset(&pucchInfo->pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
7238 pucchInfo->pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
7239 pucchInfo->pucchRecpInfo->rnti = rnti;
7241 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo=TFU_PUCCH_HARQ;
7248 /* Calculation of resources same for both bundling and muxing for M = 1
7251 RgSchUeCb *ue = rgSCHDbmGetUeCb (cellCb, rnti);
7252 if((ue) && (1 == ue->numSCells))
7254 if(ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
7256 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7257 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS(hqCb,hqRecpReq,
7258 noFdbks,dlSf,pdcch,elemIdx,cellCb);
7261 {/* M = 1 case . size is same as A Value*/
7262 hqRecpReq->hqInfo.hqSz = ue->f1bCsAVal;
7263 hqRecpReq->hqInfo.pucchResCnt = hqRecpReq->hqInfo.hqSz;
7266 hqRecpReq->hqInfo.hqSz = (noFdbks * 2); /* M for 2 cells */
7267 hqRecpReq->hqInfo.pucchResCnt = 4;
7269 hqRecpReq->hqInfo.a = ue->f1bCsAVal;
7270 /* handling for SPS occasions*/
7273 /* set the datPresinFirstSUbframe to TRUE if this
7274 * is for pcell txion*/
7276 RgSchTddANInfo *anInfo = NULLP;
7278 /* if this txion is on pcell
7279 * sps occaion, dyn sched or sps release pdcch
7280 * set the sched present in first
7281 * dl subframe of the bundle to TRUE. This
7282 * is required for mapping the feedbak when SPS occasion
7283 * is present in any of the DL subframe in the bundle in
7286 /* SPS will happen only on pcell */
7287 if((hqCb == NULLP) || (!RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7290 anInfo = rgSCHUtlGetUeANFdbkInfo(ue,
7291 &recpReqInfo->timingInfo,RGSCH_PCELL_INDEX);
7293 {/* ANInfo must be there. adding block
7295 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),
7296 "ANInfo should not be NULL for cellId=%d \n", cellCb->cellId));
7303 {/* This needs to be revisited while
7304 adding support for PUCCH format 3 */
7305 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),"Invalid Pucch format configured.."));
7312 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) ||
7313 ((noFdbks == 1) && (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)))
7315 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7317 prevHqSize = hqRecpReq->hqInfo.hqSz;
7320 /* Only one index for bundling case */
7321 hqRecpReq->M = noFdbks;
7323 TFU_HQ_RECP_REQ_NORMAL;
7324 hqRecpReq->multCnt = 1;
7325 hqRecpReq->t.nCce[0] =
7330 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
7332 hqRecpReq->type = TFU_UCI_HARQ;
7334 #else /* TFU_UPGRADE */
7337 if ((TRUE == isFirstFdbk) && (TRUE == n1PucchTkn.pres))
7339 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
7340 hqRecpReq->hqInfo.pucchResCnt=1;
7341 hqRecpReq->hqInfo.hqRes[0] = n1PucchTkn.val;
7342 hqRecpReq->hqInfo.hqSz = hqSz;
7345 else if (FALSE == n1PucchTkn.pres)
7348 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
7350 P = rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
7351 nP = cellCb->rgSchTddNpValTbl[P];
7352 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
7353 m = dlSf->dlFdbkInfo.m;
7354 /* In case of no UE */
7355 pucchRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
7356 cellCb->pucchCfg.n1PucchAn;
7357 /*ccpu00130164:MOD-Changed to maitain value of
7358 hqRecpReq->hqInfo.pucchResCnt=1 in case of bundling*/
7359 /*ccpu00132284 -MOD- hqRes need to be updated after pucchReCnt set to 1
7360 * and resource should be update at index-0*/
7361 hqRecpReq->hqInfo.pucchResCnt=1;
7362 hqRecpReq->hqInfo.hqRes[hqRecpReq->hqInfo.pucchResCnt-1] = pucchRes;
7364 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) && (hqSz > prevHqSize))
7365 hqRecpReq->hqInfo.hqSz = hqSz;
7366 else if (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)
7367 hqRecpReq->hqInfo.hqSz = hqSz;
7369 hqRecpReq->hqInfo.hqSz = prevHqSize;
7371 #endif /* TFU_UPGRADE */
7373 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
7374 &(pucchInfo->pucchRecpInfo->lnk));
7375 pucchInfo->pucchRecpInfo->lnk.node =
7376 (PTR)pucchInfo->pucchRecpInfo;
7379 else /* Multiplexing */
7382 pucchInfo->pucchRecpInfo->t.pucchRecpReq.M = noFdbks;
7384 if (n1PucchTkn.pres == TRUE)
7386 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
7387 TFU_HQ_RECP_REQ_N1PUCCH;
7388 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = n1PucchTkn.val;
7393 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
7394 TFU_HQ_RECP_REQ_NORMAL;
7395 multCnt = pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt;
7396 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.nCce[multCnt] =
7398 pucchInfo->pucchRecpInfo->t.pucchRecpReq.m[multCnt] =
7400 pucchInfo->pucchRecpInfo->t.pucchRecpReq.p[multCnt] =
7401 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
7403 pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt++;
7405 #else /* TFU_UPGRADE */
7407 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7408 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_MULT;
7409 hqRecpReq->hqInfo.hqSz = noFdbks;
7411 resIdx = hqRecpReq->hqInfo.pucchResCnt;
7412 hqRecpReq->hqInfo.pucchResCnt++;
7415 if (n1PucchTkn.pres == TRUE)
7417 hqRecpReq->hqInfo.hqRes[resIdx] = n1PucchTkn.val;
7423 m = dlSf->dlFdbkInfo.m;
7425 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
7426 nP = cellCb->rgSchTddNpValTbl[P];
7427 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
7428 hqRecpReq->hqInfo.hqRes[resIdx] = (M - m - 1)* nP +
7429 (m * nPlusOne) + pdcch->nCce +
7430 cellCb->pucchCfg.n1PucchAn;
7432 #endif /* TFU_UPGRADE */
7433 /* If all the DL subframes are scanned, then
7434 * send TFU request*/
7436 if((elemIdx != noFdbks) && alloc)
7438 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
7439 (uint8_t *)&rnti, (uint16_t) sizeof(rnti));
7444 pucchInfo->pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
7445 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
7446 &(pucchInfo->pucchRecpInfo->lnk));
7447 pucchInfo->pucchRecpInfo->lnk.node =
7448 (PTR)pucchInfo->pucchRecpInfo;
7449 /* Delete the entry after addition to the list */
7450 cmHashListDelete(&cellCb->ueTfuPendLst, (PTR) pucchInfo);
7456 *pucchInfoRef = pucchInfo;
7462 #ifdef RG_ULSCHED_AT_CRC
7463 /** @brief This function does all the processing related to a single downlink
7468 * Function: rgSCHTomUtlProcDlSfAtCrc
7471 * - collate control data for all UEs and send to PHY
7472 * - collate data buffers for all UEs and send to PHY
7474 * @param [in] RgSchDlSf *ulSf
7475 * @param [in] RgSchCellCb *cell
7476 * @param [in] TfuCntrlReqInfo *cntrlInfo
7477 * @param [out] RgSchErrInfo *err
7480 static S16 rgSCHTomUtlProcDlSfAtCrc
7483 CmLteTimingInfo crntUlFrm,
7485 TfuCntrlReqInfo *cntrlInfo,
7489 Inst inst = cell->instIdx;
7492 cntrlInfo->numDlActvUes = 0;
7493 cmLListInit(&cntrlInfo->phichLst);
7494 cmLListInit(&cntrlInfo->dlPdcchLst);
7495 cmLListInit(&cntrlInfo->ulPdcchLst);
7496 #ifdef TFU_ALLOC_EVENT_NO_INIT
7497 cntrlInfo->dlTiming.sfn = cntrlInfo->dlTiming.subframe = 0;
7501 cntrlInfo->ulTiming = crntUlFrm;
7502 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cntrlInfo->ulTiming, TFU_ULCNTRL_DLDELTA);
7504 cntrlInfo->cellId = cell->cellId;
7505 /* Fill PHICH info */
7506 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
7508 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PHICH info for "
7510 RGSCH_FREE_MEM(cntrlInfo);
7515 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) != ROK)
7517 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PDCCH info for "
7519 RGSCH_FREE_MEM(cntrlInfo);
7524 if(0 == cntrlInfo->ulMpdcchLst.count)
7531 if ((cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count) || RG_SCH_EMTC_GET_PDCCHLST_CNT(cntrlInfo))
7533 if (cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count)
7536 //if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
7539 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for"
7545 RGSCH_FREE_MEM(cntrlInfo);
7549 #endif /* #ifdef RG_ULSCHED_AT_CRC*/
7552 /** @brief This function sends the SFN Tick to L3
7557 * Function: rgSCHTomUtlSendSfnTick
7559 * @param [in] RgSchCellCb *cell
7561 static Void rgSCHTomUtlSendSfnTick
7566 RgrTtiIndInfo *rgrTtiInd;
7568 /* TTI to be sent to RRM only once per system frame */
7569 /* Added support for period = 0 to disable tick to RRM */
7570 if ((cell->rrmTtiIndPrd != 0) &&
7571 ((cell->crntTime.sfn % cell->rrmTtiIndPrd) == 0) &&
7572 (cell->crntTime.slot == 0))
7574 /* Allocate a TTI indication structure and send to RRM over RGR interface */
7575 if (rgSCHUtlAllocSBuf (cell->instIdx,
7576 (Data**)&rgrTtiInd, sizeof(RgrTtiIndInfo)) != ROK)
7578 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
7579 "Mem alloc failed for RGR TTI ind, cellId (%d))\n",
7583 rgrTtiInd->cellId = cell->cellId;
7584 //rgrTtiInd->hSfn = cell->crntTime.hSfn;
7585 rgrTtiInd->sfn = cell->crntTime.sfn;
7587 if (rgSCHUtlRgrTtiInd (cell, rgrTtiInd) != ROK)
7589 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
7590 "Failed to send RGR TTI ind, cellId (%d))\n",
7592 rgSCHUtlFreeSBuf(cell->instIdx, (Data**)&rgrTtiInd,
7593 sizeof(RgrTtiIndInfo));
7603 /* @brief Mark Dyn TDD CrntSfIdx.
7607 * Function: rgSCHDynTDDMrkCrntSfIdx
7608 * Purpose: update the dyn tdd sunframe index
7609 * @param[in] Inst schInst
7613 static Void rgSCHDynTDDMrkCrntSfIdx(Inst schInst)
7615 RgSchDynTddCb *rgSchDynTddInfo = &(rgSchCb[schInst].rgSchDynTdd);
7618 RG_SCH_DYN_TDD_MARKTYPE(rgSchDynTddInfo, rgSchDynTddInfo->crntDTddSfIdx,
7619 RG_SCH_DYNTDD_NOTDEF);
7620 rgSchDynTddInfo->crntDTddSfIdx = (rgSchDynTddInfo->crntDTddSfIdx + 1) %
7621 RG_SCH_DYNTDD_MAX_SFINFO;
7623 //printf("Initializing Index %d \n", rgSchDynTddInfo->crntDTddSfIdx);
7629 /** @brief This function fills the TTI timinig info for each cell
7633 * Function: rgSchTomFillCellTtiInfo
7635 * @param [in] TfuTtiIndInfo *ttiInd
7636 * @param [in] Inst schInst
7637 * @param [out] uint8_t *nCell
7638 * @param [out] RgSchCellCb *cell[]
7644 static Void rgSchTomFillCellTtiInfo
7646 TfuTtiIndInfo *ttiInd,
7649 RgSchCellCb *cells[]
7654 TfuTtiCellInfo *cellInfo;
7658 CmLteTimingInfo frm;
7660 if (CM_LTE_MAX_CELLS < ttiInd->numCells)
7666 rgSCHDynTDDMrkCrntSfIdx(schInst);
7669 for (i = 0; i < ttiInd->numCells; i++)
7671 cellInfo = &ttiInd->cells[i];
7672 strtCellId = rgSchCb[schInst].genCfg.startCellId;
7673 Idx1 = (uint8_t)((cellInfo->cellId - strtCellId)&(CM_LTE_MAX_CELLS-1));
7674 cell = rgSchCb[schInst].cells[Idx1];
7675 /* Validate the cell */
7678 /* Use SCH inst 0 print buff */
7679 RGSCHDBGERRNEW(schInst,(rgSchPBuf(schInst),
7680 "RgLiTfuTtiInd()No cell exists for cellId %d\n",
7684 *nCell = *nCell + 1;
7685 cells[i] = (RgSchCellCb *)cell;
7688 if(cell->schTickDelta != cellInfo->schTickDelta)
7690 printf("\nMukesh: Delta changed for cellId=%d: curr delta=%d new delta=%d\n"
7691 "dlblankSf=%d ulblankSf=%d dummyTti=%d \n",
7692 cell->cellId, cell->schTickDelta, cellInfo->schTickDelta, cellInfo->dlBlankSf,cellInfo->ulBlankSf,
7693 cellInfo->isDummyTti);
7695 RGSCH_UPDATE_DELTA(schInst, cellInfo->schTickDelta);
7696 cell->schTickDelta = cellInfo->schTickDelta;
7699 cell->stopSiSch = cellInfo->dlBlankSf;
7700 cell->stopDlSch = cellInfo->dlBlankSf;
7701 cell->stopUlSch = cellInfo->ulBlankSf;
7702 if (cellInfo->isDummyTti)
7704 cell->stopDlSch = TRUE;
7706 if((0 == (cellInfo->timingInfo.sfn % 30)) && (0 == cellInfo->timingInfo.slot))
7708 //printf("5GTF_CHECK rgSCHTOMTtiInd (%d : %d)\n", cellInfo->timingInfo.sfn, cellInfo->timingInfo.slot);
7711 RGSCHCPYTIMEINFO(cellInfo->timingInfo, cell->crntTime);
7712 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->hiDci0Time,
7713 TFU_ULCNTRL_DLDELTA);
7714 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->dlDciTime,
7715 TFU_DLCNTRL_DLDELTA);
7716 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->rcpReqTime,
7717 TFU_RECPREQ_DLDELTA);
7718 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->hqRlsTime,
7719 TFU_HQFBKIND_ULDELTA);
7720 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->dlSfRlsTime,
7723 RGSCHCPYTIMEINFO_EMTC(cellInfo->timingInfo, cell->crntTime);
7724 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->hiDci0Time,
7725 TFU_ULCNTRL_DLDELTA);
7726 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->dlDciTime,
7727 TFU_DLCNTRL_DLDELTA);
7728 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->rcpReqTime,
7729 TFU_RECPREQ_DLDELTA);
7730 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->hqRlsTime,
7731 TFU_HQFBKIND_ULDELTA);
7732 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->dlSfRlsTime,
7735 rgSCHCmnUpdVars(cell);
7736 cell->isDlDataAllwd = TRUE;
7737 /* Get DownLink SubFrame */
7738 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
7739 frm = cell->crntTime;
7741 RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
7743 RGSCH_INCR_SUB_FRAME_EMTC(frm, RG_SCH_CMN_DL_DELTA);
7745 cellSch->dl.time = frm;
7751 uint8_t idx = (cell->crntTime.slot + RG_SCH_CMN_DL_DELTA) %
7752 RGSCH_NUM_SUB_FRAMES_5G;
7754 cell->isDlDataAllwd = RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, idx);
7756 /*ccpu00130639 -ADD - used in UL HARQ proc id calculation*/
7757 if((cell->crntTime.sfn == 0) && (cell->crntTime.slot == 0))
7759 /* sfn Cycle used for Tdd UL Harq Proc Determination.
7760 This sfn Cycle will have values from 0 to numUl Harq-1. */
7761 cell->tddHqSfnCycle = (cell->tddHqSfnCycle + 1 ) %
7762 (rgSchTddUlNumHarqProcTbl[cell->ulDlCfgIdx]);
7766 if(cell->emtcEnable)
7768 rgSCHUtlEmtcResPrcTti(cell);
7774 void schFillCrntTime(
7775 SlotIndInfo slotInd,
7778 uint8_t cellCount = 0;
7779 for(cellCount = 0; cellCount < CM_LTE_MAX_CELLS; cellCount++)
7782 cell = rgSchCb[schInst].cells[cellCount];
7784 RGSCHCPYTIMEINFO(slotInd, cell->crntTime);
7786 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->hiDci0Time,
7787 TFU_ULCNTRL_DLDELTA);
7788 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->dlDciTime,
7789 TFU_DLCNTRL_DLDELTA);
7790 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->rcpReqTime,
7791 TFU_RECPREQ_DLDELTA);
7792 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->hqRlsTime,
7793 TFU_HQFBKIND_ULDELTA);
7794 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->dlSfRlsTime,
7797 RGSCH_INCR_SUB_FRAME(cell->crntTime, RG_SCH_CMN_DL_DELTA);
7799 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
7800 cellSch->dl.time = cell->crntTime;
7804 /** @brief This function prepares the TTI for scheduling and
7805 * invokes the Common channel scheduler. Uplink scheduler
7806 * is invoked first if UL Scheduling at CRC is not enabled
7810 * Function: rgSchTomTtiUlAndDlCmnChSch
7812 * @param [out] RgSchCellCb *cell
7817 static Void rgSchTomTtiUlAndDlCmnChSch
7823 cell->rlsHqArr[cell->crntHqIdx].numUes = 0;
7825 cell->crntHqIdx = cell->crntHqIdx % RGSCH_NUM_SUB_FRAMES;
7827 cmPrcTmr(&cell->tqCp, cell->tq, (PFV)rgSCHTmrProcTmr);
7828 rgSCHMeasGapANRepTtiHndl (cell);
7829 /* We need to fill the PHICH for the UL Data, first we need to get the UL
7830 * SF from Scheduler, next we fill the dlSf that goes out this TTI.
7831 * This must be performed prior to any other processing of the TTI
7832 * so that we do not wrap around and generate feedback prior to
7833 * reception of UL data.
7835 #ifndef RG_ULSCHED_AT_CRC
7838 uint8_t idx; /* Index into Uplink Sf array */
7840 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
7841 [cell->hiDci0Time.subframe];
7845 for(idx=0; idx < Mval; idx++)
7847 rgSCHCmnRlsUlSf(cell, idx);
7853 /* DTX processing for those Harq's which did not get feedback from L1 */
7854 rgSCHDhmRlsDlsfHqProc (cell, cell->hqRlsTime);
7855 /* Re-Init the Downlink subframe */
7856 rgSCHUtlDlRlsSubFrm(cell, cell->dlSfRlsTime);
7857 /* Added handling to retransmit
7858 * release PDCCH in case of DTX
7861 /*Check for DRX every TTI*/
7862 rgSCHDrxTtiInd(cell);
7864 /* For TDD, UL scheduling should happen after DL scheduling */
7866 #ifndef RG_ULSCHED_AT_CRC
7867 /* Perform UL scheduling */
7868 rgSCHCmnUlSch(cell);
7871 /* Perform DL scheduling for Common channels */
7872 rgSCHCmnDlCommonChSch(cell);
7877 /** @brief This function invokes the Non critical procedures like measurements,
7878 * and RGR configurations.
7882 * Function: rgSchTomTtiMiscFunctions
7884 * @param [in] RgSchCellCb *cell
7889 static Void rgSchTomTtiMiscFunctions
7894 uint8_t suId = cell->tfuSap->sapCfg.suId;
7896 /* Invoke RAM Tti Handler */
7897 rgSCHRamTtiHndlr(cell);
7899 /* Handle RGR configurations */
7900 rgSCHGomTtiHndlr(cell, suId);
7902 if((RGM_PRB_REPORT_START == cell->prbUsage.prbRprtEnabld)
7903 && (!(cell->prbUsage.rprtPeriod) || ((glblTtiCnt % cell->prbUsage.rprtPeriod) == 0)))
7905 rgSCHUtlUpdAvgPrbUsage(cell);
7907 rgSCHL2Meas(cell,FALSE);
7910 /* LTE_ADV_FLAG_REMOVED_START */
7911 /* Report ABS Load information to application periodically */
7912 if((RGR_ENABLE == cell->lteAdvCb.absCfg.status) &&
7913 (cell->lteAdvCb.absCfg.absLoadPeriodicity))
7915 RgrLoadInfIndInfo *rgrLoadInf;
7918 cell->lteAdvCb.absLoadTtiCnt++;
7919 if(cell->lteAdvCb.absLoadTtiCnt >= cell->lteAdvCb.absCfg.absLoadPeriodicity)
7922 if(rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&rgrLoadInf,
7923 sizeof(RgrLoadInfIndInfo)) != ROK)
7925 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),"Could not "
7926 "allocate memory for sending LoadInfo\n"));
7929 cell->lteAdvCb.absLoadTtiCnt = 0;
7930 rgrLoadInf->cellId = cell->cellId;
7931 rgrLoadInf->bw = cell->bwCfg.dlTotalBw;
7932 rgrLoadInf->type = RGR_ABS;
7933 for(idx= 0; idx<RGR_ABS_PATTERN_LEN; idx++)
7935 rgrLoadInf->u.absLoadInfo[idx] = cell->lteAdvCb.absLoadInfo[idx];
7936 cell->lteAdvCb.absLoadInfo[idx] = 0;
7938 rgSCHUtlRgrLoadInfInd(cell, rgrLoadInf);
7943 if(cell->isDlDataAllwd)
7945 /* Calling function to update CFI parameters*/
7946 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
7950 /* Incrementing the ttiCnt in case of UL subframe */
7951 if(!cell->dynCfiCb.switchOvrInProgress)
7953 cell->dynCfiCb.ttiCnt++;
7957 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
7960 /* LTE_ADV_FLAG_REMOVED_END */
7965 /** @brief This function invokes the Downlink scheduler
7969 * Function: rgSchTomTtiDlSch
7971 * @param [in] RgSchCellCb *cell
7976 static Void rgSchTomTtiDlSch
7982 if (cell->isDlDataAllwd && (cell->stopDlSch == FALSE))
7984 rgSCHCmnDlSch(cell);
7990 /** @brief This function invokes Consolidates the allocations
7991 * send the Subframe allocation info to MAC
7995 * Function: rgSchTomTtiCnsldtSfAlloc
7997 * @param [in] RgSchCellCb *cell
8002 static Void rgSchTomTtiCnsldtSfAlloc
8008 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8010 dlSf = rgSCHUtlSubFrmGet(cell, cellSch->dl.time);
8012 /* Prepare Subframe allocation info and send to MAC */
8013 rgSCHCmnCnsldtSfAlloc(cell);
8015 /* Call ACK NACK module to add to dlsf Queue */
8016 rgSCHAckNakRepAddToQ(cell, dlSf);
8018 rgSCHTomUtlProcTA(cell);
8023 /** @brief This function prepares the DL and UL Config requests
8028 * Function: rgSchTomTtiL1DlAndUlCfg
8030 * @param [in] RgSchCellCb *cell
8035 static Void rgSchTomTtiL1DlAndUlCfg
8038 RgTfuCntrlReqInfo *cntrlInfo
8041 RgSchDlSf *dlSf = rgSCHUtlSubFrmGet (cell, cell->dlDciTime);
8042 RgSchDlSf *ulSf = rgSCHUtlSubFrmGet (cell, cell->hiDci0Time);
8045 rgSCHTomUtlProcDlSf (dlSf, ulSf, cell, cntrlInfo, &err);
8046 /* Mark this frame as sent */
8047 dlSf->txDone = TRUE;
8049 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
8050 rgBwAlcnt[dlSf->sfNum] ++;
8054 rgSCHTomUtlProcTddUlSf(cell);
8056 rgSCHTomUtlProcUlSf (cell, &err);
8062 /** @brief This function prepares does the Downlink subframe re-init and
8063 * Harq DTX processing
8067 * Function: rgSchTomUtlTddRlsSfAndHarq
8069 * @param [in] RgSchCellCb *cell
8074 static Void rgSchTomUtlTddRlsSfAndHarq
8080 /* ccpu00132341-MOD- rgSchTddRlsDlSubfrmTbl is dependent on DELTA(=2).
8081 * Instead rgSchTddDlAscSetIdxKTbl can be used as the K set gives proper
8083 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper
8084 * output if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME()
8085 * as it is serving the purpose */
8086 if(rgSchTddDlAscSetIdxKTbl[cell->ulDlCfgIdx][cell->hqRlsTime.subframe].
8089 /* ccpu00132341-MOD- Providing the UL SF timing for avoiding
8090 * calculation inside the function */
8091 rgSCHDhmTddRlsSubFrm(cell, cell->hqRlsTime);
8092 rgSCHDhmRlsDlsfHqProc(cell, cell->hqRlsTime);
8097 /** @brief This function processes the UL subframe and fills TFU reception
8102 * Function: rgSCHTomUtlProcTddUlSf
8104 * @param [in] RgSchCellCb *cell
8109 static Void rgSCHTomUtlProcTddUlSf(RgSchCellCb *cell)
8113 if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8114 [cell->rcpReqTime.subframe] == RG_SCH_TDD_UL_SUBFRAME)
8116 if (rgSCHTomUtlProcUlSf (cell, &err) != ROK)
8118 /* fill in err type and call sta ind */
8119 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8120 "Unable to process Uplink subframe for cellId (%d))\n",
8124 /* TDD Fix , to allow Special SF SRS CFg */
8125 else if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8126 [cell->rcpReqTime.subframe] == RG_SCH_TDD_SPL_SUBFRAME)
8128 if (rgSCHTomUtlPrcUlTddSpclSf(cell, &err) != ROK)
8130 /* fill in err type and call sta ind */
8131 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8132 "Unable to process Sipceial subframe for cellId (%d))\n",
8142 /**********************************************************************
8145 **********************************************************************/