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 U8 rgSCHCmnCalcPcqiBitSz(RgSchUeCb *ueCb,U8 numTxAnt);
66 PUBLIC S16 rgSCHDhm5gtfHqFdbkInd(RgSchUeCb *ue,RgSchCellCb *cell,CmLteTimingInfo timingInfo,TfuHqFdbk fdbk,RgSchErrInfo *err);
69 EXTERN Bool rgSCHEmtcChkEmtcUe ARGS(
74 EXTERN Void rgSchTomTtiEmtcSched ARGS(
79 EXTERN S16 rgSCHEmtcRamVldtProcRaReq
84 TfuRaReqIndInfo *raReqInd,
89 EXTERN Void rgSCHEmtcUpdCqiInfo
95 EXTERN Void rgSCHEmtcUpdSRInfo
100 EXTERN Void rgSCHCmnEmtcHdlCrcFailInd
105 EXTERN S16 rgSCHEmtcTomUtlProcAtCrc
108 CmLteTimingInfo crntHiDci0Frm,
109 TfuCntrlReqInfo *cntrlInfo,
112 EXTERN Void rgSCHEmtcInitUeRecpReqLst
114 TfuRecpReqInfo *recpReqInfo
116 EXTERN Void rgSCHEmtcFillPucchRecpInfo
119 RgSchDlHqProcCb *hqCb,
122 EXTERN Bool rgSCHEmtcAddRecpInfoToLst
124 RgSchDlHqProcCb *hqCb,
125 TfuRecpReqInfo *recpReqInfo,
126 TfuUeRecpReqInfo *pucchRecpInfo,
129 EXTERN Void rgSCHEmtcWillUeRptCqi
134 EXTERN Void rgSchEmtcTomTtiCnsldtSfAlloc
139 EXTERN S16 rgSchEmtcTomTtiL1DlAndUlCfg
142 RgTfuCntrlReqInfo *cntrlInfo
145 EXTERN S16 rgSCHTomEmtcUtlFillDatRecpReq
147 TfuRecpReqInfo *recpReqInfo,
153 EXTERN S16 rgSCHEmtcTomUtlFillHqFdbkRecpReq
155 TfuRecpReqInfo *recpReqInfo,
161 EXTERN S16 rgSCHEmtcDhmRlsDlsfHqProc
164 CmLteTimingInfo timingInfo
167 EXTERN Void rgSCHEmtcCmnUlSch
172 #ifdef RG_ULSCHED_AT_CRC
173 EXTERN S16 rgSCHEmtcTomUtlProcDlSfAtCrc
176 CmLteTimingInfo crntUlFrm,
178 TfuCntrlReqInfo *cntrlInfo,
182 EXTERN RgSchEmtcDlSf* rgSCHEmtcUtlSubFrmGet
189 EXTERN U32 gDlMpdcchBlank;
190 EXTERN U32 gUlMpdcchBlank;
191 EXTERN S16 rgSCHUtlIotResPrcTti
198 EXTERN RgSchUeCb* rgSCHCmnGetHoUe
203 EXTERN RgSchUeCb* rgSCHCmnGetPoUe
207 CmLteTimingInfo timingInfo
209 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq ARGS(
214 TfuUeRecpReqInfo *datRecpInfo,
215 CmLteTimingInfo *timeInfo,
220 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq ARGS(
224 TfuUeRecpReqInfo *datRecpInfo,
225 CmLteTimingInfo *timeInfo,
230 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq ARGS(
234 TfuUeRecpReqInfo *datRecpInfo,
235 CmLteTimingInfo *timeInfo,
240 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq ARGS(
244 TfuUeRecpReqInfo *datRecpInfo,
245 CmLteTimingInfo *timeInfo,
249 PUBLIC void schFillCrntTime(
254 EXTERN U32 delayedApiCnt;
255 U32 gPCellTb1AckCount=0,gPCellTb2AckCount=0,gPCellTb1NackCount=0,gPCellTb2NackCount=0;
256 U32 gSCellSchedCount=0,gPrimarySchedCount=0;
257 U32 gSCellTb1AckCount=0,gSCellTb2AckCount=0,gSCellTb1NackCount=0,gSCellTb2NackCount=0;
258 U32 gPCellTb1DtxCount = 0, gPCellTb2DtxCount = 0, gSCellTb1DtxCount = 0, gSCellTb2DtxCount = 0;
259 U32 gHqFdbkCount = 0;
263 U32 gCqiRecpCount = 0;
264 U32 gCqiRecpPuschCount = 0;
265 U32 gCqiRcvdCount = 0;
266 Bool gF1bCsPres = FALSE;
268 U32 gCqiReqCount = 0;
270 U32 gACqiRcvdCount = 0;
271 U32 gCqiReptToAppCount = 0;
272 U32 gRawACqiCount= 0;
273 U32 gCqiDropCount,gPucchDropCount;
274 U32 gCqiPucchLowSnrDropCount,gCqiPucchConfMaskDropCount,gCqiPuschConfMaskDropCount;
276 U32 gUlCrcFailCount = 0;
277 U32 gUlCrcPassCount = 0;
278 U32 gPuschCqiDropCount = 0;
279 U32 gCaDbgCaFrmt = 0;
280 U32 gCaDbgNonCaFrmt = 0;
281 U32 gPcellZeroBoOcc=0,gScellZeroBoOcc=0, dbgDelayedDatReqInMac=0,gDropDatReqCnt=0, gIccPktRcvrMemDropCnt=0;
285 U32 gUlCrcFailCounter = 0;
286 U32 gUlCrcPassCounter = 0;
290 EXTERN U32 gUl5gtfPdcchSend;
295 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr ARGS
299 TfuRecpReqInfo *recpReqInfo,
300 TfuUeRecpReqInfo *pucchRecpInfo,
303 PRIVATE Bool rgSCHTomUtlFillDatHarqRecpReq ARGS
307 TfuUeRecpReqInfo *datRecpInfo,
308 TfuRecpReqInfo *recpReqInfo
310 PRIVATE S16 rgSCHTomUtlFillSrRecpReq ARGS((
311 TfuRecpReqInfo *recpReq,
315 PRIVATE S16 rgSCHTomUtlFillRiRecpReq ARGS((
316 TfuRecpReqInfo *recpReq,
320 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq ARGS((
321 TfuRecpReqInfo *recpReq,
325 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq ARGS((
326 TfuRecpReqInfo *recpReq,
330 PRIVATE S16 rgSCHTomUtlGenIndices ARGS((
335 TfuSubbandInfo* sbInfo));
337 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq ARGS(
339 TfuRecpReqInfo *recpReqInfo,
344 PRIVATE Void rgSchTomFillCellTtiInfo ARGS
346 TfuTtiIndInfo *ttiInd,
354 PUBLIC U32 rgBwAlloInfo[RGSCH_NUM_SUB_FRAMES]; /* Num of Rbs Allocated in each SF */
355 PUBLIC U32 rgBwAlcnt[RGSCH_NUM_SUB_FRAMES]; /*Num of times Allocation done in each Subframe */
358 /* rg006.201: [ccpu000111706, ccpu00112394]: Separated UL and DL TTI
365 U32 gDlNumUePerTti[20] = {0};
366 U32 gUlNumUePerTti[20] = {0};
367 PRIVATE S16 rgSCHTomUtlProcDlSf ARGS((
371 RgTfuCntrlReqInfo *cntrlInfo,
373 #ifdef RG_ULSCHED_AT_CRC
374 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc ARGS((
376 CmLteTimingInfo crntUlFrm,
378 TfuCntrlReqInfo *cntrlInfo,
380 #endif /* RG_ULSCHED_AT_CRC */
383 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf ARGS((
386 #endif /* TFU_UPGRADE */
388 PRIVATE S16 rgSCHTomUtlFillPhich ARGS((
390 TfuCntrlReqInfo *cntrlInfo,
394 PRIVATE S16 rgSCHTomUtlFillDlPdcch ARGS((
396 TfuCntrlReqInfo *cntrlInfo,
399 PRIVATE S16 rgSCHTomUtlFillUlPdcch ARGS((
401 TfuCntrlReqInfo *cntrlInfo,
405 PRIVATE S16 rgSCHTomUtlProcTA ARGS((
408 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq ARGS((
409 TfuRecpReqInfo *recpReq,
414 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq ARGS((
415 TfuRecpReqInfo *recpReq,
421 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq ARGS
425 TfuUeRecpReqInfo *datRecpInfo
427 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq ARGS
430 TfuRecpReqInfo *recpReqInfo,
432 TfuUeRecpReqInfo *pucchRecpInfo,
434 Bool isDatPresOnSecCell
437 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo ARGS
442 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz ARGS
449 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSzPucchMode21 ARGS
452 TfuCqiPucchMode21 *mode21Info,
457 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion ARGS
464 PRIVATE S16 rgSCHTomUtlMovePcqiNxtOccasion ARGS
471 PRIVATE S16 rgSCHTomUtlMovePriNxtOccasion ARGS
478 PRIVATE S16 rgSCHTomUtlMoveSrNxtOccasion ARGS
484 PRIVATE S16 rgSCHTomUtlMoveSrsNxtOccasion ARGS
489 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi ARGS((
491 Bool *willueRprtCqiRii));
494 PRIVATE S16 rgSCHTomUtlFillDatRecpReq ARGS((
495 TfuRecpReqInfo *recpReq,
500 PRIVATE S16 rgSCHTomUtlFillDatRecpReq ARGS((
501 TfuRecpReqInfo *recpReq,
508 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk ARGS((
509 TfuRecpReqInfo *recpReqInfo,
520 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk ARGS((
521 TfuRecpReqInfo *recpReqInfo,
532 PRIVATE S16 rgSCHTomUtlFillSfHqFdbk ARGS((
533 TfuRecpReqInfo *recpReqInfo,
544 PRIVATE S16 rgSCHTomUtlFillSfHqFdbk ARGS((
545 TfuRecpReqInfo *recpReqInfo,
556 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe ARGS((
557 RgSchDlHqProcCb *hqCb,
558 TfuRecpReqInfo *recpReqInfo,
567 RgrTddAckNackMode ackNackMode,
568 RgSchUePucchRecpInfo **pucchInfoRef,
576 EXTERN PUBLIC Void rgSCHCmnDlSpsSch (RgSchCellCb *cell);
580 PRIVATE S16 rgSCHTomCnsdrRelPdcch ARGS
584 TfuRecpReqInfo *recpReqInfo,
589 PRIVATE S16 rgSCHTomCnsdrRelPdcch ARGS
593 TfuRecpReqInfo *recpReqInfo,
601 PRIVATE Void rgSchTomTtiMiscFunctions ARGS
606 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch ARGS
611 PRIVATE Void rgSchTomTtiDlSch ARGS
616 PRIVATE Void rgSchTomTtiCnsldtSfAlloc ARGS
621 PRIVATE Void rgSchTomTtiL1DlAndUlCfg ARGS
624 RgTfuCntrlReqInfo *cntrlInfo
628 PRIVATE Void rgSCHTomUtlSendSfnTick ARGS
634 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq ARGS
638 PRIVATE Void rgSCHTomUtlProcTddUlSf ARGS
643 PRIVATE Void rgSCHTomUtlGethqRes ARGS
651 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1 ARGS
653 RgSchDlHqProcCb *hqCb,
654 TfuUePucchRecpReq *hqRecpReq,
660 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234 ARGS
662 RgSchDlHqProcCb *hqCb,
663 TfuUePucchRecpReq *hqRecpReq,
673 PUBLIC U32 rgDlCqiRptCnt[16], rgTotDlCqiRpt;
676 U32 rgSch5gtfCqi2Mcs[15] =
677 {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
679 /* forward references */
681 /*HARQ Feedback interpretation in accordance with Femto Forum.
682 Note: There is no value as '0' in Femto Forum Spec but in order to retain
683 the existing usage in MAC (and its Acceptance), its being considered*/
684 //CONSTANT PRIVATE U8 rgSchTomHqFbkMap[8] = {0,1,0,0,4,4,4,4};
685 /*added #defines instead of magic numbers*/
686 /*CONSTANT PRIVATE U32 rgSCHTomBinCoe[RG_SCH_MAX_NUM_UE_SEL_SUBBANDS][RG_SCH_MAX_TOT_NUM_SUBBANDS]={
687 {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},
688 {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},
689 {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},
690 {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},
691 {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},
692 {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}
696 /*ccpu00116923 - ADD - SRS present support*/
697 /*Tables Derived from 3GPP TS 36.211 Section 5.5.3.3 */
698 /* Table 5.5.3.3-1 */
700 CONSTANT PUBLIC RgSchFddCellSpSrsSubfrmTbl rgSchFddCellSpSrsSubfrmTbl = {
701 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE},
702 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE},
703 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE},
704 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE},
705 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
706 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE},
707 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE},
708 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE},
709 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE},
710 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
711 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
712 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
713 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
714 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE},
715 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE},
716 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}
719 /* Table 5.5.3.3-2 */
720 CONSTANT PUBLIC RgSchTddCellSpSrsSubfrmTbl rgSchTddCellSpSrsSubfrmTbl = {
721 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
722 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE},
723 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE},
724 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE},
725 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE},
726 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE},
727 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE},
728 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE},
729 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
730 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
731 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE},
732 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE},
733 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE},
734 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE},
735 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
736 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}
739 PUBLIC S8 rgSchCmnAper20n22DiffCqi[4] = {1, 2, 3, 4};
740 PUBLIC S8 rgSchCmnAper30n31DiffCqi[4] = {0, 1, 2, -1};
744 * @brief get Ue for dedicated preamble rach
748 * Function: rgSCHGetDedPrmUe
750 * Invoked by: rgSCHTomRaReqInd
752 * @param[in] RgSchCellCb *cell
753 * @param[in] TfuRaReqIndInfo *raReqInd
759 PUBLIC S16 rgSCHGetDedPrmUe
763 CmLteTimingInfo timingInfo,
767 PUBLIC S16 rgSCHGetDedPrmUe(cell, rapId, timingInfo, ue)
770 CmLteTimingInfo timingInfo;
774 RgSchCmnCell *cellSch = (RgSchCmnCell *)(cell->sc.sch);
776 printf("rapId[%d] cellSch->rachCfg.dedPrmStart[%d] cellSch->rachCfg.numDedPrm[%d]\n",rapId,cellSch->rachCfg.dedPrmStart,cellSch->rachCfg.numDedPrm);
777 /* Finding UE in handOver List */
778 if ((rapId < cellSch->rachCfg.dedPrmStart) ||
779 (rapId > cellSch->rachCfg.dedPrmStart +
780 cellSch->rachCfg.numDedPrm - 1))
782 /* This ded Preamble corresponds to handover */
783 *ue = rgSCHCmnGetHoUe(cell, rapId);
784 printf(" his ded Preamble corresponds to hando\n");
786 else/* Finding UE from PDCCH Order Mappings */
788 /* Get the UE which has transmitted this RaReq */
789 *ue = rgSCHCmnGetPoUe(cell, rapId, timingInfo);
790 printf(" ==== inding UE from PDCCH Order Mapping\n");
795 * @brief Handler for processing Random Access request indication
800 * Function: rgSCHTomRaReqInd
802 * Handler for processing Random Access request indication recieved from
805 * Invoked by: RgLiTfuRaReqInd of LIM
808 * - Validate the information received: cellId value and raRnti values
809 * - Process the request: Call rgSCHRamProcRaReq (cell, raRnti, raReqInd)
811 * @param[in] RgSchCellCb *cell
812 * @param[in] TfuRaReqIndInfo *raReqInd
818 PUBLIC S16 rgSCHTomRaReqInd
821 TfuRaReqIndInfo *raReqInd
824 PUBLIC S16 rgSCHTomRaReqInd(cell, raReqInd)
826 TfuRaReqIndInfo *raReqInd;
833 Bool isEmtcUe = FALSE;
835 RgSchUeCb *ue = NULLP;
837 TRC2(rgSCHTomRaReqInd);
839 if(cell->cellId != raReqInd->cellId)
841 err.errType = RGSCHERR_TOM_RAREQIND;
842 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
843 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
844 "rgSCHTomRaReqInd(): No cell found with raReq cellId = (%d) errorType (%d)"
845 " errorCause(%d)",raReqInd->cellId, err.errType, err.errCause);
849 for (raRntiCnt = 0; raRntiCnt < raReqInd->nmbOfRaRnti; raRntiCnt++)
851 for (raReqCnt = 0; raReqCnt < raReqInd->rachInfoArr->numRaReqInfo; raReqCnt++)
853 rapId = raReqInd->rachInfoArr[raRntiCnt].raReqInfoArr[raReqCnt].rapId;
855 if(RGSCH_IS_DEDPRM(cell, rapId))
857 rgSCHGetDedPrmUe(cell, rapId, raReqInd->timingInfo, &ue);
860 /* Since rapId is within dedicated range and No ue context
861 * is found means it is a spurious rach. So ignore it.*/
866 if(FALSE == isEmtcUe)
868 #if (ERRCLASS & ERRCLS_DEBUG)
869 if(raReqInd->rachInfoArr[raRntiCnt].raRnti > RGSCH_MAX_RA_RNTI)
871 RGSCHLOGERROR(cell->instIdx, ERRCLS_INT_PAR, ERG013,
872 (ErrVal)raReqInd->rachInfoArr[raRntiCnt].raRnti,
873 ("rgSCHTomRaReqInd(): raRnti is out of range\n"));
877 ret = rgSCHRamProcRaReq(raReqCnt, cell, raReqInd->rachInfoArr[raRntiCnt].raRnti,
878 (TfuRachInfo *)&raReqInd->rachInfoArr[raRntiCnt],
879 raReqInd->timingInfo, ue, &err);
882 err.errType = RGSCHERR_TOM_RAREQIND;
883 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
884 "RARNTI:%d rgSCHTomRaReqInd(): RAM processing failed errType(%d) "
885 "errCause(%d)", raReqInd->rachInfoArr[raRntiCnt].raRnti,
886 err.errType, err.errCause);
893 } /* rgSCHTomRaReqInd */
897 * @brief Handler for processing uplink CQI indication recieved from PHY.
901 * Function: rgSCHTomUlCqiInd
903 * Handler for processing uplink CQI indication recieved from PHY.
905 * Invoked by: RgLiTfuUlCqiInd
909 * - Invoke scheduler to push reported CQI info rgSCHUtlUlCqiInd
911 * @param[in] RgSchCellCb *cell
912 * @param[in] TfuUlCqiIndInfo *ulCqiInd
918 PUBLIC S16 rgSCHTomUlCqiInd
921 TfuUlCqiIndInfo *ulCqiInd
924 PUBLIC S16 rgSCHTomUlCqiInd(cell, ulCqiInd)
926 TfuUlCqiIndInfo *ulCqiInd;
931 TfuUlCqiRpt *ulCqiInfo;
932 TRC2(rgSCHTomUlCqiInd);
934 node = ulCqiInd->ulCqiRpt.first;
935 if(cell->cellId != ulCqiInd->cellId)
937 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
938 "rgSCHTomUlCqiInd() Unable to get the ulCqiInd cell with id(%d)",
943 for (;node; node=node->next)
945 ulCqiInfo = (TfuUlCqiRpt *)node->node;
946 #if (ERRCLASS & ERRCLS_DEBUG)
947 if(ulCqiInfo->numSubband == 0)
949 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Num Subband is"
950 "out of range RNTI:%d",ulCqiInfo->rnti);
954 if((ue = rgSCHDbmGetUeCb(cell, ulCqiInfo->rnti)) == NULLP)
957 if((ue = rgSCHDbmGetSpsUeCb(cell, ulCqiInfo->rnti)) == NULLP)
960 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get "
961 "the ue for RNTI:%d", ulCqiInfo->rnti);
965 /* wideband cqi is directly reported now. and also isTxPort0 */
966 rgSCHUtlUlCqiInd(cell, ue, ulCqiInfo);
969 } /* rgSCHTomUlCqiInd */
972 * @brief Handler for processing PUCCH power adjustment indication
976 * Function: rgSCHTomPucchDeltaPwrInd
978 * Handler for processing PUCCH power adjustment indication
981 * Invoked by: RgLiTfuPucchDeltaPwrInd
985 * - Invoke scheduler to push reported CQI info rgSCHUtlPucchDeltaPwrInd
987 * @param[in] RgSchCellCb *cell
988 * @param[in] TfuPucchDeltaPwrIndInfo *pucchDeltaPwr
994 PUBLIC S16 rgSCHTomPucchDeltaPwrInd
997 TfuPucchDeltaPwrIndInfo *pucchDeltaPwr
1000 PUBLIC S16 rgSCHTomPucchDeltaPwrInd(cell, pucchDeltaPwr)
1002 TfuPucchDeltaPwrIndInfo *pucchDeltaPwr;
1007 TfuPucchDeltaPwr *ueElem;
1009 TRC2(rgSCHTomPucchDeltaPwrInd);
1011 if(cell->cellId != pucchDeltaPwr->cellId)
1013 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
1014 "rgSCHTomPucchDeltaPwrInd() Unable to get the pucchDeltaPwr cell with id(%d)",
1015 pucchDeltaPwr->cellId);
1019 node = pucchDeltaPwr->pucchDeltaPwrLst.first;
1020 for (;node; node=node->next)
1022 ueElem = (TfuPucchDeltaPwr *)node->node;
1023 if((ue = rgSCHDbmGetUeCb(cell, ueElem->rnti)) == NULLP)
1026 if((ue = rgSCHDbmGetSpsUeCb(cell, ueElem->rnti)) == NULLP)
1029 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d "
1030 "rgSCHTomPucchDeltaPwrInd() Unable to get the ue ",
1035 rgSCHUtlPucchDeltaPwrInd(cell, ue, ueElem->pucchDeltaPwr);
1038 } /* rgSCHTomPucchDeltaPwrInd */
1041 * @brief Handler for processing harq ACK/NACK indication recieved from PHY.
1045 * Function: rgSCHTomHarqAckInd
1047 * Handler for processing harq ACK/NACK indication recieved from PHY.
1049 * Invoked by: RgLiTfuHqInd
1052 * For each HqAckInfo received
1054 * - If UE doesnt exist look for a RaCb and invoke rgSCHRamMsg4FdbkInd
1055 * - Invoke HARQ module to pass HARQ-ACK info rgSCHDhmHqFdbkInd
1057 * @param[in] TfuHqIndInfo *harqAckInd
1063 PUBLIC S16 rgSCHTomHarqAckInd
1066 TfuHqIndInfo *harqAckInd
1069 PUBLIC S16 rgSCHTomHarqAckInd(cell, harqAckInd)
1071 TfuHqIndInfo *harqAckInd;
1082 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1084 RgSchCellCb *iterCellP;
1086 TRC2(rgSCHTomHarqAckInd);
1088 if(cell->cellId != harqAckInd->cellId)
1090 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() Unable to get"
1091 " the cell for cellId (%d)", harqAckInd->cellId);
1092 err.errType = RGSCHERR_TOM_HARQACKIND;
1093 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
1097 node = harqAckInd->hqIndLst.first;
1098 for (;node; node=node->next)
1100 hqInfo = (TfuHqInfo *)node->node;
1102 rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1103 TfuHqFdbk fdbk = hqInfo->isAck[0];
1104 raCb = rgSCHDbmGetRaCb (cell, hqInfo->rnti);
1105 ue = rgSCHDbmGetUeCb (cell, hqInfo->rnti);
1106 if (ue != NULLP && raCb == NULLP)
1108 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, harqAckInd->timingInfo, fdbk, &err)) != ROK)
1110 err.errType = RGSCHERR_TOM_HARQACKIND;
1111 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1112 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1113 err.errType, err.errCause);
1121 if ((rgSCHDhmRlsDlsfHqProc (cell, harqAckInd->timingInfo)) != ROK)
1123 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
1124 "subframe for cellId (%d) ", cell->cellId);
1125 err.errType = RGSCHERR_TOM_HARQACKIND;
1128 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
1130 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
1132 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
1134 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
1135 if(rlsHqBufs->numUes)
1137 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
1138 RgSchMacRlsHq (&pst, rlsHqBufs);
1140 rlsHqBufs->numUes = 0;
1144 rlsHqBufs->numUes = 0;
1145 node = harqAckInd->hqIndLst.first;
1146 for (;node; node=node->next)
1148 hqInfo = (TfuHqInfo *)node->node;
1149 for(tbCnt=0; tbCnt<TFU_MAX_HARQ_FDBKS; tbCnt++)
1151 hqInfo->isAck[tbCnt]=(TfuHqFdbk)rgSchTomHqFbkMap[hqInfo->isAck[tbCnt]];
1153 raCb = rgSCHDbmGetRaCb (cell, hqInfo->rnti);
1154 ue = rgSCHDbmGetUeCb (cell, hqInfo->rnti);
1155 if (ue == NULLP && raCb != NULLP)
1158 rgSCHRamMsg4FdbkInd (raCb);
1160 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1161 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1163 err.errType = RGSCHERR_TOM_HARQACKIND;
1164 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1165 " feedback processing failed errType(%d) errCause(%d)",
1166 err.errType, err.errCause);
1171 else if (ue != NULLP && raCb == NULLP)
1173 /* Get the Downlink HARQ entity from ue */
1174 if ((rgSCHDhmHqFdbkInd (ue, RGSCH_HQ_FDB_IND_CB_TYPE_HQ_ENT,
1175 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1177 err.errType = RGSCHERR_TOM_HARQACKIND;
1178 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1179 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1180 err.errType, err.errCause);
1184 else if (ue != NULLP && raCb != NULLP)
1186 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1187 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1189 err.errType = RGSCHERR_TOM_HARQACKIND;
1190 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1191 " feedback processing failed errType(%d) errCause(%d).",
1192 err.errType, err.errCause);
1198 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1199 "UE CB or RA CB ", hqInfo->rnti);
1200 err.errType = RGSCHERR_TOM_HARQACKIND;
1205 /* Check with TDD call DHM*/
1206 if ((rgSCHDhmRlsDlsfHqProc (cell, harqAckInd->timingInfo)) != ROK)
1208 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
1209 "subframe for cellId (%d) ", harqAckInd->cellId);
1210 err.errType = RGSCHERR_TOM_HARQACKIND;
1213 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
1215 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
1217 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
1219 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
1220 if(rlsHqBufs->numUes)
1222 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
1223 RgSchMacRlsHq (&pst, rlsHqBufs);
1225 rlsHqBufs->numUes = 0;
1230 } /* rgSCHTomHarqAckInd */
1234 * @brief Handler for processing Scheduling Request indication
1235 * recieved from PHY for a list of UEs.
1239 * Function: rgSCHTomSrInd
1241 * Handler for processing Scheduling Request indication recieved from PHY
1244 * Invoked by: RgLiTfuSrInd
1248 * - Invoke scheduler to indicate SR rgSCHUtlSrRcvd
1250 * @param[in] TfuSrIndInfo *srInd
1256 PUBLIC S16 rgSCHTomSrInd
1262 PUBLIC S16 rgSCHTomSrInd(cell, srInd)
1264 TfuSrIndInfo *srInd;
1273 TRC2(rgSCHTomSrInd);
1275 if(cell->cellId != srInd->cellId)
1277 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for srcInd cellId"
1278 ":%d ", srInd->cellId);
1279 err.errType = RGSCHERR_TOM_SRIND;
1280 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
1285 node = srInd->srLst.first;
1286 for (;node; node=node->next)
1290 srInfo = (TfuSrInfo *)node->node;
1291 ue = rgSCHDbmGetUeCb (cell, srInfo->rnti);
1294 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
1298 rgSCHUtlHdlUlTransInd(cell, ue, srInd->timingInfo);
1299 /*Need to activate UE as SR received*/
1300 if (ue->isDrxEnabled)
1302 rgSCHDrxSrInd(cell, ue);
1304 ret = rgSCHUtlSrRcvd (cell, ue, srInd->timingInfo, &err);
1307 err.errType = RGSCHERR_TOM_SRIND;
1308 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Scheduler processing failed "
1309 "errType(%d) errCause(%d) RNTI:%d", err.errType, err.errCause,srInfo->rnti);
1314 } /* end of rgSCHTomSrInd */
1317 * @brief Handler for processing downlink CQI indication recieved from
1322 * Function: rgSCHTomDoaInd
1324 * Handler for processing DOA recieved from PHY
1327 * Invoked by: RgLiTfuDoaInd
1331 * - Invoke scheduler to indicate DOA rgSCHUtlDoaInd
1333 * @param[in] TfuDoaIndInfo *doaInd
1339 PUBLIC S16 rgSCHTomDoaInd
1342 TfuDoaIndInfo *doaInd
1345 PUBLIC S16 rgSCHTomDoaInd(cell, doaInd )
1347 TfuDoaIndInfo *doaInd;
1353 TRC2(rgSCHTomDoaInd);
1355 if(cell->cellId != doaInd->cellId)
1357 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for doaInd cellId"
1358 ":%d", doaInd->cellId);
1363 node = doaInd->doaRpt.first;
1364 for (;node; node=node->next)
1366 doaInfo = (TfuDoaRpt *)node->node;
1367 ue = rgSCHDbmGetUeCb (cell, doaInfo->rnti);
1370 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
1374 rgSCHUtlDoaInd(cell, ue, doaInfo);
1377 } /* rgSCHTomDoaInd */
1379 * @brief Handler for processing downlink CQI indication recieved from
1384 * Function: rgSCHTomDlCqiInd
1386 * Handler for processing downlink CQI indication recieved from PHY
1389 * Invoked by: RgLiTfuDlCqiInd
1393 * - Invoke scheduler to indicate DL CQI rgSCHUtlDlCqiInd
1395 * @param[in] TfuDlCqiIndInfo *dlCqiInd
1401 PUBLIC S16 rgSCHTomDlCqiInd
1404 TfuDlCqiIndInfo *dlCqiInd
1407 PUBLIC S16 rgSCHTomDlCqiInd(cell, dlCqiInd)
1409 TfuDlCqiIndInfo *dlCqiInd;
1414 TfuDlCqiRpt *dlCqiInfo;
1415 TRC2(rgSCHTomDlCqiInd);
1417 if(cell->cellId != dlCqiInd->cellId)
1419 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1420 ":%d", dlCqiInd->cellId);
1425 node = dlCqiInd->dlCqiRptsLst.first;
1426 for (;node; node=node->next)
1428 dlCqiInfo = (TfuDlCqiRpt *)node->node;
1429 ue = rgSCHDbmGetUeCb (cell, dlCqiInfo->rnti);
1432 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%dUnable to get the UE CB",
1436 rgSCHUtlDlCqiInd(cell, ue, dlCqiInfo, dlCqiInd->timingInfo);
1437 rgSCHUtlHdlUlTransInd(cell, ue, dlCqiInd->timingInfo);
1440 } /* rgSCHTomDlCqiInd */
1443 * @brief Handler for moving PCQI instance for the next periodic occasion
1447 * Function: rgSCHTomUtlMovePcqiNxtOccasion
1449 * Handler for moving PCQI instance for the next periodic occasion
1451 * Invoked by: rgSCHTomUtlFill*
1454 * - For a UE move its occurence instance to next occasion
1455 * depending on its periodicity
1456 * - Remove it from the current list and insert it to the list
1457 * having the index matching with the derived number.
1459 * @param[in] RgSchCellCb *cell,
1460 * [in] RgSchUeCb *ue
1466 PRIVATE S16 rgSCHTomUtlMovePcqiNxtOccasion
1470 RgSchUePCqiCb *cqiCb
1473 PRIVATE S16 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb)
1476 RgSchUePCqiCb *cqiCb;
1481 CmLteTimingInfo timingInfo;
1482 TRC2(rgSCHTomUtlMovePcqiNxtOccasion);
1484 if(cqiCb->cqiCfg.cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP)
1487 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, timingInfo, TFU_DELTA);
1489 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, timingInfo,
1490 TFU_RECPREQ_DLDELTA);
1492 RG_SCH_ADD_TO_CRNT_TIME(timingInfo,timingInfo,cqiCb->cqiPeri);
1493 rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ue,cqiCb);
1495 /* Compute Next Transmission Instance */
1496 cqiIdx = cqiCb->cqiPeri + cqiCb->nCqiTrIdx;
1497 cqiIdx = cqiIdx%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1498 /* Delete from current List and move to new list */
1499 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
1502 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1505 cqiCb->nCqiTrIdx = cqiIdx;
1506 cmLListAdd2Tail(&(cell->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst),
1507 &(cqiCb->cqiLstEnt));
1509 rgSCHUtlSCellHndlCqiCollsn(cqiCb);
1513 } /* rgSCHTomUtlMovePcqiNxtOccasion */
1516 * @brief Handler for moving RI instance for the next periodic occasion
1520 * Function: rgSCHTomUtlMovePriNxtOccasion
1522 * Handler for moving PCQI instance for the next periodic occasion
1524 * Invoked by: rgSCHTomUtlFill*
1527 * - For a UE move its occurence instance to next occasion
1528 * depending on its periodicity
1529 * - Remove it from the current list and insert it to the list
1530 * having the index matching with the derived number.
1532 * @param[in] RgSchCellCb *cell,
1533 * [in] RgSchUeCb *ue
1539 PRIVATE S16 rgSCHTomUtlMovePriNxtOccasion
1546 PRIVATE S16 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb)
1549 RgSchUePCqiCb *riCb;
1559 TRC2(rgSCHTomUtlMovePriNxtOccasion);
1560 crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
1561 +(cell->crntTime.slot);
1562 #ifdef XEON_SPECIFIC_CHANGES
1563 RGSCHCPYTIMEINFO(cell->crntTime, ue->riRecpTime);
1565 /* Compute Next Transmission Instance */
1566 if (riCb->cqiCfg.cqiSetup.cqiRepType == RGR_UE_PCQI_WB_REP)
1568 effPeriodicity = riCb->cqiPeri * riCb->riPeri;
1569 tempIdx = effPeriodicity + riCb->nRiTrIdx;
1573 effPeriodicity = (riCb->h * riCb->cqiPeri * riCb->riPeri);
1574 /* In case of SFN wraparound, the SB CQI reporting cycle breaks
1575 * and RI->WB CQI->SBCQI.. should resume. RI is repositioned
1576 * accordingly. WBCQI handling is naturally accomplished */
1577 if ((crntTime + TFU_RECPREQ_DLDELTA + effPeriodicity) >
1578 (RGSCH_MAX_SUBFRM_5G - 1))
1580 riTrInsTime = (effPeriodicity - riCb->cqiOffset + riCb->riOffset) % effPeriodicity;
1581 tempIdx = RGSCH_MAX_SUBFRM_5G + (effPeriodicity - riTrInsTime);
1582 /* In case of SFN wraparound, riDist should be distance from crntTime
1583 * + TFU_RECPREQ_DLDELTA to tempIdx. Updating effPeriodicity
1584 * to make riDist calculation consistent for both SFN wraparound
1585 * case and normal case */
1586 effPeriodicity = tempIdx - TFU_RECPREQ_DLDELTA - crntTime;
1590 tempIdx = effPeriodicity + riCb->nRiTrIdx;
1593 riIdx = tempIdx % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1594 if (effPeriodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
1596 riDist = rgSCHUtlFindDist((U16)(crntTime + TFU_RECPREQ_DLDELTA),
1597 (U16)(crntTime + TFU_RECPREQ_DLDELTA + effPeriodicity));
1604 /* ccpu00138306- If Periodicity is equal to Queue Size or multiple of it
1605 * then the next occasion idx will be same as current Idx, Hence need not
1608 if((effPeriodicity%RG_SCH_PCQI_SRS_SR_TRINS_SIZE) != 0)
1610 /* Delete from current List and move to new list */
1611 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[riCb->nRiTrIdx].riLst,
1614 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"[%d]UEID:Unable to remove node",
1617 RG_SCH_RECORD(&riCb->histElem,RGSCH_ACTION_DEL, &cell->pCqiSrsSrLst[riCb->nRiTrIdx].riLst);
1618 cmLListAdd2Tail(&cell->pCqiSrsSrLst[riIdx].riLst,
1620 RG_SCH_RECORD(&riCb->histElem,RGSCH_ACTION_ADD, &cell->pCqiSrsSrLst[riIdx].riLst);
1629 riCb->nRiTrIdx = riIdx;
1630 riCb->riDist = riDist;
1633 rgSCHUtlSCellHndlRiCollsn(riCb);
1636 } /* rgSCHTomUtlMovePriNxtOccasion */
1639 * @brief Handler for moving SR instance for the next periodic occasion
1643 * Function: rgSCHTomUtlMoveSrNxtOccasion
1645 * Handler for moving SR instance for the next periodic occasion
1647 * Invoked by: rgSCHTomUtlFill*
1650 * - For a UE move its occurence instance to next occasion
1651 * depending on its periodicity
1652 * - Remove it from the current list and insert it to the list
1653 * having the index matching with the derived number.
1655 * @param[in] RgSchCellCb *cell,
1656 * [in] RgSchUeCb *ue
1662 PRIVATE S16 rgSCHTomUtlMoveSrNxtOccasion
1668 PRIVATE S16 rgSCHTomUtlMoveSrNxtOccasion(cell, ue)
1675 TRC2(rgSCHTomUtlMoveSrNxtOccasion);
1677 /* Compute Next Transmission Instance */
1678 srIdx = ue->srCb.peri + ue->srCb.nSrTrIdx;
1679 srIdx = srIdx%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1680 /* Delete from current List and move to new list */
1681 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[ue->srCb.nSrTrIdx].srLst,
1682 &ue->srCb.srLstEnt))
1684 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1687 ue->srCb.nSrTrIdx = srIdx;
1688 cmLListAdd2Tail(&cell->pCqiSrsSrLst[ue->srCb.nSrTrIdx].srLst,
1689 &ue->srCb.srLstEnt);
1692 } /* rgSCHTomUtlMoveSrNxtOccasion */
1695 * @brief Handler for moving SRS instance for the next periodic occasion
1699 * Function: rgSCHTomUtlMoveSrsNxtOccasion
1701 * Handler for moving SRS instance for the next periodic occasion
1703 * Invoked by: rgSCHTomUtlFill*
1706 * - For a UE move its occurence instance to next occasion
1707 * depending on its periodicity
1708 * - Remove it from the current list and insert it to the list
1709 * having the index matching with the derived number.
1711 * @param[in] RgSchCellCb *cell,
1712 * [in] RgSchUeCb *ue
1718 PRIVATE S16 rgSCHTomUtlMoveSrsNxtOccasion
1724 PRIVATE S16 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue)
1735 TRC2(rgSCHTomUtlMoveSrsNxtOccasion);
1736 crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
1737 +(cell->crntTime.slot);
1739 /* Compute Next Transmission Instance */
1740 tempIdx = ue->srsCb.peri + ue->srsCb.nSrsTrIdx;
1741 srsIdx = tempIdx %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1742 if (ue->srsCb.peri > RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
1744 srsDist = rgSCHUtlFindDist((U16)(crntTime + TFU_RECPREQ_DLDELTA),
1745 (U16)(crntTime + TFU_RECPREQ_DLDELTA + ue->srsCb.peri));
1752 /* ccpu00138306- If Periodicity is equal to Queue Size or multiple of it
1753 * then the next occasion idx will be same as current Idx, Hence need not
1756 if((ue->srsCb.peri%RG_SCH_PCQI_SRS_SR_TRINS_SIZE) != 0)
1758 /* Delete from current List and move to new list */
1759 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[ue->srsCb.nSrsTrIdx].srsLst,
1760 &ue->srsCb.srsLstEnt))
1762 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1765 cmLListAdd2Tail(&cell->pCqiSrsSrLst[srsIdx].srsLst,
1766 &ue->srsCb.srsLstEnt);
1775 ue->srsCb.nSrsTrIdx = srsIdx;
1776 ue->srsCb.srsDist = srsDist;
1778 } /* rgSCHTomUtlMoveSrsNxtOccasion */
1782 * @brief Handler for processing RAW CQI indication recieved from
1787 * Function: rgSCHTomRawCqiInd
1789 * Handler for processing RAW CQI indication recieved from PHY
1792 * Invoked by: RgLiTfuRawCqiInd
1796 * - Invoke scheduler to indicate Raw CQI rgSCHUtlRawCqiInd
1798 * @param[in] TfuRawCqiIndInfo *rawCqiInd
1804 PUBLIC S16 rgSCHTomRawCqiInd
1807 TfuRawCqiIndInfo *rawCqiInd
1810 PUBLIC S16 rgSCHTomRawCqiInd(cell, rawCqiInd)
1812 TfuRawCqiIndInfo *rawCqiInd;
1817 TfuRawCqiRpt* rawCqiInfo;
1821 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1822 RgSchCellCb *iterCellP;
1833 TRC2(rgSCHTomRawCqiInd);
1835 if(cell->cellId != rawCqiInd->cellId)
1837 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1838 ":%d", rawCqiInd->cellId);
1843 node = rawCqiInd->rawCqiRpt.first;
1844 for (;node; node=node->next)
1846 rawCqiInfo = (TfuRawCqiRpt *)node->node;
1847 ue = rgSCHDbmGetUeCb (cell, rawCqiInfo->crnti);
1848 raCb = rgSCHDbmGetRaCb (cell, rawCqiInfo->crnti);
1852 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"CRNTI:%d Unable to get the UECB",
1859 if (rawCqiInfo->numBits >= 5)
1860 printf("cellId [%d] crnti [%d] numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n",
1861 cell->cellId, rawCqiInfo->crnti, rawCqiInfo->numBits, rawCqiInfo->uciPayload,
1862 rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.slot);
1864 if (rawCqiInfo->numBits == 1)
1866 rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1867 U8 fdbk = TFU_HQFDB_NACK;
1868 /* Process HARQ FdbkInd */
1869 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1872 fdbk = TFU_HQFDB_ACK;
1873 hqInfo.isAck[0] = fdbk;
1875 if (ue != NULLP && raCb == NULLP)
1877 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
1879 err.errType = RGSCHERR_TOM_HARQACKIND;
1880 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1881 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1882 err.errType, err.errCause);
1886 else if (ue == NULLP && raCb != NULLP)
1888 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1889 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1891 err.errType = RGSCHERR_TOM_HARQACKIND;
1892 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1893 " feedback processing failed errType(%d) errCause(%d)",
1894 err.errType, err.errCause);
1899 else if (ue != NULLP && raCb != NULLP)
1901 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1902 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1904 err.errType = RGSCHERR_TOM_HARQACKIND;
1905 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1906 " feedback processing failed errType(%d) errCause(%d).",
1907 err.errType, err.errCause);
1913 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1914 "UE CB or RA CB ", rawCqiInfo->crnti);
1915 err.errType = RGSCHERR_TOM_HARQACKIND;
1919 printf("rawCqiInfo->numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n", rawCqiInfo->numBits,
1920 rawCqiInfo->uciPayload, rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.slot);
1923 else if (rawCqiInfo->numBits == 5)
1925 /* Process CQI-RI Ind*/
1926 ri = (rawCqiInfo->uciPayload >> 27) & 0x1;
1927 cqi = (rawCqiInfo->uciPayload >> 28) & 0xF;
1931 printf("\n UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1934 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1935 ue->ue5gtfCb.rank = ri + 1;
1937 if (rawCqiInfo->numBits > 1)
1939 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1940 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1941 ueDl->cqiFlag = TRUE;
1942 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1943 // rgSCHCheckAndSetTxScheme(cell, ue);
1948 printf("UE[%d] CQI[%d] MCS[%d] RI[%d]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri);
1951 else if (rawCqiInfo->numBits == 6)
1953 rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1954 TfuHqFdbk fdbk = TFU_HQFDB_NACK;
1955 /* Process both HARQ and CQI-RI Ind*/
1956 ri = (rawCqiInfo->uciPayload >> 26) & 0x1;
1957 cqi = (rawCqiInfo->uciPayload >> 27) & 0xF;
1958 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1961 printf("UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1964 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1965 ue->ue5gtfCb.rank = ri + 1;
1967 if (rawCqiInfo->numBits > 1)
1969 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1970 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1971 ueDl->cqiFlag = TRUE;
1972 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1973 // rgSCHCheckAndSetTxScheme(cell, ue);
1978 fdbk = TFU_HQFDB_ACK;
1979 hqInfo.isAck[0] = fdbk;
1981 if (ue != NULLP && raCb == NULLP)
1983 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
1985 err.errType = RGSCHERR_TOM_HARQACKIND;
1986 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1987 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1988 err.errType, err.errCause);
1992 else if (ue == NULLP && raCb != NULLP)
1994 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1995 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1997 err.errType = RGSCHERR_TOM_HARQACKIND;
1998 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1999 " feedback processing failed errType(%d) errCause(%d)",
2000 err.errType, err.errCause);
2005 else if (ue != NULLP && raCb != NULLP)
2007 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
2008 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
2010 err.errType = RGSCHERR_TOM_HARQACKIND;
2011 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
2012 " feedback processing failed errType(%d) errCause(%d).",
2013 err.errType, err.errCause);
2019 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
2020 "UE CB or RA CB ", rawCqiInfo->crnti);
2021 err.errType = RGSCHERR_TOM_HARQACKIND;
2026 printf("\nUE[%u] CQI[%u] MCS[%u] RI[%u] HQ[%u]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri, hqAck);
2031 if ((rgSCHDhmRlsDlsfHqProc (cell, rawCqiInd->timingInfo)) != ROK)
2033 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
2034 "subframe for cellId (%d) ", cell->cellId);
2035 err.errType = RGSCHERR_TOM_HARQACKIND;
2038 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
2040 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
2042 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
2044 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
2045 if(rlsHqBufs->numUes)
2047 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
2048 RgSchMacRlsHq (&pst, rlsHqBufs);
2050 rlsHqBufs->numUes = 0;
2054 } /* rgSCHTomRawCqiInd */
2057 * @brief Handler for processing SRS indication recieved from
2062 * Function: rgSCHTomSrsInd
2064 * Handler for SRS indication recieved from PHY
2067 * Invoked by: RgLiTfuSrsInd
2071 * - Invoke scheduler to indicate UL SRS rgSCHUtlSrsInd
2073 * @param[in] TfuSrsIndInfo *srsInd
2079 PUBLIC S16 rgSCHTomSrsInd
2082 TfuSrsIndInfo *srsInd
2085 PUBLIC S16 rgSCHTomSrsInd(cell, srsInd)
2087 TfuSrsIndInfo *srsInd;
2094 TRC2(rgSCHTomSrsInd);
2096 if(cell->cellId != srsInd->cellId)
2098 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2099 ":%d", srsInd->cellId);
2103 node = srsInd->srsRpt.first;
2104 for (;node; node=node->next)
2106 srsInfo = (TfuSrsRpt *)node->node;
2107 ue = rgSCHDbmGetUeCb (cell, srsInfo->ueId);
2110 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
2111 "UE CB", srsInfo->ueId);
2114 rgSCHUtlSrsInd(cell, ue, srsInfo, srsInd->timingInfo);
2115 rgSCHUtlHdlUlTransInd(cell, ue, srsInd->timingInfo);
2118 } /* rgSCHTomSrsInd */
2122 * Fun: rgSCHTomUtlGenIndices
2124 * Desc: This function reconstructs the Subband Indices for
2125 * of M selected Subbands conveyed by the UE for APeriodic Modes
2126 * 2-0 and 2-2. It decodes the Label which uniquely encodes M out
2134 * File: rg_sch_utl.c
2139 PRIVATE S16 rgSCHTomUtlGenIndices
2145 TfuSubbandInfo* sbInfo
2148 PRIVATE S16 rgSCHTomUtlGenIndices(label, posM, valN, valK, sbInfo)
2153 TfuSubbandInfo* sbInfo;
2156 U8 idx, kval, xval, xmin;
2159 for(kval=0; kval<posM;kval++)
2162 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe, (posM-kval-1));
2163 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2164 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2168 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2169 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2172 sbInfo[kval].numRb = valK;
2173 sbInfo[kval].rbStart = idx*valK;
2175 label = label-binCoe;
2178 } /* end of rgSCHTomUtlGenIndices*/
2182 * @brief Handler for processing decode failure indication recieved from
2187 * Function: rgSCHTomCrcInd
2189 * Handler for processing decode failure indication recieved from
2190 * PHY for a set of UEs.
2192 * Invoked by: RgLiTfuCrcInd of rg_sch.x
2195 * - Validate the information received and retrieve cell and ue.
2196 * - Process Decode failure Indication: Call rgSCHUhmProcHqFailure().
2198 * @param[in] TfuCrcIndInfo *crcInd
2204 PUBLIC S16 rgSCHTomCrcInd
2207 TfuCrcIndInfo *crcInd
2210 PUBLIC S16 rgSCHTomCrcInd(cell, crcInd)
2212 TfuCrcIndInfo *crcInd;
2215 RgSchUeCb *ue = NULLP;
2216 RgSchRaCb *raCb = NULLP;
2218 TfuCrcInfo *crcInfo;
2219 #ifdef RG_ULSCHED_AT_CRC
2222 CmLteTimingInfo crntHiDci0Frm;
2223 //RgSchCmnUlCell *cellUl;
2224 Inst inst = cell->instIdx;
2225 TfuCntrlReqInfo *cntrlInfo;
2233 RgSchUlHqProcCb *hqProc;
2237 RgSchUlHqProcCb *ulHqProc;
2240 TRC2(rgSCHTomCrcInd);
2242 if(cell->cellId != crcInd->cellId)
2244 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2245 ":%d", crcInd->cellId);
2248 #ifdef RG_ULSCHED_AT_CRC
2251 static CmLteTimingInfo lastCrc = {2000,0};
2252 CmLteTimingInfo crntCrc = cell->crntTime;
2253 if (RGSCH_TIMEINFO_SAME(lastCrc, crntCrc))
2255 /*Removed the WA to drop 2nd CRC*/
2256 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"Recieved CRC "
2257 "twice per TTI @(%u,%u)", cell->crntTime.sfn,
2258 cell->crntTime.slot);
2264 node = crcInd->crcLst.first;
2265 for (;node; node=node->next)
2267 crcInfo = (TfuCrcInfo*)node->node;
2268 ue = rgSCHDbmGetUeCb (cell, crcInfo->rnti);
2272 /* Fetch from SPS List */
2273 ue = rgSCHDbmGetSpsUeCb(cell, crcInfo->rnti);
2277 raCb = rgSCHDbmGetRaCb (cell, crcInfo->rnti);
2284 /* Added Ul TB count for Uplink data scheduled*/
2288 ulHqProc = &(raCb->msg3HqProc);
2289 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2291 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2296 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2297 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2299 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2304 if (crcInfo->isFailure == FALSE)
2308 rgSCHRamMsg3DatInd(raCb);
2310 /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
2311 hqProc = &(raCb->msg3HqProc);
2312 RGSCH_UPD_PHICH(cell->ulDlCfgIdx, crcInd->timingInfo.slot,
2320 gUlCrcPassCounter++;
2325 RGSCHCPYTIMEINFO(crcInd->timingInfo, ue->datIndTime);
2326 #ifndef MAC_SCH_STATS
2327 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo);
2330 /** Stats update over here
2333 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2335 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo, cmnUe->ul.crntUlCqi[0]);
2337 #endif /* MAC_SCH_STATS */
2339 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2341 rgSCHUtlHdlCrcInd(cell, ue, crcInd->timingInfo);
2349 /* SR_RACH_STATS : MSG3 Nack / DTX*/
2350 if (crcInfo->isDtx == TRUE)
2356 rgNumMsg3CrcFailed++;
2358 rgSCHRamMsg3FailureInd(raCb);
2360 rgSCHCmnEmtcHdlCrcFailInd(cell, raCb);
2362 /* Added Ul TB count for CRC Failure of MSG3 */
2364 ulHqProc = &(raCb->msg3HqProc);
2365 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2367 cell->dlUlTbCnt.tbTransUlFaulty++;
2375 gUlCrcFailCounter++;
2380 #ifndef MAC_SCH_STATS
2381 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv);
2384 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2386 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv, cmnUe->ul.crntUlCqi[0]);
2388 #endif /* MAC_SCH_STATS */
2389 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2391 rgSCHUtlHdlCrcFailInd(cell, ue, crcInd->timingInfo);
2393 /* Added Ul TB count for CRC Failure of Uplink data */
2395 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2396 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2398 cell->dlUlTbCnt.tbTransUlFaulty++;
2405 /* ccpu00132653-ADD Added Sched_At_Crc Changes for TDD and optimized here
2406 the codebase across TDD and FDD*/
2407 #ifdef RG_ULSCHED_AT_CRC
2408 /* Changes to do uplink scheduling at CRC Indication */
2409 //cellUl = RG_SCH_CMN_GET_UL_CELL(cell);
2410 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, crntHiDci0Frm, TFU_ULCNTRL_DLDELTA);
2413 rgSCHCmnRlsUlSf(cell,0);
2416 /* Allocating memory for CntrlReq as it required for both EMTC and
2418 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&cntrlInfo,
2419 sizeof(TfuCntrlReqInfo))) != ROK)
2421 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuCntrlReqInfo "
2425 rgSCHCmnUlSch(cell);
2427 rgSCHL2Meas(cell,TRUE);
2429 /* Also, sending UL DCI and PHICH for just scheduled subframe */
2430 ulSf = rgSCHUtlSubFrmGet (cell, crntHiDci0Frm);
2432 if ((rgSCHTomUtlProcDlSfAtCrc (ulSf, crntHiDci0Frm, cell, cntrlInfo, &err)) != ROK)
2434 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomCrcInd() Unable to process"
2435 " downlink subframe for cellId %d", crcInd->cellId);
2436 err.errType = RGSCHERR_TOM_TTIIND;
2439 #endif /* RG_ULSCHED_AT_CRC */
2441 } /* rgSCHTomCrcInd */
2444 * @brief Handler for processing timing Advance indication recieved from
2449 * Function: rgSCHTomTimingAdvInd
2451 * Handler for processing timing advance indication recieved from PHY
2454 * Invoked by: RgLiTfuTimingAdvInd
2458 * - Call DHM to update value of Timing Advance rgSCHDhmUpdTa.
2460 * @param[in] TfuTimingAdvIndInfo *timingAdvInd
2466 PUBLIC S16 rgSCHTomTimingAdvInd
2469 TfuTimingAdvIndInfo *timingAdvInd
2472 PUBLIC S16 rgSCHTomTimingAdvInd(cell, timingAdvInd)
2474 TfuTimingAdvIndInfo *timingAdvInd;
2479 TfuTimingAdvInfo *timingAdvInfo;
2482 TRC2(rgSCHTomTimingAdvInd);
2484 if(cell->cellId != timingAdvInd->cellId)
2486 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2487 "=(%d)", timingAdvInd->cellId);
2492 node = timingAdvInd->timingAdvLst.first;
2493 for (;node; node=node->next)
2495 timingAdvInfo = (TfuTimingAdvInfo *)node->node;
2496 ue = rgSCHDbmGetUeCb (cell, timingAdvInfo->rnti);
2499 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
2500 timingAdvInfo->rnti);
2503 rgSCHDhmUpdTa (cell, ue, timingAdvInfo->timingAdv);
2506 } /* rgSCHTomTimingAdvInd */
2509 * @brief Handler for processing TTI indication recieved from
2510 * PHY for 'n' cells.
2514 * Function: rgSCHTomTtiInd
2516 * Handler for processing slot indication recieved from MAC
2517 * for a cell. This is split into the below Steps.
2519 * 1: Complete the Uplink and Common Channel Scheduling for each Cell
2520 * 2: Complete the UE specific Scheduling for each Cell / across Cells.
2521 * 3: Consolidate the subframe allocations and send to each MAC instance
2522 * 4: Fill the Tfu structures for DL and UL Config requests
2523 * 5: Handle the RGR Config messages per Cell
2525 * @param[in] SlotIndInfo *slotInd
2526 * @param[in] Inst schInst
2530 PUBLIC Void rgSCHTomTtiInd
2532 SlotIndInfo *slotInd,
2536 PUBLIC Void rgSCHTomTtiInd(slotInd, schInst)
2537 SlotIndInfo *slotInd;
2541 RgInfSfAlloc *subfrmAlloc;
2542 RgTfuCntrlReqInfo *cntrlInfo = NULLP;
2546 RgSchCellCb *cell[CM_LTE_MAX_CELLS];
2547 RgSchCellCb *cellLst[CM_LTE_MAX_CELLS];
2549 TRC2(rgSCHTomTtiInd);
2555 //rgSchTomFillCellTtiInfo(slotInd, schInst, &nCell, &cell[0]);
2557 schFillCrntTime(*slotInd,schInst);
2558 for (i = 0; i < nCell; i++)
2560 /* Perform UL and DL Common Channel scheduling */
2561 rgSchTomTtiUlAndDlCmnChSch (cell[i]);
2564 /* Perform scheduling in Order of
2568 for (i = 0; i < nCell; i++)
2571 if (cell[i]->isDlDataAllwd && (cell[i]->stopDlSch == FALSE))
2573 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell[i]);
2574 /* Perform DL Retx scheduling */
2575 cellSch->apisDl->rgSCHDlRetxSched(cell[i], &cellSch->allocInfo);
2579 rgSchCmnPreDlSch(cell, nCell, cellLst);
2580 for (i = 0; i < nCell; i++)
2582 /* Perform DL scheduling */
2583 rgSchTomTtiDlSch (cellLst[i]);
2585 rgSchCmnPstDlSch(cell[0]);
2587 for (i = 0; i < nCell; i++)
2590 #ifndef RG_ULSCHED_AT_CRC
2591 /* Perform UL scheduling for TDD */
2592 rgSCHCmnUlSch (cell[i]);
2596 /* Init SF Alloc info per Cell */
2597 for (i = 0; i < nCell; i++)
2599 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2600 rgSCHUtlResetSfAlloc(subfrmAlloc,FALSE,TRUE);
2602 for (i = 0; i < nCell; i++)
2604 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2606 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2608 * TFU_DLDATA_DLDELTA is used in this calculation because the subfrmAlloc
2609 * timingInfo which is being calculated here will be used by MAC
2611 RG_SCH_ADD_TO_CRNT_TIME(cell[i]->crntTime, subfrmAlloc->timingInfo,
2612 RG_DL_DELTA - TFU_DLDATA_DLDELTA);
2613 /* Consolidate the Allocations and send response to MAC instances */
2614 rgSchTomTtiCnsldtSfAlloc (cell[i]);
2618 for (i = 0; i < nCell; i++)
2620 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2622 /* Send the consolidated Alloc Info to MAC instances */
2623 rgSCHCmnSndCnsldtInfo (cell[i]);
2627 for (i = 0; i < nCell; i++)
2629 /* Fill control data from scheduler to PHY */
2630 if ((ret = rgSCHUtlAllocEventMem((cell[i]->instIdx), (Ptr *)&cntrlInfo,
2631 sizeof(RgTfuCntrlReqInfo))) != ROK)
2633 RLOG_ARG0(L_ERROR,DBG_CELLID,cell[i]->cellId,"Unable to Allocate TfuCntrlReqInfo"
2639 /* Fill the TFU structures and send to CL */
2640 if(TRUE == cell[i]->emtcEnable)
2642 ret = rgSchEmtcTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2646 && (NULLP != cntrlInfo))
2648 /* Fill the TFU structures and send to CL */
2649 rgSchTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2653 rgSCHTomUtlSendSfnTick(cell[0]);
2656 for (i = 0; i < nCell; i++)
2658 /* Invoke non critical functions like measurements, etc */
2659 rgSchTomTtiMiscFunctions (cell[i]);
2664 U32 dbgUeIdChngAndDatReqInClCnt = 0;
2665 static U32 gTtiCount = 0;
2668 if(gTtiCount == 3000)
2670 #ifdef XEON_SPECIFIC_CHANGES
2671 printf("SChed:: (P/S)::(%u/%u) \n",
2672 gPrimarySchedCount,gSCellSchedCount);
2674 printf("\n HQFDBK :: %u\n",gHqFdbkCount);
2679 total = gPCellTb1AckCount + gPCellTb1NackCount + gPCellTb1DtxCount;
2680 total2 = gPCellTb2AckCount + gPCellTb2NackCount + gPCellTb2DtxCount;
2682 printf("\n PCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2683 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2684 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2685 if ((total != 0 ) && total2 != 0)
2687 printf("\n PCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2688 (float)gPCellTb1AckCount/total * 100,(float)gPCellTb1NackCount/total * 100,(float)gPCellTb1DtxCount/total * 100,
2689 (float)gPCellTb2AckCount/total2 *100 ,(float)gPCellTb2NackCount/total2 *100 ,(float)gPCellTb2DtxCount/total2 *2);
2692 total = gSCellTb1AckCount + gSCellTb1NackCount + gSCellTb1DtxCount;
2693 total2 = gSCellTb2AckCount + gSCellTb2NackCount + gSCellTb2DtxCount;
2696 printf("\n SCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2697 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2698 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2699 if ((total != 0 ) && total2 != 0)
2701 printf("\n SCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2702 (float)gSCellTb1AckCount/total * 100,(float)gSCellTb1NackCount/total * 100,(float)gSCellTb1DtxCount/total * 100,
2703 (float)gSCellTb2AckCount/total2 *100 ,(float)gSCellTb2NackCount/total2 *100 ,(float)gSCellTb2DtxCount/total2 *2);
2707 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%u/%u):(%u/%u/%u/%u)\n",
2708 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2709 gACqiRcvdCount,gCqiReptToAppCount);
2711 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%u/%u/%u/%u/%u/%u)\n",
2712 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2714 printf("UL::(DCI0/CrcPass/CrcFail)::(%u/%u/%u)\n"
2715 "gPcellZeroBoOcc:%u\t gScellZeroBoOcc:%u dbgUeIdChngAndDatReqInClCnt: %u\n"
2716 "DelayedDatReqInMac: %u DelayedDatReqInCl : %u gIccPktRcvrMemDropCnt :%u\n",
2722 dbgUeIdChngAndDatReqInClCnt,
2723 dbgDelayedDatReqInMac,
2724 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2726 printf("SChed:: (P/S)::(%ld/%ld) \n",
2727 gPrimarySchedCount,gSCellSchedCount);
2729 printf("\n HQFDBK :: %ld\n",gHqFdbkCount);
2731 printf("\n PCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2732 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2733 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2735 printf("\n SCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2736 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2737 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2739 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%ld/%ld):(%ld/%ld/%ld/%ld)\n",
2740 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2741 gACqiRcvdCount,gCqiReptToAppCount);
2742 printf("\n CQI:: PucchCqiSnrDropCnt/PucchCqiConfBitMaskDropCnt/PuschCqiConfMaskDropCount :: (%ld/%ld/%ld) \n",gCqiPucchLowSnrDropCount,gCqiPucchConfMaskDropCount,gCqiPuschConfMaskDropCount);
2744 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%ld/%ld/%ld/%ld/%ld/%ld)\n",
2745 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2747 printf("UL::(DCI0/CrcPass/CrcFail)::(%ld/%ld/%ld)\n"
2748 "gPcellZeroBoOcc:%ld\t gScellZeroBoOcc:%ld dbgUeIdChngAndDatReqInClCnt: %ld\n"
2749 "DelayedDatReqInMac: %ld DelayedDatReqInCl : %ld gIccPktRcvrMemDropCnt :%ld\n",
2755 dbgUeIdChngAndDatReqInClCnt,
2756 dbgDelayedDatReqInMac,
2757 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2758 //printf ("\n delayedApiCnt:%ld",delayedApiCnt);
2762 rgSCHLaaPrintStats();
2764 gCaDbgNonCaFrmt = gIccPktRcvrMemDropCnt = 0;
2776 gCqiPucchLowSnrDropCount = 0;
2777 gCqiPucchConfMaskDropCount = 0;
2778 gCqiPuschConfMaskDropCount = 0;
2779 gPuschCqiDropCount = 0;
2782 gUlCrcPassCount = 0;
2783 gUlCrcFailCount = 0;
2786 gCqiRecpPuschCount = 0;
2789 gCqiReptToAppCount = 0;
2794 gPrimarySchedCount = 0;
2795 gSCellSchedCount = 0;
2796 gSCellTb1AckCount = 0;
2797 gSCellTb2AckCount = 0;
2798 gSCellTb2AckCount = 0;
2799 gSCellTb2NackCount = 0;
2800 gPCellTb1AckCount = 0;
2801 gPCellTb1NackCount = 0;
2802 gPCellTb2AckCount = 0;
2803 gPCellTb2NackCount = 0;
2804 gSCellTb1NackCount=0;
2806 gPCellTb1DtxCount = 0;
2807 gPCellTb2DtxCount = 0;
2808 gSCellTb1DtxCount = 0;
2809 gSCellTb2DtxCount = 0;
2810 gPcellZeroBoOcc = 0;
2811 gScellZeroBoOcc = 0;
2819 } /* rgSCHTomTtiInd */
2821 /** @brief This function does the TTI processin for the uplink subframe,
2822 * already populated by the scheduler.
2826 * Function: rgSCHTomUtlProcUlSf
2829 * - Loop through the Uplink allocations present in the uplink subframe.
2830 * - For each allocation Fill a data reception request to be sent to PHY
2831 * - Also fills the harq reception requests for the expected HQ feedbacks.
2834 * @param [in] RgSchCellCb *cell
2835 * @param [out] RgSchErrInfo *err
2842 PRIVATE S16 rgSCHTomUtlProcUlSf
2848 PRIVATE S16 rgSCHTomUtlProcUlSf (cell, err)
2854 TfuRecpReqInfo *recpReqInfo;
2856 U16 validIdx = 0; /* Index computed from recreq's timing info*/
2858 Inst inst = cell->instIdx;
2860 TRC2(rgSCHTomUtlProcUlSf)
2862 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2863 sizeof(TfuRecpReqInfo))) != ROK)
2865 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuRecpReqInfo "
2867 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2870 recpReqInfo->cellId = cell->cellId;
2871 cmLListInit(&recpReqInfo->ueRecpReqLst);
2873 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo,
2874 TFU_RECPREQ_DLDELTA);
2876 /* Filling data Reception requests */
2877 ret = rgSCHTomUtlFillDatRecpReq(recpReqInfo, cell,
2882 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Data recption "
2883 "requests for cell");
2884 RGSCH_FREE_MEM(recpReqInfo);
2887 /* Filling HARQ Reception requests */
2888 ret = rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, validIdx,err);
2891 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Harq Feedback "
2892 "reception requests for cell");
2893 RGSCH_FREE_MEM(recpReqInfo);
2896 /* sending the RecpReq to Phy */
2897 if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
2899 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for cell");
2902 } /* end of rgSCHTomUtlProcUlSf */
2906 /** @brief This function does the TTI processin for the uplink subframe,
2907 * already populated by the scheduler.
2911 * Function: rgSCHTomUtlPrcUlTddSpclSf
2914 * - Fill the SRS Info for the Special Subframe in Reception Req.
2915 * - Send the Reception Req to TFU
2918 * @param [in] RgSchCellCb *cell
2919 * @param [out] RgSchErrInfo *err
2925 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf
2931 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf (cell, err)
2937 TfuRecpReqInfo *recpReqInfo;
2938 U16 validIdx; /* Index computed from recreq's timing info*/
2939 Inst inst = cell->instIdx;
2941 TRC2(rgSCHTomUtlPrcUlTddSpclSf)
2943 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2944 sizeof(TfuRecpReqInfo))) != ROK)
2946 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to "
2947 "Allocate TfuRecpReqInfo for cell");
2948 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2951 recpReqInfo->cellId = cell->cellId;
2952 cmLListInit(&recpReqInfo->ueRecpReqLst);
2954 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo, TFU_RECPREQ_DLDELTA);
2956 RG_SCH_GET_IDX_PCQISRSSR(recpReqInfo->timingInfo, validIdx);
2959 if(cell->srsCfg.isSrsCfgPres &&
2960 rgSchTddCellSpSrsSubfrmTbl[cell->srsCfg.srsSubFrameCfg][recpReqInfo->timingInfo.slot])
2962 recpReqInfo->srsPres = TRUE;
2966 recpReqInfo->srsPres = FALSE;
2969 /* Filling SRS Reception requests */
2970 ret = rgSCHTomUtlFillSrsRecpReq (recpReqInfo, cell, validIdx, err);
2973 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to fill"
2974 " SRS recption requests for cell");;
2975 RGSCH_FREE_MEM(recpReqInfo);
2978 /* sending the RecpReq to Phy */
2979 if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
2981 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to send "
2982 "Cntrl info for cell");
2985 } /* end of rgSCHTomUtlPrcUlTddSpclSf */
2988 /** @brief This function does all the processing related to a single downlink
2993 * Function: rgSCHTomUtlProcDlSf
2996 * - collate control data for all UEs and send to PHY
2997 * - collate data buffers for all UEs and send to PHY
2999 * @param [in] RgSchDlSf *dlSf
3000 * @param [in] RgSchDlSf *ulSf
3001 * @param [in] RgSchCellCb *cell
3002 * @param [out] RgSchErrInfo *err
3006 PRIVATE S16 rgSCHTomUtlProcDlSf
3011 RgTfuCntrlReqInfo *cntrlInfo,
3015 PRIVATE S16 rgSCHTomUtlProcDlSf (dlSf, ulSf, cell, cntrlInfo, err)
3019 RgTfuCntrlReqInfo *cntrlInfo;
3023 Inst inst = cell->instIdx;
3025 U8 sfTyp = 1; /* Dl Subframe */
3027 TRC2(rgSCHTomUtlProcDlSf);
3029 cmLListInit(&cntrlInfo->phichLst);
3030 cmLListInit(&cntrlInfo->dlPdcchLst);
3031 cmLListInit(&cntrlInfo->ulPdcchLst);
3033 #ifdef TFU_ALLOC_EVENT_NO_INIT
3034 cntrlInfo->ulTiming.sfn = cntrlInfo->ulTiming.subframe = 0;
3036 cntrlInfo->dlTiming = cell->dlDciTime;
3037 cntrlInfo->cellId = cell->cellId;
3038 cntrlInfo->ulTiming = cell->hiDci0Time;
3039 if((0 == (cntrlInfo->dlTiming.sfn % 30)) && (0 == cntrlInfo->dlTiming.slot))
3041 //printf("5GTF_CHECK rgSCHTomUtlProcDlSf Cntrl dl (%d : %d) ul (%d : %d)\n", cntrlInfo->dlTiming.sfn, cntrlInfo->dlTiming.subframe, cntrlInfo->ulTiming.sfn, cntrlInfo->ulTiming.subframe);
3043 /* Fill PCFICH info */
3044 /* Fix for DCFI FLE issue: when DL delta is 1 and UL delta is 0 and CFI
3045 *change happens in that SF then UL PDCCH allocation happens with old CFI
3046 *but CFI in control Req goes updated one since it was stored in the CELL
3048 cntrlInfo->cfi = dlSf->pdcchInfo.currCfi;
3049 #ifndef RG_ULSCHED_AT_CRC
3052 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
3053 [cell->hiDci0Time.subframe];
3054 if(dlSf->sfType == RG_SCH_SPL_SF_DATA)
3056 RGSCH_GET_SPS_SF_CFI(cell->bwCfg.dlTotalBw, cntrlInfo->cfi);
3061 /* Fill PHICH info */
3062 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
3064 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PHICH info "
3065 "for cellId (%d)\n", cell->cellId));
3066 RGSCH_FREE_MEM(cntrlInfo);
3069 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) !=
3072 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
3073 "for cellId (%d)\n", cell->cellId));
3074 RGSCH_FREE_MEM(cntrlInfo);
3079 if(0 == cntrlInfo->ulMpdcchLst.count)
3086 sfTyp = rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
3087 [cell->dlDciTime.subframe];
3089 if (sfTyp != 2) /* Uplink subframe */
3091 /* Fill PDCCH info */
3092 if ((ret = rgSCHTomUtlFillDlPdcch(cell,cntrlInfo, dlSf, err)) != ROK)
3094 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
3095 "for cellId (%d)\n", cell->cellId));
3096 RGSCH_FREE_MEM(cntrlInfo);
3099 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
3100 rgBwAlcnt[dlSf->sfNum] ++;
3103 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
3104 cntrlInfo->isSPSOcc = dlSf->isSPSOcc;
3106 cntrlInfo->numDlActvUes += dlSf->numDlActvUes; /* 4UE_TTI_DELTA */
3107 dlSf->numDlActvUes = 0;
3109 if(0 == cntrlInfo->dlMpdcchLst.count)
3114 /* Now always sending down a cntrl req */
3115 /* sending the cntrl data to Phy */
3116 if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
3119 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info "
3127 /** @brief This function handles sending of the PHICH information for the
3128 * downlink subframe to be sent in the next TTI.
3135 * - Loop through the PHICH information present in the downlink
3136 * subframe and fill the information in cntrlInfo.
3138 * @param [out] TfuCntrlReqInfo *cntrlInfo
3139 * @param [in] RgSchDlSf *dlSf
3140 * @param [out] RgSchErrInfo *err
3146 PRIVATE S16 rgSCHTomUtlFillPhich
3149 TfuCntrlReqInfo *cntrlInfo,
3154 PRIVATE S16 rgSCHTomUtlFillPhich(cell, cntrlInfo, dlSf, err)
3156 TfuCntrlReqInfo *cntrlInfo;
3164 TfuPhichInfo *harqAck;
3166 RgSchCmnDlCell *cellDl = RG_SCH_CMN_GET_DL_CELL(cell);
3169 TRC2(rgSCHTomUtlFillPhich)
3171 /* Traversing the list of Phichs */
3172 node = dlSf->phichInfo.phichs.first;
3175 phich = (RgSchPhich*)node->node;
3176 if ((ret = rgSCHUtlGetEventMem((Ptr *)&harqAck, sizeof(TfuPhichInfo),
3177 &(cntrlInfo->memCp))) != ROK)
3179 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3182 #ifdef TFU_ALLOC_EVENT_NO_INIT
3183 harqAck->txPower = 0;
3185 /* fill in the tfu structure from the information present in the
3187 harqAck->rbStart = phich->rbStart;
3188 harqAck->nDmrs = phich->nDmrs;
3189 harqAck->isAck = phich->hqFeedBack;
3190 harqAck->isForMsg3 = phich->isForMsg3; /*SR_RACH_STATS : PHICH ACK/NACK for MSG3 */
3192 /* Changes for passing iPhich at TFU interface*/
3193 harqAck->iPhich = phich->iPhich;
3195 /* ccpu00138898 - Added Tx pwr offset for PHICH Tx*/
3197 harqAck->txPower = cellDl->phichTxPwrOffset;
3199 cmLListAdd2Tail(&cntrlInfo->phichLst, &(harqAck->lnk));
3200 harqAck->lnk.node = (PTR)harqAck;
3202 } /* end of while */
3208 /** @brief This function is a utility function to restart
3209 * deactivation timer.
3213 * Function: rgSCHTmrRestartScellDeactTmr
3216 * - Starts timer at scheduler
3218 * @param[in] RgSchCellCb *cell
3219 * @param[in] CmLteRnti rnti
3223 PRIVATE Void rgSCHTmrRestartScellDeactTmr
3229 PRIVATE Void rgSCHTmrRestartScellDeactTmr (cell, ueCb)
3235 RgSchUeCellInfo *sCellInfo = NULLP;
3239 if(RG_SCH_IS_CELL_SEC(ueCb, cell))
3241 sCellInfo = ueCb->cellInfo[(ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)])];
3243 if(sCellInfo->deactTmr.tmrEvnt != TMR_NONE)
3245 rgSCHTmrStopTmr(cell, RG_SCH_TMR_SCELL_DEACT, sCellInfo);
3247 if(PRSNT_NODEF == ueCb->sCellDeactTmrVal.pres)
3250 rgSCHTmrStartTmr(cell,sCellInfo,RG_SCH_TMR_SCELL_DEACT,
3251 ueCb->sCellDeactTmrVal.val);
3256 }/*end of rgSCHTmrRestartScellDeactTmr*/
3259 /** @brief This function will send all the PDCCH's for the given downlink
3267 * - Loop through all the scheduled HARQ processes and fill
3268 * the PDCCH information in cntrlInfo.
3270 * @param [out] TfuCntrlReqInfo *cntrlInfo
3271 * @param [in] RgSchDlSf *dlSf
3272 * @param [out] RgSchErrInfo *err
3277 EXTERN U32 numdlSpsRelSentToTf;
3279 PRIVATE S16 rgSCHTomUtlFillDlPdcch
3282 TfuCntrlReqInfo *cntrlInfo,
3287 PRIVATE S16 rgSCHTomUtlFillDlPdcch(cell,cntrlInfo, dlSf, err)
3289 TfuCntrlReqInfo *cntrlInfo;
3297 TfuPdcchInfo *tfuPdcch;
3298 U8 isDcivld = FALSE;
3301 TRC2(rgSCHTomUtlFillDlPdcch)
3303 /* Traversing the scheduled Harq processes */
3304 node = dlSf->pdcchInfo.pdcchs.first;
3307 pdcch = (RgSchPdcch*)node->node;
3308 switch(pdcch->dci.dciFormat)
3310 case TFU_DCI_FORMAT_3:
3311 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? TRUE : FALSE;
3314 case TFU_DCI_FORMAT_3A:
3315 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? TRUE : FALSE;
3328 /*ccpu00117179 - ADD - Build only non DCI format-0 messages */
3329 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_0) ||
3330 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A1) ||
3331 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A2))
3338 #ifdef RGSCH_SPS_STATS
3339 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_1A) &&
3340 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.mcs == 0x1F) &&
3341 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.type == TFU_ALLOC_TYPE_RIV) &&
3342 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.u.riv == 0xFFFFFFFF))
3344 numdlSpsRelSentToTf++;
3348 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3349 &(cntrlInfo->memCp))) != ROK)
3351 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3355 tfuPdcch->crnti = pdcch->crnti;
3356 tfuPdcch->isSpsRnti = pdcch->isSpsRnti;
3358 tfuPdcch->rnti = pdcch->rnti;
3361 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3363 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3365 tfuPdcch->nCce = pdcch->nCce;
3366 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3367 tfuPdcch->dci = pdcch->dci;
3369 //TODO_SID: Need to check these values during INT
3370 tfuPdcch->sectorId = 0;
3371 tfuPdcch->sccIdx = 0;
3374 /* SR_RACH_STATS : Reset isTBMsg4 */
3375 pdcch->dci.u.format1aInfo.t.pdschInfo.isTBMsg4 = FALSE;
3376 /* To be enhanced later for 2.1 */
3377 cmLListAdd2Tail(&cntrlInfo->dlPdcchLst, &(tfuPdcch->lnk));
3378 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3380 if((pdcch->rnti > 60) && (pdcch->rnti < 5000))
3382 #if defined (TENB_STATS) && defined (RG_5GTF)
3383 cell->tenbStats->sch.dl5gtfPdcchSend++;
3387 } /* end of while */
3389 if((numUePerTti) && (numUePerTti < RG_MAX_NUM_UE_PER_TTI ))
3391 cell->dlNumUeSchedPerTti[numUePerTti-1]++;
3393 gDlNumUePerTti[numUePerTti-1]++;
3397 } /* end of rgSCHTomUtlFillDlPdcch*/
3399 #ifdef RGSCH_SPS_STATS
3400 extern U32 rgSchSpsRelSentToTf;
3401 extern U32 rgSchSpsRelPdcchAllocd;
3403 /** @brief This function will send all the UL PDCCH's for the given
3411 * - Loop through all the scheduled HARQ processes and fill
3412 * the PDCCH information in cntrlInfo.
3414 * @param [out] TfuCntrlReqInfo *cntrlInfo
3415 * @param [in] RgSchDlSf *dlSf
3416 * @param [out] RgSchErrInfo *err
3422 PRIVATE S16 rgSCHTomUtlFillUlPdcch
3425 TfuCntrlReqInfo *cntrlInfo,
3430 PRIVATE S16 rgSCHTomUtlFillUlPdcch(cntrlInfo, dlSf, err)
3432 TfuCntrlReqInfo *cntrlInfo;
3440 TfuPdcchInfo *tfuPdcch;
3441 U8 isDcivld = FALSE;
3443 TRC2(rgSCHTomUtlFillUlPdcch)
3445 /* Traversing the scheduled Harq processes */
3446 node = dlSf->pdcchInfo.pdcchs.first;
3449 pdcch = (RgSchPdcch*)node->node;
3451 /*ccpu00116712- Function should pick only UL allocation related control
3453 switch(pdcch->dci.dciFormat)
3455 case TFU_DCI_FORMAT_A1:
3459 case TFU_DCI_FORMAT_A2:
3463 case TFU_DCI_FORMAT_3:
3464 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? FALSE : TRUE;
3467 case TFU_DCI_FORMAT_3A:
3468 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? FALSE : TRUE;
3483 /*ccpu00116712- Function should pick only UL allocation related control
3485 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3486 &(cntrlInfo->memCp))) != ROK)
3488 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3491 tfuPdcch->rnti = pdcch->rnti;
3493 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3495 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3497 tfuPdcch->nCce = pdcch->nCce;
3498 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3499 tfuPdcch->dci = pdcch->dci;
3501 //TODO_SID: Need to check these values during INT
3502 tfuPdcch->sectorId = 0;
3503 tfuPdcch->sccIdx = 0;
3506 /* To be enhanced later for 2.1 */
3508 #if defined (TENB_STATS) && defined (RG_5GTF)
3509 cell->tenbStats->sch.ul5gtfPdcchSend++;
3511 cmLListAdd2Tail(&cntrlInfo->ulPdcchLst, &(tfuPdcch->lnk));
3512 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3513 } /* end of while */
3515 #ifdef RGSCH_SPS_STATS
3516 if (rgSchSpsRelSentToTf != rgSchSpsRelPdcchAllocd)
3522 } /* end of rgSCHTomUtlFillUlPdcch*/
3524 /** @brief This function does the processing for Timing adjustment.
3531 * - Loop through the ue present ueTimeLst, decrement the remaining
3535 * @param [in] RgSchCellCb *cell
3541 PRIVATE S16 rgSCHTomUtlProcTA
3546 PRIVATE S16 rgSCHTomUtlProcTA (cell)
3553 TRC2(rgSCHTomUtlProcTA);
3555 node = cell->taUeLst.first;
3558 ue = (RgSchUeCb *)node->node;
3560 if (ue->dl.taCb.numRemSf == 0)
3562 ue->dl.taCb.state = RGSCH_TA_IDLE;
3563 /* If Outstanding Ta is present, schedule it */
3564 if(ue->dl.taCb.outStndngTa == TRUE)
3566 rgSCHUtlReTxTa(cell, ue);
3570 /* We need to reset state and also value of TA,
3571 * then we start the timer */
3572 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
3573 /* Start the timer only if TA is cfgd as FINITE value */
3574 if (ue->dl.taCb.cfgTaTmr)
3576 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
3579 /* need to delete from the link list */
3580 cmLListDelFrm(&(cell->taUeLst), &(ue->taLnk));
3581 ue->taLnk.node = NULLP;
3585 ue->dl.taCb.numRemSf--;
3587 } /* end of taUeLst */
3589 } /* end of rgSCHTomUtlProcTA */
3591 /** @brief This function handles filling of Hq reception request to
3606 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo
3608 TfuRecpReqInfo *recpReqInfo,
3611 RgSchDlHqProcCb *hqCb,
3613 TfuUeRecpReqInfo *pucchRecpInfo,
3614 RgSchDlHqProcCb *prvHqCb,
3618 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, validIdx, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err)
3619 TfuRecpReqInfo *recpReqInfo;
3622 RgSchDlHqProcCb *hqCb;
3624 TfuUeRecpReqInfo *pucchRecpInfo;
3625 RgSchDlHqProcCb *prvHqCb;
3630 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo
3632 TfuRecpReqInfo *recpReqInfo,
3634 RgSchDlHqProcCb *hqCb,
3636 TfuUeRecpReqInfo *pucchRecpInfo,
3637 RgSchDlHqProcCb *prvHqCb,
3641 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err)
3642 TfuRecpReqInfo *recpReqInfo;
3644 RgSchDlHqProcCb *hqCb;
3646 TfuUeRecpReqInfo *pucchRecpInfo;
3647 RgSchDlHqProcCb *prvHqCb;
3653 RgSchDlHqTbCb *tbCb;
3655 Bool isAddToLst = FALSE;
3657 for (idx = 0 ;idx < 2; idx++)
3659 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
3661 tbCb = &hqCb->tbInfo[idx];
3663 /* FOR ACK NAK REP */
3664 if ((hqCb->hqE->ue != NULLP) &&
3665 (hqCb->hqE->ue->measGapCb.isMeasuring == TRUE))
3667 if ((tbCb->fbkRecpRepCntr) &&
3668 (--tbCb->fbkRecpRepCntr))
3670 /* Add to next subfarme */
3671 /* Add this hqCb to the next dlSf's ackNakRepQ */
3672 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3673 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3674 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3675 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3678 rgSCHTomUtlMoveNxtOccasion(cell, hqCb->hqE->ue, validIdx);
3686 /* Go to the next node */
3692 //if (hqCb != prvHqCb)
3694 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3695 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3698 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
3699 "TfuUeRecpReqInfo for cell");
3700 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3703 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3704 if ((hqCb->hqE->ue != NULLP) /*&&
3705 ((tbCb->lchSchdData[0].lcId != 0) || (tbCb->taSnt ==
3709 pucchRecpInfo->rnti = hqCb->hqE->ue->ueId;
3713 if (hqCb->hqE->raCb)
3715 pucchRecpInfo->rnti = hqCb->hqE->raCb->tmpCrnti;
3721 if (!hqCb->spsN1PucchRes.pres)
3724 pucchRecpInfo->t.pucchRecpReq.hqType =
3725 TFU_HQ_RECP_REQ_NORMAL;
3726 pucchRecpInfo->t.pucchRecpReq.t.nCce =
3732 pucchRecpInfo->t.pucchRecpReq.hqType =
3733 TFU_HQ_RECP_REQ_N1PUCCH;
3734 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch =
3735 hqCb->spsN1PucchRes.val;
3739 /* Handling of other types */
3740 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
3741 #else /* TFU_UPGRADE */
3742 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
3743 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
3744 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
3746 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 2; /* MIMO */
3750 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 1; /* NON-MIMO */
3754 /* PucchRecpReq needs to be filled up for n1Pucch resource for SPS
3756 if (hqCb->spsN1PucchRes.pres)
3758 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
3761 #endif /* LTEMAC_SPS */
3763 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
3764 cell->pucchCfg.n1PucchAn);
3767 rgSCHEmtcFillPucchRecpInfo(cell, hqCb, &(pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0]));
3770 #endif/*TFU_UPGRADE*/
3773 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, hqCb->hqE->ue,
3774 pucchRecpInfo, validIdx,FALSE);
3777 /* Passing last parameter as FALSE in this case as it will be verified from hqCb*/
3778 isAddToLst = rgSCHEmtcAddRecpInfoToLst(hqCb,recpReqInfo, pucchRecpInfo,FALSE);
3782 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3784 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3787 if ((tbCb->fbkRecpRepCntr) &&
3788 (--tbCb->fbkRecpRepCntr))
3790 /* Add to next subfarme */
3791 /* Add this hqCb to the next dlSf's ackNakRepQ */
3792 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3793 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3794 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3795 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3801 }/* end of rgSCHTomUtlFillHqFdbkInfo */
3804 /** @brief This function handles filling of Hq reception request to
3809 * Function:rgSCHTomUtlFillHqFdbkFor5gtf
3813 * @param [out] TfuRecpReqInfo *recpReqInfo
3814 * @param [in] RgSchCellCb *cell
3815 * @param [in] U16 validIdx,
3816 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3817 * @param [in] RgSchDlSf *dlSf,
3818 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3819 * @param [out] RgSchErrInfo *err
3826 PRIVATE S16 rgSCHTomUtlFillHqFdbkFor5gtf
3828 TfuRecpReqInfo *recpReqInfo,
3831 RgSchDlHqInfo *dlSfHqInfo,
3833 TfuUeRecpReqInfo *pucchRecpInfo,
3837 PRIVATE S16 rgSCHTomUtlFillHqFdbkFor5gtf (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
3838 TfuRecpReqInfo *recpReqInfo;
3841 RgSchDlHqInfo *dlSfHqInfo;
3843 TfuUeRecpReqInfo *pucchRecpInfo;
3848 Inst inst = cell->instIdx;
3852 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3854 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
3860 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3861 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3864 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
3865 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
3866 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3869 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3870 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
3871 * instead of SPS-CRNTI */
3873 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
3875 pucchReqInfo->uciInfo = TFU_XPUCCH_UCI_INFO;
3877 /* 5gtf TODO : Hardcoded nPUCCHIdx */
3878 pucchReqInfo->uciPduInfo.pucchIndex = 0;
3880 pucchReqInfo->uciPduInfo.numBits = 1;
3882 /* 5gtf TODO : CQI Periodicity Hardcoded to (n,0)*/
3883 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
3885 pucchReqInfo->uciPduInfo.numBits += 5;
3886 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
3887 ue->ue5gtfCb.cqiRiPer);
3890 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3891 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3893 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
3897 /** @brief This function handles filling of Hq reception request to
3902 * Function:rgSCHTomUtlFillHqFdbkForFrmt1B
3905 * Allocates the N1Pucch Resources based on teh A Value
3907 * @param [out] TfuRecpReqInfo *recpReqInfo
3908 * @param [in] RgSchCellCb *cell
3909 * @param [in] U16 validIdx,
3910 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3911 * @param [in] RgSchDlSf *dlSf,
3912 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3913 * @param [out] RgSchErrInfo *err
3921 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3923 TfuRecpReqInfo *recpReqInfo,
3926 RgSchDlHqInfo *dlSfHqInfo,
3928 TfuUeRecpReqInfo *pucchRecpInfo,
3932 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
3933 TfuRecpReqInfo *recpReqInfo;
3936 RgSchDlHqInfo *dlSfHqInfo;
3938 TfuUeRecpReqInfo *pucchRecpInfo;
3943 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3945 TfuRecpReqInfo *recpReqInfo,
3947 RgSchDlHqInfo *dlSfHqInfo,
3949 TfuUeRecpReqInfo *pucchRecpInfo,
3953 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B (recpReqInfo, cell, hqCb, dlSf, pucchRecpInfo, err)
3954 TfuRecpReqInfo *recpReqInfo;
3956 RgSchDlHqInfo *dlSfHqInfo;
3958 TfuUeRecpReqInfo *pucchRecpInfo;
3964 Inst inst = cell->instIdx;
3968 RgSchDlHqProcCb *hqCb = NULLP;
3970 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3971 Bool isDatPresOnSecCell = FALSE;
3972 U8 primCellTbCount = 0;
3974 hqPNode = dlSfHqInfo->hqPLst.first;
3975 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
3981 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3982 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3985 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
3986 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
3987 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3990 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3991 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
3992 * instead of SPS-CRNTI */
3994 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
3997 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
3998 /* Handling of other types */
3999 pucchReqInfo->type = TFU_UCI_HARQ;
4000 #else /* TFU_UPGRADE */
4001 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
4002 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
4003 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4004 /* Fill HqSz by using totalTbCnt based on the TM mode and
4005 * the number of serv cells configured*/
4007 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
4008 pucchReqInfo->hqInfo.pucchResCnt = ue->f1bCsAVal;
4010 cmMemset((U8 *)pucchReqInfo->hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
4012 /* Two Resources needs to be configured if the
4013 * serving cell is in mimo mode else single
4015 if ((dlSf->relPdcch != NULLP) &&
4016 (RGSCH_TIMEINFO_SAME(recpReqInfo->timingInfo, ue->relPdcchFbkTiming)))
4017 {/* Pcell is having sps rel pdcch present */
4018 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
4019 {/* prim cell is in mimo mode, use 0 and 1 */
4020 pucchReqInfo->hqInfo.hqRes[0] = (dlSf->relPdcch->nCce +
4021 cell->pucchCfg.n1PucchAn);
4022 pucchReqInfo->hqInfo.hqRes[1] = pucchReqInfo->hqInfo.hqRes[0] + 1;
4027 pucchReqInfo->hqInfo.hqRes[2] = (dlSf->relPdcch->nCce +
4028 cell->pucchCfg.n1PucchAn);
4030 /* Release the pdcch so that it will not further processed */
4031 rgSCHUtlPdcchPut(ue->cell,&dlSf->pdcchInfo, dlSf->relPdcch);
4032 dlSf->relPdcch = NULLP;/* only one UE will be scheduled for release pdcch order in one tti */
4034 #endif/*LTEMAC_SPS*/
4035 #endif/*TFU_UPGRADE*/
4038 hqCb = (RgSchDlHqProcCb *)hqPNode->node;
4039 hqPNode = hqPNode->next;
4040 /* In case of CSI + 1BCS , CSI will be
4041 * dropped if scheduling is present on
4042 * seconday cell.36.213 10.1.1
4044 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4046 isDatPresOnSecCell = TRUE;
4049 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
4050 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
4052 primCellTbCount = 2;
4055 primCellTbCount = 1;
4059 pucchReqInfo->t.nCce = hqCb->pdcch->nCce;
4062 switch(ue->f1bCsAVal)
4064 case RG_SCH_A_VAL_2:
4065 /* harq(0) is primary harq(1) is secondary) */
4066 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4068 pucchReqInfo->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.\
4069 cw1N1Res[hqCb->tpc].n1PucchIdx;
4071 else/* primary cell */
4074 /* Need to consider only sps occasions */
4075 if (hqCb->spsN1PucchRes.pres)
4077 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4080 #endif /* LTEMAC_SPS */
4083 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4084 cell->pucchCfg.n1PucchAn);
4088 case RG_SCH_A_VAL_3:
4089 /* Serving cell in mimo mode should be
4090 * in 0 and 1 and the serving cell in siso
4091 * mode should be in 2 indices */
4092 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4094 U8 cellIdx = ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(hqCb->hqE->cell)];
4095 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[cellIdx]->txMode.txModeEnum) > 1)
4096 {/* Sec cell is in mimo mode, use 0 and 1 */
4097 pucchReqInfo->hqInfo.hqRes[0] =
4098 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4100 pucchReqInfo->hqInfo.hqRes[1] =
4101 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
4104 {/* Sec cell is in siso mode, use 2 */
4105 pucchReqInfo->hqInfo.hqRes[2] =
4106 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4110 {/* primary cell hq */
4111 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
4112 {/* prim cell is in mimo mode, use 0 and 1 */
4114 if (hqCb->spsN1PucchRes.pres)
4115 {/* SPS occasions */
4116 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4117 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
4120 #endif /* LTEMAC_SPS */
4122 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4123 cell->pucchCfg.n1PucchAn);
4124 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
4125 cell->pucchCfg.n1PucchAn + 1);
4129 {/* prim cell is in siso mode use 2 */
4131 /* Need to consider only sps occasions */
4132 if (hqCb->spsN1PucchRes.pres)
4134 pucchReqInfo->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
4137 #endif /* LTEMAC_SPS */
4140 pucchReqInfo->hqInfo.hqRes[2] = (hqCb->pdcch->nCce +
4141 cell->pucchCfg.n1PucchAn);
4147 case RG_SCH_A_VAL_4:
4149 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4150 {/* 2 and 3 for sec cell */
4151 pucchReqInfo->hqInfo.hqRes[2] =
4152 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4153 pucchReqInfo->hqInfo.hqRes[3] =
4154 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
4156 else/* primary cell */
4157 {/* 0 and 1 are for primary cell */
4159 /* Need to consider only sps occasions */
4160 if (hqCb->spsN1PucchRes.pres)
4162 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4163 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
4166 #endif /* LTEMAC_SPS */
4169 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4170 cell->pucchCfg.n1PucchAn);
4171 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
4172 cell->pucchCfg.n1PucchAn + 1);
4179 /* TOD:: Add error print */
4183 #endif/*TFU_UPGRADE*/
4194 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
4195 pucchRecpInfo, validIdx,isDatPresOnSecCell);
4197 /* Channel selection wil not be used in case of
4198 * CQI + HARQ. if the data was present only on
4200 if((isDatPresOnSecCell == FALSE) &&
4201 (dlSfHqInfo->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
4202 {/* Data is present only on primary cell */
4204 switch(pucchReqInfo->uciInfo)
4206 case TFU_PUCCH_HARQ_SRS:
4207 case TFU_PUCCH_HARQ_CQI:
4208 case TFU_PUCCH_HARQ_SR_SRS:
4209 case TFU_PUCCH_HARQ_SR_CQI:
4211 dlSfHqInfo->uciFrmtTyp = RG_SCH_UCI_FORMAT1A_1B;
4212 pucchReqInfo->hqInfo.hqSz = primCellTbCount;
4213 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4222 #endif/*TFU_UPGRADE*/
4223 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4224 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4226 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
4227 /** @brief This function handles filling of Hq reception request to
4232 * Function:rgSCHTomUtlFillHqFdbkForFrmt3
4235 * Allocates the N1Pucch Resources based on teh A Value
4237 * @param [out] TfuRecpReqInfo *recpReqInfo
4238 * @param [in] RgSchCellCb *cell
4239 * @param [in] U16 validIdx,
4240 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
4241 * @param [in] RgSchDlSf *dlSf,
4242 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
4243 * @param [out] RgSchErrInfo *err
4251 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3
4253 TfuRecpReqInfo *recpReqInfo,
4256 RgSchDlHqInfo *dlSfHqInfo,
4258 TfuUeRecpReqInfo *pucchRecpInfo,
4262 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3 (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
4263 TfuRecpReqInfo *recpReqInfo;
4266 RgSchDlHqInfo *dlSfHqInfo;
4268 TfuUeRecpReqInfo *pucchRecpInfo;
4273 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3
4275 TfuRecpReqInfo *recpReqInfo,
4277 RgSchDlHqInfo *dlSfHqInfo,
4279 TfuUeRecpReqInfo *pucchRecpInfo,
4283 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3 (recpReqInfo, cell, hqCb, dlSf, pucchRecpInfo, err)
4284 TfuRecpReqInfo *recpReqInfo;
4286 RgSchDlHqInfo *dlSfHqInfo;
4288 TfuUeRecpReqInfo *pucchRecpInfo;
4294 Inst inst = cell->instIdx;
4299 TfuUePucchRecpReq *pucchReqInfo = NULLP;
4301 //hqPNode = dlSfHqInfo->hqPLst.first;
4302 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
4308 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4309 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
4312 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
4313 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
4314 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4317 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4318 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
4319 * instead of SPS-CRNTI */
4321 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
4324 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
4325 /* Handling of other types */
4326 pucchReqInfo->type = TFU_UCI_HARQ;
4327 #else /* TFU_UPGRADE */
4328 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
4329 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
4330 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4331 /* Fill HqSz by using totalTbCnt based on the TM mode and
4332 * the number of serv cells configured*/
4334 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
4335 pucchReqInfo->hqInfo.pucchResCnt = 1;
4337 cmMemset((U8 *)pucchReqInfo->hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
4338 #endif/*TFU_UPGRADE*/
4339 pucchReqInfo->hqInfo.hqRes[0] = dlSfHqInfo->n3ScellPucch.n3PucchIdx;
4341 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
4342 pucchRecpInfo, validIdx,TRUE);
4343 #endif/*TFU_UPGRADE*/
4344 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4345 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4347 }/* end of rgSCHTomUtlFillHqFdbkForFrmt3 */
4351 /** @brief This function handles filling of HARQ feedback recption request to
4360 * @param [out] TfuRecpReqInfo *recpReqInfo
4361 * @param [in] RgSchCellCb *cell
4362 * @param [out] RgSchErrInfo *err
4369 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq
4371 TfuRecpReqInfo *recpReqInfo,
4377 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, validIdx, err)
4378 TfuRecpReqInfo *recpReqInfo;
4385 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq
4387 TfuRecpReqInfo *recpReqInfo,
4392 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, err)
4393 TfuRecpReqInfo *recpReqInfo;
4400 RgSchDlHqProcCb *hqCb;
4401 CmLteTimingInfo futTime;
4404 TfuUeRecpReqInfo *pucchRecpInfo = NULLP;
4406 RgSchDlHqProcCb *prvHqCb=NULLP;
4408 TRC2(rgSCHTomUtlFillHqFdbkRecpReq);
4415 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper output
4416 * if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME() as it is
4417 * serving the purpose */
4418 RGSCHDECRFRMCRNTTIME(cell->crntTime, futTime, (RG_SCH_CMN_HARQ_INTERVAL -
4419 TFU_RECPREQ_DLDELTA));
4420 dlSf = rgSCHUtlSubFrmGet (cell, futTime);
4421 /* Get the next dlsf as well */
4422 RG_SCH_ADD_TO_CRNT_TIME(futTime, futTime, 1)
4423 nxtDlsf = rgSCHUtlSubFrmGet (cell, futTime);
4427 if (dlSf->ueLst.count != 0)
4429 node = dlSf->ueLst.first;
4432 ue = (RgSchUeCb *)(node->node);
4435 if(ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx].isPuschHarqRecpPres == TRUE)
4436 {/* This UE is already considered for PUSCH
4440 rgSCHTomUtlFillHqFdbkFor5gtf(recpReqInfo, cell, validIdx,
4441 &ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx], dlSf, pucchRecpInfo, err);
4442 } /* end of while */
4443 } /* If hq is expected */
4445 if (dlSf->msg4HqPLst.count != 0)
4448 node = dlSf->msg4HqPLst.first;
4451 hqCb = (RgSchDlHqProcCb*)(node->node);
4453 //TODO_SID: need to check validIdx
4454 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, validIdx, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err);
4456 } /* end of while */
4459 /* Check with TDD Code */
4460 /* FOR ACK NACK REP */
4462 } /* end of rgSCHTomUtlFillHqFdbkRecpReq */
4464 /** @brief This function handles filling of SR reception request to
4473 * @param [out] TfuRecpReqInfo *recpReqInfo
4474 * @param [in] RgSchCellCb *cell
4475 * @param [out] RgSchErrInfo *err
4482 PRIVATE S16 rgSCHTomUtlFillSrRecpReq
4484 TfuRecpReqInfo *recpReqInfo,
4490 PRIVATE S16 rgSCHTomUtlFillSrRecpReq (recpReqInfo, cell, validIdx, err)
4491 TfuRecpReqInfo *recpReqInfo;
4498 TfuUeRecpReqInfo *pucchRecpInfo;
4504 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
4508 TRC2(rgSCHTomUtlFillSrRecpReq);
4512 node = cell->pCqiSrsSrLst[validIdx].srLst.first;
4515 ue = (RgSchUeCb *)(node->node);
4516 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4522 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4523 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4525 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4526 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4527 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4530 #ifdef TFU_ALLOC_EVENT_NO_INIT
4531 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4532 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4538 /* Should we check for Rel8 and above???
4539 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
4541 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
4542 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
4543 if((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
4544 (ulSpsUe->isUlSpsActv))
4546 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4551 pucchRecpInfo->rnti = ue->ueId;
4552 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
4553 ue->srCb.srCfg.srSetup.srResIdx;
4554 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR;
4555 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4556 rgSCHTomUtlFillCqiSrsWithSr(cell, ue, recpReqInfo,
4557 pucchRecpInfo, validIdx);
4559 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4563 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4565 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4568 }/* end of rgSCHTomUtlFillSrRecpReq */
4571 /** @brief This function tells will the UE has a periodic CQI/PMI/RI
4580 * @param [in] RgSchUeCb *ue
4581 * @param [out] Bool *willueRprtCqiRi
4588 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi
4591 Bool *willueRprtCqiRi
4594 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi ( ue, willueRprtCqiRi)
4596 Bool *willueRprtCqiRi;
4599 TRC2(rgSCHTomUtlWillUeRprtCqiRi);
4601 /* Intialising Reporting probability as TRUE */
4602 *willueRprtCqiRi = TRUE;
4604 /* Checking the cases in which UE will not report CQIPMI/RI */
4605 if(ue->isDrxEnabled && ue->drxCb)
4608 if(ue->drxCb->cqiMask.pres && ue->drxCb->cqiMask.val == RGR_DRX_SETUP)
4609 {/*cqiMask is setup by upper layers */
4610 if((ue->drxCb->drxUlInactvMask & RG_SCH_DRX_ONDUR_BITMASK) ==
4611 RG_SCH_DRX_ONDUR_BITMASK)
4612 {/*onDuration NOT running, do not expect cqi/pmi/ri*/
4613 *willueRprtCqiRi = FALSE;
4617 #endif /*end of LTEMAC_R9*/
4618 /* ccpu00134258: Fix for CQI DRX issue*/
4619 if(ue->drxCb->onDurTmrLen > 2)
4621 if ( !RG_SCH_DRX_UL_IS_UE_ACTIVE(ue->drxCb) )
4622 {/*UE is not active, do not expect cqi/pmi/ri*/
4623 *willueRprtCqiRi = FALSE;
4626 }/*ue->isDrxEnabled*/
4628 } /*End of rgSCHTomUtlWillUeRprtCqiRi*/
4630 /** @brief This function handles filling of RI reception request to
4639 * @param [out] TfuRecpReqInfo *recpReqInfo
4640 * @param [in] RgSchCellCb *cell
4641 * @param [in] U16 validIdx
4642 * @param [out] RgSchErrInfo *err
4649 PRIVATE S16 rgSCHTomUtlFillRiRecpReq
4651 TfuRecpReqInfo *recpReqInfo,
4657 PRIVATE S16 rgSCHTomUtlFillRiRecpReq (recpReqInfo, cell, validIdx, err)
4658 TfuRecpReqInfo *recpReqInfo;
4665 TfuUeRecpReqInfo *pucchRecpInfo;
4668 Bool willUeRprtCqi; /* Flag set due to CQI Mask
4669 and UE inactive state (DRX) */
4670 RgSchUePCqiCb *riCb = NULLP;
4671 TRC2(rgSCHTomUtlFillRiRecpReq);
4673 node = cell->pCqiSrsSrLst[validIdx].riLst.first;
4676 riCb = (RgSchUePCqiCb *)(node->node);
4677 ue = riCb->servCellInfo->ue;
4678 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4680 if(riCb->riRecpPrcsd)
4682 /*ccpu00140578:: RI Proecssing is already done for this TTI
4683 * as part of PUSCH reception process or HARQ
4684 * Reception processing. Hence skipping this UE
4686 riCb->riRecpPrcsd = FALSE;
4689 if(riCb->riDist ==0)
4691 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4692 #ifdef XEON_SPECIFIC_CHANGES
4693 if(RGSCH_TIMEINFO_SAME(cell->crntTime, ue->riRecpTime))
4699 if((TRUE == riCb->isRiIgnoByCollsn)
4700 || (willUeRprtCqi == FALSE))
4702 if(willUeRprtCqi == FALSE)
4705 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4708 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4709 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4711 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4712 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4713 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4716 #ifdef TFU_ALLOC_EVENT_NO_INIT
4717 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4718 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4721 pucchRecpInfo->rnti = ue->ueId;
4722 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4723 riCb->cqiCfg.cqiSetup.cqiPResIdx;
4724 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = riCb->riNumBits;
4725 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4726 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4728 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4729 riCb->servCellInfo->sCellIdx;
4731 rgSCHTomUtlFillRiBitWidthInfo(ue);
4732 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4733 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
4735 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
4737 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4739 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4741 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4742 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4750 }/* end of rgSCHTomUtlFillRiRecpReq */
4753 /** @brief This function handles filling of 5GTF CQI-RI reception request to
4762 * @param [out] TfuRecpReqInfo *recpReqInfo
4763 * @param [in] RgSchCellCb *cell
4764 * @param [in] U16 validIdx
4765 * @param [out] RgSchErrInfo *err
4773 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq
4775 TfuRecpReqInfo *recpReqInfo,
4781 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq (recpReqInfo, cell, validIdx, err)
4782 TfuRecpReqInfo *recpReqInfo;
4788 TfuUeRecpReqInfo *pucchRecpInfo;
4789 RgSchUeCb *ue = NULLP;
4792 TRC2(rgSCHTomUtlFillCqiRiRecpReq);
4794 while ((ue = rgSCHDbmGetNextUeCb(cell, ue)) != NULLP)
4796 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
4798 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4799 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4801 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4802 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4803 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4806 #ifdef TFU_ALLOC_EVENT_NO_INIT
4807 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4808 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4810 pucchRecpInfo->rnti = ue->ueId;
4811 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_XPUCCH_UCI_INFO;
4812 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.pucchIndex = 0;
4813 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.numBits = 5;
4815 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
4816 ue->ue5gtfCb.cqiRiPer);
4817 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4818 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4822 }/* end of rgSCHTomUtlFillCqiRiRecpReq */
4825 /** @brief This function handles filling of PCQI reception request to
4834 * @param [out] TfuRecpReqInfo *recpReqInfo
4835 * @param [in] RgSchCellCb *cell
4836 * @param [in] U16 validIdx
4837 * @param [out] RgSchErrInfo *err
4844 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq
4846 TfuRecpReqInfo *recpReqInfo,
4852 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq (recpReqInfo, cell, validIdx, err)
4853 TfuRecpReqInfo *recpReqInfo;
4860 TfuUeRecpReqInfo *pucchRecpInfo;
4865 Bool willUeRprtCqi; /* Flag set due to CQI Mask
4866 and UE Inactive state (DRX)*/
4868 RgSchUePCqiCb *cqiCb = NULLP;
4869 Bool isAddToLst = FALSE;
4871 TRC2(rgSCHTomUtlFillPcqiRecpReq);
4873 node = cell->pCqiSrsSrLst[validIdx].cqiLst.first;
4876 cqiCb = (RgSchUePCqiCb*)(node->node);
4877 ue = cqiCb->servCellInfo->ue;
4878 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4880 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4882 if ((cqiCb->isCqiIgnoByCollsn == TRUE) ||
4883 (willUeRprtCqi == FALSE))
4885 if(willUeRprtCqi == FALSE)
4888 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4892 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4894 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4895 cqiCb->servCellInfo->sCellIdx;
4897 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
4900 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to Fill CqiPmi "
4905 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4906 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4908 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4909 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4910 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4913 #ifdef TFU_ALLOC_EVENT_NO_INIT
4914 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4915 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4918 /*Fill PCQI params*/
4919 pucchRecpInfo->rnti = ue->ueId;
4920 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4921 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
4922 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = cqiPmiSz;
4923 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4924 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4925 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4927 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4930 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4934 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4936 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4939 }/* end of rgSCHTomUtlFillPcqiRecpReq */
4940 /** @brief This function handles filling of SRS reception request to
4949 * @param [out] TfuRecpReqInfo *recpReqInfo
4950 * @param [in] RgSchCellCb *cell
4951 * @param [in] U16 validIdx
4952 * @param [out] RgSchErrInfo *err
4958 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq
4960 TfuRecpReqInfo *recpReqInfo,
4966 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq (recpReqInfo, cell, validIdx, err)
4967 TfuRecpReqInfo *recpReqInfo;
4974 TfuUeRecpReqInfo *pucchRecpInfo;
4978 TRC2(rgSCHTomUtlFillSrsRecpReq);
4980 node = cell->pCqiSrsSrLst[validIdx].srsLst.first;
4983 ue = (RgSchUeCb *)(node->node);
4984 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4986 if(ue->srsCb.srsRecpPrcsd)
4988 /* ccpu00140578::SRS Proecssing is already done for this TTI
4989 * as part of PUSCH or HARQ reception process and
4990 * hence skipping this UE */
4991 ue->srsCb.srsRecpPrcsd = FALSE;
4995 if(ue->srsCb.srsDist ==0)
4997 /* We need to add the recp request to be sent on the pucchANRep value. */
4998 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4999 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
5001 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5002 "TfuUeRecpReqInfo for RNTI:%d ",ue->ueId);
5003 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5007 #ifdef TFU_ALLOC_EVENT_NO_INIT
5008 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
5012 pucchRecpInfo->rnti = ue->ueId;
5013 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
5014 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
5015 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
5016 ue->srsCb.srsCfg.srsSetup.fDomPosi;
5017 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
5018 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
5019 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
5020 ue->srsCb.srsCfg.srsSetup.txComb;
5021 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
5022 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
5023 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
5024 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
5026 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SRS;
5027 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
5028 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
5029 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
5033 ue->srsCb.srsDist--;
5037 }/* end of rgSCHTomUtlFillSrsRecpReq */
5040 /** @brief This function handles filling of data reception requests for
5049 * @param [out] TfuRecpReqInfo *recpReqInfo
5050 * @param [in] RgSchCellCb *cell
5051 * @param [out] RgSchErrInfo *err
5057 PRIVATE S16 rgSCHTomUtlFillDatRecpReq
5059 TfuRecpReqInfo *recpReqInfo,
5064 PRIVATE S16 rgSCHTomUtlFillDatRecpReq (recpReqInfo, cell, err)
5065 TfuRecpReqInfo *recpReqInfo;
5071 RgSchUlAlloc *alloc;
5072 TfuUeRecpReqInfo *datRecpInfo;
5074 TRC2(rgSCHTomUtlFillDatRecpReq)
5076 /* processing steps are
5077 * - Run through the UL allocations going out in this subframe.
5078 * - Run through the UL receptions expected the next subframe.
5080 alloc = rgSCHUtlFirstRcptnReq (cell);
5083 /* FOR ACK NACK REP */
5084 if (NULLP != alloc->ue)
5086 /* If measuring or ackNakRep we shall not send dat RecpReq */
5087 if ((alloc->ue->measGapCb.isMeasuring == TRUE) ||
5088 (alloc->ue->ackNakRepCb.isAckNakRep == TRUE))
5090 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5095 if ((ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
5096 sizeof(TfuUeRecpReqInfo),
5097 &(recpReqInfo->memCp))) != ROK)
5099 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5100 "TfuUeRecpReqInfo for RNTI:%d ", alloc->ue->ueId);
5101 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5104 if (!alloc->forMsg3)
5106 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
5107 rgSCHUtlAllocRcptInfo (alloc,
5109 &datRecpInfo->t.puschRecpReq.mcs,
5110 &datRecpInfo->t.puschRecpReq.rbStart,
5111 &datRecpInfo->t.puschRecpReq.numRb,
5112 &datRecpInfo->t.puschRecpReq.rv,
5113 &datRecpInfo->t.puschRecpReq.size,
5114 &datRecpInfo->t.puschRecpReq.modType,
5115 &datRecpInfo->t.puschRecpReq.isRtx,
5116 &datRecpInfo->t.puschRecpReq.nDmrs,
5117 &datRecpInfo->t.puschRecpReq.ndi,
5118 &datRecpInfo->t.puschRecpReq.harqProcId
5123 datRecpInfo->type = TFU_RECP_REQ_MSG3;
5124 rgSCHUtlAllocRcptInfo (alloc,
5126 &datRecpInfo->t.msg3RecpReq.mcs,
5127 &datRecpInfo->t.msg3RecpReq.rbStart,
5128 &datRecpInfo->t.msg3RecpReq.numRb,
5129 /*ccpu00128993 - MOD - fix for msg3 softcombining bug*/
5130 &datRecpInfo->t.msg3RecpReq.rv,
5131 &datRecpInfo->t.msg3RecpReq.size,
5132 &datRecpInfo->t.msg3RecpReq.modType,
5133 &datRecpInfo->t.msg3RecpReq.isRtx,
5134 &datRecpInfo->t.msg3RecpReq.nDmrs,
5135 &datRecpInfo->t.msg3RecpReq.ndi,
5136 &datRecpInfo->t.msg3RecpReq.harqProcId
5140 /* Other fields of datRecpInfo shall be filled
5141 * here for new features */
5142 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
5143 datRecpInfo->lnk.node = (PTR)datRecpInfo;
5145 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5146 } /* end of while */
5148 } /* end of rgSCHTomUtlFillDatRecpReq */
5151 /** @brief This function handles filling of data reception requests for
5160 * @param [out] TfuRecpReqInfo *recpReqInfo
5161 * @param [in] RgSchCellCb *cell
5162 * @param [in] U16 validIdx
5163 * @param [out] RgSchErrInfo *err
5169 PRIVATE S16 rgSCHTomUtlFillDatRecpReq
5171 TfuRecpReqInfo *recpReqInfo,
5177 PRIVATE S16 rgSCHTomUtlFillDatRecpReq (recpReqInfo, cell, validIdx, err)
5178 TfuRecpReqInfo *recpReqInfo;
5184 CmLteTimingInfo dci0Time;
5187 RgSchUlAlloc *alloc;
5188 TfuUeRecpReqInfo *datRecpInfo;
5190 Bool isAperiodic = FALSE; /*Set when Aperiodic CQI is expected */
5193 TRC2(rgSCHTomUtlFillDatRecpReq);
5195 if((0 == (recpReqInfo->timingInfo.sfn % 30)) && (0 == recpReqInfo->timingInfo.slot))
5197 //printf("5GTF_CHECK rgSCHTomUtlFillDatRecpReq (%d : %d)\n", recpReqInfo->timingInfo.sfn, recpReqInfo->timingInfo.slot);
5199 /* processing steps are
5200 * - Run through the UL allocations going out in this subframe.
5201 * - Run through the UL receptions expected the next subframe.
5204 alloc = rgSCHUtlFirstRcptnReq (cell);
5207 isAperiodic = FALSE;
5208 ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
5209 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
5212 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5213 "TfuUeRecpReqInfo for RNTI:%d ", alloc->rnti);
5214 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5217 #ifdef TFU_ALLOC_EVENT_NO_INIT
5218 datRecpInfo->t.puschRecpReq.initialNSrs.pres = FALSE;
5219 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
5221 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
5222 /* Check if this if for MSG3 - no scope for feedback along with it. */
5223 if ((FALSE == alloc->forMsg3))
5225 /* Check if any DL HARQ processes has a feedback coming at the time of
5226 * this reception request.
5231 RGSCHDECRFRMCRNTTIME(cell->crntTime,dci0Time,(RGSCH_ULCTRL_RECP_DIST));
5233 idx = (dci0Time.sfn * RGSCH_NUM_SUB_FRAMES_5G + dci0Time.slot)%
5234 RGSCH_ULCTRL_RECP_DIST;
5236 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
5237 datRecpInfo->rnti = alloc->rnti;
5238 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
5239 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5242 else /*Enters for Msg3 == TRUE condition*/
5244 /* ccpu00130884 - ADD - HO case when Msg3 alloc and Cqi/Ri/SRS opportunity
5245 * occur at same time */
5246 if(NULLP != alloc->ue)
5249 /* Only DATA is expected */
5250 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
5251 datRecpInfo->rnti = alloc->rnti;
5252 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
5253 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5258 if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA &&
5259 datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_SRS &&
5260 isAperiodic == FALSE)
5262 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = TRUE;
5263 datRecpInfo->t.puschRecpReq.initialNumRbs.val = alloc->ue->initNumRbs;
5267 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
5270 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
5271 datRecpInfo->lnk.node = (PTR)datRecpInfo;
5272 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5274 } /* end of while */
5276 if(numUePerTti && (numUePerTti < RG_MAX_NUM_UE_PER_TTI))
5278 cell->ulNumUeSchedPerTti[numUePerTti-1]++;
5279 gUlNumUePerTti[numUePerTti - 1]++;
5282 } /* end of rgSCHTomUtlFillDatRecpReq */
5284 /* rg009.201. Added changes of TFU_UPGRADE */
5286 /***********************************************************
5288 * Func : rgSCHTomUtlFillRiBitWidthInfo
5291 * Desc : Fills the RI BitWidth and stores it for decoding.
5300 **********************************************************/
5302 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo
5307 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo(ueCb)
5311 RgSchUePCqiCb *riCb = ueCb->nPRiCb;
5312 TRC2(rgSCHTomUtlFillRiBitWidthInfo);
5314 if (ueCb->mimoInfo.txMode != RGR_UE_TM_3 &&
5315 ueCb->mimoInfo.txMode != RGR_UE_TM_4)
5320 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
5321 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
5322 (TfuDlCqiPucchMode)riCb->cqiCfg.cqiSetup.prdModeEnum;
5323 switch(ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode)
5325 case TFU_PUCCH_CQI_MODE10:
5326 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.type = TFU_RPT_RI;
5327 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.u.ri =
5330 case TFU_PUCCH_CQI_MODE11:
5331 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.type = TFU_RPT_RI;
5332 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.u.ri =
5335 case TFU_PUCCH_CQI_MODE20:
5336 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.type = TFU_RPT_RI;
5337 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.u.ri =
5340 case TFU_PUCCH_CQI_MODE21:
5341 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.type = TFU_RPT_RI;
5342 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.u.ri =
5349 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5353 /***********************************************************
5355 * Func : rgSCHTomUtlFetchPcqiBitSz
5358 * Desc : Fetch the CQI/PMI bits for a UE based on the mode, periodicity.
5367 **********************************************************/
5369 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz
5376 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz(ueCb, numTxAnt, ri)
5384 TfuCqiPucchMode10 *mode10Info;
5385 TfuCqiPucchMode11 *mode11Info;
5386 TfuCqiPucchMode20 *mode20Info;
5387 TfuCqiPucchMode21 *mode21Info;
5388 RgSchUePCqiCb *cqiCb = ueCb->nPCqiCb;
5390 TRC3(rgSCHTomUtlFetchPcqiBitSz);
5392 confRepMode = cqiCb->cqiCfg.cqiSetup.prdModeEnum;
5393 if((ueCb->mimoInfo.txMode != RGR_UE_TM_3) &&
5394 (ueCb->mimoInfo.txMode != RGR_UE_TM_4))
5400 *ri = cqiCb->perRiVal;
5402 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
5403 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
5404 (TfuDlCqiPucchMode)confRepMode;
5407 case RGR_PRD_CQI_MOD10:
5409 mode10Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info;
5411 mode10Info->type = TFU_RPT_CQI;
5412 mode10Info->u.cqi = 4;
5416 case RGR_PRD_CQI_MOD11:
5418 mode11Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info;
5419 mode11Info->type = TFU_RPT_CQI;
5425 mode11Info->u.cqi.cqi = 4;
5426 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5427 mode11Info->u.cqi.pmi = 2;
5432 mode11Info->u.cqi.cqi = 4;
5433 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5434 mode11Info->u.cqi.wideDiffCqi.val = 3;
5435 mode11Info->u.cqi.pmi = 1;
5438 else if(numTxAnt == 4)
5443 mode11Info->u.cqi.cqi = 4;
5444 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5445 mode11Info->u.cqi.pmi = 4;
5450 mode11Info->u.cqi.cqi = 4;
5451 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5452 mode11Info->u.cqi.wideDiffCqi.val = 3;
5453 mode11Info->u.cqi.pmi = 4;
5458 /* This is number of antenna case 1.
5459 * This is not applicable for Mode 1-1.
5460 * So setting it to invalid value */
5466 case RGR_PRD_CQI_MOD20:
5468 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info;
5469 mode20Info->type = TFU_RPT_CQI;
5473 mode20Info->u.cqi.isWideband = TRUE;
5474 mode20Info->u.cqi.u.wideCqi = 4;
5478 pcqiSz = 4 + cqiCb->label;
5479 mode20Info->u.cqi.isWideband = FALSE;
5480 mode20Info->u.cqi.u.subCqi.cqi = 4;
5481 mode20Info->u.cqi.u.subCqi.l = cqiCb->label;
5486 case RGR_PRD_CQI_MOD21:
5488 mode21Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info;
5489 mode21Info->type = TFU_RPT_CQI;
5490 //pcqiSz = rgSCHTomUtlFetchPcqiBitSzPucchMode21(ueCb,
5491 // mode21Info, numTxAnt, ri);
5499 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5504 /***********************************************************
5506 * Func : rgSCHTomUtlPcqiSbCalcBpIdx
5509 * Desc : Determines the BP index from the timing info
5518 **********************************************************/
5520 PUBLIC S16 rgSCHTomUtlPcqiSbCalcBpIdx
5522 CmLteTimingInfo crntTimInfo,
5524 RgSchUePCqiCb *cqiCb
5527 PUBLIC S16 rgSCHTomUtlPcqiSbCalcBpIdx(crntTimInfo, ueCb, cqiCb)
5528 CmLteTimingInfo crntTimInfo;
5530 RgSchUePCqiCb *cqiCb;
5533 U16 tti = (crntTimInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTimInfo.slot);
5534 U16 prdNum = tti/cqiCb->cqiPeri;
5536 TRC2(rgSCHTomUtlPcqiSbCalcBpIdx);
5537 if((prdNum % cqiCb->h) == 0)
5541 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
5546 cqiCb->isWb = FALSE;
5547 cqiCb->bpIdx = ((prdNum % cqiCb->h) - 1) % cqiCb->J;
5549 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_0;
5557 * @brief Function which moves PCQI, RI, SR and SRS to next periodicity
5558 * Occasions as that needs to be done in case of Ack/Nack repetition
5559 * reception request occasions or during Measurement Gap occasions.
5563 * Function: rgSCHTomUtlMoveNxtOccasion
5565 * Function which moves PCQI, RI, SR and SRS to next perodicity
5566 * Occasions as that needs to be done in case of Ack/Nack repetition
5567 * reception request occasions or during Measurement Gap occasions.
5569 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5572 * - Check whether the current Tx Instance matches with the rec req time
5573 * - If true, then move them to their next Tx Instance
5575 * @param[in] RgSchCellCb *cell,
5583 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion
5590 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion(cell, ue, validIdx)
5596 RgSchUePCqiCb *cqiCb = ue->nPCqiCb;
5597 RgSchUePCqiCb *riCb = ue->nPRiCb;
5598 TRC2(rgSCHTomUtlMoveNxtOccasion);
5600 /* ccpu00140578::Skip the UE if already RI recpetion
5601 * is processed in the same subframe */
5602 if ((riCb->nRiTrIdx == validIdx) &&
5603 (riCb->riRecpPrcsd == FALSE))
5605 if(riCb->riDist ==0)
5607 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
5613 /* ccpu00140578:: As this UE is considered for this TTI
5614 * Same UE should not get processed for RI reception
5615 * or for updating th RI distance.*/
5616 if(riCb->nRiTrIdx == validIdx)
5618 riCb->riRecpPrcsd = TRUE;
5621 if (cqiCb->nCqiTrIdx == validIdx)
5623 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
5626 /* ccpu00140578::Skip the UE if SRS recpetion
5627 * is already processed in the same subframe */
5628 if ((ue->srsCb.nSrsTrIdx == validIdx) &&
5629 (ue->srsCb.srsRecpPrcsd == FALSE))
5631 if(ue->srsCb.srsDist ==0)
5633 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
5637 ue->srsCb.srsDist--;
5639 /* ccpu00140578:: As this UE is considered for this TTI
5640 * Same UE should not get processed for SRS reception
5641 * or for updating th SRS distance.*/
5642 if(ue->srsCb.nSrsTrIdx == validIdx)
5644 ue->srsCb.srsRecpPrcsd = TRUE;
5647 if (ue->srCb.nSrTrIdx == validIdx)
5649 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
5652 } /* rgSCHTomUtlMoveNxtOccasion */
5655 /***********************************************************
5657 * Func : rgSCHTomPrepareAcqiRecp
5660 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
5661 * for decoding. Fill RECP request and prepare the scartchpad
5662 * to aid decoding of Aperiodic CQI.
5671 **********************************************************/
5673 PUBLIC Void rgSCHTomPrepareAcqiRecp
5677 TfuUePuschCqiRecpInfo *cqiRecpReqInfo,
5681 PUBLIC Void rgSCHTomPrepareAcqiRecp(ueCb, cell, cqiRecpReqInfo, ccIdx)
5684 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5689 RgSchCqiRawPuschMode12 *mode12Info;
5690 RgSchCqiRawPuschMode20 *mode20Info;
5691 RgSchCqiRawPuschMode22 *mode22Info;
5692 RgSchCqiRawPuschMode30 *mode30Info;
5693 RgSchCqiRawPuschMode31 *mode31Info;
5694 U8 numTxAnt = cell->numTxAntPorts;
5695 U8 sCellIdx = ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)];
5697 RgSchUeACqiCb *acqiCb = &ueCb->cellInfo[sCellIdx]->acqiCb;
5699 TRC2(rgSCHTomPrepareAcqiRecp);
5702 cqiRecpReqInfo->reportType = TFU_APERIODIC_CQI_TYPE; /* Aperiodic */
5703 if (ueCb->mimoInfo.txMode == RGR_UE_TM_3 ||
5704 ueCb->mimoInfo.txMode == RGR_UE_TM_4)
5706 cqiRecpReqInfo->riSz[ccIdx].pres = TRUE;
5707 cqiRecpReqInfo->riSz[ccIdx].val = acqiCb->riNumBits;
5709 /* This flag will be rmeoved after making changes in BRDCM CL
5710 * Sachin is doing the change
5712 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
5714 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5715 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5717 if(ueCb->nPCqiCb->perRiVal == 1)
5719 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5723 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5726 /* Fill scratchpad to aid decoding of aper CQI upon
5728 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
5729 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUSCH;
5731 numOfCells = ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells;
5733 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5734 puschRawCqiInfo.mode = (TfuDlCqiPuschMode)confRepMode;
5736 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5737 puschRawCqiInfo.ri.pres = cqiRecpReqInfo->riSz[ccIdx].pres;
5739 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5740 puschRawCqiInfo.ri.val = cqiRecpReqInfo->riSz[ccIdx].val;
5742 /* Setting the sCellIdx */
5743 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5744 sCellIdx = sCellIdx;
5748 case RGR_APRD_CQI_MOD12:
5750 mode12Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5751 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode12Info;
5752 mode12Info->wideBCqiCw0 = 4;
5753 mode12Info->r1WideBCqiCw1 = 0;
5754 mode12Info->rg1WideBCqiCw1 = 4;
5757 mode12Info->r1TotalPmiBitLen = 2*acqiCb->N;
5758 mode12Info->rg1TotalPmiBitLen = acqiCb->N;
5760 else if(numTxAnt == 4)
5762 mode12Info->r1TotalPmiBitLen = 4*acqiCb->N;
5763 mode12Info->rg1TotalPmiBitLen = 4*acqiCb->N;
5768 case RGR_APRD_CQI_MOD20:
5770 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5771 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode20Info;
5772 mode20Info->wideBCqiCw = 4;
5773 mode20Info->subBandDiffCqi = 2;
5774 mode20Info->posOfM = acqiCb->L;
5778 case RGR_APRD_CQI_MOD22:
5780 mode22Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5781 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode22Info;
5782 mode22Info->wideBCqiCw0 = 4;
5783 mode22Info->sBDiffCqiCw0 = 2;
5784 mode22Info->r1WideBCqiCw1 = 0;
5785 mode22Info->r1SbDiffCqiCw1 = 0;
5786 mode22Info->rg1WideBCqiCw1 = 4;
5787 mode22Info->rg1SbDiffCqiCw1 = 2;
5788 mode22Info->posOfM = acqiCb->L;
5791 mode22Info->r1PmiBitLen = 4;
5792 mode22Info->rg1PmiBitLen = 2;
5794 else if(numTxAnt == 4)
5796 mode22Info->r1PmiBitLen = 8;
5797 mode22Info->rg1PmiBitLen = 8;
5802 case RGR_APRD_CQI_MOD30:
5804 mode30Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5805 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode30Info;
5806 mode30Info->wideBCqiCw = 4;
5807 mode30Info->totLenSbDiffCqi = 2*acqiCb->N;
5811 case RGR_APRD_CQI_MOD31:
5813 mode31Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5814 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode31Info;
5815 mode31Info->wideBCqiCw0 = 4;
5816 mode31Info->totLenSbDiffCqiCw0 = 2*acqiCb->N;
5817 mode31Info->r1WideBCqiCw1 = 0;
5818 mode31Info->r1TotLenSbDiffCqiCw1 =0;
5819 mode31Info->rg1WideBCqiCw1 = 4;
5820 mode31Info->rg1TotLenSbDiffCqiCw1 = 2*acqiCb->N;
5823 mode31Info->r1PmiBitLen = 2;
5824 mode31Info->rg1PmiBitLen = 1;
5826 else if(numTxAnt == 4)
5828 mode31Info->r1PmiBitLen = 4;
5829 mode31Info->rg1PmiBitLen = 4;
5840 * @brief Function which handles the filling of Aperiodic CQI/RI reception
5845 * Function: rgSCHTomUtlFillDatAperRecpReq
5847 * Function which handles the filling of Aperiodic CQI/RI reception
5850 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5853 * - Fill the reception request for the data arriving on the ULSCH
5854 * - Fill the reception request information for the Aperiodic CQI/PMI/RI
5856 * @param[in] RgSchCellCb *cell,
5857 * RgSchUlAlloc *alloc,
5858 * TfuUeRecpReqInfo *datRecpInfo,
5859 * CmLteTimingInfo *timeInfo,
5866 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq
5870 RgSchUlAlloc *alloc,
5871 TfuUeRecpReqInfo *datRecpInfo,
5872 CmLteTimingInfo *timeInfo,
5877 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq(cell, cqiReq, alloc, datRecpInfo, timeInfo, hqPres, validIdx)
5880 RgSchUlAlloc *alloc;
5881 TfuUeRecpReqInfo *datRecpInfo;
5882 CmLteTimingInfo *timeInfo;
5887 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5888 RgSchUeCb *ueCb = alloc->ue;
5893 TRC2(rgSCHTomUtlFillDatAperRecpReq);
5895 /*Fill RI Reception Params*/
5896 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
5897 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
5898 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
5901 cqiRecpReqInfo->cCNum = 0;
5902 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells = 0;
5905 rgSCHTomUtlGetTrigSet(cell, ueCb, cqiReq, &triggerSet);
5906 for (sIdx = 0; sIdx < CM_LTE_MAX_CELLS; sIdx++)
5908 /* The Aperiodic request for SCell index sIdx */
5909 if ((triggerSet >> (7 - sIdx)) & 0x01)
5911 /* The Aperiodic request for SCell index sIdx */
5912 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[sIdx]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5913 cqiRecpReqInfo->cCNum++;
5914 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5918 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[0]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5919 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5922 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5924 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
5926 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
5927 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
5931 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
5933 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
5937 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
5939 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
5941 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
5943 datRecpInfo->rnti = alloc->rnti;
5944 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
5945 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5947 } /* rgSCHTomUtlFillDatAperRecpReq */
5952 * @brief Function which handles the filling of Periodic RI reception
5953 * request values which arrives along with UL Data on ULSCH
5957 * Function: rgSCHTomUtlFillDatPriRecpReq
5959 * Function which handles the filling of Periodic RI reception
5960 * request values which arrives along with UL Data on ULSCH
5962 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5965 * - Fill the reception request for the data arriving on the ULSCH
5966 * - Fill the reception request information for the Periodic RI
5968 * @param[in] RgSchCellCb *cell,
5969 * RgSchUlAlloc *alloc,
5970 * TfuUeRecpReqInfo *datRecpInfo,
5971 * CmLteTimingInfo *timeInfo,
5978 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq
5981 RgSchUlAlloc *alloc,
5982 TfuUeRecpReqInfo *datRecpInfo,
5983 CmLteTimingInfo *timeInfo,
5988 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq(cell, alloc, datRecpInfo, timeInfo,
5991 RgSchUlAlloc *alloc;
5992 TfuUeRecpReqInfo *datRecpInfo;
5993 CmLteTimingInfo *timeInfo;
5998 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5999 TRC2(rgSCHTomUtlFillDatPriRecpReq);
6001 /*Fill RI Reception Params*/
6002 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
6003 #ifdef TFU_ALLOC_EVENT_NO_INIT
6004 cqiRecpReqInfo->cqiBetaOff = 0;
6005 /* Fill only the first RI index since Periodic can come
6007 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
6008 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
6010 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* periodic */
6011 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
6013 /* Fill only the first RI index since Periodic can come
6015 cqiRecpReqInfo->cCNum = 1;
6016 cqiRecpReqInfo->riSz[0].pres = TRUE;
6017 cqiRecpReqInfo->riSz[0].val = alloc->ue->nPRiCb->riNumBits;
6019 rgSCHTomUtlFillRiBitWidthInfo(alloc->ue);
6020 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
6022 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6023 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
6027 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
6029 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
6033 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
6035 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
6037 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
6039 datRecpInfo->rnti = alloc->rnti;
6040 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6041 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6043 } /* rgSCHTomUtlFillDatPriRecpReq */
6047 * @brief Function which handles the filling of Periodic CQI/PMI reception
6048 * request values which arrives along with UL Data on ULSCH
6052 * Function: rgSCHTomUtlFillDatPCqiRecpReq
6054 * Function which handles the filling of Periodic CQI/PMI reception
6055 * request values which arrives along with UL Data on ULSCH
6057 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
6060 * - Fill the reception request for the data arriving on the ULSCH
6061 * - Fill the reception request information for the Periodic CQI/PMI
6063 * @param[in] RgSchCellCb *cell,
6064 * RgSchUlAlloc *alloc,
6065 * TfuUeRecpReqInfo *datRecpInfo,
6066 * CmLteTimingInfo *timeInfo,
6074 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq
6077 RgSchUlAlloc *alloc,
6078 TfuUeRecpReqInfo *datRecpInfo,
6079 CmLteTimingInfo *timeInfo,
6084 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq(cell, alloc, datRecpInfo,
6085 timeInfo, hqPres, validIdx)
6087 RgSchUlAlloc *alloc;
6088 TfuUeRecpReqInfo *datRecpInfo;
6089 CmLteTimingInfo *timeInfo;
6094 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
6095 U8 cqiPmiSz; /*Raw CQI/PMI Size*/
6098 TRC2(rgSCHTomUtlFillDatPCqiRecpReq);
6101 /*Fill CQI Reception Params*/
6102 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
6103 #ifdef TFU_ALLOC_EVENT_NO_INIT
6104 cqiRecpReqInfo->riBetaOff = 0;
6106 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
6107 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(alloc->ue, cell->numTxAntPorts, &ri);
6110 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Fill "
6111 "CqiPmi size RNTI:%d",alloc->rnti);
6115 /* Fill only the first RI index since Periodic can come
6117 cqiRecpReqInfo->cCNum = 1;
6118 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* Periodic */
6119 /* This flags will be removed once Sachin does changes
6121 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
6122 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
6123 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
6127 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
6128 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
6132 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
6133 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
6136 cqiRecpReqInfo->riSz[0].pres = FALSE;
6138 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
6140 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6141 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
6144 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
6146 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
6150 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
6152 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
6154 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
6156 datRecpInfo->rnti = alloc->rnti;
6157 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6158 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6160 } /* rgSCHTomUtlFillDatPCqiRecpReq */
6163 * @brief Function which handles the filling of SRS reception
6164 * request values which arrives along with UL Data on ULSCH
6168 * Function: rgSCHTomUtlFillDatSrsRecpReq
6170 * Function which handles the filling of SRS reception
6171 * request values which arrives along with UL Data on ULSCH
6173 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
6176 * - Fill the reception request for the data arriving on the ULSCH
6177 * - Fill the reception request information for the SRS
6179 * @param[in] RgSchCellCb *cell,
6180 * RgSchUlAlloc *alloc,
6181 * TfuUeRecpReqInfo *datRecpInfo,
6182 * CmLteTimingInfo *timeInfo,
6189 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq
6192 RgSchUlAlloc *alloc,
6193 TfuUeRecpReqInfo *datRecpInfo,
6194 CmLteTimingInfo *timeInfo,
6198 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq(cell, alloc, datRecpInfo, timeInfo,
6201 RgSchUlAlloc *alloc;
6202 TfuUeRecpReqInfo *datRecpInfo;
6203 CmLteTimingInfo *timeInfo;
6207 TRC2(rgSCHTomUtlFillDatSrsRecpReq);
6208 datRecpInfo->rnti = alloc->rnti;
6209 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6212 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_HARQ_SRS;
6216 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_SRS;
6218 datRecpInfo->rnti = alloc->rnti;
6219 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6220 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6222 } /* rgSCHTomUtlFillDatSrsRecpReq */
6225 * @brief Function which handles the filling of only SRS reception
6226 * request values on ULSCH
6230 * Function: rgSCHTomFillOnlySrsRecpReq
6232 * Function which handles the filling of SRS reception
6233 * request values which arrives along with UL Data on ULSCH
6235 * Invoked by: rgSCHTomUtlFillDatSrsRecpReq of rg_sch_tom.c
6238 * - Fill the reception request for the data arriving on the ULSCH
6239 * - Fill the reception request information for the SRS
6241 * @param[in] RgSchCellCb *cell,
6242 * RgSchUlAlloc *alloc,
6243 * TfuUeRecpReqInfo *datRecpInfo,
6249 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq
6252 RgSchUlAlloc *alloc,
6253 TfuUeRecpReqInfo *datRecpInfo
6256 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq(cell, alloc, datRecpInfo)
6258 RgSchUlAlloc *alloc;
6259 TfuUeRecpReqInfo *datRecpInfo;
6262 TfuUePuschSrsRecpInfo *srsRecpReqInfo;
6263 TRC2(rgSCHTomFillOnlySrsRecpReq);
6265 srsRecpReqInfo = &datRecpInfo->t.puschRecpReq.srsInfo;
6266 srsRecpReqInfo->srsBw = (TfuUlSrsBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsBw;
6267 srsRecpReqInfo->nRrc = alloc->ue->srsCb.srsCfg.srsSetup.fDomPosi;
6268 srsRecpReqInfo->srsHopBw = (TfuUlSrsHoBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsHopBw;
6269 srsRecpReqInfo->transComb = alloc->ue->srsCb.srsCfg.srsSetup.txComb;
6270 srsRecpReqInfo->srsCfgIdx = alloc->ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6271 srsRecpReqInfo->srsCyclicShft = (TfuUlSrsCycShiftInfo)alloc->ue->srsCb.srsCfg.srsSetup.cycShift;
6273 /* ccpu00117050 - ADD - nSrs setting
6274 * Refer Section 5.2.2.6 of TS 36.212 V8.5.0*/
6275 datRecpInfo->t.puschRecpReq.ulSchInfo.nSrs = 1;
6278 } /* rgSCHTomFillOnlySrsRecpReq */
6281 * @brief Function which handles the filling of PCQI/RI, SRS and SR
6282 * Reception Request Information along
6283 * with the HARQ reception Request
6287 * Function: rgSCHTomUtlFillCqiSrSrsWithHq
6289 * Function which handles the filling of PCQI/RI, SRS ans SR
6290 * Reception Request Information along
6291 * with the HARQ reception Request
6294 * Invoked by: rgSCHTomUtlFillHqFdbkRecpReq &
6295 * rgSCHTomUtlFillSfHqFdbk of rg_sch_tom.c
6298 * - Fill the reception request for the Control Info arriving on the PUCCH
6299 * - Fill the reception request information for the SR, RI, CQI, SRS
6301 * @param[in] RgSchCellCb *cell,
6302 * TfuRecpReqInfo *recpReqInfo,
6303 * RgSchDlHqProcCb *hqCb,
6304 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
6305 * @param[in] U16 validIdx
6311 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq
6314 TfuRecpReqInfo *recpReqInfo,
6316 TfuUeRecpReqInfo *pucchRecpInfo,
6318 Bool isDatPresOnSecCell
6321 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq(cell, recpReqInfo, ue,
6322 pucchRecpInfo, validIdx,isDatPresOnSecCell)
6324 TfuRecpReqInfo *recpReqInfo;
6326 TfuUeRecpReqInfo *pucchRecpInfo;
6328 Bool isDatPresOnSecCell;
6331 RgSchUePCqiCb *cqiCb;
6332 RgSchUePCqiCb *riCb;
6333 U8 ri; /*To fetch RI value*/
6334 Bool willUeRprtCqi; /* Flag set due to CQI Mask and
6335 UE Inactive state (DRX)*/
6336 Bool willUeRprtSr = TRUE;
6337 TfuAckNackMode hqFdbkMode;
6340 Bool dropCqi = FALSE;
6342 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
6345 RgSchEmtcUeInfo *emtcUe = NULLP;
6348 TRC2(rgSCHTomUtlFillCqiSrSrsWithHq);
6352 /*Changes for PUCCH Format3 */
6353 hqFdbkMode = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqFdbkMode;
6354 numCqiBit = rgSCHCmnCalcPcqiBitSz (ue,cell->numTxAntPorts);
6355 totalPucchBits = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz + numCqiBit;
6358 emtcUe = RG_GET_EMTC_UE_CB(ue);
6360 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
6361 #ifdef EMTC_ENABLE /*VINU*/
6364 if((emtcUe->pucchRepNumFr1 > 1) || (emtcUe->pucchRepNumFr2 > 1))
6366 willUeRprtCqi = FALSE;
6367 willUeRprtSr = FALSE;
6371 if(ue->srCb.nSrTrIdx == validIdx)
6375 /* Should we check for Rel8 and above???
6376 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
6378 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
6379 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
6380 if(!((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
6381 (ulSpsUe->isUlSpsActv)))
6388 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
6389 ue->srCb.srCfg.srSetup.srResIdx;
6390 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
6391 /* FORMAT3: If SR is present it will be appended after HARQ */
6392 totalPucchBits = totalPucchBits + 1;
6399 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
6401 /* LTE_ADV:: UE will drop CSI during CSI+1BCS if data is present
6402 * on sec cell(isDatPresOnSecCell)*/
6404 if (hqFdbkMode == TFU_ACK_NACK_CHANNEL_SELECTION)
6406 if (hqFdbkMode == TFU_UCI_FORMAT_1B_CS)
6409 if (isDatPresOnSecCell == TRUE)
6416 /* Format 3 Changes : If Hq + SR + CQI bits < 22 and simultaneousAckNackAndCQI-Format3
6417 is enabled then CQI will be multiplexed with HQ otherwise CQI will be dropped
6418 Spec 36.213 Sec 10.1.1 */
6419 else if (hqFdbkMode == TFU_UCI_FORMAT_3)
6421 if ((isDatPresOnSecCell == TRUE) &&
6422 ((!ue->simulAckNackCQIFormat3) || (totalPucchBits > 22)))
6430 cqiCb = ue->nPCqiCb;
6431 if(riCb->nRiTrIdx == validIdx)
6433 /*ccpu00140578:: Skip the UE if the RI is already processed
6435 if(riCb->riRecpPrcsd == FALSE)
6437 if(riCb->riDist == 0)
6439 if((riCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
6440 (isDatPresOnSecCell == FALSE))
6443 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6444 riCb->cqiCfg.cqiSetup.cqiPResIdx;
6445 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6447 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
6449 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
6453 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
6455 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6457 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6458 ue->nPRiCb->servCellInfo->sCellIdx;
6460 rgSCHTomUtlFillRiBitWidthInfo(ue);
6461 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
6463 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
6478 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
6484 /* Skip the UE for RI processing on PUCCH
6485 * in the same subframe as it already processed */
6486 if(riCb->nRiTrIdx == validIdx)
6488 /* As the new idx is same is current idx
6489 * then PUCCH reception processing will consider
6490 * RI also in the same subframe. To block this
6491 * below flag is used*/
6492 riCb->riRecpPrcsd = TRUE;
6496 else if(cqiCb->nCqiTrIdx == validIdx)
6498 if((cqiCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
6499 (isDatPresOnSecCell == FALSE))
6502 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6503 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6505 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6507 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6508 cqiCb->servCellInfo->sCellIdx;
6510 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6511 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6512 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6514 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d "
6515 "Unable to Fill CqiPmi size", ue->ueId);
6518 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
6520 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
6524 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
6537 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6539 if(ue->srsCb.nSrsTrIdx == validIdx)
6541 /* ccpu00140578::Skip the UE for SRS reception processing
6542 * if already done as part of PUSCH recpetion
6544 if(ue->srsCb.srsRecpPrcsd == FALSE)
6546 if(ue->srsCb.srsDist ==0 )
6548 if((pucchRecpInfo->t.pucchRecpReq.uciInfo != TFU_PUCCH_HARQ_CQI)
6549 && (ue->srsCb.srsCfg.srsSetup.sANSrs)
6550 && (isDatPresOnSecCell == FALSE))
6553 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6554 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6555 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6556 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6557 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6558 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6559 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6560 ue->srsCb.srsCfg.srsSetup.txComb;
6561 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6562 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6563 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6564 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6565 /* ccpu00116923 - ADD - New Reception Request types for CQI and SRS with SR */
6566 switch(pucchRecpInfo->t.pucchRecpReq.uciInfo)
6568 case TFU_PUCCH_HARQ_SR:
6569 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
6571 case TFU_PUCCH_HARQ_SR_CQI:
6572 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI_SRS;
6575 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SRS;
6579 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6583 ue->srsCb.srsDist--;
6585 /* Skip the UE for SRS processing on PUCCH
6586 * in the same subframe as it already processed */
6587 if(ue->srsCb.nSrsTrIdx == validIdx)
6589 /* As the new idx is same is current idx
6590 * then PUCCH reception processing will consider
6591 * SRS also in the same subframe. To block this
6592 * below flag is used*/
6593 ue->srsCb.srsRecpPrcsd = TRUE;
6601 } /* rgSCHTomUtlFillCqiSrSrsWithHq */
6604 * @brief Function which handles the filling of PCQI/RI, SRS
6605 * Reception Request Information along with SR reception
6610 * Function: rgSCHTomUtlFillCqiSrsWithSr
6612 * Function which handles the filling of PCQI/RI, SRS
6613 * Reception Request Information along
6614 * with the SR reception Request
6617 * Invoked by: rgSCHTomUtlFillSrRecpReq of rg_sch_tom.c
6620 * - Fill the reception request for CQI/RI, SRS if they occur
6621 * in the same instance as of SR.
6623 * @param[in] RgSchCellCb *cell,
6625 * TfuRecpReqInfo *recpReqInfo,
6626 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
6627 * @param[in] U16 validIdx
6634 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr
6638 TfuRecpReqInfo *recpReqInfo,
6639 TfuUeRecpReqInfo *pucchRecpInfo,
6643 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr(cell, ue, recpReqInfo,
6644 pucchRecpInfo, validIdx)
6647 TfuRecpReqInfo *recpReqInfo;
6648 TfuUeRecpReqInfo *pucchRecpInfo;
6652 RgSchUePCqiCb *cqiCb;
6653 RgSchUePCqiCb *riCb;
6654 U8 ri; /*To fetch RI value*/
6655 Bool willUeRprtCqi; /* Flag set due to CQI Mask and
6656 UE Inactive state (DRX)*/
6657 TRC2(rgSCHTomUtlFillCqiSrsWithSr);
6660 cqiCb = ue->nPCqiCb;
6661 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
6663 rgSCHEmtcWillUeRptCqi(ue, &willUeRprtCqi);
6665 if(riCb->nRiTrIdx == validIdx)
6667 /*ccpu00140578:: Skip the UE if the RI is already processed
6669 if(riCb->riRecpPrcsd == FALSE)
6671 if(riCb->riDist == 0)
6673 if(willUeRprtCqi == TRUE)
6676 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6677 riCb->cqiCfg.cqiSetup.cqiPResIdx;
6678 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6681 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6682 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6684 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6685 ue->nPRiCb->servCellInfo->sCellIdx;
6687 rgSCHTomUtlFillRiBitWidthInfo(ue);
6688 /* TODO:: syed Shouldn't this be done outside this if condition */
6689 if (cqiCb->nCqiTrIdx == validIdx)
6691 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6694 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
6700 if(riCb->nRiTrIdx == validIdx)
6701 {/* Need to skip this UE during PUCCH RI recpetion process
6702 in the current subframe */
6703 riCb->riRecpPrcsd = TRUE;
6707 else if(cqiCb->nCqiTrIdx == validIdx)
6709 if(willUeRprtCqi == TRUE)
6712 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6713 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6715 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6718 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6719 cqiCb->servCellInfo->sCellIdx;
6721 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6722 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6723 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6725 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d"
6726 " Unable to Fill CqiPmi size", ue->ueId);
6730 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6732 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6734 if(ue->srsCb.nSrsTrIdx == validIdx)
6736 /* ccpu00140578:: Cnsider the SRS processing
6737 * only if not done in the same TTI
6738 * as part of PUSCH or HARQ reception process*/
6739 if(ue->srsCb.srsRecpPrcsd == FALSE)
6741 if(ue->srsCb.srsDist ==0 )
6743 if(ue->srsCb.srsCfg.srsSetup.sANSrs)
6746 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6747 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6748 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6749 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6750 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6751 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6752 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6753 ue->srsCb.srsCfg.srsSetup.txComb;
6754 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6755 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6756 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6757 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6758 /* ccpu00116923 - ADD - New Reception Request types for CQI and
6760 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_SR_CQI)
6762 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI_SRS;
6766 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_SRS;
6770 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6774 ue->srsCb.srsDist--;
6776 /* Skip the UE for SRS processing on PUCCH
6777 * in the same subframe as it already processed */
6778 if(ue->srsCb.nSrsTrIdx == validIdx)
6780 /* As the new idx is same is current idx
6781 * then PUCCH reception processing will consider
6782 * SRS also in the same subframe. To block this
6783 * below flag is used*/
6784 ue->srsCb.srsRecpPrcsd = TRUE;
6790 } /* rgSCHTomUtlFillCqiSrsWithSr */
6796 /** @brief This function handles filling of HARQ feedback repetition
6797 * recption request for each subframe
6801 * Function: rgSCHTomUtlFillSfRepHqFdbk
6805 * @param [out] TfuRecpReqInfo *recpReqInfo
6806 * @param [in] RgSchCellCb *cell
6807 * @param [out] RgSchErrInfo *err
6808 * @param [in] RgSchDlSf *dlSf
6809 * @param [in] U8 noFdbks
6810 * @param [in] CmMemListCp *memCp
6811 * @param [in] U8 elemIdx
6812 * @param [in] RgSchDlSf *nxtDlsf
6819 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk
6821 TfuRecpReqInfo *recpReqInfo,
6822 RgSchCellCb *cellCb,
6832 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk (recpReqInfo, cellCb, err, dlSf,
6833 noFdbks, memCp, elemIdx, nxtDlsf, validIdx)
6834 TfuRecpReqInfo *recpReqInfo;
6835 RgSchCellCb *cellCb;
6846 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk
6848 TfuRecpReqInfo *recpReqInfo,
6849 RgSchCellCb *cellCb,
6858 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk (recpReqInfo, cellCb, err, dlSf,
6859 noFdbks, memCp, elemIdx, nxtDlsf)
6860 TfuRecpReqInfo *recpReqInfo;
6861 RgSchCellCb *cellCb;
6871 RgSchDlHqProcCb *hqCb;
6875 TfuUeRecpReqInfo *pucchRecpInfo;
6877 TfuUePucchHqRecpInfo *hqRecpReq;
6879 RgSchDlHqTbCb *tbCb;
6880 RgSchDlHqProcCb *prvHqCb = NULLP;
6882 TRC2(rgSCHTomUtlFillSfRepHqFdbk)
6884 node = dlSf->ackNakRepQ.first;
6887 tbCb = (RgSchDlHqTbCb *)(node->node);
6889 ueCb = hqCb->hqE->ue;
6891 if (--tbCb->fbkRecpRepCntr)
6893 /* Add to next subfarme */
6894 /* Add this hqCb to the next dlSf's ackNakRepQ */
6895 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
6896 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
6897 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
6898 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
6905 /* Go to the next node */
6910 if ((hqCb->hqE->ue != NULLP) &&
6911 (hqCb->hqE->ue->measGapCb.isMeasuring != TRUE)
6912 && (hqCb != prvHqCb)
6915 /* We need to add the recp request to be sent on the pucchANRep
6918 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
6919 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
6922 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to"
6923 "Allocate TfuUeRecpReqInfo for RNTI:%d ", ueCb->ueId);
6924 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
6927 pucchRecpInfo->rnti = ueCb->ueId;
6929 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
6931 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
6934 /* FOR repetition Feedback shall come on n1PucchAnRep Configured per
6938 pucchRecpInfo->t.pucchRecpReq.hqType = TFU_HQ_RECP_REQ_N1PUCCH;
6939 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = ueCb->ackNakRepCb.pucchRes;
6941 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
6942 hqRecpReq = &(pucchRecpInfo->t.pucchRecpReq.hqInfo);
6943 /* ACK NACK rep works only in bundling mode . */
6944 hqRecpReq->hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_BUNDL;
6945 if ((hqCb->hqPSfLnk.node != NULLP) &&
6946 (hqCb->hqPSfLnk.node != NULLP))
6949 hqRecpReq->hqSz = 2;
6953 hqRecpReq->hqSz = 1;
6955 hqRecpReq->pucchResCnt = 1;
6956 hqRecpReq->hqRes[0] = ueCb->ackNakRepCb.pucchRes;
6958 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
6959 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
6961 /* In a given dlSf, if there is 2 TBs context
6962 * stored for a given harq, then they are added
6963 * adjacent to each other in the subframe. To avoid
6964 * adding duplicate recpnInfo for each TB, store this
6965 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
6966 * do not add reception req info.*/
6969 RGSCH_NULL_CHECK(cellCb->instIdx, hqCb->hqE->ue);
6970 rgSCHTomUtlMoveNxtOccasion(cellCb, hqCb->hqE->ue, validIdx);
6972 /* Go to the next node */
6978 /** @brief This function handles filling of HARQ feedback recption request
6983 * Function: rgSCHTomUtlFillSfHqFdbkInfo
6987 * @param [out] TfuRecpReqInfo *recpReqInfo
6988 * @param [in] RgSchCellCb *cell
6989 * @param [out] RgSchErrInfo *err
6990 * @param [in] RgSchDlSf *dlSf
6991 * @param [in] U8 noFdbks
6992 * @param [in] CmMemListCp *memCp
6993 * @param [in] U8 elemIdx
6994 * @param [in] RgSchDlSf *nxtDlsf
6995 * @param [in] U16 validIdx;
7002 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo
7004 TfuRecpReqInfo *recpReqInfo,
7005 RgSchCellCb *cellCb,
7013 RgSchDlHqProcCb *hqCb,
7014 RgSchUePucchRecpInfo *pucchInfo,
7016 RgSchDlHqProcCb *prvHqCb
7019 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo (recpReqInfo, cellCb, err, dlSf,
7020 noFdbks, memCp, elemIdx, nxtDlsf, validIdx, hqCb, pucchInfo, alloc, prvHqCb)
7021 TfuRecpReqInfo *recpReqInfo;
7022 RgSchCellCb *cellCb;
7030 RgSchDlHqProcCb *hqCb;
7031 RgSchUePucchRecpInfo *pucchInfo;
7033 RgSchDlHqProcCb *prvHqCb;
7037 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo
7039 TfuRecpReqInfo *recpReqInfo,
7040 RgSchCellCb *cellCb,
7047 RgSchDlHqProcCb *hqCb,
7048 RgSchUePucchRecpInfo *pucchInfo,
7050 RgSchDlHqProcCb *prvHqCb
7053 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo (recpReqInfo, cellCb, err, dlSf,
7054 noFdbks, memCp, elemIdx, nxtDlsf, hqCb, pucchInfo, alloc, prvHqCb)
7055 TfuRecpReqInfo *recpReqInfo;
7056 RgSchCellCb *cellCb;
7063 RgSchDlHqProcCb *hqCb;
7064 RgSchUePucchRecpInfo *pucchInfo;
7066 RgSchDlHqProcCb *prvHqCb;
7071 RgSchUeCb *ueCb = hqCb->hqE->ue;
7073 CmLteTimingInfo futTime;
7074 RgSchTddANInfo *anInfo;
7077 RgrTddAckNackMode ackNackMode;
7078 RgSchDlHqTbCb *tbCb;
7083 TRC2(rgSCHTomUtlFillSfHqFdbkInfo)
7086 RG_SCH_ADD_TO_CRNT_TIME(cellCb->crntTime, futTime, TFU_RECPREQ_DLDELTA);
7090 for (idx = 0 ;idx < 2; idx++)
7092 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
7095 tbCb = &hqCb->tbInfo[idx];
7099 ackNackMode = ueCb->dl.ackNackMode;
7101 if(ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL)
7103 anInfo = rgSCHUtlGetUeANFdbkInfo(ueCb, &futTime);
7104 /* Only the last scheduled TB for the UE is for HARQ
7105 * ACK/NACK reception in Bundling case */
7106 if((anInfo == NULLP) ||
7107 (anInfo->latestMIdx != dlSf->dlFdbkInfo.m))
7114 /* Get the TFU reception request pointer, if present */
7115 cmHashListFind(&cellCb->ueTfuPendLst, (U8*) &ueCb->ueId,
7116 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
7119 /* For upgrade we shall use the existing logic of pending list. */
7120 cmHashListFind(&cellCb->ueTfuPendLst, (U8*) &ueCb->ueId,
7121 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
7124 else if(hqCb->hqE->raCb != NULLP)
7126 /* For RACH it is set to Bundling */
7127 ackNackMode = RGR_TDD_ACKNACK_MODE_BUNDL;
7128 rnti = hqCb->hqE->raCb->tmpCrnti;
7135 /* Do not proceed if PUSCH
7136 reception req is already filled*/
7141 /* Go to the next node */
7145 if(((ueCb == NULLP) || (ueCb->measGapCb.isMeasuring != TRUE))
7149 TknU16 n1PucchTkn = {FALSE, 0};
7152 pdcch = tbCb->hqP->pdcch;
7154 n1PucchTkn = hqCb->spsN1PucchRes;
7156 for (tbIndx = 0; tbIndx < TFU_MAX_TB; tbIndx++)
7158 if (hqCb->tbInfo[tbIndx].state == HQ_TB_WAITING &&
7159 (RGSCH_TIMEINFO_SAME(hqCb->tbInfo[tbIndx].fdbkTime,
7160 recpReqInfo->timingInfo)))
7163 hqCb->tbInfo[tbIndx].pucchFdbkIdx = hqCb->ulDai;
7166 ret = rgSCHTomUtlFillSfHqFdbkForOneUe(hqCb,recpReqInfo, cellCb, err, dlSf, noFdbks,
7167 memCp, elemIdx, nxtDlsf, rnti, ackNackMode, &pucchInfo, pdcch,
7168 n1PucchTkn, &alloc, hqSz);
7173 /* TODO:: In case of F1BCS and CSI in same subframe
7174 * UE shall drop the CSI if there was at least one
7175 * PDSCH transmission in any of the DL subframe
7176 * mapping to this UL subframe
7179 rgSCHTomUtlFillCqiSrSrsWithHq(cellCb,recpReqInfo, hqCb->hqE->ue,
7180 pucchInfo->pucchRecpInfo, validIdx,FALSE);
7182 if((hqCb->hqE->ue) &&
7183 (hqCb->hqE->ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
7186 if(RG_SCH_IS_CELL_SEC(hqCb->hqE->ue,hqCb->hqE->cell))
7188 switch(pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo)
7190 case TFU_PUCCH_HARQ_SR_CQI:
7191 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
7192 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7194 case TFU_PUCCH_HARQ_CQI:
7195 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
7196 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7198 case TFU_PUCCH_HARQ_SR_CQI_SRS:
7199 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
7200 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7202 case TFU_PUCCH_HARQ_SR_SRS:
7203 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
7205 case TFU_PUCCH_HARQ_SRS:
7206 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
7217 /* TODO antz - pushing the following code (under TFU_UPGRADE)
7218 * into the above function (...ForOneUe) did not work (caused
7219 * two additional TCs to fail). Don't know why. If this
7220 * is done later, make sure that the code branch
7221 * for relPdcch (later in this func) is also modified appropriately.
7223 /* Now add to the recp request or pending list */
7224 //if((elemIdx != (noFdbks - 1)))
7226 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
7227 (U8 *)&rnti ,(U16) sizeof(CmLteRnti));
7231 } /* If measuring */
7232 /* Go to the next node */
7233 if ((tbCb->fbkRecpRepCntr) && (--tbCb->fbkRecpRepCntr))
7235 /* Add to next subfarme */
7236 /* Add this hqCb to the next dlSf's ackNakRepQ */
7237 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
7238 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
7239 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
7240 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
7242 /* In a given dlSf, if there is 2 TBs context
7243 * stored for a given harq, then they are added
7244 * adjacent to each other in the subframe. To avoid
7245 * adding duplicate recpnInfo for each TB, store this
7246 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
7247 * do not add reception req info.*/
7255 /** @brief This function calculates the pucch resource idx
7256 * that is to be filled in harq reception request
7260 * Function: rgSCHTomUtlGethqRes
7263 * -Calculate the pucch resource idx
7264 * Harq Reception Request for Format 1B with
7267 * @param [in] U8 noFdbks
7268 * @param [in] RgSchDlSf *dlSf
7269 * @param [in] RgSchPdcch *pdcch
7270 * @param [in] RgSchCellCb *cellCb
7271 * @param [out]U16 *hqRes
7275 PRIVATE Void rgSCHTomUtlGethqRes
7280 RgSchCellCb *cellCb,
7284 PRIVATE Void rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,hqRes)
7288 RgSchCellCb *cellCb;
7300 m = dlSf->dlFdbkInfo.m;
7302 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
7303 nP = cellCb->rgSchTddNpValTbl[P];
7304 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
7305 *hqRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
7306 cellCb->pucchCfg.n1PucchAn;
7311 /** @brief This function fills the harq reception request for
7312 * TDD in case of Fomat 1B with CS for M=1
7316 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
7319 * -Fill Harq Reception Request for Format 1B with
7322 * @param [in] RgSchDlHqProcCb *hqCb
7323 * @param [in] TfuUePucchRecpReq *hqRecpReq
7324 * @param [in] U8 noFdbks
7325 * @param [in] RgSchDlSf *dlSf
7326 * @param [in] RgSchPdcch *pdcch
7327 * @param [in] RgSchCellCb *cellCb
7331 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
7333 RgSchDlHqProcCb *hqCb,
7334 TfuUePucchRecpReq *hqRecpReq,
7341 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1(hqCb, hqRecpReq,
7342 noFdbks,dlSf,pdcch,cellCb)
7343 RgSchDlHqProcCb *hqCb;
7344 TfuUePucchRecpReq *hqRecpReq;
7348 RgSchCellCb *cellCb;
7351 RgSchUeCb *ue = NULLP;
7352 Bool isCellSec = FALSE;
7355 /*ccpu00147920: UeCb is NULL for SPS activation*/
7356 if(pdcch && pdcch->ue)
7357 {/* SPS Release pdcch or dynamic data */
7364 /* This is not supposed to happen
7365 * Error case. hqCB has to be ter
7366 * when pdcch is present . Adding
7367 * if check bcs of kwork*/
7374 if((hqCb != NULLP) &&
7375 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7380 switch(ue->f1bCsAVal)
7382 case RG_SCH_A_VAL_2:
7383 /* harq(0) is primary harq(1) is secondary) */
7386 hqRecpReq->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.
7387 cw1N1Res[hqCb->tpc].n1PucchIdx;
7389 else/* primary cell */
7392 /* hqCb will be null in case of sps rel pdcch */
7393 if ((hqCb) && hqCb->spsN1PucchRes.pres)
7394 {/* SPS occasion or dyn sched*/
7395 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7398 #endif /* LTEMAC_SPS */
7399 {/* dyn data or sps release */
7403 /* This is not supposed to happen
7404 * Error case. hqCB has to be ter
7405 * when pdcch is present . Adding
7406 * if check bcs of kwork*/
7411 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7412 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7416 case RG_SCH_A_VAL_3:
7418 /* Serving cell in mimo mode should be
7419 * in 0 and 1 and the serving cell in siso
7420 * mode should be in 2 indices */
7423 U8 servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
7424 hqCb->hqE->cell->cellId,
7427 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
7428 {/* Sec cell is in mimo mode, use 0 and 1 */
7429 hqRecpReq->hqInfo.hqRes[0] =
7430 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7431 hqRecpReq->hqInfo.hqRes[1] =
7432 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7435 {/* Sec cell is in siso mode, use 2 */
7436 hqRecpReq->hqInfo.hqRes[2] =
7437 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7441 {/* primary cell hq */
7443 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
7444 {/* prim cell is in mimo mode, use 0 and 1 */
7446 if (hqCb && hqCb->spsN1PucchRes.pres)
7447 {/* Not sps release */
7448 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7451 #endif /* LTEMAC_SPS */
7452 {/* sps rel or dyn */
7456 /* This is not supposed to happen
7457 * Error case. hqCB has to be ter
7458 * when pdcch is present . Adding
7459 * if check bcs of kwork*/
7464 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7465 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7466 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
7470 {/* prim cell is in siso mode use 2 */
7472 /* Consider sps occasions */
7473 if (hqCb && hqCb->spsN1PucchRes.pres)
7474 {/* Not sps release */
7475 hqRecpReq->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
7478 #endif /* LTEMAC_SPS */
7483 /* This is not supposed to happen
7484 * Error case. hqCB has to be ter
7485 * when pdcch is present . Adding
7486 * if check bcs of kwork*/
7491 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7492 hqRecpReq->hqInfo.hqRes[2] = hqRes;
7498 case RG_SCH_A_VAL_4:
7499 {/* Both the serv cells are in mimo mode */
7501 {/* 2 and 3 for sec cell */
7502 hqRecpReq->hqInfo.hqRes[2] =
7503 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7504 hqRecpReq->hqInfo.hqRes[3] =
7505 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7507 else/* primary cell */
7508 {/* 0 and 1 are for primary cell */
7510 if (hqCb && hqCb->spsN1PucchRes.pres)
7511 {/* Not sps release */
7512 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7515 #endif /* LTEMAC_SPS */
7520 /* This is not supposed to happen
7521 * Error case. hqCB has to be ter
7522 * when pdcch is present . Adding
7523 * if check bcs of kwork*/
7528 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7529 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7530 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
7541 /** @brief This function fills the harq reception request for
7542 * TDD in case of Fomat 1B with CS for M>=2
7546 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
7549 * -Fill Harq Reception Request for Format 1B with
7552 * @param [in] RgSchDlHqProcCb *hqCb
7553 * @param [in] TfuUePucchRecpReq *hqRecpReq
7554 * @param [in] U8 noFdbks
7555 * @param [in] RgSchDlSf *dlSf
7556 * @param [in] RgSchPdcch *pdcch
7557 * @param [in] RgSchCellCb *cellCb
7558 * @param [in] U8 elemIdx
7562 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
7564 RgSchDlHqProcCb *hqCb,
7565 TfuUePucchRecpReq *hqRecpReq,
7569 RgSchCellCb *cellCb,
7573 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234(
7574 hqCb,hqRecpReq,noFdbks,dlSf,pdcch,cellCb,elemIdx)
7575 RgSchDlHqProcCb *hqCb;
7576 TfuUePucchRecpReq *hqRecpReq;
7580 RgSchCellCb *cellCb;
7585 Bool isCellSec = FALSE;
7590 {/* SPS Release pdcch or dynamic data */
7597 /* This is not supposed to happen
7598 * Error case. hqCB has to be ter
7599 * when pdcch is present . Adding
7600 * if check bcs of kwork*/
7607 if((hqCb != NULLP) && (ue != NULLP) &&
7608 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7614 {/* Sec Cell indices are 2 and 3*/
7615 servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
7616 hqCb->hqE->cell->cellId,
7619 hqRecpReq->hqInfo.hqRes[2] =
7620 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7622 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
7624 hqRecpReq->hqInfo.hqRes[3] =
7625 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7629 {/* Primary cell indices are 0 and 1 */
7631 * M > 2 if SPS occasion is present in any of the
7632 * DL subframe in the bundle, the n1Pucch(0) is
7633 * the SPS resource and n1Pucch(1) is the resource
7634 * derived from pdcch with DAI = 1
7635 * If No SPS Occasion
7636 * Then n1Pucch(0) is from pdcch with DAI =1
7637 * and n1Pucch(1) is from pdcch with DAI = 2
7641 {/* this is not sps release pdcch */
7642 if(hqCb->spsN1PucchRes.pres == TRUE)
7644 hqRes = hqCb->spsN1PucchRes.val;
7649 {/*Dynamic scheduling or SPS Release
7650 Derive from pdcch */
7651 if(pdcch->dlDai < 3)
7652 {/* No need to calcualte from DAI > 2 */
7653 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7659 hqRecpReq->hqInfo.hqRes[elemIdx] = hqRes;
7662 {/* Pdcch with DAI = 1 and 2 needs to be used
7663 for resource calculation*/
7664 if(hqCb && hqCb->spsN1PucchRes.pres == TRUE)
7665 {/* dyn or sps occasion */
7666 /* Shift the hqRes[0] if it was filled
7667 * if there was a pdcch with DAI 1 before to this
7670 {/* SPS occasion happened in the middle
7672 /* shifting the non SPS resource to n1Pucch(1) */
7673 hqRecpReq->hqInfo.hqRes[1] = hqRecpReq->hqInfo.hqRes[0];
7676 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7679 else if(pdcch && pdcch->dlDai < 3)
7681 else if(pdcch->dlDai < 3)
7683 {/* sps rel or dyn sched */
7684 /* hqCb wil not be present for sps release pdcch */
7685 if(hqCb && (pdcch->dlDai != hqCb->ulDai))
7686 {/* there was a SPS occasion before to this */
7687 if(pdcch->dlDai == 1)
7689 hqRecpReq->hqInfo.hqRes[1] = hqRes;
7690 }/* ignore the DAI 2 in this case */
7692 {/* There was no SPS occasion before to this */
7696 {/* Added check to ignore kwork warning */
7697 hqRecpReq->hqInfo.hqRes[(pdcch->dlDai)-1] = hqRes;
7706 /** @brief This function fills the harq reception request for
7707 * TDD in case of Fomat 1B with CS
7711 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7714 * -Fill Harq Reception Request for Format 1B with
7717 * @param [in] RgSchDlSf *ulSf
7718 * @param [in] RgSchCellCb *cell
7719 * @param [out]TfuUePucchRecpReq *hqRecpReq
7723 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7725 RgSchDlHqProcCb *hqCb,
7726 TfuUePucchRecpReq *hqRecpReq,
7734 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS(hqCb,hqRecpReq,noFdbks,dlSf,pdcch,
7735 n1PucchTkn,elemIdx,cellCb)
7736 RgSchDlHqProcCb *hqCb;
7737 TfuUePucchRecpReq *hqRecpReq;
7742 RgSchCellCb *cellCb;
7745 /* Update teh fdbk mode if something different is present
7746 * in L1 API file for F1BS *//* 1 --> F1BCS */
7747 hqRecpReq->hqInfo.hqFdbkMode = TFU_ACK_NACK_CHANNEL_SELECTION;
7751 case RG_SCH_M_VAL_1:
7754 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1(hqCb,hqRecpReq,
7755 noFdbks,dlSf,pdcch,cellCb);
7758 case RG_SCH_M_VAL_2:
7759 case RG_SCH_M_VAL_3:
7760 case RG_SCH_M_VAL_4:
7762 /* Spatial bundling will be applied */
7763 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234(hqCb,hqRecpReq,
7764 noFdbks,dlSf,pdcch,cellCb,elemIdx);
7774 /***********************************************************
7776 * Func : rgSCHTomUtlFillSfHqFdbkForOneUe
7778 * Desc : Fill HARQ feedback info for one UE/entry
7786 **********************************************************/
7788 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe
7790 RgSchDlHqProcCb *hqCb,
7791 TfuRecpReqInfo *recpReqInfo,
7792 RgSchCellCb *cellCb,
7800 RgrTddAckNackMode ackNackMode,
7801 RgSchUePucchRecpInfo **pucchInfoRef,
7808 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe(hqCb,recpReqInfo, cellCb, err, dlSf,
7809 noFdbks, memCp, elemIdx, nxtDlsf, rnti, ackNackMode, pucchInfoRef,
7810 pdcch, n1PucchTkn, allocRef, hqSz)
7811 RgSchDlHqProcCb *hqCb;
7812 TfuRecpReqInfo *recpReqInfo;
7813 RgSchCellCb *cellCb;
7821 RgrTddAckNackMode ackNackMode;
7822 RgSchUePucchRecpInfo **pucchInfoRef;
7829 RgSchUePucchRecpInfo *pucchInfo = *pucchInfoRef;
7832 TfuUePucchRecpReq *hqRecpReq;
7847 Bool isFirstFdbk = FALSE;
7849 if(pucchInfo == NULLP)
7851 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchInfo,
7852 sizeof(RgSchUePucchRecpInfo), memCp)) != ROK)
7854 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7855 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7856 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7860 #ifdef TFU_ALLOC_EVENT_NO_INIT
7861 pucchInfo->hashLstEnt.hashVal = 0;
7862 pucchInfo->hashLstEnt.keyLen = 0;
7863 pucchInfo->hashLstEnt.key = 0;
7864 pucchInfo->hashLstEnt.list.prev = pucchInfo->hashLstEnt.list.next = 0;
7866 if ((ret = rgSCHUtlGetEventMem((Ptr *)&(pucchInfo->pucchRecpInfo),
7867 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp))) != ROK)
7869 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7870 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7871 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7874 cmMemset((U8 *)pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
7875 #ifdef TFU_ALLOC_EVENT_NO_INIT
7876 cmMemset((U8 *)&pucchInfo->pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
7878 pucchInfo->pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
7879 pucchInfo->pucchRecpInfo->rnti = rnti;
7881 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo=TFU_PUCCH_HARQ;
7888 /* Calculation of resources same for both bundling and muxing for M = 1
7891 RgSchUeCb *ue = rgSCHDbmGetUeCb (cellCb, rnti);
7892 if((ue) && (1 == ue->numSCells))
7894 if(ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
7896 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7897 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS(hqCb,hqRecpReq,
7898 noFdbks,dlSf,pdcch,elemIdx,cellCb);
7901 {/* M = 1 case . size is same as A Value*/
7902 hqRecpReq->hqInfo.hqSz = ue->f1bCsAVal;
7903 hqRecpReq->hqInfo.pucchResCnt = hqRecpReq->hqInfo.hqSz;
7906 hqRecpReq->hqInfo.hqSz = (noFdbks * 2); /* M for 2 cells */
7907 hqRecpReq->hqInfo.pucchResCnt = 4;
7909 hqRecpReq->hqInfo.a = ue->f1bCsAVal;
7910 /* handling for SPS occasions*/
7913 /* set the datPresinFirstSUbframe to TRUE if this
7914 * is for pcell txion*/
7916 RgSchTddANInfo *anInfo = NULLP;
7918 /* if this txion is on pcell
7919 * sps occaion, dyn sched or sps release pdcch
7920 * set the sched present in first
7921 * dl subframe of the bundle to TRUE. This
7922 * is required for mapping the feedbak when SPS occasion
7923 * is present in any of the DL subframe in the bundle in
7926 /* SPS will happen only on pcell */
7927 if((hqCb == NULLP) || (!RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7930 anInfo = rgSCHUtlGetUeANFdbkInfo(ue,
7931 &recpReqInfo->timingInfo,RGSCH_PCELL_INDEX);
7933 {/* ANInfo must be there. adding block
7935 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),
7936 "ANInfo should not be NULL for cellId=%d \n", cellCb->cellId));
7943 {/* This needs to be revisited while
7944 adding support for PUCCH format 3 */
7945 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),"Invalid Pucch format configured.."));
7952 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) ||
7953 ((noFdbks == 1) && (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)))
7955 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7957 prevHqSize = hqRecpReq->hqInfo.hqSz;
7960 /* Only one index for bundling case */
7961 hqRecpReq->M = noFdbks;
7963 TFU_HQ_RECP_REQ_NORMAL;
7964 hqRecpReq->multCnt = 1;
7965 hqRecpReq->t.nCce[0] =
7970 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
7972 hqRecpReq->type = TFU_UCI_HARQ;
7974 #else /* TFU_UPGRADE */
7977 if ((TRUE == isFirstFdbk) && (TRUE == n1PucchTkn.pres))
7979 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
7980 hqRecpReq->hqInfo.pucchResCnt=1;
7981 hqRecpReq->hqInfo.hqRes[0] = n1PucchTkn.val;
7982 hqRecpReq->hqInfo.hqSz = hqSz;
7985 else if (FALSE == n1PucchTkn.pres)
7988 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
7990 P = rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
7991 nP = cellCb->rgSchTddNpValTbl[P];
7992 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
7993 m = dlSf->dlFdbkInfo.m;
7994 /* In case of no UE */
7995 pucchRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
7996 cellCb->pucchCfg.n1PucchAn;
7997 /*ccpu00130164:MOD-Changed to maitain value of
7998 hqRecpReq->hqInfo.pucchResCnt=1 in case of bundling*/
7999 /*ccpu00132284 -MOD- hqRes need to be updated after pucchReCnt set to 1
8000 * and resource should be update at index-0*/
8001 hqRecpReq->hqInfo.pucchResCnt=1;
8002 hqRecpReq->hqInfo.hqRes[hqRecpReq->hqInfo.pucchResCnt-1] = pucchRes;
8004 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) && (hqSz > prevHqSize))
8005 hqRecpReq->hqInfo.hqSz = hqSz;
8006 else if (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)
8007 hqRecpReq->hqInfo.hqSz = hqSz;
8009 hqRecpReq->hqInfo.hqSz = prevHqSize;
8011 #endif /* TFU_UPGRADE */
8013 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
8014 &(pucchInfo->pucchRecpInfo->lnk));
8015 pucchInfo->pucchRecpInfo->lnk.node =
8016 (PTR)pucchInfo->pucchRecpInfo;
8019 else /* Multiplexing */
8022 pucchInfo->pucchRecpInfo->t.pucchRecpReq.M = noFdbks;
8024 if (n1PucchTkn.pres == TRUE)
8026 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
8027 TFU_HQ_RECP_REQ_N1PUCCH;
8028 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = n1PucchTkn.val;
8033 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
8034 TFU_HQ_RECP_REQ_NORMAL;
8035 multCnt = pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt;
8036 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.nCce[multCnt] =
8038 pucchInfo->pucchRecpInfo->t.pucchRecpReq.m[multCnt] =
8040 pucchInfo->pucchRecpInfo->t.pucchRecpReq.p[multCnt] =
8041 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
8043 pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt++;
8045 #else /* TFU_UPGRADE */
8047 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
8048 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_MULT;
8049 hqRecpReq->hqInfo.hqSz = noFdbks;
8051 resIdx = hqRecpReq->hqInfo.pucchResCnt;
8052 hqRecpReq->hqInfo.pucchResCnt++;
8055 if (n1PucchTkn.pres == TRUE)
8057 hqRecpReq->hqInfo.hqRes[resIdx] = n1PucchTkn.val;
8063 m = dlSf->dlFdbkInfo.m;
8065 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
8066 nP = cellCb->rgSchTddNpValTbl[P];
8067 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
8068 hqRecpReq->hqInfo.hqRes[resIdx] = (M - m - 1)* nP +
8069 (m * nPlusOne) + pdcch->nCce +
8070 cellCb->pucchCfg.n1PucchAn;
8072 #endif /* TFU_UPGRADE */
8073 /* If all the DL subframes are scanned, then
8074 * send TFU request*/
8076 if((elemIdx != noFdbks) && alloc)
8078 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
8079 (U8 *)&rnti, (U16) sizeof(rnti));
8084 pucchInfo->pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
8085 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
8086 &(pucchInfo->pucchRecpInfo->lnk));
8087 pucchInfo->pucchRecpInfo->lnk.node =
8088 (PTR)pucchInfo->pucchRecpInfo;
8089 /* Delete the entry after addition to the list */
8090 cmHashListDelete(&cellCb->ueTfuPendLst, (PTR) pucchInfo);
8096 *pucchInfoRef = pucchInfo;
8102 #ifdef RG_ULSCHED_AT_CRC
8103 /** @brief This function does all the processing related to a single downlink
8108 * Function: rgSCHTomUtlProcDlSfAtCrc
8111 * - collate control data for all UEs and send to PHY
8112 * - collate data buffers for all UEs and send to PHY
8114 * @param [in] RgSchDlSf *ulSf
8115 * @param [in] RgSchCellCb *cell
8116 * @param [in] TfuCntrlReqInfo *cntrlInfo
8117 * @param [out] RgSchErrInfo *err
8121 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc
8124 CmLteTimingInfo crntUlFrm,
8126 TfuCntrlReqInfo *cntrlInfo,
8130 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc (ulSf, crntUlFrm, cell, cntrlInfo, err)
8132 CmLteTimingInfo crntUlFrm;
8134 TfuCntrlReqInfo *cntrlInfo;
8138 Inst inst = cell->instIdx;
8141 TRC2(rgSCHTomUtlProcDlSfAtCrc);
8144 cntrlInfo->numDlActvUes = 0;
8145 cmLListInit(&cntrlInfo->phichLst);
8146 cmLListInit(&cntrlInfo->dlPdcchLst);
8147 cmLListInit(&cntrlInfo->ulPdcchLst);
8148 #ifdef TFU_ALLOC_EVENT_NO_INIT
8149 cntrlInfo->dlTiming.sfn = cntrlInfo->dlTiming.subframe = 0;
8153 cntrlInfo->ulTiming = crntUlFrm;
8154 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cntrlInfo->ulTiming, TFU_ULCNTRL_DLDELTA);
8156 cntrlInfo->cellId = cell->cellId;
8157 /* Fill PHICH info */
8158 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
8160 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PHICH info for "
8162 RGSCH_FREE_MEM(cntrlInfo);
8167 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) != ROK)
8169 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PDCCH info for "
8171 RGSCH_FREE_MEM(cntrlInfo);
8176 if(0 == cntrlInfo->ulMpdcchLst.count)
8183 if ((cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count) || RG_SCH_EMTC_GET_PDCCHLST_CNT(cntrlInfo))
8185 if (cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count)
8188 if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
8191 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for"
8197 RGSCH_FREE_MEM(cntrlInfo);
8201 #endif /* #ifdef RG_ULSCHED_AT_CRC*/
8204 /** @brief This function sends the SFN Tick to L3
8209 * Function: rgSCHTomUtlSendSfnTick
8211 * @param [in] RgSchCellCb *cell
8214 PRIVATE Void rgSCHTomUtlSendSfnTick
8219 PRIVATE Void rgSCHTomUtlSendSfnTick (cell)
8223 RgrTtiIndInfo *rgrTtiInd;
8225 TRC2(rgSCHTomUtlSendSfnTick);
8227 /* TTI to be sent to RRM only once per system frame */
8228 /* Added support for period = 0 to disable tick to RRM */
8229 if ((cell->rrmTtiIndPrd != 0) &&
8230 ((cell->crntTime.sfn % cell->rrmTtiIndPrd) == 0) &&
8231 (cell->crntTime.slot == 0))
8233 /* Allocate a TTI indication structure and send to RRM over RGR interface */
8234 if (rgSCHUtlAllocSBuf (cell->instIdx,
8235 (Data**)&rgrTtiInd, sizeof(RgrTtiIndInfo)) != ROK)
8237 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
8238 "Mem alloc failed for RGR TTI ind, cellId (%d))\n",
8242 rgrTtiInd->cellId = cell->cellId;
8243 //rgrTtiInd->hSfn = cell->crntTime.hSfn;
8244 rgrTtiInd->sfn = cell->crntTime.sfn;
8246 if (rgSCHUtlRgrTtiInd (cell, rgrTtiInd) != ROK)
8248 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
8249 "Failed to send RGR TTI ind, cellId (%d))\n",
8251 rgSCHUtlFreeSBuf(cell->instIdx, (Data**)&rgrTtiInd,
8252 sizeof(RgrTtiIndInfo));
8262 /* @brief Mark Dyn TDD CrntSfIdx.
8266 * Function: rgSCHDynTDDMrkCrntSfIdx
8267 * Purpose: update the dyn tdd sunframe index
8268 * @param[in] Inst schInst
8273 PRIVATE Void rgSCHDynTDDMrkCrntSfIdx
8278 PRIVATE Void rgSCHDynTDDMrkCrntSfIdx(schInst)
8282 RgSchDynTddCb *rgSchDynTddInfo = &(rgSchCb[schInst].rgSchDynTdd);
8284 TRC2(rgSCHDynTDDMrkCrntSfIdx)
8286 RG_SCH_DYN_TDD_MARKTYPE(rgSchDynTddInfo, rgSchDynTddInfo->crntDTddSfIdx,
8287 RG_SCH_DYNTDD_NOTDEF);
8288 rgSchDynTddInfo->crntDTddSfIdx = (rgSchDynTddInfo->crntDTddSfIdx + 1) %
8289 RG_SCH_DYNTDD_MAX_SFINFO;
8291 //printf("Initializing Index %d \n", rgSchDynTddInfo->crntDTddSfIdx);
8297 /** @brief This function fills the TTI timinig info for each cell
8301 * Function: rgSchTomFillCellTtiInfo
8303 * @param [in] TfuTtiIndInfo *ttiInd
8304 * @param [in] Inst schInst
8305 * @param [out] U8 *nCell
8306 * @param [out] RgSchCellCb *cell[]
8313 PRIVATE Void rgSchTomFillCellTtiInfo
8315 TfuTtiIndInfo *ttiInd,
8318 RgSchCellCb *cells[]
8321 PRIVATE Void rgSchTomFillCellTtiInfo (ttiInd, schInst, nCell, cells)
8322 TfuTtiIndInfo *ttiInd;
8325 RgSchCellCb *cells[];
8330 TfuTtiCellInfo *cellInfo;
8334 CmLteTimingInfo frm;
8336 TRC2 (rgSchTomFillCellTtiInfo);
8338 if (CM_LTE_MAX_CELLS < ttiInd->numCells)
8344 rgSCHDynTDDMrkCrntSfIdx(schInst);
8347 for (i = 0; i < ttiInd->numCells; i++)
8349 cellInfo = &ttiInd->cells[i];
8350 strtCellId = rgSchCb[schInst].genCfg.startCellId;
8351 Idx1 = (U8)((cellInfo->cellId - strtCellId)&(CM_LTE_MAX_CELLS-1));
8352 cell = rgSchCb[schInst].cells[Idx1];
8353 /* Validate the cell */
8356 /* Use SCH inst 0 print buff */
8357 RGSCHDBGERRNEW(schInst,(rgSchPBuf(schInst),
8358 "RgLiTfuTtiInd()No cell exists for cellId %d\n",
8362 *nCell = *nCell + 1;
8363 cells[i] = (RgSchCellCb *)cell;
8366 if(cell->schTickDelta != cellInfo->schTickDelta)
8368 printf("\nMukesh: Delta changed for cellId=%d: curr delta=%d new delta=%d\n"
8369 "dlblankSf=%d ulblankSf=%d dummyTti=%d \n",
8370 cell->cellId, cell->schTickDelta, cellInfo->schTickDelta, cellInfo->dlBlankSf,cellInfo->ulBlankSf,
8371 cellInfo->isDummyTti);
8373 RGSCH_UPDATE_DELTA(schInst, cellInfo->schTickDelta);
8374 cell->schTickDelta = cellInfo->schTickDelta;
8377 cell->stopSiSch = cellInfo->dlBlankSf;
8378 cell->stopDlSch = cellInfo->dlBlankSf;
8379 cell->stopUlSch = cellInfo->ulBlankSf;
8380 if (cellInfo->isDummyTti)
8382 cell->stopDlSch = TRUE;
8384 if((0 == (cellInfo->timingInfo.sfn % 30)) && (0 == cellInfo->timingInfo.slot))
8386 //printf("5GTF_CHECK rgSCHTOMTtiInd (%d : %d)\n", cellInfo->timingInfo.sfn, cellInfo->timingInfo.slot);
8389 RGSCHCPYTIMEINFO(cellInfo->timingInfo, cell->crntTime);
8390 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->hiDci0Time,
8391 TFU_ULCNTRL_DLDELTA);
8392 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->dlDciTime,
8393 TFU_DLCNTRL_DLDELTA);
8394 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->rcpReqTime,
8395 TFU_RECPREQ_DLDELTA);
8396 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->hqRlsTime,
8397 TFU_HQFBKIND_ULDELTA);
8398 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->dlSfRlsTime,
8401 RGSCHCPYTIMEINFO_EMTC(cellInfo->timingInfo, cell->crntTime);
8402 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->hiDci0Time,
8403 TFU_ULCNTRL_DLDELTA);
8404 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->dlDciTime,
8405 TFU_DLCNTRL_DLDELTA);
8406 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->rcpReqTime,
8407 TFU_RECPREQ_DLDELTA);
8408 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->hqRlsTime,
8409 TFU_HQFBKIND_ULDELTA);
8410 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->dlSfRlsTime,
8413 rgSCHCmnUpdVars(cell);
8414 cell->isDlDataAllwd = TRUE;
8415 /* Get DownLink SubFrame */
8416 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8417 frm = cell->crntTime;
8419 RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
8421 RGSCH_INCR_SUB_FRAME_EMTC(frm, RG_SCH_CMN_DL_DELTA);
8423 cellSch->dl.time = frm;
8429 U8 idx = (cell->crntTime.slot + RG_SCH_CMN_DL_DELTA) %
8430 RGSCH_NUM_SUB_FRAMES_5G;
8432 cell->isDlDataAllwd = RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, idx);
8434 /*ccpu00130639 -ADD - used in UL HARQ proc id calculation*/
8435 if((cell->crntTime.sfn == 0) && (cell->crntTime.slot == 0))
8437 /* sfn Cycle used for Tdd UL Harq Proc Determination.
8438 This sfn Cycle will have values from 0 to numUl Harq-1. */
8439 cell->tddHqSfnCycle = (cell->tddHqSfnCycle + 1 ) %
8440 (rgSchTddUlNumHarqProcTbl[cell->ulDlCfgIdx]);
8444 if(cell->emtcEnable)
8446 rgSCHUtlEmtcResPrcTti(cell);
8452 void schFillCrntTime(
8453 SlotIndInfo slotInd,
8457 for(cellCount = 0; cellCount < CM_LTE_MAX_CELLS; cellCount++)
8460 cell = rgSchCb[schInst].cells[cellCount];
8462 RGSCHCPYTIMEINFO(slotInd, cell->crntTime);
8464 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->hiDci0Time,
8465 TFU_ULCNTRL_DLDELTA);
8466 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->dlDciTime,
8467 TFU_DLCNTRL_DLDELTA);
8468 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->rcpReqTime,
8469 TFU_RECPREQ_DLDELTA);
8470 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->hqRlsTime,
8471 TFU_HQFBKIND_ULDELTA);
8472 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->dlSfRlsTime,
8475 RGSCH_INCR_SUB_FRAME(cell->crntTime, RG_SCH_CMN_DL_DELTA);
8477 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8478 cellSch->dl.time = cell->crntTime;
8482 /** @brief This function prepares the TTI for scheduling and
8483 * invokes the Common channel scheduler. Uplink scheduler
8484 * is invoked first if UL Scheduling at CRC is not enabled
8488 * Function: rgSchTomTtiUlAndDlCmnChSch
8490 * @param [out] RgSchCellCb *cell
8496 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch
8501 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch (cell)
8506 TRC2(rgSchTomTtiUlAndDlCmnChSch);
8508 cell->rlsHqArr[cell->crntHqIdx].numUes = 0;
8510 cell->crntHqIdx = cell->crntHqIdx % RGSCH_NUM_SUB_FRAMES;
8512 cmPrcTmr(&cell->tqCp, cell->tq, (PFV)rgSCHTmrProcTmr);
8513 rgSCHMeasGapANRepTtiHndl (cell);
8514 /* We need to fill the PHICH for the UL Data, first we need to get the UL
8515 * SF from Scheduler, next we fill the dlSf that goes out this TTI.
8516 * This must be performed prior to any other processing of the TTI
8517 * so that we do not wrap around and generate feedback prior to
8518 * reception of UL data.
8520 #ifndef RG_ULSCHED_AT_CRC
8523 U8 idx; /* Index into Uplink Sf array */
8525 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
8526 [cell->hiDci0Time.subframe];
8530 for(idx=0; idx < Mval; idx++)
8532 rgSCHCmnRlsUlSf(cell, idx);
8538 /* DTX processing for those Harq's which did not get feedback from L1 */
8539 rgSCHDhmRlsDlsfHqProc (cell, cell->hqRlsTime);
8540 /* Re-Init the Downlink subframe */
8541 rgSCHUtlDlRlsSubFrm(cell, cell->dlSfRlsTime);
8542 /* Added handling to retransmit
8543 * release PDCCH in case of DTX
8546 /*Check for DRX every TTI*/
8547 rgSCHDrxTtiInd(cell);
8549 /* For TDD, UL scheduling should happen after DL scheduling */
8551 #ifndef RG_ULSCHED_AT_CRC
8552 /* Perform UL scheduling */
8553 rgSCHCmnUlSch(cell);
8556 /* Perform DL scheduling for Common channels */
8557 rgSCHCmnDlCommonChSch(cell);
8562 /** @brief This function invokes the Non critical procedures like measurements,
8563 * and RGR configurations.
8567 * Function: rgSchTomTtiMiscFunctions
8569 * @param [in] RgSchCellCb *cell
8575 PRIVATE Void rgSchTomTtiMiscFunctions
8580 PRIVATE Void rgSchTomTtiMiscFunctions (cell)
8584 U8 suId = cell->tfuSap->sapCfg.suId;
8586 TRC2(rgSchTomTtiMiscFunctions);
8588 /* Invoke RAM Tti Handler */
8589 rgSCHRamTtiHndlr(cell);
8591 /* Handle RGR configurations */
8592 rgSCHGomTtiHndlr(cell, suId);
8594 if((RGM_PRB_REPORT_START == cell->prbUsage.prbRprtEnabld)
8595 && (!(cell->prbUsage.rprtPeriod) || ((glblTtiCnt % cell->prbUsage.rprtPeriod) == 0)))
8597 rgSCHUtlUpdAvgPrbUsage(cell);
8599 rgSCHL2Meas(cell,FALSE);
8602 /* LTE_ADV_FLAG_REMOVED_START */
8603 /* Report ABS Load information to application periodically */
8604 if((RGR_ENABLE == cell->lteAdvCb.absCfg.status) &&
8605 (cell->lteAdvCb.absCfg.absLoadPeriodicity))
8607 RgrLoadInfIndInfo *rgrLoadInf;
8610 cell->lteAdvCb.absLoadTtiCnt++;
8611 if(cell->lteAdvCb.absLoadTtiCnt >= cell->lteAdvCb.absCfg.absLoadPeriodicity)
8614 if(rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&rgrLoadInf,
8615 sizeof(RgrLoadInfIndInfo)) != ROK)
8617 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),"Could not "
8618 "allocate memory for sending LoadInfo\n"));
8621 cell->lteAdvCb.absLoadTtiCnt = 0;
8622 rgrLoadInf->cellId = cell->cellId;
8623 rgrLoadInf->bw = cell->bwCfg.dlTotalBw;
8624 rgrLoadInf->type = RGR_ABS;
8625 for(idx= 0; idx<RGR_ABS_PATTERN_LEN; idx++)
8627 rgrLoadInf->u.absLoadInfo[idx] = cell->lteAdvCb.absLoadInfo[idx];
8628 cell->lteAdvCb.absLoadInfo[idx] = 0;
8630 rgSCHUtlRgrLoadInfInd(cell, rgrLoadInf);
8635 if(cell->isDlDataAllwd)
8637 /* Calling function to update CFI parameters*/
8638 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
8642 /* Incrementing the ttiCnt in case of UL subframe */
8643 if(!cell->dynCfiCb.switchOvrInProgress)
8645 cell->dynCfiCb.ttiCnt++;
8649 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
8652 /* LTE_ADV_FLAG_REMOVED_END */
8657 /** @brief This function invokes the Downlink scheduler
8661 * Function: rgSchTomTtiDlSch
8663 * @param [in] RgSchCellCb *cell
8669 PRIVATE Void rgSchTomTtiDlSch
8674 PRIVATE Void rgSchTomTtiDlSch (cell)
8678 TRC2(rgSchTomTtiDlSch);
8680 if (cell->isDlDataAllwd && (cell->stopDlSch == FALSE))
8682 rgSCHCmnDlSch(cell);
8688 /** @brief This function invokes Consolidates the allocations
8689 * send the Subframe allocation info to MAC
8693 * Function: rgSchTomTtiCnsldtSfAlloc
8695 * @param [in] RgSchCellCb *cell
8701 PRIVATE Void rgSchTomTtiCnsldtSfAlloc
8706 PRIVATE Void rgSchTomTtiCnsldtSfAlloc (cell)
8711 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8713 dlSf = rgSCHUtlSubFrmGet(cell, cellSch->dl.time);
8715 TRC2(rgSchTomTtiCnsldtSfAlloc);
8717 /* Prepare Subframe allocation info and send to MAC */
8718 rgSCHCmnCnsldtSfAlloc(cell);
8720 /* Call ACK NACK module to add to dlsf Queue */
8721 rgSCHAckNakRepAddToQ(cell, dlSf);
8723 rgSCHTomUtlProcTA(cell);
8728 /** @brief This function prepares the DL and UL Config requests
8733 * Function: rgSchTomTtiL1DlAndUlCfg
8735 * @param [in] RgSchCellCb *cell
8741 PRIVATE Void rgSchTomTtiL1DlAndUlCfg
8744 RgTfuCntrlReqInfo *cntrlInfo
8747 PRIVATE Void rgSchTomTtiL1DlAndUlCfg (cell, cntrlInfo)
8749 RgTfuCntrlReqInfo *cntrlInfo;
8752 RgSchDlSf *dlSf = rgSCHUtlSubFrmGet (cell, cell->dlDciTime);
8753 RgSchDlSf *ulSf = rgSCHUtlSubFrmGet (cell, cell->hiDci0Time);
8756 TRC2(rgSchTomTtiL1DlAndUlCfg);
8758 rgSCHTomUtlProcDlSf (dlSf, ulSf, cell, cntrlInfo, &err);
8759 /* Mark this frame as sent */
8760 dlSf->txDone = TRUE;
8762 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
8763 rgBwAlcnt[dlSf->sfNum] ++;
8767 rgSCHTomUtlProcTddUlSf(cell);
8769 rgSCHTomUtlProcUlSf (cell, &err);
8775 /** @brief This function prepares does the Downlink subframe re-init and
8776 * Harq DTX processing
8780 * Function: rgSchTomUtlTddRlsSfAndHarq
8782 * @param [in] RgSchCellCb *cell
8788 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq
8793 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq (cell)
8797 TRC2(rgSchTomUtlTddRlsSfAndHarq);
8799 /* ccpu00132341-MOD- rgSchTddRlsDlSubfrmTbl is dependent on DELTA(=2).
8800 * Instead rgSchTddDlAscSetIdxKTbl can be used as the K set gives proper
8802 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper
8803 * output if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME()
8804 * as it is serving the purpose */
8805 if(rgSchTddDlAscSetIdxKTbl[cell->ulDlCfgIdx][cell->hqRlsTime.subframe].
8808 /* ccpu00132341-MOD- Providing the UL SF timing for avoiding
8809 * calculation inside the function */
8810 rgSCHDhmTddRlsSubFrm(cell, cell->hqRlsTime);
8811 rgSCHDhmRlsDlsfHqProc(cell, cell->hqRlsTime);
8816 /** @brief This function processes the UL subframe and fills TFU reception
8821 * Function: rgSCHTomUtlProcTddUlSf
8823 * @param [in] RgSchCellCb *cell
8829 PRIVATE Void rgSCHTomUtlProcTddUlSf
8834 PRIVATE Void rgSCHTomUtlProcTddUlSf (cell)
8840 TRC2(rgSCHTomUtlProcTddUlSf);
8842 if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8843 [cell->rcpReqTime.subframe] == RG_SCH_TDD_UL_SUBFRAME)
8845 if (rgSCHTomUtlProcUlSf (cell, &err) != ROK)
8847 /* fill in err type and call sta ind */
8848 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8849 "Unable to process Uplink subframe for cellId (%d))\n",
8853 /* TDD Fix , to allow Special SF SRS CFg */
8854 else if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8855 [cell->rcpReqTime.subframe] == RG_SCH_TDD_SPL_SUBFRAME)
8857 if (rgSCHTomUtlPrcUlTddSpclSf(cell, &err) != ROK)
8859 /* fill in err type and call sta ind */
8860 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8861 "Unable to process Sipceial subframe for cellId (%d))\n",
8871 /**********************************************************************
8874 **********************************************************************/