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 "envopt.h" /* environment options */
41 #include "envdep.h" /* environment dependent */
42 #include "envind.h" /* environment independent */
43 #include "gen.h" /* general layer */
44 #include "ssi.h" /* system services */
45 #include "cm5.h" /* common timers defines */
46 #include "cm_hash.h" /* common hash list defines */
47 #include "cm_llist.h" /* common linked list defines */
48 #include "cm_mblk.h" /* memory management */
49 #include "cm_tkns.h" /* common tokens */
50 #include "cm_lte.h" /* common tokens */
51 #include "tfu.h" /* RGU defines */
52 #include "lrg.h" /* layer management defines for LTE-MAC */
53 #include "rgr.h" /* layer management defines for LTE-MAC */
54 #include "rgm.h" /* layer management defines for LTE-MAC */
55 #include "rg_env.h" /* defines and macros for MAC */
56 #include "rg_sch_err.h" /* defines and macros for MAC */
57 #include "rg_sch_inf.h" /* defines and macros for MAC */
58 #include "rg_sch.h" /* defines and macros for MAC */
59 #include "rg_sch_cmn.h" /* typedefs for MAC */
60 #include "rl_interface.h"
61 #include "rl_common.h"
64 /* header/extern include files (.x) */
65 #include "gen.x" /* general layer typedefs */
66 #include "ssi.x" /* system services typedefs */
67 #include "cm5.x" /* common timers */
68 #include "cm_hash.x" /* common hash list */
69 #include "cm_lib.x" /* common library */
70 #include "cm_llist.x" /* common linked list */
71 #include "cm_mblk.x" /* memory management */
72 #include "cm_tkns.x" /* common tokens */
73 #include "cm_lte.x" /* common tokens */
74 #include "tfu.x" /* RGU types */
75 #include "lrg.x" /* layer management typedefs for MAC */
76 #include "rgr.x" /* layer management typedefs for MAC */
77 #include "rgm.x" /* layer management typedefs for MAC */
78 #include "rg_sch_inf.x" /* typedefs for Scheduler */
79 #include "rg_sch.x" /* typedefs for MAC */
80 #include "rg_sch_cmn.x" /* typedefs for MAC */
82 #include "rg_sch_emtc_ext.x"
86 EXTERN Bool rgSCHEmtcChkEmtcUe ARGS(
91 EXTERN Void rgSchTomTtiEmtcSched ARGS(
96 EXTERN S16 rgSCHEmtcRamVldtProcRaReq
101 TfuRaReqIndInfo *raReqInd,
106 EXTERN Void rgSCHEmtcUpdCqiInfo
109 RgSchUePCqiCb *cqiCb,
112 EXTERN Void rgSCHEmtcUpdSRInfo
117 EXTERN Void rgSCHCmnEmtcHdlCrcFailInd
122 EXTERN S16 rgSCHEmtcTomUtlProcAtCrc
125 CmLteTimingInfo crntHiDci0Frm,
126 TfuCntrlReqInfo *cntrlInfo,
129 EXTERN Void rgSCHEmtcInitUeRecpReqLst
131 TfuRecpReqInfo *recpReqInfo
133 EXTERN Void rgSCHEmtcFillPucchRecpInfo
136 RgSchDlHqProcCb *hqCb,
139 EXTERN Bool rgSCHEmtcAddRecpInfoToLst
141 RgSchDlHqProcCb *hqCb,
142 TfuRecpReqInfo *recpReqInfo,
143 TfuUeRecpReqInfo *pucchRecpInfo,
146 EXTERN Void rgSCHEmtcWillUeRptCqi
151 EXTERN Void rgSchEmtcTomTtiCnsldtSfAlloc
156 EXTERN S16 rgSchEmtcTomTtiL1DlAndUlCfg
159 RgTfuCntrlReqInfo *cntrlInfo
162 EXTERN S16 rgSCHTomEmtcUtlFillDatRecpReq
164 TfuRecpReqInfo *recpReqInfo,
170 EXTERN S16 rgSCHEmtcTomUtlFillHqFdbkRecpReq
172 TfuRecpReqInfo *recpReqInfo,
178 EXTERN S16 rgSCHEmtcDhmRlsDlsfHqProc
181 CmLteTimingInfo timingInfo
184 EXTERN Void rgSCHEmtcCmnUlSch
189 #ifdef RG_ULSCHED_AT_CRC
190 EXTERN S16 rgSCHEmtcTomUtlProcDlSfAtCrc
193 CmLteTimingInfo crntUlFrm,
195 TfuCntrlReqInfo *cntrlInfo,
199 EXTERN RgSchEmtcDlSf* rgSCHEmtcUtlSubFrmGet
206 EXTERN U32 gDlMpdcchBlank;
207 EXTERN U32 gUlMpdcchBlank;
208 EXTERN S16 rgSCHUtlIotResPrcTti
215 EXTERN RgSchUeCb* rgSCHCmnGetHoUe
220 EXTERN RgSchUeCb* rgSCHCmnGetPoUe
224 CmLteTimingInfo timingInfo
226 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq ARGS(
231 TfuUeRecpReqInfo *datRecpInfo,
232 CmLteTimingInfo *timeInfo,
237 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq ARGS(
241 TfuUeRecpReqInfo *datRecpInfo,
242 CmLteTimingInfo *timeInfo,
247 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq ARGS(
251 TfuUeRecpReqInfo *datRecpInfo,
252 CmLteTimingInfo *timeInfo,
257 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq ARGS(
261 TfuUeRecpReqInfo *datRecpInfo,
262 CmLteTimingInfo *timeInfo,
268 EXTERN U32 delayedApiCnt;
269 U32 gPCellTb1AckCount=0,gPCellTb2AckCount=0,gPCellTb1NackCount=0,gPCellTb2NackCount=0;
270 U32 gSCellSchedCount=0,gPrimarySchedCount=0;
271 U32 gSCellTb1AckCount=0,gSCellTb2AckCount=0,gSCellTb1NackCount=0,gSCellTb2NackCount=0;
272 U32 gPCellTb1DtxCount = 0, gPCellTb2DtxCount = 0, gSCellTb1DtxCount = 0, gSCellTb2DtxCount = 0;
273 U32 gHqFdbkCount = 0;
277 U32 gCqiRecpCount = 0;
278 U32 gCqiRecpPuschCount = 0;
279 U32 gCqiRcvdCount = 0;
280 Bool gF1bCsPres = FALSE;
282 U32 gCqiReqCount = 0;
284 U32 gACqiRcvdCount = 0;
285 U32 gCqiReptToAppCount = 0;
286 U32 gRawACqiCount= 0;
287 U32 gCqiDropCount,gPucchDropCount;
288 U32 gCqiPucchLowSnrDropCount,gCqiPucchConfMaskDropCount,gCqiPuschConfMaskDropCount;
290 U32 gUlCrcFailCount = 0;
291 U32 gUlCrcPassCount = 0;
292 U32 gPuschCqiDropCount = 0;
293 U32 gCaDbgCaFrmt = 0;
294 U32 gCaDbgNonCaFrmt = 0;
295 U32 gPcellZeroBoOcc=0,gScellZeroBoOcc=0, dbgDelayedDatReqInMac=0,gDropDatReqCnt=0, gIccPktRcvrMemDropCnt=0;
299 U32 gUlCrcFailCounter = 0;
300 U32 gUlCrcPassCounter = 0;
304 EXTERN U32 gUl5gtfPdcchSend;
305 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq ARGS(
307 TfuRecpReqInfo *recpReqInfo,
316 PUBLIC U32 rgBwAlloInfo[RGSCH_NUM_SUB_FRAMES]; /* Num of Rbs Allocated in each SF */
317 PUBLIC U32 rgBwAlcnt[RGSCH_NUM_SUB_FRAMES]; /*Num of times Allocation done in each Subframe */
320 /* rg006.201: [ccpu000111706, ccpu00112394]: Separated UL and DL TTI
327 U32 gDlNumUePerTti[20] = {0};
328 U32 gUlNumUePerTti[20] = {0};
329 PRIVATE S16 rgSCHTomUtlProcDlSf ARGS((
333 RgTfuCntrlReqInfo *cntrlInfo,
335 #ifdef RG_ULSCHED_AT_CRC
336 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc ARGS((
338 CmLteTimingInfo crntUlFrm,
340 TfuCntrlReqInfo *cntrlInfo,
342 #endif /* RG_ULSCHED_AT_CRC */
345 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf ARGS((
348 #endif /* TFU_UPGRADE */
350 PRIVATE S16 rgSCHTomUtlFillPhich ARGS((
352 TfuCntrlReqInfo *cntrlInfo,
356 PRIVATE S16 rgSCHTomUtlFillDlPdcch ARGS((
358 TfuCntrlReqInfo *cntrlInfo,
361 PRIVATE S16 rgSCHTomUtlFillUlPdcch ARGS((
363 TfuCntrlReqInfo *cntrlInfo,
367 PRIVATE S16 rgSCHTomUtlProcTA ARGS((
370 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq ARGS((
371 TfuRecpReqInfo *recpReq,
376 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq ARGS((
377 TfuRecpReqInfo *recpReq,
383 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq ARGS
387 TfuUeRecpReqInfo *datRecpInfo
390 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr ARGS
394 TfuRecpReqInfo *recpReqInfo,
395 TfuUeRecpReqInfo *pucchRecpInfo,
399 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq ARGS
402 TfuRecpReqInfo *recpReqInfo,
404 TfuUeRecpReqInfo *pucchRecpInfo,
406 Bool isDatPresOnSecCell
409 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo ARGS
414 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz ARGS
421 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSzPucchMode21 ARGS
424 TfuCqiPucchMode21 *mode21Info,
429 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion ARGS
436 PRIVATE S16 rgSCHTomUtlMovePcqiNxtOccasion ARGS
443 PRIVATE S16 rgSCHTomUtlMovePriNxtOccasion ARGS
450 PRIVATE S16 rgSCHTomUtlMoveSrNxtOccasion ARGS
456 PRIVATE S16 rgSCHTomUtlMoveSrsNxtOccasion ARGS
462 PRIVATE Bool rgSCHTomUtlFillDatHarqRecpReq ARGS
466 TfuUeRecpReqInfo *datRecpInfo,
467 TfuRecpReqInfo *recpReqInfo
470 PRIVATE S16 rgSCHTomUtlFillSrRecpReq ARGS((
471 TfuRecpReqInfo *recpReq,
476 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi ARGS((
478 Bool *willueRprtCqiRii));
480 PRIVATE S16 rgSCHTomUtlFillRiRecpReq ARGS((
481 TfuRecpReqInfo *recpReq,
486 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq ARGS((
487 TfuRecpReqInfo *recpReq,
492 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq ARGS((
493 TfuRecpReqInfo *recpReq,
498 PRIVATE S16 rgSCHTomUtlGenIndices ARGS((
503 TfuSubbandInfo* sbInfo));
507 PRIVATE S16 rgSCHTomUtlFillDatRecpReq ARGS((
508 TfuRecpReqInfo *recpReq,
513 PRIVATE S16 rgSCHTomUtlFillDatRecpReq ARGS((
514 TfuRecpReqInfo *recpReq,
521 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk ARGS((
522 TfuRecpReqInfo *recpReqInfo,
533 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk ARGS((
534 TfuRecpReqInfo *recpReqInfo,
545 PRIVATE S16 rgSCHTomUtlFillSfHqFdbk ARGS((
546 TfuRecpReqInfo *recpReqInfo,
557 PRIVATE S16 rgSCHTomUtlFillSfHqFdbk ARGS((
558 TfuRecpReqInfo *recpReqInfo,
569 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe ARGS((
570 RgSchDlHqProcCb *hqCb,
571 TfuRecpReqInfo *recpReqInfo,
580 RgrTddAckNackMode ackNackMode,
581 RgSchUePucchRecpInfo **pucchInfoRef,
589 EXTERN PUBLIC Void rgSCHCmnDlSpsSch (RgSchCellCb *cell);
592 PRIVATE S16 rgSCHTomCnsdrRelPdcch ARGS
596 TfuRecpReqInfo *recpReqInfo,
601 PRIVATE S16 rgSCHTomCnsdrRelPdcch ARGS
605 TfuRecpReqInfo *recpReqInfo,
612 PRIVATE Void rgSchTomTtiMiscFunctions ARGS
617 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch ARGS
622 PRIVATE Void rgSchTomTtiDlSch ARGS
627 PRIVATE Void rgSchTomTtiCnsldtSfAlloc ARGS
632 PRIVATE Void rgSchTomTtiL1DlAndUlCfg ARGS
635 RgTfuCntrlReqInfo *cntrlInfo
639 PRIVATE Void rgSCHTomUtlSendSfnTick ARGS
645 PRIVATE Void rgSchTomFillCellTtiInfo ARGS
647 TfuTtiIndInfo *ttiInd,
653 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq ARGS
657 PRIVATE Void rgSCHTomUtlProcTddUlSf ARGS
662 PRIVATE Void rgSCHTomUtlGethqRes ARGS
670 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1 ARGS
672 RgSchDlHqProcCb *hqCb,
673 TfuUePucchRecpReq *hqRecpReq,
679 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234 ARGS
681 RgSchDlHqProcCb *hqCb,
682 TfuUePucchRecpReq *hqRecpReq,
692 PUBLIC U32 rgDlCqiRptCnt[16], rgTotDlCqiRpt;
695 U32 rgSch5gtfCqi2Mcs[15] =
696 {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
698 /* forward references */
700 /*HARQ Feedback interpretation in accordance with Femto Forum.
701 Note: There is no value as '0' in Femto Forum Spec but in order to retain
702 the existing usage in MAC (and its Acceptance), its being considered*/
703 CONSTANT PRIVATE U8 rgSchTomHqFbkMap[8] = {0,1,0,0,4,4,4,4};
704 /*added #defines instead of magic numbers*/
705 CONSTANT PRIVATE U32 rgSCHTomBinCoe[RG_SCH_MAX_NUM_UE_SEL_SUBBANDS][RG_SCH_MAX_TOT_NUM_SUBBANDS]={
706 {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},
707 {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},
708 {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},
709 {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},
710 {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},
711 {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}
715 /*ccpu00116923 - ADD - SRS present support*/
716 /*Tables Derived from 3GPP TS 36.211 Section 5.5.3.3 */
717 /* Table 5.5.3.3-1 */
719 CONSTANT PUBLIC RgSchFddCellSpSrsSubfrmTbl rgSchFddCellSpSrsSubfrmTbl = {
720 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE},
721 {TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE},
722 {FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE},
723 {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE},
724 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
725 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE},
726 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE},
727 {TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE},
728 {FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE},
729 {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
730 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
731 {FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
732 {FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
733 {TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE},
734 {TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE},
735 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}
738 /* Table 5.5.3.3-2 */
739 CONSTANT PUBLIC RgSchTddCellSpSrsSubfrmTbl rgSchTddCellSpSrsSubfrmTbl = {
740 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
741 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE},
742 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE},
743 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE},
744 {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE},
745 {FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE},
746 {FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE},
747 {FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE},
748 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
749 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE},
750 {FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE},
751 {FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE},
752 {FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE},
753 {FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE},
754 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
755 {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}
758 PUBLIC S8 rgSchCmnAper20n22DiffCqi[4] = {1, 2, 3, 4};
759 PUBLIC S8 rgSchCmnAper30n31DiffCqi[4] = {0, 1, 2, -1};
763 * @brief get Ue for dedicated preamble rach
767 * Function: rgSCHGetDedPrmUe
769 * Invoked by: rgSCHTomRaReqInd
771 * @param[in] RgSchCellCb *cell
772 * @param[in] TfuRaReqIndInfo *raReqInd
778 PUBLIC S16 rgSCHGetDedPrmUe
782 CmLteTimingInfo timingInfo,
786 PUBLIC S16 rgSCHGetDedPrmUe(cell, rapId, timingInfo, ue)
789 CmLteTimingInfo timingInfo;
793 RgSchCmnCell *cellSch = (RgSchCmnCell *)(cell->sc.sch);
795 printf("rapId[%d] cellSch->rachCfg.dedPrmStart[%d] cellSch->rachCfg.numDedPrm[%d]\n",rapId,cellSch->rachCfg.dedPrmStart,cellSch->rachCfg.numDedPrm);
796 /* Finding UE in handOver List */
797 if ((rapId < cellSch->rachCfg.dedPrmStart) ||
798 (rapId > cellSch->rachCfg.dedPrmStart +
799 cellSch->rachCfg.numDedPrm - 1))
801 /* This ded Preamble corresponds to handover */
802 *ue = rgSCHCmnGetHoUe(cell, rapId);
803 printf(" his ded Preamble corresponds to hando\n");
805 else/* Finding UE from PDCCH Order Mappings */
807 /* Get the UE which has transmitted this RaReq */
808 *ue = rgSCHCmnGetPoUe(cell, rapId, timingInfo);
809 printf(" ==== inding UE from PDCCH Order Mapping\n");
814 * @brief Handler for processing Random Access request indication
819 * Function: rgSCHTomRaReqInd
821 * Handler for processing Random Access request indication recieved from
824 * Invoked by: RgLiTfuRaReqInd of LIM
827 * - Validate the information received: cellId value and raRnti values
828 * - Process the request: Call rgSCHRamProcRaReq (cell, raRnti, raReqInd)
830 * @param[in] RgSchCellCb *cell
831 * @param[in] TfuRaReqIndInfo *raReqInd
837 PUBLIC S16 rgSCHTomRaReqInd
840 TfuRaReqIndInfo *raReqInd
843 PUBLIC S16 rgSCHTomRaReqInd(cell, raReqInd)
845 TfuRaReqIndInfo *raReqInd;
852 Bool isEmtcUe = FALSE;
854 RgSchUeCb *ue = NULLP;
856 TRC2(rgSCHTomRaReqInd);
858 if(cell->cellId != raReqInd->cellId)
860 err.errType = RGSCHERR_TOM_RAREQIND;
861 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
862 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
863 "rgSCHTomRaReqInd(): No cell found with raReq cellId = (%d) errorType (%d)"
864 " errorCause(%d)",raReqInd->cellId, err.errType, err.errCause);
868 for (raRntiCnt = 0; raRntiCnt < raReqInd->nmbOfRaRnti; raRntiCnt++)
870 for (raReqCnt = 0; raReqCnt < raReqInd->rachInfoArr->numRaReqInfo; raReqCnt++)
872 rapId = raReqInd->rachInfoArr[raRntiCnt].raReqInfoArr[raReqCnt].rapId;
874 if(RGSCH_IS_DEDPRM(cell, rapId))
876 rgSCHGetDedPrmUe(cell, rapId, raReqInd->timingInfo, &ue);
879 /* Since rapId is within dedicated range and No ue context
880 * is found means it is a spurious rach. So ignore it.*/
885 if(FALSE == isEmtcUe)
887 #if (ERRCLASS & ERRCLS_DEBUG)
888 if(raReqInd->rachInfoArr[raRntiCnt].raRnti > RGSCH_MAX_RA_RNTI)
890 RGSCHLOGERROR(cell->instIdx, ERRCLS_INT_PAR, ERG013,
891 (ErrVal)raReqInd->rachInfoArr[raRntiCnt].raRnti,
892 ("rgSCHTomRaReqInd(): raRnti is out of range\n"));
896 ret = rgSCHRamProcRaReq(raReqCnt, cell, raReqInd->rachInfoArr[raRntiCnt].raRnti,
897 (TfuRachInfo *)&raReqInd->rachInfoArr[raRntiCnt],
898 raReqInd->timingInfo, ue, &err);
901 err.errType = RGSCHERR_TOM_RAREQIND;
902 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
903 "RARNTI:%d rgSCHTomRaReqInd(): RAM processing failed errType(%d) "
904 "errCause(%d)", raReqInd->rachInfoArr[raRntiCnt].raRnti,
905 err.errType, err.errCause);
912 } /* rgSCHTomRaReqInd */
916 * @brief Handler for processing uplink CQI indication recieved from PHY.
920 * Function: rgSCHTomUlCqiInd
922 * Handler for processing uplink CQI indication recieved from PHY.
924 * Invoked by: RgLiTfuUlCqiInd
928 * - Invoke scheduler to push reported CQI info rgSCHUtlUlCqiInd
930 * @param[in] RgSchCellCb *cell
931 * @param[in] TfuUlCqiIndInfo *ulCqiInd
937 PUBLIC S16 rgSCHTomUlCqiInd
940 TfuUlCqiIndInfo *ulCqiInd
943 PUBLIC S16 rgSCHTomUlCqiInd(cell, ulCqiInd)
945 TfuUlCqiIndInfo *ulCqiInd;
950 TfuUlCqiRpt *ulCqiInfo;
951 TRC2(rgSCHTomUlCqiInd);
953 node = ulCqiInd->ulCqiRpt.first;
954 if(cell->cellId != ulCqiInd->cellId)
956 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
957 "rgSCHTomUlCqiInd() Unable to get the ulCqiInd cell with id(%d)",
962 for (;node; node=node->next)
964 ulCqiInfo = (TfuUlCqiRpt *)node->node;
965 #if (ERRCLASS & ERRCLS_DEBUG)
966 if(ulCqiInfo->numSubband == 0)
968 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Num Subband is"
969 "out of range RNTI:%d",ulCqiInfo->rnti);
973 if((ue = rgSCHDbmGetUeCb(cell, ulCqiInfo->rnti)) == NULLP)
976 if((ue = rgSCHDbmGetSpsUeCb(cell, ulCqiInfo->rnti)) == NULLP)
979 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get "
980 "the ue for RNTI:%d", ulCqiInfo->rnti);
984 /* wideband cqi is directly reported now. and also isTxPort0 */
985 rgSCHUtlUlCqiInd(cell, ue, ulCqiInfo);
988 } /* rgSCHTomUlCqiInd */
991 * @brief Handler for processing PUCCH power adjustment indication
995 * Function: rgSCHTomPucchDeltaPwrInd
997 * Handler for processing PUCCH power adjustment indication
1000 * Invoked by: RgLiTfuPucchDeltaPwrInd
1004 * - Invoke scheduler to push reported CQI info rgSCHUtlPucchDeltaPwrInd
1006 * @param[in] RgSchCellCb *cell
1007 * @param[in] TfuPucchDeltaPwrIndInfo *pucchDeltaPwr
1013 PUBLIC S16 rgSCHTomPucchDeltaPwrInd
1016 TfuPucchDeltaPwrIndInfo *pucchDeltaPwr
1019 PUBLIC S16 rgSCHTomPucchDeltaPwrInd(cell, pucchDeltaPwr)
1021 TfuPucchDeltaPwrIndInfo *pucchDeltaPwr;
1026 TfuPucchDeltaPwr *ueElem;
1028 TRC2(rgSCHTomPucchDeltaPwrInd);
1030 if(cell->cellId != pucchDeltaPwr->cellId)
1032 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
1033 "rgSCHTomPucchDeltaPwrInd() Unable to get the pucchDeltaPwr cell with id(%d)",
1034 pucchDeltaPwr->cellId);
1038 node = pucchDeltaPwr->pucchDeltaPwrLst.first;
1039 for (;node; node=node->next)
1041 ueElem = (TfuPucchDeltaPwr *)node->node;
1042 if((ue = rgSCHDbmGetUeCb(cell, ueElem->rnti)) == NULLP)
1045 if((ue = rgSCHDbmGetSpsUeCb(cell, ueElem->rnti)) == NULLP)
1048 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d "
1049 "rgSCHTomPucchDeltaPwrInd() Unable to get the ue ",
1054 rgSCHUtlPucchDeltaPwrInd(cell, ue, ueElem->pucchDeltaPwr);
1057 } /* rgSCHTomPucchDeltaPwrInd */
1060 * @brief Handler for processing harq ACK/NACK indication recieved from PHY.
1064 * Function: rgSCHTomHarqAckInd
1066 * Handler for processing harq ACK/NACK indication recieved from PHY.
1068 * Invoked by: RgLiTfuHqInd
1071 * For each HqAckInfo received
1073 * - If UE doesnt exist look for a RaCb and invoke rgSCHRamMsg4FdbkInd
1074 * - Invoke HARQ module to pass HARQ-ACK info rgSCHDhmHqFdbkInd
1076 * @param[in] TfuHqIndInfo *harqAckInd
1082 PUBLIC S16 rgSCHTomHarqAckInd
1085 TfuHqIndInfo *harqAckInd
1088 PUBLIC S16 rgSCHTomHarqAckInd(cell, harqAckInd)
1090 TfuHqIndInfo *harqAckInd;
1103 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1105 RgSchCellCb *iterCellP;
1107 TRC2(rgSCHTomHarqAckInd);
1109 if(cell->cellId != harqAckInd->cellId)
1111 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() Unable to get"
1112 " the cell for cellId (%d)", harqAckInd->cellId);
1113 err.errType = RGSCHERR_TOM_HARQACKIND;
1114 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
1118 node = harqAckInd->hqIndLst.first;
1119 for (;node; node=node->next)
1121 hqInfo = (TfuHqInfo *)node->node;
1123 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1124 TfuHqFdbk fdbk = hqInfo->isAck[0];
1125 raCb = rgSCHDbmGetRaCb (cell, hqInfo->rnti);
1126 ue = rgSCHDbmGetUeCb (cell, hqInfo->rnti);
1127 if (ue != NULLP && raCb == NULLP)
1129 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, harqAckInd->timingInfo, fdbk, &err)) != ROK)
1131 err.errType = RGSCHERR_TOM_HARQACKIND;
1132 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1133 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1134 err.errType, err.errCause);
1142 if ((rgSCHDhmRlsDlsfHqProc (cell, harqAckInd->timingInfo)) != ROK)
1144 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
1145 "subframe for cellId (%d) ", cell->cellId);
1146 err.errType = RGSCHERR_TOM_HARQACKIND;
1149 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
1151 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
1153 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
1155 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
1156 if(rlsHqBufs->numUes)
1158 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
1159 RgSchMacRlsHq (&pst, rlsHqBufs);
1161 rlsHqBufs->numUes = 0;
1165 rlsHqBufs->numUes = 0;
1166 node = harqAckInd->hqIndLst.first;
1167 for (;node; node=node->next)
1169 hqInfo = (TfuHqInfo *)node->node;
1170 for(tbCnt=0; tbCnt<TFU_MAX_HARQ_FDBKS; tbCnt++)
1172 hqInfo->isAck[tbCnt]=(TfuHqFdbk)rgSchTomHqFbkMap[hqInfo->isAck[tbCnt]];
1174 raCb = rgSCHDbmGetRaCb (cell, hqInfo->rnti);
1175 ue = rgSCHDbmGetUeCb (cell, hqInfo->rnti);
1176 if (ue == NULLP && raCb != NULLP)
1179 rgSCHRamMsg4FdbkInd (raCb);
1181 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1182 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1184 err.errType = RGSCHERR_TOM_HARQACKIND;
1185 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1186 " feedback processing failed errType(%d) errCause(%d)",
1187 err.errType, err.errCause);
1192 else if (ue != NULLP && raCb == NULLP)
1194 /* Get the Downlink HARQ entity from ue */
1195 if ((rgSCHDhmHqFdbkInd (ue, RGSCH_HQ_FDB_IND_CB_TYPE_HQ_ENT,
1196 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1198 err.errType = RGSCHERR_TOM_HARQACKIND;
1199 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1200 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1201 err.errType, err.errCause);
1205 else if (ue != NULLP && raCb != NULLP)
1207 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1208 cell, harqAckInd->timingInfo, hqInfo, rlsHqBufs, &err)) != ROK)
1210 err.errType = RGSCHERR_TOM_HARQACKIND;
1211 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1212 " feedback processing failed errType(%d) errCause(%d).",
1213 err.errType, err.errCause);
1219 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1220 "UE CB or RA CB ", hqInfo->rnti);
1221 err.errType = RGSCHERR_TOM_HARQACKIND;
1226 /* Check with TDD call DHM*/
1227 if ((rgSCHDhmRlsDlsfHqProc (cell, harqAckInd->timingInfo)) != ROK)
1229 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
1230 "subframe for cellId (%d) ", harqAckInd->cellId);
1231 err.errType = RGSCHERR_TOM_HARQACKIND;
1234 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
1236 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
1238 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
1240 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
1241 if(rlsHqBufs->numUes)
1243 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
1244 RgSchMacRlsHq (&pst, rlsHqBufs);
1246 rlsHqBufs->numUes = 0;
1251 } /* rgSCHTomHarqAckInd */
1255 * @brief Handler for processing Scheduling Request indication
1256 * recieved from PHY for a list of UEs.
1260 * Function: rgSCHTomSrInd
1262 * Handler for processing Scheduling Request indication recieved from PHY
1265 * Invoked by: RgLiTfuSrInd
1269 * - Invoke scheduler to indicate SR rgSCHUtlSrRcvd
1271 * @param[in] TfuSrIndInfo *srInd
1277 PUBLIC S16 rgSCHTomSrInd
1283 PUBLIC S16 rgSCHTomSrInd(cell, srInd)
1285 TfuSrIndInfo *srInd;
1294 TRC2(rgSCHTomSrInd);
1296 if(cell->cellId != srInd->cellId)
1298 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for srcInd cellId"
1299 ":%d ", srInd->cellId);
1300 err.errType = RGSCHERR_TOM_SRIND;
1301 err.errCause = RGSCHERR_TOM_INV_CELL_ID;
1306 node = srInd->srLst.first;
1307 for (;node; node=node->next)
1311 srInfo = (TfuSrInfo *)node->node;
1312 ue = rgSCHDbmGetUeCb (cell, srInfo->rnti);
1315 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
1319 rgSCHUtlHdlUlTransInd(cell, ue, srInd->timingInfo);
1320 /*Need to activate UE as SR received*/
1321 if (ue->isDrxEnabled)
1323 rgSCHDrxSrInd(cell, ue);
1325 ret = rgSCHUtlSrRcvd (cell, ue, srInd->timingInfo, &err);
1328 err.errType = RGSCHERR_TOM_SRIND;
1329 RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,"Scheduler processing failed "
1330 "errType(%d) errCause(%d) RNTI:%d", err.errType, err.errCause,srInfo->rnti);
1335 } /* end of rgSCHTomSrInd */
1338 * @brief Handler for processing downlink CQI indication recieved from
1343 * Function: rgSCHTomDoaInd
1345 * Handler for processing DOA recieved from PHY
1348 * Invoked by: RgLiTfuDoaInd
1352 * - Invoke scheduler to indicate DOA rgSCHUtlDoaInd
1354 * @param[in] TfuDoaIndInfo *doaInd
1360 PUBLIC S16 rgSCHTomDoaInd
1363 TfuDoaIndInfo *doaInd
1366 PUBLIC S16 rgSCHTomDoaInd(cell, doaInd )
1368 TfuDoaIndInfo *doaInd;
1374 TRC2(rgSCHTomDoaInd);
1376 if(cell->cellId != doaInd->cellId)
1378 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for doaInd cellId"
1379 ":%d", doaInd->cellId);
1384 node = doaInd->doaRpt.first;
1385 for (;node; node=node->next)
1387 doaInfo = (TfuDoaRpt *)node->node;
1388 ue = rgSCHDbmGetUeCb (cell, doaInfo->rnti);
1391 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
1395 rgSCHUtlDoaInd(cell, ue, doaInfo);
1398 } /* rgSCHTomDoaInd */
1400 * @brief Handler for processing downlink CQI indication recieved from
1405 * Function: rgSCHTomDlCqiInd
1407 * Handler for processing downlink CQI indication recieved from PHY
1410 * Invoked by: RgLiTfuDlCqiInd
1414 * - Invoke scheduler to indicate DL CQI rgSCHUtlDlCqiInd
1416 * @param[in] TfuDlCqiIndInfo *dlCqiInd
1422 PUBLIC S16 rgSCHTomDlCqiInd
1425 TfuDlCqiIndInfo *dlCqiInd
1428 PUBLIC S16 rgSCHTomDlCqiInd(cell, dlCqiInd)
1430 TfuDlCqiIndInfo *dlCqiInd;
1435 TfuDlCqiRpt *dlCqiInfo;
1436 TRC2(rgSCHTomDlCqiInd);
1438 if(cell->cellId != dlCqiInd->cellId)
1440 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1441 ":%d", dlCqiInd->cellId);
1446 node = dlCqiInd->dlCqiRptsLst.first;
1447 for (;node; node=node->next)
1449 dlCqiInfo = (TfuDlCqiRpt *)node->node;
1450 ue = rgSCHDbmGetUeCb (cell, dlCqiInfo->rnti);
1453 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%dUnable to get the UE CB",
1457 rgSCHUtlDlCqiInd(cell, ue, dlCqiInfo, dlCqiInd->timingInfo);
1458 rgSCHUtlHdlUlTransInd(cell, ue, dlCqiInd->timingInfo);
1461 } /* rgSCHTomDlCqiInd */
1464 * @brief Handler for moving PCQI instance for the next periodic occasion
1468 * Function: rgSCHTomUtlMovePcqiNxtOccasion
1470 * Handler for moving PCQI instance for the next periodic occasion
1472 * Invoked by: rgSCHTomUtlFill*
1475 * - For a UE move its occurence instance to next occasion
1476 * depending on its periodicity
1477 * - Remove it from the current list and insert it to the list
1478 * having the index matching with the derived number.
1480 * @param[in] RgSchCellCb *cell,
1481 * [in] RgSchUeCb *ue
1487 PRIVATE S16 rgSCHTomUtlMovePcqiNxtOccasion
1491 RgSchUePCqiCb *cqiCb
1494 PRIVATE S16 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb)
1497 RgSchUePCqiCb *cqiCb;
1502 CmLteTimingInfo timingInfo;
1503 TRC2(rgSCHTomUtlMovePcqiNxtOccasion);
1505 if(cqiCb->cqiCfg.cqiSetup.cqiRepType == RGR_UE_PCQI_SB_REP)
1508 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, timingInfo, TFU_DELTA);
1510 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, timingInfo,
1511 TFU_RECPREQ_DLDELTA);
1513 RG_SCH_ADD_TO_CRNT_TIME(timingInfo,timingInfo,cqiCb->cqiPeri);
1514 rgSCHTomUtlPcqiSbCalcBpIdx(timingInfo,ue,cqiCb);
1516 /* Compute Next Transmission Instance */
1517 cqiIdx = cqiCb->cqiPeri + cqiCb->nCqiTrIdx;
1518 cqiIdx = cqiIdx%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1519 /* Delete from current List and move to new list */
1520 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
1523 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1526 cqiCb->nCqiTrIdx = cqiIdx;
1527 cmLListAdd2Tail(&(cell->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst),
1528 &(cqiCb->cqiLstEnt));
1530 rgSCHUtlSCellHndlCqiCollsn(cqiCb);
1534 } /* rgSCHTomUtlMovePcqiNxtOccasion */
1537 * @brief Handler for moving RI instance for the next periodic occasion
1541 * Function: rgSCHTomUtlMovePriNxtOccasion
1543 * Handler for moving PCQI instance for the next periodic occasion
1545 * Invoked by: rgSCHTomUtlFill*
1548 * - For a UE move its occurence instance to next occasion
1549 * depending on its periodicity
1550 * - Remove it from the current list and insert it to the list
1551 * having the index matching with the derived number.
1553 * @param[in] RgSchCellCb *cell,
1554 * [in] RgSchUeCb *ue
1560 PRIVATE S16 rgSCHTomUtlMovePriNxtOccasion
1567 PRIVATE S16 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb)
1570 RgSchUePCqiCb *riCb;
1580 TRC2(rgSCHTomUtlMovePriNxtOccasion);
1581 crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
1582 +(cell->crntTime.subframe);
1583 #ifdef XEON_SPECIFIC_CHANGES
1584 RGSCHCPYTIMEINFO(cell->crntTime, ue->riRecpTime);
1586 /* Compute Next Transmission Instance */
1587 if (riCb->cqiCfg.cqiSetup.cqiRepType == RGR_UE_PCQI_WB_REP)
1589 effPeriodicity = riCb->cqiPeri * riCb->riPeri;
1590 tempIdx = effPeriodicity + riCb->nRiTrIdx;
1594 effPeriodicity = (riCb->h * riCb->cqiPeri * riCb->riPeri);
1595 /* In case of SFN wraparound, the SB CQI reporting cycle breaks
1596 * and RI->WB CQI->SBCQI.. should resume. RI is repositioned
1597 * accordingly. WBCQI handling is naturally accomplished */
1598 if ((crntTime + TFU_RECPREQ_DLDELTA + effPeriodicity) >
1599 (RGSCH_MAX_SUBFRM_5G - 1))
1601 riTrInsTime = (effPeriodicity - riCb->cqiOffset + riCb->riOffset) % effPeriodicity;
1602 tempIdx = RGSCH_MAX_SUBFRM_5G + (effPeriodicity - riTrInsTime);
1603 /* In case of SFN wraparound, riDist should be distance from crntTime
1604 * + TFU_RECPREQ_DLDELTA to tempIdx. Updating effPeriodicity
1605 * to make riDist calculation consistent for both SFN wraparound
1606 * case and normal case */
1607 effPeriodicity = tempIdx - TFU_RECPREQ_DLDELTA - crntTime;
1611 tempIdx = effPeriodicity + riCb->nRiTrIdx;
1614 riIdx = tempIdx % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1615 if (effPeriodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
1617 riDist = rgSCHUtlFindDist((U16)(crntTime + TFU_RECPREQ_DLDELTA),
1618 (U16)(crntTime + TFU_RECPREQ_DLDELTA + effPeriodicity));
1625 /* ccpu00138306- If Periodicity is equal to Queue Size or multiple of it
1626 * then the next occasion idx will be same as current Idx, Hence need not
1629 if((effPeriodicity%RG_SCH_PCQI_SRS_SR_TRINS_SIZE) != 0)
1631 /* Delete from current List and move to new list */
1632 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[riCb->nRiTrIdx].riLst,
1635 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"[%d]UEID:Unable to remove node",
1638 RG_SCH_RECORD(&riCb->histElem,RGSCH_ACTION_DEL, &cell->pCqiSrsSrLst[riCb->nRiTrIdx].riLst);
1639 cmLListAdd2Tail(&cell->pCqiSrsSrLst[riIdx].riLst,
1641 RG_SCH_RECORD(&riCb->histElem,RGSCH_ACTION_ADD, &cell->pCqiSrsSrLst[riIdx].riLst);
1650 riCb->nRiTrIdx = riIdx;
1651 riCb->riDist = riDist;
1654 rgSCHUtlSCellHndlRiCollsn(riCb);
1657 } /* rgSCHTomUtlMovePriNxtOccasion */
1660 * @brief Handler for moving SR instance for the next periodic occasion
1664 * Function: rgSCHTomUtlMoveSrNxtOccasion
1666 * Handler for moving SR instance for the next periodic occasion
1668 * Invoked by: rgSCHTomUtlFill*
1671 * - For a UE move its occurence instance to next occasion
1672 * depending on its periodicity
1673 * - Remove it from the current list and insert it to the list
1674 * having the index matching with the derived number.
1676 * @param[in] RgSchCellCb *cell,
1677 * [in] RgSchUeCb *ue
1683 PRIVATE S16 rgSCHTomUtlMoveSrNxtOccasion
1689 PRIVATE S16 rgSCHTomUtlMoveSrNxtOccasion(cell, ue)
1696 TRC2(rgSCHTomUtlMoveSrNxtOccasion);
1698 /* Compute Next Transmission Instance */
1699 srIdx = ue->srCb.peri + ue->srCb.nSrTrIdx;
1700 srIdx = srIdx%RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1701 /* Delete from current List and move to new list */
1702 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[ue->srCb.nSrTrIdx].srLst,
1703 &ue->srCb.srLstEnt))
1705 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1708 ue->srCb.nSrTrIdx = srIdx;
1709 cmLListAdd2Tail(&cell->pCqiSrsSrLst[ue->srCb.nSrTrIdx].srLst,
1710 &ue->srCb.srLstEnt);
1713 } /* rgSCHTomUtlMoveSrNxtOccasion */
1716 * @brief Handler for moving SRS instance for the next periodic occasion
1720 * Function: rgSCHTomUtlMoveSrsNxtOccasion
1722 * Handler for moving SRS instance for the next periodic occasion
1724 * Invoked by: rgSCHTomUtlFill*
1727 * - For a UE move its occurence instance to next occasion
1728 * depending on its periodicity
1729 * - Remove it from the current list and insert it to the list
1730 * having the index matching with the derived number.
1732 * @param[in] RgSchCellCb *cell,
1733 * [in] RgSchUeCb *ue
1739 PRIVATE S16 rgSCHTomUtlMoveSrsNxtOccasion
1745 PRIVATE S16 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue)
1756 TRC2(rgSCHTomUtlMoveSrsNxtOccasion);
1757 crntTime = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G)
1758 +(cell->crntTime.subframe);
1760 /* Compute Next Transmission Instance */
1761 tempIdx = ue->srsCb.peri + ue->srsCb.nSrsTrIdx;
1762 srsIdx = tempIdx %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
1763 if (ue->srsCb.peri > RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
1765 srsDist = rgSCHUtlFindDist((U16)(crntTime + TFU_RECPREQ_DLDELTA),
1766 (U16)(crntTime + TFU_RECPREQ_DLDELTA + ue->srsCb.peri));
1773 /* ccpu00138306- If Periodicity is equal to Queue Size or multiple of it
1774 * then the next occasion idx will be same as current Idx, Hence need not
1777 if((ue->srsCb.peri%RG_SCH_PCQI_SRS_SR_TRINS_SIZE) != 0)
1779 /* Delete from current List and move to new list */
1780 if (NULLP == cmLListDelFrm(&cell->pCqiSrsSrLst[ue->srsCb.nSrsTrIdx].srsLst,
1781 &ue->srsCb.srsLstEnt))
1783 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to remove node",
1786 cmLListAdd2Tail(&cell->pCqiSrsSrLst[srsIdx].srsLst,
1787 &ue->srsCb.srsLstEnt);
1796 ue->srsCb.nSrsTrIdx = srsIdx;
1797 ue->srsCb.srsDist = srsDist;
1800 } /* rgSCHTomUtlMoveSrsNxtOccasion */
1804 * @brief Handler for processing RAW CQI indication recieved from
1809 * Function: rgSCHTomRawCqiInd
1811 * Handler for processing RAW CQI indication recieved from PHY
1814 * Invoked by: RgLiTfuRawCqiInd
1818 * - Invoke scheduler to indicate Raw CQI rgSCHUtlRawCqiInd
1820 * @param[in] TfuRawCqiIndInfo *rawCqiInd
1826 PUBLIC S16 rgSCHTomRawCqiInd
1829 TfuRawCqiIndInfo *rawCqiInd
1832 PUBLIC S16 rgSCHTomRawCqiInd(cell, rawCqiInd)
1834 TfuRawCqiIndInfo *rawCqiInd;
1839 TfuRawCqiRpt* rawCqiInfo;
1841 TfuDlCqiRpt dlCqiInfo;
1842 Bool skipPerCqiRpt = FALSE;
1845 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1846 RgSchCellCb *iterCellP;
1857 TRC2(rgSCHTomRawCqiInd);
1859 if(cell->cellId != rawCqiInd->cellId)
1861 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1862 ":%d", rawCqiInd->cellId);
1867 node = rawCqiInd->rawCqiRpt.first;
1868 for (;node; node=node->next)
1870 rawCqiInfo = (TfuRawCqiRpt *)node->node;
1871 ue = rgSCHDbmGetUeCb (cell, rawCqiInfo->crnti);
1872 raCb = rgSCHDbmGetRaCb (cell, rawCqiInfo->crnti);
1876 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"CRNTI:%d Unable to get the UECB",
1883 if (rawCqiInfo->numBits >= 5)
1884 printf("cellId [%d] crnti [%d] numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n",
1885 cell->cellId, rawCqiInfo->crnti, rawCqiInfo->numBits, rawCqiInfo->uciPayload,
1886 rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.subframe);
1888 if (rawCqiInfo->numBits == 1)
1890 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1891 U8 fdbk = TFU_HQFDB_NACK;
1892 /* Process HARQ FdbkInd */
1893 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1896 fdbk = TFU_HQFDB_ACK;
1897 hqInfo.isAck[0] = fdbk;
1899 if (ue != NULLP && raCb == NULLP)
1901 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
1903 err.errType = RGSCHERR_TOM_HARQACKIND;
1904 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1905 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1906 err.errType, err.errCause);
1910 else if (ue == NULLP && raCb != NULLP)
1912 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1913 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1915 err.errType = RGSCHERR_TOM_HARQACKIND;
1916 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1917 " feedback processing failed errType(%d) errCause(%d)",
1918 err.errType, err.errCause);
1923 else if (ue != NULLP && raCb != NULLP)
1925 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1926 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1928 err.errType = RGSCHERR_TOM_HARQACKIND;
1929 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1930 " feedback processing failed errType(%d) errCause(%d).",
1931 err.errType, err.errCause);
1937 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1938 "UE CB or RA CB ", rawCqiInfo->crnti);
1939 err.errType = RGSCHERR_TOM_HARQACKIND;
1943 printf("rawCqiInfo->numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n", rawCqiInfo->numBits,
1944 rawCqiInfo->uciPayload, rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.subframe);
1947 else if (rawCqiInfo->numBits == 5)
1949 /* Process CQI-RI Ind*/
1950 ri = (rawCqiInfo->uciPayload >> 27) & 0x1;
1951 cqi = (rawCqiInfo->uciPayload >> 28) & 0xF;
1955 printf("\n UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1958 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1959 ue->ue5gtfCb.rank = ri + 1;
1961 if (rawCqiInfo->numBits > 1)
1963 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1964 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1965 ueDl->cqiFlag = TRUE;
1966 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1967 // rgSCHCheckAndSetTxScheme(cell, ue);
1972 printf("UE[%d] CQI[%d] MCS[%d] RI[%d]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri);
1975 else if (rawCqiInfo->numBits == 6)
1977 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1978 TfuHqFdbk fdbk = TFU_HQFDB_NACK;
1979 /* Process both HARQ and CQI-RI Ind*/
1980 ri = (rawCqiInfo->uciPayload >> 26) & 0x1;
1981 cqi = (rawCqiInfo->uciPayload >> 27) & 0xF;
1982 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1985 printf("UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1988 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1989 ue->ue5gtfCb.rank = ri + 1;
1991 if (rawCqiInfo->numBits > 1)
1993 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1994 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1995 ueDl->cqiFlag = TRUE;
1996 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1997 // rgSCHCheckAndSetTxScheme(cell, ue);
2002 fdbk = TFU_HQFDB_ACK;
2003 hqInfo.isAck[0] = fdbk;
2005 if (ue != NULLP && raCb == NULLP)
2007 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
2009 err.errType = RGSCHERR_TOM_HARQACKIND;
2010 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
2011 "HARQ feedback processing failed errType(%d)errCause(%d)n",
2012 err.errType, err.errCause);
2016 else if (ue == NULLP && raCb != NULLP)
2018 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
2019 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
2021 err.errType = RGSCHERR_TOM_HARQACKIND;
2022 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
2023 " feedback processing failed errType(%d) errCause(%d)",
2024 err.errType, err.errCause);
2029 else if (ue != NULLP && raCb != NULLP)
2031 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
2032 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
2034 err.errType = RGSCHERR_TOM_HARQACKIND;
2035 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
2036 " feedback processing failed errType(%d) errCause(%d).",
2037 err.errType, err.errCause);
2043 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
2044 "UE CB or RA CB ", rawCqiInfo->crnti);
2045 err.errType = RGSCHERR_TOM_HARQACKIND;
2050 printf("\nUE[%u] CQI[%u] MCS[%u] RI[%u] HQ[%u]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri, hqAck);
2055 if ((rgSCHDhmRlsDlsfHqProc (cell, rawCqiInd->timingInfo)) != ROK)
2057 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
2058 "subframe for cellId (%d) ", cell->cellId);
2059 err.errType = RGSCHERR_TOM_HARQACKIND;
2062 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
2064 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
2066 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
2068 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
2069 if(rlsHqBufs->numUes)
2071 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
2072 RgSchMacRlsHq (&pst, rlsHqBufs);
2074 rlsHqBufs->numUes = 0;
2078 } /* rgSCHTomRawCqiInd */
2081 * @brief Handler for processing SRS indication recieved from
2086 * Function: rgSCHTomSrsInd
2088 * Handler for SRS indication recieved from PHY
2091 * Invoked by: RgLiTfuSrsInd
2095 * - Invoke scheduler to indicate UL SRS rgSCHUtlSrsInd
2097 * @param[in] TfuSrsIndInfo *srsInd
2103 PUBLIC S16 rgSCHTomSrsInd
2106 TfuSrsIndInfo *srsInd
2109 PUBLIC S16 rgSCHTomSrsInd(cell, srsInd)
2111 TfuSrsIndInfo *srsInd;
2118 TRC2(rgSCHTomSrsInd);
2120 if(cell->cellId != srsInd->cellId)
2122 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2123 ":%d", srsInd->cellId);
2127 node = srsInd->srsRpt.first;
2128 for (;node; node=node->next)
2130 srsInfo = (TfuSrsRpt *)node->node;
2131 ue = rgSCHDbmGetUeCb (cell, srsInfo->ueId);
2134 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
2135 "UE CB", srsInfo->ueId);
2138 rgSCHUtlSrsInd(cell, ue, srsInfo, srsInd->timingInfo);
2139 rgSCHUtlHdlUlTransInd(cell, ue, srsInd->timingInfo);
2142 } /* rgSCHTomSrsInd */
2146 * Fun: rgSCHTomUtlGenIndices
2148 * Desc: This function reconstructs the Subband Indices for
2149 * of M selected Subbands conveyed by the UE for APeriodic Modes
2150 * 2-0 and 2-2. It decodes the Label which uniquely encodes M out
2158 * File: rg_sch_utl.c
2162 PRIVATE S16 rgSCHTomUtlGenIndices
2168 TfuSubbandInfo* sbInfo
2171 PRIVATE S16 rgSCHTomUtlGenIndices(label, posM, valN, valK, sbInfo)
2176 TfuSubbandInfo* sbInfo;
2179 U8 idx, kval, xval, xmin;
2182 for(kval=0; kval<posM;kval++)
2185 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe, (posM-kval-1));
2186 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2187 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2191 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2192 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2195 sbInfo[kval].numRb = valK;
2196 sbInfo[kval].rbStart = idx*valK;
2198 label = label-binCoe;
2201 } /* end of rgSCHTomUtlGenIndices*/
2204 * @brief Handler for processing decode failure indication recieved from
2209 * Function: rgSCHTomCrcInd
2211 * Handler for processing decode failure indication recieved from
2212 * PHY for a set of UEs.
2214 * Invoked by: RgLiTfuCrcInd of rg_sch.x
2217 * - Validate the information received and retrieve cell and ue.
2218 * - Process Decode failure Indication: Call rgSCHUhmProcHqFailure().
2220 * @param[in] TfuCrcIndInfo *crcInd
2226 PUBLIC S16 rgSCHTomCrcInd
2229 TfuCrcIndInfo *crcInd
2232 PUBLIC S16 rgSCHTomCrcInd(cell, crcInd)
2234 TfuCrcIndInfo *crcInd;
2237 RgSchUeCb *ue = NULLP;
2238 RgSchRaCb *raCb = NULLP;
2240 TfuCrcInfo *crcInfo;
2241 #ifdef RG_ULSCHED_AT_CRC
2244 CmLteTimingInfo crntHiDci0Frm;
2245 //RgSchCmnUlCell *cellUl;
2246 Inst inst = cell->instIdx;
2247 TfuCntrlReqInfo *cntrlInfo;
2255 RgSchUlHqProcCb *hqProc;
2259 RgSchUlHqProcCb *ulHqProc;
2262 TRC2(rgSCHTomCrcInd);
2264 if(cell->cellId != crcInd->cellId)
2266 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2267 ":%d", crcInd->cellId);
2270 #ifdef RG_ULSCHED_AT_CRC
2273 static CmLteTimingInfo lastCrc = {2000,0};
2274 CmLteTimingInfo crntCrc = cell->crntTime;
2275 if (RGSCH_TIMEINFO_SAME(lastCrc, crntCrc))
2277 /*Removed the WA to drop 2nd CRC*/
2278 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"Recieved CRC "
2279 "twice per TTI @(%u,%u)", cell->crntTime.sfn,
2280 cell->crntTime.subframe);
2286 node = crcInd->crcLst.first;
2287 for (;node; node=node->next)
2289 crcInfo = (TfuCrcInfo*)node->node;
2290 ue = rgSCHDbmGetUeCb (cell, crcInfo->rnti);
2294 /* Fetch from SPS List */
2295 ue = rgSCHDbmGetSpsUeCb(cell, crcInfo->rnti);
2299 raCb = rgSCHDbmGetRaCb (cell, crcInfo->rnti);
2306 /* Added Ul TB count for Uplink data scheduled*/
2310 ulHqProc = &(raCb->msg3HqProc);
2311 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2313 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2318 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2319 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2321 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2326 if (crcInfo->isFailure == FALSE)
2330 rgSCHRamMsg3DatInd(raCb);
2332 /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
2333 hqProc = &(raCb->msg3HqProc);
2334 RGSCH_UPD_PHICH(cell->ulDlCfgIdx, crcInd->timingInfo.subframe,
2342 gUlCrcPassCounter++;
2347 RGSCHCPYTIMEINFO(crcInd->timingInfo, ue->datIndTime);
2348 #ifndef MAC_SCH_STATS
2349 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo);
2352 /** Stats update over here
2355 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2357 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo, cmnUe->ul.crntUlCqi[0]);
2359 #endif /* MAC_SCH_STATS */
2361 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2363 rgSCHUtlHdlCrcInd(cell, ue, crcInd->timingInfo);
2371 /* SR_RACH_STATS : MSG3 Nack / DTX*/
2372 if (crcInfo->isDtx == TRUE)
2378 rgNumMsg3CrcFailed++;
2380 rgSCHRamMsg3FailureInd(raCb);
2382 rgSCHCmnEmtcHdlCrcFailInd(cell, raCb);
2384 /* Added Ul TB count for CRC Failure of MSG3 */
2386 ulHqProc = &(raCb->msg3HqProc);
2387 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2389 cell->dlUlTbCnt.tbTransUlFaulty++;
2397 gUlCrcFailCounter++;
2402 #ifndef MAC_SCH_STATS
2403 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv);
2406 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2408 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv, cmnUe->ul.crntUlCqi[0]);
2410 #endif /* MAC_SCH_STATS */
2411 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2413 rgSCHUtlHdlCrcFailInd(cell, ue, crcInd->timingInfo);
2415 /* Added Ul TB count for CRC Failure of Uplink data */
2417 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2418 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2420 cell->dlUlTbCnt.tbTransUlFaulty++;
2427 /* ccpu00132653-ADD Added Sched_At_Crc Changes for TDD and optimized here
2428 the codebase across TDD and FDD*/
2429 #ifdef RG_ULSCHED_AT_CRC
2430 /* Changes to do uplink scheduling at CRC Indication */
2431 //cellUl = RG_SCH_CMN_GET_UL_CELL(cell);
2432 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, crntHiDci0Frm, TFU_ULCNTRL_DLDELTA);
2435 rgSCHCmnRlsUlSf(cell,0);
2438 /* Allocating memory for CntrlReq as it required for both EMTC and
2440 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&cntrlInfo,
2441 sizeof(TfuCntrlReqInfo))) != ROK)
2443 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuCntrlReqInfo "
2447 rgSCHCmnUlSch(cell);
2449 rgSCHL2Meas(cell,TRUE);
2451 /* Also, sending UL DCI and PHICH for just scheduled subframe */
2452 ulSf = rgSCHUtlSubFrmGet (cell, crntHiDci0Frm);
2454 if ((rgSCHTomUtlProcDlSfAtCrc (ulSf, crntHiDci0Frm, cell, cntrlInfo, &err)) != ROK)
2456 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomCrcInd() Unable to process"
2457 " downlink subframe for cellId %d", crcInd->cellId);
2458 err.errType = RGSCHERR_TOM_TTIIND;
2461 #endif /* RG_ULSCHED_AT_CRC */
2463 } /* rgSCHTomCrcInd */
2466 * @brief Handler for processing timing Advance indication recieved from
2471 * Function: rgSCHTomTimingAdvInd
2473 * Handler for processing timing advance indication recieved from PHY
2476 * Invoked by: RgLiTfuTimingAdvInd
2480 * - Call DHM to update value of Timing Advance rgSCHDhmUpdTa.
2482 * @param[in] TfuTimingAdvIndInfo *timingAdvInd
2488 PUBLIC S16 rgSCHTomTimingAdvInd
2491 TfuTimingAdvIndInfo *timingAdvInd
2494 PUBLIC S16 rgSCHTomTimingAdvInd(cell, timingAdvInd)
2496 TfuTimingAdvIndInfo *timingAdvInd;
2501 TfuTimingAdvInfo *timingAdvInfo;
2504 TRC2(rgSCHTomTimingAdvInd);
2506 if(cell->cellId != timingAdvInd->cellId)
2508 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2509 "=(%d)", timingAdvInd->cellId);
2514 node = timingAdvInd->timingAdvLst.first;
2515 for (;node; node=node->next)
2517 timingAdvInfo = (TfuTimingAdvInfo *)node->node;
2518 ue = rgSCHDbmGetUeCb (cell, timingAdvInfo->rnti);
2521 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
2522 timingAdvInfo->rnti);
2525 rgSCHDhmUpdTa (cell, ue, timingAdvInfo->timingAdv);
2528 } /* rgSCHTomTimingAdvInd */
2531 * @brief Handler for processing TTI indication recieved from
2532 * PHY for 'n' cells.
2536 * Function: rgSCHTomTtiInd
2538 * Handler for processing TTI indication recieved from PHY
2539 * for a cell. This is split into the below Steps.
2541 * 1: Complete the Uplink and Common Channel Scheduling for each Cell
2542 * 2: Complete the UE specific Scheduling for each Cell / across Cells.
2543 * 3: Consolidate the subframe allocations and send to each MAC instance
2544 * 4: Fill the Tfu structures for DL and UL Config requests
2545 * 5: Handle the RGR Config messages per Cell
2547 * @param[in] TfuTtiIndInfo *ttiInd
2548 * @param[in] Inst schInst
2552 PUBLIC Void rgSCHTomTtiInd
2554 TfuTtiIndInfo *ttiInd,
2558 PUBLIC Void rgSCHTomTtiInd(ttiInd, schInst)
2559 TfuTtiIndInfo *ttiInd;
2563 RgInfSfAlloc *subfrmAlloc;
2564 RgTfuCntrlReqInfo *cntrlInfo = NULLP;
2568 RgSchCellCb *cell[CM_LTE_MAX_CELLS];
2569 RgSchCellCb *cellLst[CM_LTE_MAX_CELLS];
2571 TRC2(rgSCHTomTtiInd);
2577 rgSchTomFillCellTtiInfo(ttiInd, schInst, &nCell, &cell[0]);
2578 for (i = 0; i < nCell; i++)
2580 /* Perform UL and DL Common Channel scheduling */
2581 rgSchTomTtiUlAndDlCmnChSch (cell[i]);
2584 /* Perform scheduling in Order of
2588 for (i = 0; i < nCell; i++)
2591 if (cell[i]->isDlDataAllwd && (cell[i]->stopDlSch == FALSE))
2593 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell[i]);
2594 /* Perform DL Retx scheduling */
2595 cellSch->apisDl->rgSCHDlRetxSched(cell[i], &cellSch->allocInfo);
2599 rgSchCmnPreDlSch(cell, nCell, cellLst);
2600 for (i = 0; i < nCell; i++)
2602 /* Perform DL scheduling */
2603 rgSchTomTtiDlSch (cellLst[i]);
2605 rgSchCmnPstDlSch(cell[0]);
2607 for (i = 0; i < nCell; i++)
2610 #ifndef RG_ULSCHED_AT_CRC
2611 /* Perform UL scheduling for TDD */
2612 rgSCHCmnUlSch (cell[i]);
2616 /* Init SF Alloc info per Cell */
2617 for (i = 0; i < nCell; i++)
2619 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2620 rgSCHUtlResetSfAlloc(subfrmAlloc,FALSE,TRUE);
2622 for (i = 0; i < nCell; i++)
2624 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2626 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2628 * TFU_DLDATA_DLDELTA is used in this calculation because the subfrmAlloc
2629 * timingInfo which is being calculated here will be used by MAC
2631 RG_SCH_ADD_TO_CRNT_TIME(cell[i]->crntTime, subfrmAlloc->timingInfo,
2632 RG_DL_DELTA - TFU_DLDATA_DLDELTA);
2633 /* Consolidate the Allocations and send response to MAC instances */
2634 rgSchTomTtiCnsldtSfAlloc (cell[i]);
2638 for (i = 0; i < nCell; i++)
2640 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2642 /* Send the consolidated Alloc Info to MAC instances */
2643 rgSCHCmnSndCnsldtInfo (cell[i]);
2647 for (i = 0; i < nCell; i++)
2649 /* Fill control data from scheduler to PHY */
2650 if ((ret = rgSCHUtlAllocEventMem((cell[i]->instIdx), (Ptr *)&cntrlInfo,
2651 sizeof(RgTfuCntrlReqInfo))) != ROK)
2653 RLOG_ARG0(L_ERROR,DBG_CELLID,cell[i]->cellId,"Unable to Allocate TfuCntrlReqInfo"
2659 /* Fill the TFU structures and send to CL */
2660 if(TRUE == cell[i]->emtcEnable)
2662 ret = rgSchEmtcTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2666 && (NULLP != cntrlInfo))
2668 /* Fill the TFU structures and send to CL */
2669 rgSchTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2673 rgSCHTomUtlSendSfnTick(cell[0]);
2676 for (i = 0; i < nCell; i++)
2678 /* Invoke non critical functions like measurements, etc */
2679 rgSchTomTtiMiscFunctions (cell[i]);
2684 U32 dbgUeIdChngAndDatReqInClCnt = 0;
2685 static U32 gTtiCount = 0;
2688 if(gTtiCount == 3000)
2690 #ifdef XEON_SPECIFIC_CHANGES
2691 printf("SChed:: (P/S)::(%u/%u) \n",
2692 gPrimarySchedCount,gSCellSchedCount);
2694 printf("\n HQFDBK :: %u\n",gHqFdbkCount);
2699 total = gPCellTb1AckCount + gPCellTb1NackCount + gPCellTb1DtxCount;
2700 total2 = gPCellTb2AckCount + gPCellTb2NackCount + gPCellTb2DtxCount;
2702 printf("\n PCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2703 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2704 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2705 if ((total != 0 ) && total2 != 0)
2707 printf("\n PCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2708 (float)gPCellTb1AckCount/total * 100,(float)gPCellTb1NackCount/total * 100,(float)gPCellTb1DtxCount/total * 100,
2709 (float)gPCellTb2AckCount/total2 *100 ,(float)gPCellTb2NackCount/total2 *100 ,(float)gPCellTb2DtxCount/total2 *2);
2712 total = gSCellTb1AckCount + gSCellTb1NackCount + gSCellTb1DtxCount;
2713 total2 = gSCellTb2AckCount + gSCellTb2NackCount + gSCellTb2DtxCount;
2716 printf("\n SCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2717 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2718 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2719 if ((total != 0 ) && total2 != 0)
2721 printf("\n SCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2722 (float)gSCellTb1AckCount/total * 100,(float)gSCellTb1NackCount/total * 100,(float)gSCellTb1DtxCount/total * 100,
2723 (float)gSCellTb2AckCount/total2 *100 ,(float)gSCellTb2NackCount/total2 *100 ,(float)gSCellTb2DtxCount/total2 *2);
2727 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%u/%u):(%u/%u/%u/%u)\n",
2728 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2729 gACqiRcvdCount,gCqiReptToAppCount);
2731 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%u/%u/%u/%u/%u/%u)\n",
2732 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2734 printf("UL::(DCI0/CrcPass/CrcFail)::(%u/%u/%u)\n"
2735 "gPcellZeroBoOcc:%u\t gScellZeroBoOcc:%u dbgUeIdChngAndDatReqInClCnt: %u\n"
2736 "DelayedDatReqInMac: %u DelayedDatReqInCl : %u gIccPktRcvrMemDropCnt :%u\n",
2742 dbgUeIdChngAndDatReqInClCnt,
2743 dbgDelayedDatReqInMac,
2744 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2746 printf("SChed:: (P/S)::(%ld/%ld) \n",
2747 gPrimarySchedCount,gSCellSchedCount);
2749 printf("\n HQFDBK :: %ld\n",gHqFdbkCount);
2751 printf("\n PCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2752 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2753 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2755 printf("\n SCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2756 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2757 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2759 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%ld/%ld):(%ld/%ld/%ld/%ld)\n",
2760 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2761 gACqiRcvdCount,gCqiReptToAppCount);
2762 printf("\n CQI:: PucchCqiSnrDropCnt/PucchCqiConfBitMaskDropCnt/PuschCqiConfMaskDropCount :: (%ld/%ld/%ld) \n",gCqiPucchLowSnrDropCount,gCqiPucchConfMaskDropCount,gCqiPuschConfMaskDropCount);
2764 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%ld/%ld/%ld/%ld/%ld/%ld)\n",
2765 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2767 printf("UL::(DCI0/CrcPass/CrcFail)::(%ld/%ld/%ld)\n"
2768 "gPcellZeroBoOcc:%ld\t gScellZeroBoOcc:%ld dbgUeIdChngAndDatReqInClCnt: %ld\n"
2769 "DelayedDatReqInMac: %ld DelayedDatReqInCl : %ld gIccPktRcvrMemDropCnt :%ld\n",
2775 dbgUeIdChngAndDatReqInClCnt,
2776 dbgDelayedDatReqInMac,
2777 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2778 //printf ("\n delayedApiCnt:%ld",delayedApiCnt);
2782 rgSCHLaaPrintStats();
2784 gCaDbgNonCaFrmt = gIccPktRcvrMemDropCnt = 0;
2796 gCqiPucchLowSnrDropCount = 0;
2797 gCqiPucchConfMaskDropCount = 0;
2798 gCqiPuschConfMaskDropCount = 0;
2799 gPuschCqiDropCount = 0;
2802 gUlCrcPassCount = 0;
2803 gUlCrcFailCount = 0;
2806 gCqiRecpPuschCount = 0;
2809 gCqiReptToAppCount = 0;
2814 gPrimarySchedCount = 0;
2815 gSCellSchedCount = 0;
2816 gSCellTb1AckCount = 0;
2817 gSCellTb2AckCount = 0;
2818 gSCellTb2AckCount = 0;
2819 gSCellTb2NackCount = 0;
2820 gPCellTb1AckCount = 0;
2821 gPCellTb1NackCount = 0;
2822 gPCellTb2AckCount = 0;
2823 gPCellTb2NackCount = 0;
2824 gSCellTb1NackCount=0;
2826 gPCellTb1DtxCount = 0;
2827 gPCellTb2DtxCount = 0;
2828 gSCellTb1DtxCount = 0;
2829 gSCellTb2DtxCount = 0;
2830 gPcellZeroBoOcc = 0;
2831 gScellZeroBoOcc = 0;
2839 } /* rgSCHTomTtiInd */
2841 /** @brief This function does the TTI processin for the uplink subframe,
2842 * already populated by the scheduler.
2846 * Function: rgSCHTomUtlProcUlSf
2849 * - Loop through the Uplink allocations present in the uplink subframe.
2850 * - For each allocation Fill a data reception request to be sent to PHY
2851 * - Also fills the harq reception requests for the expected HQ feedbacks.
2854 * @param [in] RgSchCellCb *cell
2855 * @param [out] RgSchErrInfo *err
2862 PRIVATE S16 rgSCHTomUtlProcUlSf
2868 PRIVATE S16 rgSCHTomUtlProcUlSf (cell, err)
2874 TfuRecpReqInfo *recpReqInfo;
2876 U16 validIdx; /* Index computed from recreq's timing info*/
2878 Inst inst = cell->instIdx;
2880 TRC2(rgSCHTomUtlProcUlSf)
2882 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2883 sizeof(TfuRecpReqInfo))) != ROK)
2885 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuRecpReqInfo "
2887 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2890 recpReqInfo->cellId = cell->cellId;
2891 cmLListInit(&recpReqInfo->ueRecpReqLst);
2893 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo,
2894 TFU_RECPREQ_DLDELTA);
2896 /* Filling data Reception requests */
2897 ret = rgSCHTomUtlFillDatRecpReq(recpReqInfo, cell,
2902 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Data recption "
2903 "requests for cell");
2904 RGSCH_FREE_MEM(recpReqInfo);
2907 /* Filling HARQ Reception requests */
2908 ret = rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, validIdx,err);
2911 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Harq Feedback "
2912 "reception requests for cell");
2913 RGSCH_FREE_MEM(recpReqInfo);
2916 /* sending the RecpReq to Phy */
2917 if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
2919 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for cell");
2922 } /* end of rgSCHTomUtlProcUlSf */
2926 /** @brief This function does the TTI processin for the uplink subframe,
2927 * already populated by the scheduler.
2931 * Function: rgSCHTomUtlPrcUlTddSpclSf
2934 * - Fill the SRS Info for the Special Subframe in Reception Req.
2935 * - Send the Reception Req to TFU
2938 * @param [in] RgSchCellCb *cell
2939 * @param [out] RgSchErrInfo *err
2945 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf
2951 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf (cell, err)
2957 TfuRecpReqInfo *recpReqInfo;
2958 U16 validIdx; /* Index computed from recreq's timing info*/
2959 Inst inst = cell->instIdx;
2961 TRC2(rgSCHTomUtlPrcUlTddSpclSf)
2963 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2964 sizeof(TfuRecpReqInfo))) != ROK)
2966 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to "
2967 "Allocate TfuRecpReqInfo for cell");
2968 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2971 recpReqInfo->cellId = cell->cellId;
2972 cmLListInit(&recpReqInfo->ueRecpReqLst);
2974 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo, TFU_RECPREQ_DLDELTA);
2976 RG_SCH_GET_IDX_PCQISRSSR(recpReqInfo->timingInfo, validIdx);
2979 if(cell->srsCfg.isSrsCfgPres &&
2980 rgSchTddCellSpSrsSubfrmTbl[cell->srsCfg.srsSubFrameCfg][recpReqInfo->timingInfo.subframe])
2982 recpReqInfo->srsPres = TRUE;
2986 recpReqInfo->srsPres = FALSE;
2989 /* Filling SRS Reception requests */
2990 ret = rgSCHTomUtlFillSrsRecpReq (recpReqInfo, cell, validIdx, err);
2993 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to fill"
2994 " SRS recption requests for cell");;
2995 RGSCH_FREE_MEM(recpReqInfo);
2998 /* sending the RecpReq to Phy */
2999 if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
3001 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to send "
3002 "Cntrl info for cell");
3005 } /* end of rgSCHTomUtlPrcUlTddSpclSf */
3008 /** @brief This function does all the processing related to a single downlink
3013 * Function: rgSCHTomUtlProcDlSf
3016 * - collate control data for all UEs and send to PHY
3017 * - collate data buffers for all UEs and send to PHY
3019 * @param [in] RgSchDlSf *dlSf
3020 * @param [in] RgSchDlSf *ulSf
3021 * @param [in] RgSchCellCb *cell
3022 * @param [out] RgSchErrInfo *err
3026 PRIVATE S16 rgSCHTomUtlProcDlSf
3031 RgTfuCntrlReqInfo *cntrlInfo,
3035 PRIVATE S16 rgSCHTomUtlProcDlSf (dlSf, ulSf, cell, cntrlInfo, err)
3039 RgTfuCntrlReqInfo *cntrlInfo;
3043 Inst inst = cell->instIdx;
3045 U8 sfTyp = 1; /* Dl Subframe */
3047 TRC2(rgSCHTomUtlProcDlSf);
3049 cmLListInit(&cntrlInfo->phichLst);
3050 cmLListInit(&cntrlInfo->dlPdcchLst);
3051 cmLListInit(&cntrlInfo->ulPdcchLst);
3053 #ifdef TFU_ALLOC_EVENT_NO_INIT
3054 cntrlInfo->ulTiming.sfn = cntrlInfo->ulTiming.subframe = 0;
3056 cntrlInfo->dlTiming = cell->dlDciTime;
3057 cntrlInfo->cellId = cell->cellId;
3058 cntrlInfo->ulTiming = cell->hiDci0Time;
3059 if((0 == (cntrlInfo->dlTiming.sfn % 30)) && (0 == cntrlInfo->dlTiming.subframe))
3061 //printf("5GTF_CHECK rgSCHTomUtlProcDlSf Cntrl dl (%d : %d) ul (%d : %d)\n", cntrlInfo->dlTiming.sfn, cntrlInfo->dlTiming.subframe, cntrlInfo->ulTiming.sfn, cntrlInfo->ulTiming.subframe);
3063 /* Fill PCFICH info */
3064 /* Fix for DCFI FLE issue: when DL delta is 1 and UL delta is 0 and CFI
3065 *change happens in that SF then UL PDCCH allocation happens with old CFI
3066 *but CFI in control Req goes updated one since it was stored in the CELL
3068 cntrlInfo->cfi = dlSf->pdcchInfo.currCfi;
3069 #ifndef RG_ULSCHED_AT_CRC
3072 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
3073 [cell->hiDci0Time.subframe];
3074 if(dlSf->sfType == RG_SCH_SPL_SF_DATA)
3076 RGSCH_GET_SPS_SF_CFI(cell->bwCfg.dlTotalBw, cntrlInfo->cfi);
3081 /* Fill PHICH info */
3082 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
3084 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PHICH info "
3085 "for cellId (%d)\n", cell->cellId));
3086 RGSCH_FREE_MEM(cntrlInfo);
3089 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) !=
3092 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
3093 "for cellId (%d)\n", cell->cellId));
3094 RGSCH_FREE_MEM(cntrlInfo);
3099 if(0 == cntrlInfo->ulMpdcchLst.count)
3106 sfTyp = rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
3107 [cell->dlDciTime.subframe];
3109 if (sfTyp != 2) /* Uplink subframe */
3111 /* Fill PDCCH info */
3112 if ((ret = rgSCHTomUtlFillDlPdcch(cell,cntrlInfo, dlSf, err)) != ROK)
3114 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
3115 "for cellId (%d)\n", cell->cellId));
3116 RGSCH_FREE_MEM(cntrlInfo);
3119 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
3120 rgBwAlcnt[dlSf->sfNum] ++;
3123 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
3124 cntrlInfo->isSPSOcc = dlSf->isSPSOcc;
3126 cntrlInfo->numDlActvUes += dlSf->numDlActvUes; /* 4UE_TTI_DELTA */
3127 dlSf->numDlActvUes = 0;
3129 if(0 == cntrlInfo->dlMpdcchLst.count)
3134 /* Now always sending down a cntrl req */
3135 /* sending the cntrl data to Phy */
3136 if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
3139 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info "
3147 /** @brief This function handles sending of the PHICH information for the
3148 * downlink subframe to be sent in the next TTI.
3155 * - Loop through the PHICH information present in the downlink
3156 * subframe and fill the information in cntrlInfo.
3158 * @param [out] TfuCntrlReqInfo *cntrlInfo
3159 * @param [in] RgSchDlSf *dlSf
3160 * @param [out] RgSchErrInfo *err
3166 PRIVATE S16 rgSCHTomUtlFillPhich
3169 TfuCntrlReqInfo *cntrlInfo,
3174 PRIVATE S16 rgSCHTomUtlFillPhich(cell, cntrlInfo, dlSf, err)
3176 TfuCntrlReqInfo *cntrlInfo;
3184 TfuPhichInfo *harqAck;
3186 RgSchCmnDlCell *cellDl = RG_SCH_CMN_GET_DL_CELL(cell);
3189 TRC2(rgSCHTomUtlFillPhich)
3191 /* Traversing the list of Phichs */
3192 node = dlSf->phichInfo.phichs.first;
3195 phich = (RgSchPhich*)node->node;
3196 if ((ret = rgSCHUtlGetEventMem((Ptr *)&harqAck, sizeof(TfuPhichInfo),
3197 &(cntrlInfo->memCp))) != ROK)
3199 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3202 #ifdef TFU_ALLOC_EVENT_NO_INIT
3203 harqAck->txPower = 0;
3205 /* fill in the tfu structure from the information present in the
3207 harqAck->rbStart = phich->rbStart;
3208 harqAck->nDmrs = phich->nDmrs;
3209 harqAck->isAck = phich->hqFeedBack;
3210 harqAck->isForMsg3 = phich->isForMsg3; /*SR_RACH_STATS : PHICH ACK/NACK for MSG3 */
3212 /* Changes for passing iPhich at TFU interface*/
3213 harqAck->iPhich = phich->iPhich;
3215 /* ccpu00138898 - Added Tx pwr offset for PHICH Tx*/
3217 harqAck->txPower = cellDl->phichTxPwrOffset;
3219 cmLListAdd2Tail(&cntrlInfo->phichLst, &(harqAck->lnk));
3220 harqAck->lnk.node = (PTR)harqAck;
3222 } /* end of while */
3228 /** @brief This function is a utility function to restart
3229 * deactivation timer.
3233 * Function: rgSCHTmrRestartScellDeactTmr
3236 * - Starts timer at scheduler
3238 * @param[in] RgSchCellCb *cell
3239 * @param[in] CmLteRnti rnti
3243 PRIVATE Void rgSCHTmrRestartScellDeactTmr
3249 PRIVATE Void rgSCHTmrRestartScellDeactTmr (cell, ueCb)
3255 RgSchUeCellInfo *sCellInfo = NULLP;
3259 if(RG_SCH_IS_CELL_SEC(ueCb, cell))
3261 sCellInfo = ueCb->cellInfo[(ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)])];
3263 if(sCellInfo->deactTmr.tmrEvnt != TMR_NONE)
3265 rgSCHTmrStopTmr(cell, RG_SCH_TMR_SCELL_DEACT, sCellInfo);
3267 if(PRSNT_NODEF == ueCb->sCellDeactTmrVal.pres)
3270 rgSCHTmrStartTmr(cell,sCellInfo,RG_SCH_TMR_SCELL_DEACT,
3271 ueCb->sCellDeactTmrVal.val);
3276 }/*end of rgSCHTmrRestartScellDeactTmr*/
3279 /** @brief This function will send all the PDCCH's for the given downlink
3287 * - Loop through all the scheduled HARQ processes and fill
3288 * the PDCCH information in cntrlInfo.
3290 * @param [out] TfuCntrlReqInfo *cntrlInfo
3291 * @param [in] RgSchDlSf *dlSf
3292 * @param [out] RgSchErrInfo *err
3297 EXTERN U32 numdlSpsRelSentToTf;
3299 PRIVATE S16 rgSCHTomUtlFillDlPdcch
3302 TfuCntrlReqInfo *cntrlInfo,
3307 PRIVATE S16 rgSCHTomUtlFillDlPdcch(cell,cntrlInfo, dlSf, err)
3309 TfuCntrlReqInfo *cntrlInfo;
3317 TfuPdcchInfo *tfuPdcch;
3318 U8 isDcivld = FALSE;
3321 TRC2(rgSCHTomUtlFillDlPdcch)
3323 /* Traversing the scheduled Harq processes */
3324 node = dlSf->pdcchInfo.pdcchs.first;
3327 pdcch = (RgSchPdcch*)node->node;
3328 switch(pdcch->dci.dciFormat)
3330 case TFU_DCI_FORMAT_3:
3331 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? TRUE : FALSE;
3334 case TFU_DCI_FORMAT_3A:
3335 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? TRUE : FALSE;
3348 /*ccpu00117179 - ADD - Build only non DCI format-0 messages */
3349 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_0) ||
3350 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A1) ||
3351 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A2))
3358 #ifdef RGSCH_SPS_STATS
3359 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_1A) &&
3360 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.mcs == 0x1F) &&
3361 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.type == TFU_ALLOC_TYPE_RIV) &&
3362 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.u.riv == 0xFFFFFFFF))
3364 numdlSpsRelSentToTf++;
3368 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3369 &(cntrlInfo->memCp))) != ROK)
3371 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3375 tfuPdcch->crnti = pdcch->crnti;
3376 tfuPdcch->isSpsRnti = pdcch->isSpsRnti;
3378 tfuPdcch->rnti = pdcch->rnti;
3381 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3383 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3385 tfuPdcch->nCce = pdcch->nCce;
3386 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3387 tfuPdcch->dci = pdcch->dci;
3389 //TODO_SID: Need to check these values during INT
3390 tfuPdcch->sectorId = 0;
3391 tfuPdcch->sccIdx = 0;
3394 /* SR_RACH_STATS : Reset isTBMsg4 */
3395 pdcch->dci.u.format1aInfo.t.pdschInfo.isTBMsg4 = FALSE;
3396 /* To be enhanced later for 2.1 */
3397 cmLListAdd2Tail(&cntrlInfo->dlPdcchLst, &(tfuPdcch->lnk));
3398 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3400 if((pdcch->rnti > 60) && (pdcch->rnti < 5000))
3402 #if defined (TENB_STATS) && defined (RG_5GTF)
3403 cell->tenbStats->sch.dl5gtfPdcchSend++;
3407 } /* end of while */
3409 if((numUePerTti) && (numUePerTti < RG_MAX_NUM_UE_PER_TTI ))
3411 cell->dlNumUeSchedPerTti[numUePerTti-1]++;
3413 gDlNumUePerTti[numUePerTti-1]++;
3417 } /* end of rgSCHTomUtlFillDlPdcch*/
3419 #ifdef RGSCH_SPS_STATS
3420 extern U32 rgSchSpsRelSentToTf;
3421 extern U32 rgSchSpsRelPdcchAllocd;
3423 /** @brief This function will send all the UL PDCCH's for the given
3431 * - Loop through all the scheduled HARQ processes and fill
3432 * the PDCCH information in cntrlInfo.
3434 * @param [out] TfuCntrlReqInfo *cntrlInfo
3435 * @param [in] RgSchDlSf *dlSf
3436 * @param [out] RgSchErrInfo *err
3442 PRIVATE S16 rgSCHTomUtlFillUlPdcch
3445 TfuCntrlReqInfo *cntrlInfo,
3450 PRIVATE S16 rgSCHTomUtlFillUlPdcch(cntrlInfo, dlSf, err)
3452 TfuCntrlReqInfo *cntrlInfo;
3460 TfuPdcchInfo *tfuPdcch;
3461 U8 isDcivld = FALSE;
3463 TRC2(rgSCHTomUtlFillUlPdcch)
3465 /* Traversing the scheduled Harq processes */
3466 node = dlSf->pdcchInfo.pdcchs.first;
3469 pdcch = (RgSchPdcch*)node->node;
3471 /*ccpu00116712- Function should pick only UL allocation related control
3473 switch(pdcch->dci.dciFormat)
3475 case TFU_DCI_FORMAT_A1:
3479 case TFU_DCI_FORMAT_A2:
3483 case TFU_DCI_FORMAT_3:
3484 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? FALSE : TRUE;
3487 case TFU_DCI_FORMAT_3A:
3488 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? FALSE : TRUE;
3503 /*ccpu00116712- Function should pick only UL allocation related control
3505 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3506 &(cntrlInfo->memCp))) != ROK)
3508 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3511 tfuPdcch->rnti = pdcch->rnti;
3513 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3515 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3517 tfuPdcch->nCce = pdcch->nCce;
3518 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3519 tfuPdcch->dci = pdcch->dci;
3521 //TODO_SID: Need to check these values during INT
3522 tfuPdcch->sectorId = 0;
3523 tfuPdcch->sccIdx = 0;
3526 /* To be enhanced later for 2.1 */
3528 #if defined (TENB_STATS) && defined (RG_5GTF)
3529 cell->tenbStats->sch.ul5gtfPdcchSend++;
3531 cmLListAdd2Tail(&cntrlInfo->ulPdcchLst, &(tfuPdcch->lnk));
3532 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3533 } /* end of while */
3535 #ifdef RGSCH_SPS_STATS
3536 if (rgSchSpsRelSentToTf != rgSchSpsRelPdcchAllocd)
3542 } /* end of rgSCHTomUtlFillUlPdcch*/
3544 /** @brief This function does the processing for Timing adjustment.
3551 * - Loop through the ue present ueTimeLst, decrement the remaining
3555 * @param [in] RgSchCellCb *cell
3561 PRIVATE S16 rgSCHTomUtlProcTA
3566 PRIVATE S16 rgSCHTomUtlProcTA (cell)
3573 TRC2(rgSCHTomUtlProcTA);
3575 node = cell->taUeLst.first;
3578 ue = (RgSchUeCb *)node->node;
3580 if (ue->dl.taCb.numRemSf == 0)
3582 ue->dl.taCb.state = RGSCH_TA_IDLE;
3583 /* If Outstanding Ta is present, schedule it */
3584 if(ue->dl.taCb.outStndngTa == TRUE)
3586 rgSCHUtlReTxTa(cell, ue);
3590 /* We need to reset state and also value of TA,
3591 * then we start the timer */
3592 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
3593 /* Start the timer only if TA is cfgd as FINITE value */
3594 if (ue->dl.taCb.cfgTaTmr)
3596 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
3599 /* need to delete from the link list */
3600 cmLListDelFrm(&(cell->taUeLst), &(ue->taLnk));
3601 ue->taLnk.node = NULLP;
3605 ue->dl.taCb.numRemSf--;
3607 } /* end of taUeLst */
3610 } /* end of rgSCHTomUtlProcTA */
3612 /** @brief This function handles filling of Hq reception request to
3627 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo
3629 TfuRecpReqInfo *recpReqInfo,
3632 RgSchDlHqProcCb *hqCb,
3634 TfuUeRecpReqInfo *pucchRecpInfo,
3635 RgSchDlHqProcCb *prvHqCb,
3639 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, validIdx, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err)
3640 TfuRecpReqInfo *recpReqInfo;
3643 RgSchDlHqProcCb *hqCb;
3645 TfuUeRecpReqInfo *pucchRecpInfo;
3646 RgSchDlHqProcCb *prvHqCb;
3651 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo
3653 TfuRecpReqInfo *recpReqInfo,
3655 RgSchDlHqProcCb *hqCb,
3657 TfuUeRecpReqInfo *pucchRecpInfo,
3658 RgSchDlHqProcCb *prvHqCb,
3662 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err)
3663 TfuRecpReqInfo *recpReqInfo;
3665 RgSchDlHqProcCb *hqCb;
3667 TfuUeRecpReqInfo *pucchRecpInfo;
3668 RgSchDlHqProcCb *prvHqCb;
3674 RgSchDlHqTbCb *tbCb;
3676 Bool isAddToLst = FALSE;
3678 for (idx = 0 ;idx < 2; idx++)
3680 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
3682 tbCb = &hqCb->tbInfo[idx];
3684 /* FOR ACK NAK REP */
3685 if ((hqCb->hqE->ue != NULLP) &&
3686 (hqCb->hqE->ue->measGapCb.isMeasuring == TRUE))
3688 if ((tbCb->fbkRecpRepCntr) &&
3689 (--tbCb->fbkRecpRepCntr))
3691 /* Add to next subfarme */
3692 /* Add this hqCb to the next dlSf's ackNakRepQ */
3693 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3694 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3695 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3696 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3699 rgSCHTomUtlMoveNxtOccasion(cell, hqCb->hqE->ue, validIdx);
3707 /* Go to the next node */
3713 //if (hqCb != prvHqCb)
3715 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3716 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3719 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
3720 "TfuUeRecpReqInfo for cell");
3721 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3724 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3725 if ((hqCb->hqE->ue != NULLP) /*&&
3726 ((tbCb->lchSchdData[0].lcId != 0) || (tbCb->taSnt ==
3730 pucchRecpInfo->rnti = hqCb->hqE->ue->ueId;
3734 if (hqCb->hqE->raCb)
3736 pucchRecpInfo->rnti = hqCb->hqE->raCb->tmpCrnti;
3742 if (!hqCb->spsN1PucchRes.pres)
3745 pucchRecpInfo->t.pucchRecpReq.hqType =
3746 TFU_HQ_RECP_REQ_NORMAL;
3747 pucchRecpInfo->t.pucchRecpReq.t.nCce =
3753 pucchRecpInfo->t.pucchRecpReq.hqType =
3754 TFU_HQ_RECP_REQ_N1PUCCH;
3755 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch =
3756 hqCb->spsN1PucchRes.val;
3760 /* Handling of other types */
3761 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
3762 #else /* TFU_UPGRADE */
3763 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
3764 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
3765 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
3767 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 2; /* MIMO */
3771 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 1; /* NON-MIMO */
3775 /* PucchRecpReq needs to be filled up for n1Pucch resource for SPS
3777 if (hqCb->spsN1PucchRes.pres)
3779 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
3782 #endif /* LTEMAC_SPS */
3784 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
3785 cell->pucchCfg.n1PucchAn);
3788 rgSCHEmtcFillPucchRecpInfo(cell, hqCb, &(pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0]));
3791 #endif/*TFU_UPGRADE*/
3794 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, hqCb->hqE->ue,
3795 pucchRecpInfo, validIdx,FALSE);
3798 /* Passing last parameter as FALSE in this case as it will be verified from hqCb*/
3799 isAddToLst = rgSCHEmtcAddRecpInfoToLst(hqCb,recpReqInfo, pucchRecpInfo,FALSE);
3803 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3805 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3808 if ((tbCb->fbkRecpRepCntr) &&
3809 (--tbCb->fbkRecpRepCntr))
3811 /* Add to next subfarme */
3812 /* Add this hqCb to the next dlSf's ackNakRepQ */
3813 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3814 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3815 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3816 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3822 }/* end of rgSCHTomUtlFillHqFdbkInfo */
3825 /** @brief This function handles filling of Hq reception request to
3830 * Function:rgSCHTomUtlFillHqFdbkFor5gtf
3834 * @param [out] TfuRecpReqInfo *recpReqInfo
3835 * @param [in] RgSchCellCb *cell
3836 * @param [in] U16 validIdx,
3837 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3838 * @param [in] RgSchDlSf *dlSf,
3839 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3840 * @param [out] RgSchErrInfo *err
3847 PRIVATE S16 rgSCHTomUtlFillHqFdbkFor5gtf
3849 TfuRecpReqInfo *recpReqInfo,
3852 RgSchDlHqInfo *dlSfHqInfo,
3854 TfuUeRecpReqInfo *pucchRecpInfo,
3858 PRIVATE S16 rgSCHTomUtlFillHqFdbkFor5gtf (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
3859 TfuRecpReqInfo *recpReqInfo;
3862 RgSchDlHqInfo *dlSfHqInfo;
3864 TfuUeRecpReqInfo *pucchRecpInfo;
3869 Inst inst = cell->instIdx;
3873 RgSchDlHqProcCb *hqCb = NULLP;
3875 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3876 Bool isDatPresOnSecCell = FALSE;
3877 U8 primCellTbCount = 0;
3879 hqPNode = dlSfHqInfo->hqPLst.first;
3880 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
3886 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3887 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3890 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
3891 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
3892 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3895 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3896 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
3897 * instead of SPS-CRNTI */
3899 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
3901 pucchReqInfo->uciInfo = TFU_XPUCCH_UCI_INFO;
3903 /* 5gtf TODO : Hardcoded nPUCCHIdx */
3904 pucchReqInfo->uciPduInfo.pucchIndex = 0;
3906 pucchReqInfo->uciPduInfo.numBits = 1;
3908 /* 5gtf TODO : CQI Periodicity Hardcoded to (n,0)*/
3909 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
3911 pucchReqInfo->uciPduInfo.numBits += 5;
3912 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
3913 ue->ue5gtfCb.cqiRiPer);
3916 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3917 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3919 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
3923 /** @brief This function handles filling of Hq reception request to
3928 * Function:rgSCHTomUtlFillHqFdbkForFrmt1B
3931 * Allocates the N1Pucch Resources based on teh A Value
3933 * @param [out] TfuRecpReqInfo *recpReqInfo
3934 * @param [in] RgSchCellCb *cell
3935 * @param [in] U16 validIdx,
3936 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3937 * @param [in] RgSchDlSf *dlSf,
3938 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3939 * @param [out] RgSchErrInfo *err
3947 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3949 TfuRecpReqInfo *recpReqInfo,
3952 RgSchDlHqInfo *dlSfHqInfo,
3954 TfuUeRecpReqInfo *pucchRecpInfo,
3958 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
3959 TfuRecpReqInfo *recpReqInfo;
3962 RgSchDlHqInfo *dlSfHqInfo;
3964 TfuUeRecpReqInfo *pucchRecpInfo;
3969 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3971 TfuRecpReqInfo *recpReqInfo,
3973 RgSchDlHqInfo *dlSfHqInfo,
3975 TfuUeRecpReqInfo *pucchRecpInfo,
3979 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B (recpReqInfo, cell, hqCb, dlSf, pucchRecpInfo, err)
3980 TfuRecpReqInfo *recpReqInfo;
3982 RgSchDlHqInfo *dlSfHqInfo;
3984 TfuUeRecpReqInfo *pucchRecpInfo;
3990 Inst inst = cell->instIdx;
3994 RgSchDlHqProcCb *hqCb = NULLP;
3996 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3997 Bool isDatPresOnSecCell = FALSE;
3998 U8 primCellTbCount = 0;
4000 hqPNode = dlSfHqInfo->hqPLst.first;
4001 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
4007 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4008 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
4011 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
4012 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
4013 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4016 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4017 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
4018 * instead of SPS-CRNTI */
4020 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
4023 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
4024 /* Handling of other types */
4025 pucchReqInfo->type = TFU_UCI_HARQ;
4026 #else /* TFU_UPGRADE */
4027 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
4028 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
4029 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4030 /* Fill HqSz by using totalTbCnt based on the TM mode and
4031 * the number of serv cells configured*/
4033 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
4034 pucchReqInfo->hqInfo.pucchResCnt = ue->f1bCsAVal;
4036 cmMemset((U8 *)pucchReqInfo->hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
4038 /* Two Resources needs to be configured if the
4039 * serving cell is in mimo mode else single
4041 if ((dlSf->relPdcch != NULLP) &&
4042 (RGSCH_TIMEINFO_SAME(recpReqInfo->timingInfo, ue->relPdcchFbkTiming)))
4043 {/* Pcell is having sps rel pdcch present */
4044 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
4045 {/* prim cell is in mimo mode, use 0 and 1 */
4046 pucchReqInfo->hqInfo.hqRes[0] = (dlSf->relPdcch->nCce +
4047 cell->pucchCfg.n1PucchAn);
4048 pucchReqInfo->hqInfo.hqRes[1] = pucchReqInfo->hqInfo.hqRes[0] + 1;
4053 pucchReqInfo->hqInfo.hqRes[2] = (dlSf->relPdcch->nCce +
4054 cell->pucchCfg.n1PucchAn);
4056 /* Release the pdcch so that it will not further processed */
4057 rgSCHUtlPdcchPut(ue->cell,&dlSf->pdcchInfo, dlSf->relPdcch);
4058 dlSf->relPdcch = NULLP;/* only one UE will be scheduled for release pdcch order in one tti */
4060 #endif/*LTEMAC_SPS*/
4061 #endif/*TFU_UPGRADE*/
4064 hqCb = (RgSchDlHqProcCb *)hqPNode->node;
4065 hqPNode = hqPNode->next;
4066 /* In case of CSI + 1BCS , CSI will be
4067 * dropped if scheduling is present on
4068 * seconday cell.36.213 10.1.1
4070 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4072 isDatPresOnSecCell = TRUE;
4075 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
4076 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
4078 primCellTbCount = 2;
4081 primCellTbCount = 1;
4085 pucchReqInfo->t.nCce = hqCb->pdcch->nCce;
4088 switch(ue->f1bCsAVal)
4090 case RG_SCH_A_VAL_2:
4091 /* harq(0) is primary harq(1) is secondary) */
4092 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4094 pucchReqInfo->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.\
4095 cw1N1Res[hqCb->tpc].n1PucchIdx;
4097 else/* primary cell */
4100 /* Need to consider only sps occasions */
4101 if (hqCb->spsN1PucchRes.pres)
4103 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4106 #endif /* LTEMAC_SPS */
4109 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4110 cell->pucchCfg.n1PucchAn);
4114 case RG_SCH_A_VAL_3:
4115 /* Serving cell in mimo mode should be
4116 * in 0 and 1 and the serving cell in siso
4117 * mode should be in 2 indices */
4118 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4120 U8 cellIdx = ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(hqCb->hqE->cell)];
4121 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[cellIdx]->txMode.txModeEnum) > 1)
4122 {/* Sec cell is in mimo mode, use 0 and 1 */
4123 pucchReqInfo->hqInfo.hqRes[0] =
4124 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4126 pucchReqInfo->hqInfo.hqRes[1] =
4127 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
4130 {/* Sec cell is in siso mode, use 2 */
4131 pucchReqInfo->hqInfo.hqRes[2] =
4132 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4136 {/* primary cell hq */
4137 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
4138 {/* prim cell is in mimo mode, use 0 and 1 */
4140 if (hqCb->spsN1PucchRes.pres)
4141 {/* SPS occasions */
4142 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4143 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
4146 #endif /* LTEMAC_SPS */
4148 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4149 cell->pucchCfg.n1PucchAn);
4150 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
4151 cell->pucchCfg.n1PucchAn + 1);
4155 {/* prim cell is in siso mode use 2 */
4157 /* Need to consider only sps occasions */
4158 if (hqCb->spsN1PucchRes.pres)
4160 pucchReqInfo->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
4163 #endif /* LTEMAC_SPS */
4166 pucchReqInfo->hqInfo.hqRes[2] = (hqCb->pdcch->nCce +
4167 cell->pucchCfg.n1PucchAn);
4173 case RG_SCH_A_VAL_4:
4175 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4176 {/* 2 and 3 for sec cell */
4177 pucchReqInfo->hqInfo.hqRes[2] =
4178 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4179 pucchReqInfo->hqInfo.hqRes[3] =
4180 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
4182 else/* primary cell */
4183 {/* 0 and 1 are for primary cell */
4185 /* Need to consider only sps occasions */
4186 if (hqCb->spsN1PucchRes.pres)
4188 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4189 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
4192 #endif /* LTEMAC_SPS */
4195 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4196 cell->pucchCfg.n1PucchAn);
4197 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
4198 cell->pucchCfg.n1PucchAn + 1);
4205 /* TOD:: Add error print */
4209 #endif/*TFU_UPGRADE*/
4220 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
4221 pucchRecpInfo, validIdx,isDatPresOnSecCell);
4223 /* Channel selection wil not be used in case of
4224 * CQI + HARQ. if the data was present only on
4226 if((isDatPresOnSecCell == FALSE) &&
4227 (dlSfHqInfo->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
4228 {/* Data is present only on primary cell */
4230 switch(pucchReqInfo->uciInfo)
4232 case TFU_PUCCH_HARQ_SRS:
4233 case TFU_PUCCH_HARQ_CQI:
4234 case TFU_PUCCH_HARQ_SR_SRS:
4235 case TFU_PUCCH_HARQ_SR_CQI:
4237 dlSfHqInfo->uciFrmtTyp = RG_SCH_UCI_FORMAT1A_1B;
4238 pucchReqInfo->hqInfo.hqSz = primCellTbCount;
4239 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4248 #endif/*TFU_UPGRADE*/
4249 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4250 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4252 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
4253 /** @brief This function handles filling of Hq reception request to
4258 * Function:rgSCHTomUtlFillHqFdbkForFrmt3
4261 * Allocates the N1Pucch Resources based on teh A Value
4263 * @param [out] TfuRecpReqInfo *recpReqInfo
4264 * @param [in] RgSchCellCb *cell
4265 * @param [in] U16 validIdx,
4266 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
4267 * @param [in] RgSchDlSf *dlSf,
4268 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
4269 * @param [out] RgSchErrInfo *err
4277 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3
4279 TfuRecpReqInfo *recpReqInfo,
4282 RgSchDlHqInfo *dlSfHqInfo,
4284 TfuUeRecpReqInfo *pucchRecpInfo,
4288 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3 (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
4289 TfuRecpReqInfo *recpReqInfo;
4292 RgSchDlHqInfo *dlSfHqInfo;
4294 TfuUeRecpReqInfo *pucchRecpInfo;
4299 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3
4301 TfuRecpReqInfo *recpReqInfo,
4303 RgSchDlHqInfo *dlSfHqInfo,
4305 TfuUeRecpReqInfo *pucchRecpInfo,
4309 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3 (recpReqInfo, cell, hqCb, dlSf, pucchRecpInfo, err)
4310 TfuRecpReqInfo *recpReqInfo;
4312 RgSchDlHqInfo *dlSfHqInfo;
4314 TfuUeRecpReqInfo *pucchRecpInfo;
4320 Inst inst = cell->instIdx;
4325 TfuUePucchRecpReq *pucchReqInfo = NULLP;
4327 //hqPNode = dlSfHqInfo->hqPLst.first;
4328 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
4334 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4335 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
4338 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
4339 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
4340 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4343 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4344 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
4345 * instead of SPS-CRNTI */
4347 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
4350 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
4351 /* Handling of other types */
4352 pucchReqInfo->type = TFU_UCI_HARQ;
4353 #else /* TFU_UPGRADE */
4354 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
4355 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
4356 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4357 /* Fill HqSz by using totalTbCnt based on the TM mode and
4358 * the number of serv cells configured*/
4360 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
4361 pucchReqInfo->hqInfo.pucchResCnt = 1;
4363 cmMemset((U8 *)pucchReqInfo->hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
4364 #endif/*TFU_UPGRADE*/
4365 pucchReqInfo->hqInfo.hqRes[0] = dlSfHqInfo->n3ScellPucch.n3PucchIdx;
4367 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
4368 pucchRecpInfo, validIdx,TRUE);
4369 #endif/*TFU_UPGRADE*/
4370 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4371 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4373 }/* end of rgSCHTomUtlFillHqFdbkForFrmt3 */
4377 /** @brief This function handles filling of HARQ feedback recption request to
4386 * @param [out] TfuRecpReqInfo *recpReqInfo
4387 * @param [in] RgSchCellCb *cell
4388 * @param [out] RgSchErrInfo *err
4395 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq
4397 TfuRecpReqInfo *recpReqInfo,
4403 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, validIdx, err)
4404 TfuRecpReqInfo *recpReqInfo;
4411 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq
4413 TfuRecpReqInfo *recpReqInfo,
4418 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, err)
4419 TfuRecpReqInfo *recpReqInfo;
4427 RgSchDlHqProcCb *hqCb;
4428 CmLteTimingInfo futTime;
4431 TfuUeRecpReqInfo *pucchRecpInfo = NULLP;
4434 Inst inst = cell->instIdx;
4437 RgSchDlHqTbCb *tbCb;
4438 RgSchDlHqProcCb *prvHqCb=NULLP;
4440 TRC2(rgSCHTomUtlFillHqFdbkRecpReq);
4447 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper output
4448 * if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME() as it is
4449 * serving the purpose */
4450 RGSCHDECRFRMCRNTTIME(cell->crntTime, futTime, (RG_SCH_CMN_HARQ_INTERVAL -
4451 TFU_RECPREQ_DLDELTA));
4452 dlSf = rgSCHUtlSubFrmGet (cell, futTime);
4453 /* Get the next dlsf as well */
4454 RG_SCH_ADD_TO_CRNT_TIME(futTime, futTime, 1)
4455 nxtDlsf = rgSCHUtlSubFrmGet (cell, futTime);
4459 if (dlSf->ueLst.count != 0)
4461 node = dlSf->ueLst.first;
4464 ue = (RgSchUeCb *)(node->node);
4467 if(ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx].isPuschHarqRecpPres == TRUE)
4468 {/* This UE is already considered for PUSCH
4472 rgSCHTomUtlFillHqFdbkFor5gtf(recpReqInfo, cell, validIdx,
4473 &ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx], dlSf, pucchRecpInfo, err);
4474 } /* end of while */
4475 } /* If hq is expected */
4477 if (dlSf->msg4HqPLst.count != 0)
4480 node = dlSf->msg4HqPLst.first;
4483 hqCb = (RgSchDlHqProcCb*)(node->node);
4485 //TODO_SID: need to check validIdx
4486 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, validIdx, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err);
4488 } /* end of while */
4491 /* Check with TDD Code */
4492 /* FOR ACK NACK REP */
4494 } /* end of rgSCHTomUtlFillHqFdbkRecpReq */
4496 /** @brief This function handles filling of SR reception request to
4505 * @param [out] TfuRecpReqInfo *recpReqInfo
4506 * @param [in] RgSchCellCb *cell
4507 * @param [out] RgSchErrInfo *err
4513 PRIVATE S16 rgSCHTomUtlFillSrRecpReq
4515 TfuRecpReqInfo *recpReqInfo,
4521 PRIVATE S16 rgSCHTomUtlFillSrRecpReq (recpReqInfo, cell, validIdx, err)
4522 TfuRecpReqInfo *recpReqInfo;
4529 TfuUeRecpReqInfo *pucchRecpInfo;
4535 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
4539 TRC2(rgSCHTomUtlFillSrRecpReq);
4543 node = cell->pCqiSrsSrLst[validIdx].srLst.first;
4546 ue = (RgSchUeCb *)(node->node);
4547 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4553 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4554 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4556 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4557 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4558 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4561 #ifdef TFU_ALLOC_EVENT_NO_INIT
4562 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4563 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4569 /* Should we check for Rel8 and above???
4570 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
4572 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
4573 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
4574 if((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
4575 (ulSpsUe->isUlSpsActv))
4577 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4582 pucchRecpInfo->rnti = ue->ueId;
4583 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
4584 ue->srCb.srCfg.srSetup.srResIdx;
4585 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR;
4586 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4587 rgSCHTomUtlFillCqiSrsWithSr(cell, ue, recpReqInfo,
4588 pucchRecpInfo, validIdx);
4590 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4594 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4596 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4599 }/* end of rgSCHTomUtlFillSrRecpReq */
4602 /** @brief This function tells will the UE has a periodic CQI/PMI/RI
4611 * @param [in] RgSchUeCb *ue
4612 * @param [out] Bool *willueRprtCqiRi
4619 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi
4622 Bool *willueRprtCqiRi
4625 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi ( ue, willueRprtCqiRi)
4627 Bool *willueRprtCqiRi;
4630 TRC2(rgSCHTomUtlWillUeRprtCqiRi);
4632 /* Intialising Reporting probability as TRUE */
4633 *willueRprtCqiRi = TRUE;
4635 /* Checking the cases in which UE will not report CQIPMI/RI */
4636 if(ue->isDrxEnabled && ue->drxCb)
4639 if(ue->drxCb->cqiMask.pres && ue->drxCb->cqiMask.val == RGR_DRX_SETUP)
4640 {/*cqiMask is setup by upper layers */
4641 if((ue->drxCb->drxUlInactvMask & RG_SCH_DRX_ONDUR_BITMASK) ==
4642 RG_SCH_DRX_ONDUR_BITMASK)
4643 {/*onDuration NOT running, do not expect cqi/pmi/ri*/
4644 *willueRprtCqiRi = FALSE;
4648 #endif /*end of LTEMAC_R9*/
4649 /* ccpu00134258: Fix for CQI DRX issue*/
4650 if(ue->drxCb->onDurTmrLen > 2)
4652 if ( !RG_SCH_DRX_UL_IS_UE_ACTIVE(ue->drxCb) )
4653 {/*UE is not active, do not expect cqi/pmi/ri*/
4654 *willueRprtCqiRi = FALSE;
4657 }/*ue->isDrxEnabled*/
4660 } /*End of rgSCHTomUtlWillUeRprtCqiRi*/
4662 /** @brief This function handles filling of RI reception request to
4671 * @param [out] TfuRecpReqInfo *recpReqInfo
4672 * @param [in] RgSchCellCb *cell
4673 * @param [in] U16 validIdx
4674 * @param [out] RgSchErrInfo *err
4680 PRIVATE S16 rgSCHTomUtlFillRiRecpReq
4682 TfuRecpReqInfo *recpReqInfo,
4688 PRIVATE S16 rgSCHTomUtlFillRiRecpReq (recpReqInfo, cell, validIdx, err)
4689 TfuRecpReqInfo *recpReqInfo;
4696 TfuUeRecpReqInfo *pucchRecpInfo;
4699 Bool willUeRprtCqi; /* Flag set due to CQI Mask
4700 and UE inactive state (DRX) */
4701 RgSchUePCqiCb *riCb = NULLP;
4702 TRC2(rgSCHTomUtlFillRiRecpReq);
4704 node = cell->pCqiSrsSrLst[validIdx].riLst.first;
4707 riCb = (RgSchUePCqiCb *)(node->node);
4708 ue = riCb->servCellInfo->ue;
4709 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4711 if(riCb->riRecpPrcsd)
4713 /*ccpu00140578:: RI Proecssing is already done for this TTI
4714 * as part of PUSCH reception process or HARQ
4715 * Reception processing. Hence skipping this UE
4717 riCb->riRecpPrcsd = FALSE;
4720 if(riCb->riDist ==0)
4722 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4723 #ifdef XEON_SPECIFIC_CHANGES
4724 if(RGSCH_TIMEINFO_SAME(cell->crntTime, ue->riRecpTime))
4730 if((TRUE == riCb->isRiIgnoByCollsn)
4731 || (willUeRprtCqi == FALSE))
4733 if(willUeRprtCqi == FALSE)
4736 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4739 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4740 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4742 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4743 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4744 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4747 #ifdef TFU_ALLOC_EVENT_NO_INIT
4748 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4749 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4752 pucchRecpInfo->rnti = ue->ueId;
4753 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4754 riCb->cqiCfg.cqiSetup.cqiPResIdx;
4755 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = riCb->riNumBits;
4756 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4757 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4759 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4760 riCb->servCellInfo->sCellIdx;
4762 rgSCHTomUtlFillRiBitWidthInfo(ue);
4763 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4764 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
4766 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
4768 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4770 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4772 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4773 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4781 }/* end of rgSCHTomUtlFillRiRecpReq */
4784 /** @brief This function handles filling of 5GTF CQI-RI reception request to
4793 * @param [out] TfuRecpReqInfo *recpReqInfo
4794 * @param [in] RgSchCellCb *cell
4795 * @param [in] U16 validIdx
4796 * @param [out] RgSchErrInfo *err
4802 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq
4804 TfuRecpReqInfo *recpReqInfo,
4810 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq (recpReqInfo, cell, validIdx, err)
4811 TfuRecpReqInfo *recpReqInfo;
4817 TfuUeRecpReqInfo *pucchRecpInfo;
4818 RgSchUeCb *ue = NULLP;
4821 TRC2(rgSCHTomUtlFillCqiRiRecpReq);
4823 while ((ue = rgSCHDbmGetNextUeCb(cell, ue)) != NULLP)
4825 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
4827 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4828 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4830 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4831 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4832 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4835 #ifdef TFU_ALLOC_EVENT_NO_INIT
4836 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4837 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4839 pucchRecpInfo->rnti = ue->ueId;
4840 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_XPUCCH_UCI_INFO;
4841 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.pucchIndex = 0;
4842 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.numBits = 5;
4844 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
4845 ue->ue5gtfCb.cqiRiPer);
4846 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4847 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4852 }/* end of rgSCHTomUtlFillCqiRiRecpReq */
4855 /** @brief This function handles filling of PCQI reception request to
4864 * @param [out] TfuRecpReqInfo *recpReqInfo
4865 * @param [in] RgSchCellCb *cell
4866 * @param [in] U16 validIdx
4867 * @param [out] RgSchErrInfo *err
4873 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq
4875 TfuRecpReqInfo *recpReqInfo,
4881 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq (recpReqInfo, cell, validIdx, err)
4882 TfuRecpReqInfo *recpReqInfo;
4889 TfuUeRecpReqInfo *pucchRecpInfo;
4894 Bool willUeRprtCqi; /* Flag set due to CQI Mask
4895 and UE Inactive state (DRX)*/
4897 RgSchUePCqiCb *cqiCb = NULLP;
4898 Bool isAddToLst = FALSE;
4900 TRC2(rgSCHTomUtlFillPcqiRecpReq);
4902 node = cell->pCqiSrsSrLst[validIdx].cqiLst.first;
4905 cqiCb = (RgSchUePCqiCb*)(node->node);
4906 ue = cqiCb->servCellInfo->ue;
4907 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4909 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4911 if ((cqiCb->isCqiIgnoByCollsn == TRUE) ||
4912 (willUeRprtCqi == FALSE))
4914 if(willUeRprtCqi == FALSE)
4917 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4921 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4923 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4924 cqiCb->servCellInfo->sCellIdx;
4926 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
4929 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to Fill CqiPmi "
4934 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4935 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4937 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4938 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4939 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4942 #ifdef TFU_ALLOC_EVENT_NO_INIT
4943 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4944 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4947 /*Fill PCQI params*/
4948 pucchRecpInfo->rnti = ue->ueId;
4949 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4950 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
4951 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = cqiPmiSz;
4952 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4953 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4954 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4956 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4959 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4963 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4965 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4968 }/* end of rgSCHTomUtlFillPcqiRecpReq */
4970 /** @brief This function handles filling of SRS reception request to
4979 * @param [out] TfuRecpReqInfo *recpReqInfo
4980 * @param [in] RgSchCellCb *cell
4981 * @param [in] U16 validIdx
4982 * @param [out] RgSchErrInfo *err
4988 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq
4990 TfuRecpReqInfo *recpReqInfo,
4996 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq (recpReqInfo, cell, validIdx, err)
4997 TfuRecpReqInfo *recpReqInfo;
5004 TfuUeRecpReqInfo *pucchRecpInfo;
5008 TRC2(rgSCHTomUtlFillSrsRecpReq);
5010 node = cell->pCqiSrsSrLst[validIdx].srsLst.first;
5013 ue = (RgSchUeCb *)(node->node);
5014 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
5016 if(ue->srsCb.srsRecpPrcsd)
5018 /* ccpu00140578::SRS Proecssing is already done for this TTI
5019 * as part of PUSCH or HARQ reception process and
5020 * hence skipping this UE */
5021 ue->srsCb.srsRecpPrcsd = FALSE;
5025 if(ue->srsCb.srsDist ==0)
5027 /* We need to add the recp request to be sent on the pucchANRep value. */
5028 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
5029 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
5031 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5032 "TfuUeRecpReqInfo for RNTI:%d ",ue->ueId);
5033 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5037 #ifdef TFU_ALLOC_EVENT_NO_INIT
5038 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
5042 pucchRecpInfo->rnti = ue->ueId;
5043 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
5044 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
5045 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
5046 ue->srsCb.srsCfg.srsSetup.fDomPosi;
5047 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
5048 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
5049 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
5050 ue->srsCb.srsCfg.srsSetup.txComb;
5051 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
5052 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
5053 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
5054 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
5056 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SRS;
5057 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
5058 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
5059 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
5063 ue->srsCb.srsDist--;
5067 }/* end of rgSCHTomUtlFillSrsRecpReq */
5070 /** @brief This function handles filling of data reception requests for
5079 * @param [out] TfuRecpReqInfo *recpReqInfo
5080 * @param [in] RgSchCellCb *cell
5081 * @param [out] RgSchErrInfo *err
5087 PRIVATE S16 rgSCHTomUtlFillDatRecpReq
5089 TfuRecpReqInfo *recpReqInfo,
5094 PRIVATE S16 rgSCHTomUtlFillDatRecpReq (recpReqInfo, cell, err)
5095 TfuRecpReqInfo *recpReqInfo;
5101 RgSchUlAlloc *alloc;
5102 TfuUeRecpReqInfo *datRecpInfo;
5104 TRC2(rgSCHTomUtlFillDatRecpReq)
5106 /* processing steps are
5107 * - Run through the UL allocations going out in this subframe.
5108 * - Run through the UL receptions expected the next subframe.
5110 alloc = rgSCHUtlFirstRcptnReq (cell);
5113 /* FOR ACK NACK REP */
5114 if (NULLP != alloc->ue)
5116 /* If measuring or ackNakRep we shall not send dat RecpReq */
5117 if ((alloc->ue->measGapCb.isMeasuring == TRUE) ||
5118 (alloc->ue->ackNakRepCb.isAckNakRep == TRUE))
5120 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5125 if ((ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
5126 sizeof(TfuUeRecpReqInfo),
5127 &(recpReqInfo->memCp))) != ROK)
5129 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5130 "TfuUeRecpReqInfo for RNTI:%d ", alloc->ue->ueId);
5131 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5134 if (!alloc->forMsg3)
5136 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
5137 rgSCHUtlAllocRcptInfo (alloc,
5139 &datRecpInfo->t.puschRecpReq.mcs,
5140 &datRecpInfo->t.puschRecpReq.rbStart,
5141 &datRecpInfo->t.puschRecpReq.numRb,
5142 &datRecpInfo->t.puschRecpReq.rv,
5143 &datRecpInfo->t.puschRecpReq.size,
5144 &datRecpInfo->t.puschRecpReq.modType,
5145 &datRecpInfo->t.puschRecpReq.isRtx,
5146 &datRecpInfo->t.puschRecpReq.nDmrs,
5147 &datRecpInfo->t.puschRecpReq.ndi,
5148 &datRecpInfo->t.puschRecpReq.harqProcId
5153 datRecpInfo->type = TFU_RECP_REQ_MSG3;
5154 rgSCHUtlAllocRcptInfo (alloc,
5156 &datRecpInfo->t.msg3RecpReq.mcs,
5157 &datRecpInfo->t.msg3RecpReq.rbStart,
5158 &datRecpInfo->t.msg3RecpReq.numRb,
5159 /*ccpu00128993 - MOD - fix for msg3 softcombining bug*/
5160 &datRecpInfo->t.msg3RecpReq.rv,
5161 &datRecpInfo->t.msg3RecpReq.size,
5162 &datRecpInfo->t.msg3RecpReq.modType,
5163 &datRecpInfo->t.msg3RecpReq.isRtx,
5164 &datRecpInfo->t.msg3RecpReq.nDmrs,
5165 &datRecpInfo->t.msg3RecpReq.ndi,
5166 &datRecpInfo->t.msg3RecpReq.harqProcId
5170 /* Other fields of datRecpInfo shall be filled
5171 * here for new features */
5172 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
5173 datRecpInfo->lnk.node = (PTR)datRecpInfo;
5175 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5176 } /* end of while */
5178 } /* end of rgSCHTomUtlFillDatRecpReq */
5181 /** @brief This function handles filling of data reception requests for
5190 * @param [out] TfuRecpReqInfo *recpReqInfo
5191 * @param [in] RgSchCellCb *cell
5192 * @param [in] U16 validIdx
5193 * @param [out] RgSchErrInfo *err
5199 PRIVATE S16 rgSCHTomUtlFillDatRecpReq
5201 TfuRecpReqInfo *recpReqInfo,
5207 PRIVATE S16 rgSCHTomUtlFillDatRecpReq (recpReqInfo, cell, validIdx, err)
5208 TfuRecpReqInfo *recpReqInfo;
5214 CmLteTimingInfo dci0Time;
5216 Bool recvCtrl = TRUE;
5218 RgSchUlAlloc *alloc;
5219 TfuUeRecpReqInfo *datRecpInfo;
5221 Bool hqPres; /*Set when HARQ Rec Req is present*/
5222 Bool isAperiodic = FALSE; /*Set when Aperiodic CQI is expected */
5225 TRC2(rgSCHTomUtlFillDatRecpReq);
5227 if((0 == (recpReqInfo->timingInfo.sfn % 30)) && (0 == recpReqInfo->timingInfo.subframe))
5229 //printf("5GTF_CHECK rgSCHTomUtlFillDatRecpReq (%d : %d)\n", recpReqInfo->timingInfo.sfn, recpReqInfo->timingInfo.subframe);
5231 /* processing steps are
5232 * - Run through the UL allocations going out in this subframe.
5233 * - Run through the UL receptions expected the next subframe.
5236 alloc = rgSCHUtlFirstRcptnReq (cell);
5239 isAperiodic = FALSE;
5240 ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
5241 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
5244 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5245 "TfuUeRecpReqInfo for RNTI:%d ", alloc->rnti);
5246 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5249 #ifdef TFU_ALLOC_EVENT_NO_INIT
5250 datRecpInfo->t.puschRecpReq.initialNSrs.pres = FALSE;
5251 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
5253 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
5254 /* ccpu00131944 - Intializing hqPres in each iteration*/
5256 /* Check if this if for MSG3 - no scope for feedback along with it. */
5257 if ((FALSE == alloc->forMsg3))
5259 /* Check if any DL HARQ processes has a feedback coming at the time of
5260 * this reception request.
5265 RGSCHDECRFRMCRNTTIME(cell->crntTime,dci0Time,(RGSCH_ULCTRL_RECP_DIST));
5267 idx = (dci0Time.sfn * RGSCH_NUM_SUB_FRAMES_5G + dci0Time.subframe)%
5268 RGSCH_ULCTRL_RECP_DIST;
5269 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
5270 datRecpInfo->rnti = alloc->rnti;
5271 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
5272 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5275 else /*Enters for Msg3 == TRUE condition*/
5277 /* ccpu00130884 - ADD - HO case when Msg3 alloc and Cqi/Ri/SRS opportunity
5278 * occur at same time */
5279 if(NULLP != alloc->ue)
5282 /* Only DATA is expected */
5283 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
5284 datRecpInfo->rnti = alloc->rnti;
5285 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
5286 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5291 if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA &&
5292 datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_SRS &&
5293 isAperiodic == FALSE)
5295 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = TRUE;
5296 datRecpInfo->t.puschRecpReq.initialNumRbs.val = alloc->ue->initNumRbs;
5300 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
5303 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
5304 datRecpInfo->lnk.node = (PTR)datRecpInfo;
5305 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5307 } /* end of while */
5309 if(numUePerTti && (numUePerTti < RG_MAX_NUM_UE_PER_TTI))
5311 cell->ulNumUeSchedPerTti[numUePerTti-1]++;
5312 gUlNumUePerTti[numUePerTti - 1]++;
5315 } /* end of rgSCHTomUtlFillDatRecpReq */
5317 /* rg009.201. Added changes of TFU_UPGRADE */
5319 /***********************************************************
5321 * Func : rgSCHTomUtlFillRiBitWidthInfo
5324 * Desc : Fills the RI BitWidth and stores it for decoding.
5333 **********************************************************/
5335 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo
5340 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo(ueCb)
5344 RgSchUePCqiCb *riCb = ueCb->nPRiCb;
5345 TRC2(rgSCHTomUtlFillRiBitWidthInfo);
5347 if (ueCb->mimoInfo.txMode != RGR_UE_TM_3 &&
5348 ueCb->mimoInfo.txMode != RGR_UE_TM_4)
5353 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
5354 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
5355 (TfuDlCqiPucchMode)riCb->cqiCfg.cqiSetup.prdModeEnum;
5356 switch(ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode)
5358 case TFU_PUCCH_CQI_MODE10:
5359 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.type = TFU_RPT_RI;
5360 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.u.ri =
5363 case TFU_PUCCH_CQI_MODE11:
5364 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.type = TFU_RPT_RI;
5365 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.u.ri =
5368 case TFU_PUCCH_CQI_MODE20:
5369 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.type = TFU_RPT_RI;
5370 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.u.ri =
5373 case TFU_PUCCH_CQI_MODE21:
5374 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.type = TFU_RPT_RI;
5375 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.u.ri =
5382 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5386 /***********************************************************
5388 * Func : rgSCHTomUtlFetchPcqiBitSz
5391 * Desc : Fetch the CQI/PMI bits for a UE based on the mode, periodicity.
5400 **********************************************************/
5402 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz
5409 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz(ueCb, numTxAnt, ri)
5417 TfuCqiPucchMode10 *mode10Info;
5418 TfuCqiPucchMode11 *mode11Info;
5419 TfuCqiPucchMode20 *mode20Info;
5420 TfuCqiPucchMode21 *mode21Info;
5421 RgSchUePCqiCb *cqiCb = ueCb->nPCqiCb;
5423 TRC3(rgSCHTomUtlFetchPcqiBitSz);
5425 confRepMode = cqiCb->cqiCfg.cqiSetup.prdModeEnum;
5426 if((ueCb->mimoInfo.txMode != RGR_UE_TM_3) &&
5427 (ueCb->mimoInfo.txMode != RGR_UE_TM_4))
5433 *ri = cqiCb->perRiVal;
5435 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
5436 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
5437 (TfuDlCqiPucchMode)confRepMode;
5440 case RGR_PRD_CQI_MOD10:
5442 mode10Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info;
5444 mode10Info->type = TFU_RPT_CQI;
5445 mode10Info->u.cqi = 4;
5449 case RGR_PRD_CQI_MOD11:
5451 mode11Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info;
5452 mode11Info->type = TFU_RPT_CQI;
5458 mode11Info->u.cqi.cqi = 4;
5459 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5460 mode11Info->u.cqi.pmi = 2;
5465 mode11Info->u.cqi.cqi = 4;
5466 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5467 mode11Info->u.cqi.wideDiffCqi.val = 3;
5468 mode11Info->u.cqi.pmi = 1;
5471 else if(numTxAnt == 4)
5476 mode11Info->u.cqi.cqi = 4;
5477 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5478 mode11Info->u.cqi.pmi = 4;
5483 mode11Info->u.cqi.cqi = 4;
5484 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5485 mode11Info->u.cqi.wideDiffCqi.val = 3;
5486 mode11Info->u.cqi.pmi = 4;
5491 /* This is number of antenna case 1.
5492 * This is not applicable for Mode 1-1.
5493 * So setting it to invalid value */
5499 case RGR_PRD_CQI_MOD20:
5501 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info;
5502 mode20Info->type = TFU_RPT_CQI;
5506 mode20Info->u.cqi.isWideband = TRUE;
5507 mode20Info->u.cqi.u.wideCqi = 4;
5511 pcqiSz = 4 + cqiCb->label;
5512 mode20Info->u.cqi.isWideband = FALSE;
5513 mode20Info->u.cqi.u.subCqi.cqi = 4;
5514 mode20Info->u.cqi.u.subCqi.l = cqiCb->label;
5519 case RGR_PRD_CQI_MOD21:
5521 mode21Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info;
5522 mode21Info->type = TFU_RPT_CQI;
5523 //pcqiSz = rgSCHTomUtlFetchPcqiBitSzPucchMode21(ueCb,
5524 // mode21Info, numTxAnt, ri);
5532 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5537 /***********************************************************
5539 * Func : rgSCHTomUtlPcqiSbCalcBpIdx
5542 * Desc : Determines the BP index from the timing info
5551 **********************************************************/
5553 PUBLIC S16 rgSCHTomUtlPcqiSbCalcBpIdx
5555 CmLteTimingInfo crntTimInfo,
5557 RgSchUePCqiCb *cqiCb
5560 PUBLIC S16 rgSCHTomUtlPcqiSbCalcBpIdx(crntTimInfo, ueCb, cqiCb)
5561 CmLteTimingInfo crntTimInfo;
5563 RgSchUePCqiCb *cqiCb;
5566 U16 tti = (crntTimInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTimInfo.subframe);
5567 U16 prdNum = tti/cqiCb->cqiPeri;
5569 TRC2(rgSCHTomUtlPcqiSbCalcBpIdx);
5570 if((prdNum % cqiCb->h) == 0)
5574 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
5579 cqiCb->isWb = FALSE;
5580 cqiCb->bpIdx = ((prdNum % cqiCb->h) - 1) % cqiCb->J;
5582 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_0;
5590 * @brief Function which moves PCQI, RI, SR and SRS to next periodicity
5591 * Occasions as that needs to be done in case of Ack/Nack repetition
5592 * reception request occasions or during Measurement Gap occasions.
5596 * Function: rgSCHTomUtlMoveNxtOccasion
5598 * Function which moves PCQI, RI, SR and SRS to next perodicity
5599 * Occasions as that needs to be done in case of Ack/Nack repetition
5600 * reception request occasions or during Measurement Gap occasions.
5602 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5605 * - Check whether the current Tx Instance matches with the rec req time
5606 * - If true, then move them to their next Tx Instance
5608 * @param[in] RgSchCellCb *cell,
5616 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion
5623 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion(cell, ue, validIdx)
5629 RgSchUePCqiCb *cqiCb = ue->nPCqiCb;
5630 RgSchUePCqiCb *riCb = ue->nPRiCb;
5631 TRC2(rgSCHTomUtlMoveNxtOccasion);
5633 /* ccpu00140578::Skip the UE if already RI recpetion
5634 * is processed in the same subframe */
5635 if ((riCb->nRiTrIdx == validIdx) &&
5636 (riCb->riRecpPrcsd == FALSE))
5638 if(riCb->riDist ==0)
5640 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
5646 /* ccpu00140578:: As this UE is considered for this TTI
5647 * Same UE should not get processed for RI reception
5648 * or for updating th RI distance.*/
5649 if(riCb->nRiTrIdx == validIdx)
5651 riCb->riRecpPrcsd = TRUE;
5654 if (cqiCb->nCqiTrIdx == validIdx)
5656 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
5659 /* ccpu00140578::Skip the UE if SRS recpetion
5660 * is already processed in the same subframe */
5661 if ((ue->srsCb.nSrsTrIdx == validIdx) &&
5662 (ue->srsCb.srsRecpPrcsd == FALSE))
5664 if(ue->srsCb.srsDist ==0)
5666 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
5670 ue->srsCb.srsDist--;
5672 /* ccpu00140578:: As this UE is considered for this TTI
5673 * Same UE should not get processed for SRS reception
5674 * or for updating th SRS distance.*/
5675 if(ue->srsCb.nSrsTrIdx == validIdx)
5677 ue->srsCb.srsRecpPrcsd = TRUE;
5680 if (ue->srCb.nSrTrIdx == validIdx)
5682 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
5685 } /* rgSCHTomUtlMoveNxtOccasion */
5688 /***********************************************************
5690 * Func : rgSCHTomPrepareAcqiRecp
5693 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
5694 * for decoding. Fill RECP request and prepare the scartchpad
5695 * to aid decoding of Aperiodic CQI.
5704 **********************************************************/
5706 PUBLIC Void rgSCHTomPrepareAcqiRecp
5710 TfuUePuschCqiRecpInfo *cqiRecpReqInfo,
5714 PUBLIC Void rgSCHTomPrepareAcqiRecp(ueCb, cell, cqiRecpReqInfo, ccIdx)
5717 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5722 RgSchCqiRawPuschMode12 *mode12Info;
5723 RgSchCqiRawPuschMode20 *mode20Info;
5724 RgSchCqiRawPuschMode22 *mode22Info;
5725 RgSchCqiRawPuschMode30 *mode30Info;
5726 RgSchCqiRawPuschMode31 *mode31Info;
5727 U8 numTxAnt = cell->numTxAntPorts;
5728 U8 sCellIdx = ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)];
5730 RgSchUeACqiCb *acqiCb = &ueCb->cellInfo[sCellIdx]->acqiCb;
5732 TRC2(rgSCHTomPrepareAcqiRecp);
5735 cqiRecpReqInfo->reportType = TFU_APERIODIC_CQI_TYPE; /* Aperiodic */
5736 if (ueCb->mimoInfo.txMode == RGR_UE_TM_3 ||
5737 ueCb->mimoInfo.txMode == RGR_UE_TM_4)
5739 cqiRecpReqInfo->riSz[ccIdx].pres = TRUE;
5740 cqiRecpReqInfo->riSz[ccIdx].val = acqiCb->riNumBits;
5742 /* This flag will be rmeoved after making changes in BRDCM CL
5743 * Sachin is doing the change
5745 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
5747 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5748 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5750 if(ueCb->nPCqiCb->perRiVal == 1)
5752 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5756 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5759 /* Fill scratchpad to aid decoding of aper CQI upon
5761 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
5762 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUSCH;
5764 numOfCells = ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells;
5766 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5767 puschRawCqiInfo.mode = (TfuDlCqiPuschMode)confRepMode;
5769 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5770 puschRawCqiInfo.ri.pres = cqiRecpReqInfo->riSz[ccIdx].pres;
5772 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5773 puschRawCqiInfo.ri.val = cqiRecpReqInfo->riSz[ccIdx].val;
5775 /* Setting the sCellIdx */
5776 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5777 sCellIdx = sCellIdx;
5781 case RGR_APRD_CQI_MOD12:
5783 mode12Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5784 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode12Info;
5785 mode12Info->wideBCqiCw0 = 4;
5786 mode12Info->r1WideBCqiCw1 = 0;
5787 mode12Info->rg1WideBCqiCw1 = 4;
5790 mode12Info->r1TotalPmiBitLen = 2*acqiCb->N;
5791 mode12Info->rg1TotalPmiBitLen = acqiCb->N;
5793 else if(numTxAnt == 4)
5795 mode12Info->r1TotalPmiBitLen = 4*acqiCb->N;
5796 mode12Info->rg1TotalPmiBitLen = 4*acqiCb->N;
5801 case RGR_APRD_CQI_MOD20:
5803 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5804 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode20Info;
5805 mode20Info->wideBCqiCw = 4;
5806 mode20Info->subBandDiffCqi = 2;
5807 mode20Info->posOfM = acqiCb->L;
5811 case RGR_APRD_CQI_MOD22:
5813 mode22Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5814 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode22Info;
5815 mode22Info->wideBCqiCw0 = 4;
5816 mode22Info->sBDiffCqiCw0 = 2;
5817 mode22Info->r1WideBCqiCw1 = 0;
5818 mode22Info->r1SbDiffCqiCw1 = 0;
5819 mode22Info->rg1WideBCqiCw1 = 4;
5820 mode22Info->rg1SbDiffCqiCw1 = 2;
5821 mode22Info->posOfM = acqiCb->L;
5824 mode22Info->r1PmiBitLen = 4;
5825 mode22Info->rg1PmiBitLen = 2;
5827 else if(numTxAnt == 4)
5829 mode22Info->r1PmiBitLen = 8;
5830 mode22Info->rg1PmiBitLen = 8;
5835 case RGR_APRD_CQI_MOD30:
5837 mode30Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5838 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode30Info;
5839 mode30Info->wideBCqiCw = 4;
5840 mode30Info->totLenSbDiffCqi = 2*acqiCb->N;
5844 case RGR_APRD_CQI_MOD31:
5846 mode31Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5847 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode31Info;
5848 mode31Info->wideBCqiCw0 = 4;
5849 mode31Info->totLenSbDiffCqiCw0 = 2*acqiCb->N;
5850 mode31Info->r1WideBCqiCw1 = 0;
5851 mode31Info->r1TotLenSbDiffCqiCw1 =0;
5852 mode31Info->rg1WideBCqiCw1 = 4;
5853 mode31Info->rg1TotLenSbDiffCqiCw1 = 2*acqiCb->N;
5856 mode31Info->r1PmiBitLen = 2;
5857 mode31Info->rg1PmiBitLen = 1;
5859 else if(numTxAnt == 4)
5861 mode31Info->r1PmiBitLen = 4;
5862 mode31Info->rg1PmiBitLen = 4;
5873 * @brief Function which handles the filling of Aperiodic CQI/RI reception
5878 * Function: rgSCHTomUtlFillDatAperRecpReq
5880 * Function which handles the filling of Aperiodic CQI/RI reception
5883 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5886 * - Fill the reception request for the data arriving on the ULSCH
5887 * - Fill the reception request information for the Aperiodic CQI/PMI/RI
5889 * @param[in] RgSchCellCb *cell,
5890 * RgSchUlAlloc *alloc,
5891 * TfuUeRecpReqInfo *datRecpInfo,
5892 * CmLteTimingInfo *timeInfo,
5899 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq
5903 RgSchUlAlloc *alloc,
5904 TfuUeRecpReqInfo *datRecpInfo,
5905 CmLteTimingInfo *timeInfo,
5910 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq(cell, cqiReq, alloc, datRecpInfo, timeInfo, hqPres, validIdx)
5913 RgSchUlAlloc *alloc;
5914 TfuUeRecpReqInfo *datRecpInfo;
5915 CmLteTimingInfo *timeInfo;
5920 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5921 RgSchUeCb *ueCb = alloc->ue;
5926 TRC2(rgSCHTomUtlFillDatAperRecpReq);
5928 /*Fill RI Reception Params*/
5929 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
5930 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
5931 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
5934 cqiRecpReqInfo->cCNum = 0;
5935 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells = 0;
5938 rgSCHTomUtlGetTrigSet(cell, ueCb, cqiReq, &triggerSet);
5939 for (sIdx = 0; sIdx < CM_LTE_MAX_CELLS; sIdx++)
5941 /* The Aperiodic request for SCell index sIdx */
5942 if ((triggerSet >> (7 - sIdx)) & 0x01)
5944 /* The Aperiodic request for SCell index sIdx */
5945 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[sIdx]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5946 cqiRecpReqInfo->cCNum++;
5947 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5951 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[0]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5952 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5955 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5957 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
5959 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
5960 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
5964 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
5966 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
5970 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
5972 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
5974 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
5976 datRecpInfo->rnti = alloc->rnti;
5977 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
5978 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5980 } /* rgSCHTomUtlFillDatAperRecpReq */
5985 * @brief Function which handles the filling of Periodic RI reception
5986 * request values which arrives along with UL Data on ULSCH
5990 * Function: rgSCHTomUtlFillDatPriRecpReq
5992 * Function which handles the filling of Periodic RI reception
5993 * request values which arrives along with UL Data on ULSCH
5995 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5998 * - Fill the reception request for the data arriving on the ULSCH
5999 * - Fill the reception request information for the Periodic RI
6001 * @param[in] RgSchCellCb *cell,
6002 * RgSchUlAlloc *alloc,
6003 * TfuUeRecpReqInfo *datRecpInfo,
6004 * CmLteTimingInfo *timeInfo,
6011 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq
6014 RgSchUlAlloc *alloc,
6015 TfuUeRecpReqInfo *datRecpInfo,
6016 CmLteTimingInfo *timeInfo,
6021 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq(cell, alloc, datRecpInfo, timeInfo,
6024 RgSchUlAlloc *alloc;
6025 TfuUeRecpReqInfo *datRecpInfo;
6026 CmLteTimingInfo *timeInfo;
6031 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
6032 TRC2(rgSCHTomUtlFillDatPriRecpReq);
6034 /*Fill RI Reception Params*/
6035 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
6036 #ifdef TFU_ALLOC_EVENT_NO_INIT
6037 cqiRecpReqInfo->cqiBetaOff = 0;
6038 /* Fill only the first RI index since Periodic can come
6040 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
6041 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
6043 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* periodic */
6044 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
6046 /* Fill only the first RI index since Periodic can come
6048 cqiRecpReqInfo->cCNum = 1;
6049 cqiRecpReqInfo->riSz[0].pres = TRUE;
6050 cqiRecpReqInfo->riSz[0].val = alloc->ue->nPRiCb->riNumBits;
6052 rgSCHTomUtlFillRiBitWidthInfo(alloc->ue);
6053 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
6055 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6056 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
6060 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
6062 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
6066 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
6068 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
6070 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
6072 datRecpInfo->rnti = alloc->rnti;
6073 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6074 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6076 } /* rgSCHTomUtlFillDatPriRecpReq */
6080 * @brief Function which handles the filling of Periodic CQI/PMI reception
6081 * request values which arrives along with UL Data on ULSCH
6085 * Function: rgSCHTomUtlFillDatPCqiRecpReq
6087 * Function which handles the filling of Periodic CQI/PMI reception
6088 * request values which arrives along with UL Data on ULSCH
6090 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
6093 * - Fill the reception request for the data arriving on the ULSCH
6094 * - Fill the reception request information for the Periodic CQI/PMI
6096 * @param[in] RgSchCellCb *cell,
6097 * RgSchUlAlloc *alloc,
6098 * TfuUeRecpReqInfo *datRecpInfo,
6099 * CmLteTimingInfo *timeInfo,
6107 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq
6110 RgSchUlAlloc *alloc,
6111 TfuUeRecpReqInfo *datRecpInfo,
6112 CmLteTimingInfo *timeInfo,
6117 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq(cell, alloc, datRecpInfo,
6118 timeInfo, hqPres, validIdx)
6120 RgSchUlAlloc *alloc;
6121 TfuUeRecpReqInfo *datRecpInfo;
6122 CmLteTimingInfo *timeInfo;
6127 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
6128 U8 cqiPmiSz; /*Raw CQI/PMI Size*/
6131 TRC2(rgSCHTomUtlFillDatPCqiRecpReq);
6134 /*Fill CQI Reception Params*/
6135 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
6136 #ifdef TFU_ALLOC_EVENT_NO_INIT
6137 cqiRecpReqInfo->riBetaOff = 0;
6139 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
6140 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(alloc->ue, cell->numTxAntPorts, &ri);
6143 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Fill "
6144 "CqiPmi size RNTI:%d",alloc->rnti);
6148 /* Fill only the first RI index since Periodic can come
6150 cqiRecpReqInfo->cCNum = 1;
6151 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* Periodic */
6152 /* This flags will be removed once Sachin does changes
6154 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
6155 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
6156 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
6160 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
6161 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
6165 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
6166 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
6169 cqiRecpReqInfo->riSz[0].pres = FALSE;
6171 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
6173 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6174 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
6177 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
6179 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
6183 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
6185 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
6187 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
6189 datRecpInfo->rnti = alloc->rnti;
6190 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6191 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6193 } /* rgSCHTomUtlFillDatPCqiRecpReq */
6196 * @brief Function which handles the filling of SRS reception
6197 * request values which arrives along with UL Data on ULSCH
6201 * Function: rgSCHTomUtlFillDatSrsRecpReq
6203 * Function which handles the filling of SRS reception
6204 * request values which arrives along with UL Data on ULSCH
6206 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
6209 * - Fill the reception request for the data arriving on the ULSCH
6210 * - Fill the reception request information for the SRS
6212 * @param[in] RgSchCellCb *cell,
6213 * RgSchUlAlloc *alloc,
6214 * TfuUeRecpReqInfo *datRecpInfo,
6215 * CmLteTimingInfo *timeInfo,
6222 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq
6225 RgSchUlAlloc *alloc,
6226 TfuUeRecpReqInfo *datRecpInfo,
6227 CmLteTimingInfo *timeInfo,
6231 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq(cell, alloc, datRecpInfo, timeInfo,
6234 RgSchUlAlloc *alloc;
6235 TfuUeRecpReqInfo *datRecpInfo;
6236 CmLteTimingInfo *timeInfo;
6240 TRC2(rgSCHTomUtlFillDatSrsRecpReq);
6241 datRecpInfo->rnti = alloc->rnti;
6242 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6245 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_HARQ_SRS;
6249 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_SRS;
6251 datRecpInfo->rnti = alloc->rnti;
6252 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6253 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6255 } /* rgSCHTomUtlFillDatSrsRecpReq */
6258 * @brief Function which handles the filling of only SRS reception
6259 * request values on ULSCH
6263 * Function: rgSCHTomFillOnlySrsRecpReq
6265 * Function which handles the filling of SRS reception
6266 * request values which arrives along with UL Data on ULSCH
6268 * Invoked by: rgSCHTomUtlFillDatSrsRecpReq of rg_sch_tom.c
6271 * - Fill the reception request for the data arriving on the ULSCH
6272 * - Fill the reception request information for the SRS
6274 * @param[in] RgSchCellCb *cell,
6275 * RgSchUlAlloc *alloc,
6276 * TfuUeRecpReqInfo *datRecpInfo,
6282 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq
6285 RgSchUlAlloc *alloc,
6286 TfuUeRecpReqInfo *datRecpInfo
6289 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq(cell, alloc, datRecpInfo)
6291 RgSchUlAlloc *alloc;
6292 TfuUeRecpReqInfo *datRecpInfo;
6295 TfuUePuschSrsRecpInfo *srsRecpReqInfo;
6296 TRC2(rgSCHTomFillOnlySrsRecpReq);
6298 srsRecpReqInfo = &datRecpInfo->t.puschRecpReq.srsInfo;
6299 srsRecpReqInfo->srsBw = (TfuUlSrsBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsBw;
6300 srsRecpReqInfo->nRrc = alloc->ue->srsCb.srsCfg.srsSetup.fDomPosi;
6301 srsRecpReqInfo->srsHopBw = (TfuUlSrsHoBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsHopBw;
6302 srsRecpReqInfo->transComb = alloc->ue->srsCb.srsCfg.srsSetup.txComb;
6303 srsRecpReqInfo->srsCfgIdx = alloc->ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6304 srsRecpReqInfo->srsCyclicShft = (TfuUlSrsCycShiftInfo)alloc->ue->srsCb.srsCfg.srsSetup.cycShift;
6306 /* ccpu00117050 - ADD - nSrs setting
6307 * Refer Section 5.2.2.6 of TS 36.212 V8.5.0*/
6308 datRecpInfo->t.puschRecpReq.ulSchInfo.nSrs = 1;
6311 } /* rgSCHTomFillOnlySrsRecpReq */
6314 * @brief Function which handles the filling of PCQI/RI, SRS and SR
6315 * Reception Request Information along
6316 * with the HARQ reception Request
6320 * Function: rgSCHTomUtlFillCqiSrSrsWithHq
6322 * Function which handles the filling of PCQI/RI, SRS ans SR
6323 * Reception Request Information along
6324 * with the HARQ reception Request
6327 * Invoked by: rgSCHTomUtlFillHqFdbkRecpReq &
6328 * rgSCHTomUtlFillSfHqFdbk of rg_sch_tom.c
6331 * - Fill the reception request for the Control Info arriving on the PUCCH
6332 * - Fill the reception request information for the SR, RI, CQI, SRS
6334 * @param[in] RgSchCellCb *cell,
6335 * TfuRecpReqInfo *recpReqInfo,
6336 * RgSchDlHqProcCb *hqCb,
6337 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
6338 * @param[in] U16 validIdx
6344 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq
6347 TfuRecpReqInfo *recpReqInfo,
6349 TfuUeRecpReqInfo *pucchRecpInfo,
6351 Bool isDatPresOnSecCell
6354 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq(cell, recpReqInfo, ue,
6355 pucchRecpInfo, validIdx,isDatPresOnSecCell)
6357 TfuRecpReqInfo *recpReqInfo;
6359 TfuUeRecpReqInfo *pucchRecpInfo;
6361 Bool isDatPresOnSecCell;
6364 RgSchUePCqiCb *cqiCb;
6365 RgSchUePCqiCb *riCb;
6366 U8 ri; /*To fetch RI value*/
6367 Bool willUeRprtCqi; /* Flag set due to CQI Mask and
6368 UE Inactive state (DRX)*/
6369 Bool willUeRprtSr = TRUE;
6370 TfuAckNackMode hqFdbkMode;
6373 Bool dropCqi = FALSE;
6375 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
6378 RgSchEmtcUeInfo *emtcUe = NULLP;
6381 TRC2(rgSCHTomUtlFillCqiSrSrsWithHq);
6385 /*Changes for PUCCH Format3 */
6386 hqFdbkMode = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqFdbkMode;
6387 numCqiBit = rgSCHCmnCalcPcqiBitSz (ue,cell->numTxAntPorts);
6388 totalPucchBits = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz + numCqiBit;
6391 emtcUe = RG_GET_EMTC_UE_CB(ue);
6393 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
6394 #ifdef EMTC_ENABLE /*VINU*/
6397 if((emtcUe->pucchRepNumFr1 > 1) || (emtcUe->pucchRepNumFr2 > 1))
6399 willUeRprtCqi = FALSE;
6400 willUeRprtSr = FALSE;
6404 if(ue->srCb.nSrTrIdx == validIdx)
6408 /* Should we check for Rel8 and above???
6409 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
6411 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
6412 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
6413 if(!((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
6414 (ulSpsUe->isUlSpsActv)))
6421 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
6422 ue->srCb.srCfg.srSetup.srResIdx;
6423 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
6424 /* FORMAT3: If SR is present it will be appended after HARQ */
6425 totalPucchBits = totalPucchBits + 1;
6432 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
6434 /* LTE_ADV:: UE will drop CSI during CSI+1BCS if data is present
6435 * on sec cell(isDatPresOnSecCell)*/
6437 if (hqFdbkMode == TFU_ACK_NACK_CHANNEL_SELECTION)
6439 if (hqFdbkMode == TFU_UCI_FORMAT_1B_CS)
6442 if (isDatPresOnSecCell == TRUE)
6449 /* Format 3 Changes : If Hq + SR + CQI bits < 22 and simultaneousAckNackAndCQI-Format3
6450 is enabled then CQI will be multiplexed with HQ otherwise CQI will be dropped
6451 Spec 36.213 Sec 10.1.1 */
6452 else if (hqFdbkMode == TFU_UCI_FORMAT_3)
6454 if ((isDatPresOnSecCell == TRUE) &&
6455 ((!ue->simulAckNackCQIFormat3) || (totalPucchBits > 22)))
6463 cqiCb = ue->nPCqiCb;
6464 if(riCb->nRiTrIdx == validIdx)
6466 /*ccpu00140578:: Skip the UE if the RI is already processed
6468 if(riCb->riRecpPrcsd == FALSE)
6470 if(riCb->riDist == 0)
6472 if((riCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
6473 (isDatPresOnSecCell == FALSE))
6476 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6477 riCb->cqiCfg.cqiSetup.cqiPResIdx;
6478 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6480 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
6482 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
6486 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
6488 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6490 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6491 ue->nPRiCb->servCellInfo->sCellIdx;
6493 rgSCHTomUtlFillRiBitWidthInfo(ue);
6494 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
6496 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
6511 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
6517 /* Skip the UE for RI processing on PUCCH
6518 * in the same subframe as it already processed */
6519 if(riCb->nRiTrIdx == validIdx)
6521 /* As the new idx is same is current idx
6522 * then PUCCH reception processing will consider
6523 * RI also in the same subframe. To block this
6524 * below flag is used*/
6525 riCb->riRecpPrcsd = TRUE;
6529 else if(cqiCb->nCqiTrIdx == validIdx)
6531 if((cqiCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
6532 (isDatPresOnSecCell == FALSE))
6535 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6536 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6538 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6540 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6541 cqiCb->servCellInfo->sCellIdx;
6543 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6544 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6545 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6547 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d "
6548 "Unable to Fill CqiPmi size", ue->ueId);
6551 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
6553 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
6557 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
6570 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6572 if(ue->srsCb.nSrsTrIdx == validIdx)
6574 /* ccpu00140578::Skip the UE for SRS reception processing
6575 * if already done as part of PUSCH recpetion
6577 if(ue->srsCb.srsRecpPrcsd == FALSE)
6579 if(ue->srsCb.srsDist ==0 )
6581 if((pucchRecpInfo->t.pucchRecpReq.uciInfo != TFU_PUCCH_HARQ_CQI)
6582 && (ue->srsCb.srsCfg.srsSetup.sANSrs)
6583 && (isDatPresOnSecCell == FALSE))
6586 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6587 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6588 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6589 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6590 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6591 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6592 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6593 ue->srsCb.srsCfg.srsSetup.txComb;
6594 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6595 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6596 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6597 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6598 /* ccpu00116923 - ADD - New Reception Request types for CQI and SRS with SR */
6599 switch(pucchRecpInfo->t.pucchRecpReq.uciInfo)
6601 case TFU_PUCCH_HARQ_SR:
6602 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
6604 case TFU_PUCCH_HARQ_SR_CQI:
6605 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI_SRS;
6608 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SRS;
6612 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6616 ue->srsCb.srsDist--;
6618 /* Skip the UE for SRS processing on PUCCH
6619 * in the same subframe as it already processed */
6620 if(ue->srsCb.nSrsTrIdx == validIdx)
6622 /* As the new idx is same is current idx
6623 * then PUCCH reception processing will consider
6624 * SRS also in the same subframe. To block this
6625 * below flag is used*/
6626 ue->srsCb.srsRecpPrcsd = TRUE;
6634 } /* rgSCHTomUtlFillCqiSrSrsWithHq */
6637 * @brief Function which handles the filling of PCQI/RI, SRS
6638 * Reception Request Information along with SR reception
6643 * Function: rgSCHTomUtlFillCqiSrsWithSr
6645 * Function which handles the filling of PCQI/RI, SRS
6646 * Reception Request Information along
6647 * with the SR reception Request
6650 * Invoked by: rgSCHTomUtlFillSrRecpReq of rg_sch_tom.c
6653 * - Fill the reception request for CQI/RI, SRS if they occur
6654 * in the same instance as of SR.
6656 * @param[in] RgSchCellCb *cell,
6658 * TfuRecpReqInfo *recpReqInfo,
6659 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
6660 * @param[in] U16 validIdx
6666 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr
6670 TfuRecpReqInfo *recpReqInfo,
6671 TfuUeRecpReqInfo *pucchRecpInfo,
6675 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr(cell, ue, recpReqInfo,
6676 pucchRecpInfo, validIdx)
6679 TfuRecpReqInfo *recpReqInfo;
6680 TfuUeRecpReqInfo *pucchRecpInfo;
6684 RgSchUePCqiCb *cqiCb;
6685 RgSchUePCqiCb *riCb;
6686 U8 ri; /*To fetch RI value*/
6687 Bool willUeRprtCqi; /* Flag set due to CQI Mask and
6688 UE Inactive state (DRX)*/
6689 TRC2(rgSCHTomUtlFillCqiSrsWithSr);
6692 cqiCb = ue->nPCqiCb;
6693 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
6695 rgSCHEmtcWillUeRptCqi(ue, &willUeRprtCqi);
6697 if(riCb->nRiTrIdx == validIdx)
6699 /*ccpu00140578:: Skip the UE if the RI is already processed
6701 if(riCb->riRecpPrcsd == FALSE)
6703 if(riCb->riDist == 0)
6705 if(willUeRprtCqi == TRUE)
6708 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6709 riCb->cqiCfg.cqiSetup.cqiPResIdx;
6710 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6713 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6714 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6716 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6717 ue->nPRiCb->servCellInfo->sCellIdx;
6719 rgSCHTomUtlFillRiBitWidthInfo(ue);
6720 /* TODO:: syed Shouldn't this be done outside this if condition */
6721 if (cqiCb->nCqiTrIdx == validIdx)
6723 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6726 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
6732 if(riCb->nRiTrIdx == validIdx)
6733 {/* Need to skip this UE during PUCCH RI recpetion process
6734 in the current subframe */
6735 riCb->riRecpPrcsd = TRUE;
6739 else if(cqiCb->nCqiTrIdx == validIdx)
6741 if(willUeRprtCqi == TRUE)
6744 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6745 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6747 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6750 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6751 cqiCb->servCellInfo->sCellIdx;
6753 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6754 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6755 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6757 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d"
6758 " Unable to Fill CqiPmi size", ue->ueId);
6762 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6764 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6766 if(ue->srsCb.nSrsTrIdx == validIdx)
6768 /* ccpu00140578:: Cnsider the SRS processing
6769 * only if not done in the same TTI
6770 * as part of PUSCH or HARQ reception process*/
6771 if(ue->srsCb.srsRecpPrcsd == FALSE)
6773 if(ue->srsCb.srsDist ==0 )
6775 if(ue->srsCb.srsCfg.srsSetup.sANSrs)
6778 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6779 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6780 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6781 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6782 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6783 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6784 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6785 ue->srsCb.srsCfg.srsSetup.txComb;
6786 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6787 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6788 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6789 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6790 /* ccpu00116923 - ADD - New Reception Request types for CQI and
6792 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_SR_CQI)
6794 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI_SRS;
6798 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_SRS;
6802 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6806 ue->srsCb.srsDist--;
6808 /* Skip the UE for SRS processing on PUCCH
6809 * in the same subframe as it already processed */
6810 if(ue->srsCb.nSrsTrIdx == validIdx)
6812 /* As the new idx is same is current idx
6813 * then PUCCH reception processing will consider
6814 * SRS also in the same subframe. To block this
6815 * below flag is used*/
6816 ue->srsCb.srsRecpPrcsd = TRUE;
6822 } /* rgSCHTomUtlFillCqiSrsWithSr */
6828 /** @brief This function handles filling of HARQ feedback repetition
6829 * recption request for each subframe
6833 * Function: rgSCHTomUtlFillSfRepHqFdbk
6837 * @param [out] TfuRecpReqInfo *recpReqInfo
6838 * @param [in] RgSchCellCb *cell
6839 * @param [out] RgSchErrInfo *err
6840 * @param [in] RgSchDlSf *dlSf
6841 * @param [in] U8 noFdbks
6842 * @param [in] CmMemListCp *memCp
6843 * @param [in] U8 elemIdx
6844 * @param [in] RgSchDlSf *nxtDlsf
6851 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk
6853 TfuRecpReqInfo *recpReqInfo,
6854 RgSchCellCb *cellCb,
6864 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk (recpReqInfo, cellCb, err, dlSf,
6865 noFdbks, memCp, elemIdx, nxtDlsf, validIdx)
6866 TfuRecpReqInfo *recpReqInfo;
6867 RgSchCellCb *cellCb;
6878 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk
6880 TfuRecpReqInfo *recpReqInfo,
6881 RgSchCellCb *cellCb,
6890 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk (recpReqInfo, cellCb, err, dlSf,
6891 noFdbks, memCp, elemIdx, nxtDlsf)
6892 TfuRecpReqInfo *recpReqInfo;
6893 RgSchCellCb *cellCb;
6903 RgSchDlHqProcCb *hqCb;
6907 TfuUeRecpReqInfo *pucchRecpInfo;
6909 TfuUePucchHqRecpInfo *hqRecpReq;
6911 RgSchDlHqTbCb *tbCb;
6912 RgSchDlHqProcCb *prvHqCb = NULLP;
6914 TRC2(rgSCHTomUtlFillSfRepHqFdbk)
6916 node = dlSf->ackNakRepQ.first;
6919 tbCb = (RgSchDlHqTbCb *)(node->node);
6921 ueCb = hqCb->hqE->ue;
6923 if (--tbCb->fbkRecpRepCntr)
6925 /* Add to next subfarme */
6926 /* Add this hqCb to the next dlSf's ackNakRepQ */
6927 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
6928 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
6929 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
6930 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
6937 /* Go to the next node */
6942 if ((hqCb->hqE->ue != NULLP) &&
6943 (hqCb->hqE->ue->measGapCb.isMeasuring != TRUE)
6944 && (hqCb != prvHqCb)
6947 /* We need to add the recp request to be sent on the pucchANRep
6950 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
6951 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
6954 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to"
6955 "Allocate TfuUeRecpReqInfo for RNTI:%d ", ueCb->ueId);
6956 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
6959 pucchRecpInfo->rnti = ueCb->ueId;
6961 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
6963 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
6966 /* FOR repetition Feedback shall come on n1PucchAnRep Configured per
6970 pucchRecpInfo->t.pucchRecpReq.hqType = TFU_HQ_RECP_REQ_N1PUCCH;
6971 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = ueCb->ackNakRepCb.pucchRes;
6973 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
6974 hqRecpReq = &(pucchRecpInfo->t.pucchRecpReq.hqInfo);
6975 /* ACK NACK rep works only in bundling mode . */
6976 hqRecpReq->hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_BUNDL;
6977 if ((hqCb->hqPSfLnk.node != NULLP) &&
6978 (hqCb->hqPSfLnk.node != NULLP))
6981 hqRecpReq->hqSz = 2;
6985 hqRecpReq->hqSz = 1;
6987 hqRecpReq->pucchResCnt = 1;
6988 hqRecpReq->hqRes[0] = ueCb->ackNakRepCb.pucchRes;
6990 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
6991 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
6993 /* In a given dlSf, if there is 2 TBs context
6994 * stored for a given harq, then they are added
6995 * adjacent to each other in the subframe. To avoid
6996 * adding duplicate recpnInfo for each TB, store this
6997 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
6998 * do not add reception req info.*/
7001 RGSCH_NULL_CHECK(cellCb->instIdx, hqCb->hqE->ue);
7002 rgSCHTomUtlMoveNxtOccasion(cellCb, hqCb->hqE->ue, validIdx);
7004 /* Go to the next node */
7011 /** @brief This function handles filling of HARQ feedback recption request
7016 * Function: rgSCHTomUtlFillSfHqFdbkInfo
7020 * @param [out] TfuRecpReqInfo *recpReqInfo
7021 * @param [in] RgSchCellCb *cell
7022 * @param [out] RgSchErrInfo *err
7023 * @param [in] RgSchDlSf *dlSf
7024 * @param [in] U8 noFdbks
7025 * @param [in] CmMemListCp *memCp
7026 * @param [in] U8 elemIdx
7027 * @param [in] RgSchDlSf *nxtDlsf
7028 * @param [in] U16 validIdx;
7035 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo
7037 TfuRecpReqInfo *recpReqInfo,
7038 RgSchCellCb *cellCb,
7046 RgSchDlHqProcCb *hqCb,
7047 RgSchUePucchRecpInfo *pucchInfo,
7049 RgSchDlHqProcCb *prvHqCb
7052 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo (recpReqInfo, cellCb, err, dlSf,
7053 noFdbks, memCp, elemIdx, nxtDlsf, validIdx, hqCb, pucchInfo, alloc, prvHqCb)
7054 TfuRecpReqInfo *recpReqInfo;
7055 RgSchCellCb *cellCb;
7063 RgSchDlHqProcCb *hqCb;
7064 RgSchUePucchRecpInfo *pucchInfo;
7066 RgSchDlHqProcCb *prvHqCb;
7070 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo
7072 TfuRecpReqInfo *recpReqInfo,
7073 RgSchCellCb *cellCb,
7080 RgSchDlHqProcCb *hqCb,
7081 RgSchUePucchRecpInfo *pucchInfo,
7083 RgSchDlHqProcCb *prvHqCb
7086 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo (recpReqInfo, cellCb, err, dlSf,
7087 noFdbks, memCp, elemIdx, nxtDlsf, hqCb, pucchInfo, alloc, prvHqCb)
7088 TfuRecpReqInfo *recpReqInfo;
7089 RgSchCellCb *cellCb;
7096 RgSchDlHqProcCb *hqCb;
7097 RgSchUePucchRecpInfo *pucchInfo;
7099 RgSchDlHqProcCb *prvHqCb;
7104 RgSchUeCb *ueCb = hqCb->hqE->ue;
7106 CmLteTimingInfo futTime;
7107 RgSchTddANInfo *anInfo;
7110 RgrTddAckNackMode ackNackMode;
7111 RgSchDlHqTbCb *tbCb;
7116 TRC2(rgSCHTomUtlFillSfHqFdbkInfo)
7119 RG_SCH_ADD_TO_CRNT_TIME(cellCb->crntTime, futTime, TFU_RECPREQ_DLDELTA);
7123 for (idx = 0 ;idx < 2; idx++)
7125 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
7128 tbCb = &hqCb->tbInfo[idx];
7132 ackNackMode = ueCb->dl.ackNackMode;
7134 if(ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL)
7136 anInfo = rgSCHUtlGetUeANFdbkInfo(ueCb, &futTime);
7137 /* Only the last scheduled TB for the UE is for HARQ
7138 * ACK/NACK reception in Bundling case */
7139 if((anInfo == NULLP) ||
7140 (anInfo->latestMIdx != dlSf->dlFdbkInfo.m))
7147 /* Get the TFU reception request pointer, if present */
7148 cmHashListFind(&cellCb->ueTfuPendLst, (U8*) &ueCb->ueId,
7149 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
7152 /* For upgrade we shall use the existing logic of pending list. */
7153 cmHashListFind(&cellCb->ueTfuPendLst, (U8*) &ueCb->ueId,
7154 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
7157 else if(hqCb->hqE->raCb != NULLP)
7159 /* For RACH it is set to Bundling */
7160 ackNackMode = RGR_TDD_ACKNACK_MODE_BUNDL;
7161 rnti = hqCb->hqE->raCb->tmpCrnti;
7168 /* Do not proceed if PUSCH
7169 reception req is already filled*/
7174 /* Go to the next node */
7178 if(((ueCb == NULLP) || (ueCb->measGapCb.isMeasuring != TRUE))
7182 TknU16 n1PucchTkn = {FALSE, 0};
7185 pdcch = tbCb->hqP->pdcch;
7187 n1PucchTkn = hqCb->spsN1PucchRes;
7189 for (tbIndx = 0; tbIndx < TFU_MAX_TB; tbIndx++)
7191 if (hqCb->tbInfo[tbIndx].state == HQ_TB_WAITING &&
7192 (RGSCH_TIMEINFO_SAME(hqCb->tbInfo[tbIndx].fdbkTime,
7193 recpReqInfo->timingInfo)))
7196 hqCb->tbInfo[tbIndx].pucchFdbkIdx = hqCb->ulDai;
7199 ret = rgSCHTomUtlFillSfHqFdbkForOneUe(hqCb,recpReqInfo, cellCb, err, dlSf, noFdbks,
7200 memCp, elemIdx, nxtDlsf, rnti, ackNackMode, &pucchInfo, pdcch,
7201 n1PucchTkn, &alloc, hqSz);
7206 /* TODO:: In case of F1BCS and CSI in same subframe
7207 * UE shall drop the CSI if there was at least one
7208 * PDSCH transmission in any of the DL subframe
7209 * mapping to this UL subframe
7212 rgSCHTomUtlFillCqiSrSrsWithHq(cellCb,recpReqInfo, hqCb->hqE->ue,
7213 pucchInfo->pucchRecpInfo, validIdx,FALSE);
7215 if((hqCb->hqE->ue) &&
7216 (hqCb->hqE->ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
7219 if(RG_SCH_IS_CELL_SEC(hqCb->hqE->ue,hqCb->hqE->cell))
7221 switch(pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo)
7223 case TFU_PUCCH_HARQ_SR_CQI:
7224 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
7225 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7227 case TFU_PUCCH_HARQ_CQI:
7228 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
7229 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7231 case TFU_PUCCH_HARQ_SR_CQI_SRS:
7232 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
7233 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7235 case TFU_PUCCH_HARQ_SR_SRS:
7236 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
7238 case TFU_PUCCH_HARQ_SRS:
7239 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
7250 /* TODO antz - pushing the following code (under TFU_UPGRADE)
7251 * into the above function (...ForOneUe) did not work (caused
7252 * two additional TCs to fail). Don't know why. If this
7253 * is done later, make sure that the code branch
7254 * for relPdcch (later in this func) is also modified appropriately.
7256 /* Now add to the recp request or pending list */
7257 //if((elemIdx != (noFdbks - 1)))
7259 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
7260 (U8 *)&rnti ,(U16) sizeof(CmLteRnti));
7264 } /* If measuring */
7265 /* Go to the next node */
7266 if ((tbCb->fbkRecpRepCntr) && (--tbCb->fbkRecpRepCntr))
7268 /* Add to next subfarme */
7269 /* Add this hqCb to the next dlSf's ackNakRepQ */
7270 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
7271 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
7272 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
7273 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
7275 /* In a given dlSf, if there is 2 TBs context
7276 * stored for a given harq, then they are added
7277 * adjacent to each other in the subframe. To avoid
7278 * adding duplicate recpnInfo for each TB, store this
7279 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
7280 * do not add reception req info.*/
7288 /** @brief This function calculates the pucch resource idx
7289 * that is to be filled in harq reception request
7293 * Function: rgSCHTomUtlGethqRes
7296 * -Calculate the pucch resource idx
7297 * Harq Reception Request for Format 1B with
7300 * @param [in] U8 noFdbks
7301 * @param [in] RgSchDlSf *dlSf
7302 * @param [in] RgSchPdcch *pdcch
7303 * @param [in] RgSchCellCb *cellCb
7304 * @param [out]U16 *hqRes
7308 PRIVATE Void rgSCHTomUtlGethqRes
7313 RgSchCellCb *cellCb,
7317 PRIVATE Void rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,hqRes)
7321 RgSchCellCb *cellCb;
7333 m = dlSf->dlFdbkInfo.m;
7335 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
7336 nP = cellCb->rgSchTddNpValTbl[P];
7337 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
7338 *hqRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
7339 cellCb->pucchCfg.n1PucchAn;
7344 /** @brief This function fills the harq reception request for
7345 * TDD in case of Fomat 1B with CS for M=1
7349 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
7352 * -Fill Harq Reception Request for Format 1B with
7355 * @param [in] RgSchDlHqProcCb *hqCb
7356 * @param [in] TfuUePucchRecpReq *hqRecpReq
7357 * @param [in] U8 noFdbks
7358 * @param [in] RgSchDlSf *dlSf
7359 * @param [in] RgSchPdcch *pdcch
7360 * @param [in] RgSchCellCb *cellCb
7364 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
7366 RgSchDlHqProcCb *hqCb,
7367 TfuUePucchRecpReq *hqRecpReq,
7374 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1(hqCb, hqRecpReq,
7375 noFdbks,dlSf,pdcch,cellCb)
7376 RgSchDlHqProcCb *hqCb;
7377 TfuUePucchRecpReq *hqRecpReq;
7381 RgSchCellCb *cellCb;
7384 RgSchUeCb *ue = NULLP;
7385 Bool isCellSec = FALSE;
7388 /*ccpu00147920: UeCb is NULL for SPS activation*/
7389 if(pdcch && pdcch->ue)
7390 {/* SPS Release pdcch or dynamic data */
7397 /* This is not supposed to happen
7398 * Error case. hqCB has to be ter
7399 * when pdcch is present . Adding
7400 * if check bcs of kwork*/
7407 if((hqCb != NULLP) &&
7408 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7413 switch(ue->f1bCsAVal)
7415 case RG_SCH_A_VAL_2:
7416 /* harq(0) is primary harq(1) is secondary) */
7419 hqRecpReq->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.
7420 cw1N1Res[hqCb->tpc].n1PucchIdx;
7422 else/* primary cell */
7425 /* hqCb will be null in case of sps rel pdcch */
7426 if ((hqCb) && hqCb->spsN1PucchRes.pres)
7427 {/* SPS occasion or dyn sched*/
7428 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7431 #endif /* LTEMAC_SPS */
7432 {/* dyn data or sps release */
7436 /* This is not supposed to happen
7437 * Error case. hqCB has to be ter
7438 * when pdcch is present . Adding
7439 * if check bcs of kwork*/
7444 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7445 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7449 case RG_SCH_A_VAL_3:
7451 /* Serving cell in mimo mode should be
7452 * in 0 and 1 and the serving cell in siso
7453 * mode should be in 2 indices */
7456 U8 servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
7457 hqCb->hqE->cell->cellId,
7460 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
7461 {/* Sec cell is in mimo mode, use 0 and 1 */
7462 hqRecpReq->hqInfo.hqRes[0] =
7463 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7464 hqRecpReq->hqInfo.hqRes[1] =
7465 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7468 {/* Sec cell is in siso mode, use 2 */
7469 hqRecpReq->hqInfo.hqRes[2] =
7470 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7474 {/* primary cell hq */
7476 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
7477 {/* prim cell is in mimo mode, use 0 and 1 */
7479 if (hqCb && hqCb->spsN1PucchRes.pres)
7480 {/* Not sps release */
7481 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7484 #endif /* LTEMAC_SPS */
7485 {/* sps rel or dyn */
7489 /* This is not supposed to happen
7490 * Error case. hqCB has to be ter
7491 * when pdcch is present . Adding
7492 * if check bcs of kwork*/
7497 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7498 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7499 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
7503 {/* prim cell is in siso mode use 2 */
7505 /* Consider sps occasions */
7506 if (hqCb && hqCb->spsN1PucchRes.pres)
7507 {/* Not sps release */
7508 hqRecpReq->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
7511 #endif /* LTEMAC_SPS */
7516 /* This is not supposed to happen
7517 * Error case. hqCB has to be ter
7518 * when pdcch is present . Adding
7519 * if check bcs of kwork*/
7524 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7525 hqRecpReq->hqInfo.hqRes[2] = hqRes;
7531 case RG_SCH_A_VAL_4:
7532 {/* Both the serv cells are in mimo mode */
7534 {/* 2 and 3 for sec cell */
7535 hqRecpReq->hqInfo.hqRes[2] =
7536 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7537 hqRecpReq->hqInfo.hqRes[3] =
7538 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7540 else/* primary cell */
7541 {/* 0 and 1 are for primary cell */
7543 if (hqCb && hqCb->spsN1PucchRes.pres)
7544 {/* Not sps release */
7545 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7548 #endif /* LTEMAC_SPS */
7553 /* This is not supposed to happen
7554 * Error case. hqCB has to be ter
7555 * when pdcch is present . Adding
7556 * if check bcs of kwork*/
7561 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7562 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7563 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
7574 /** @brief This function fills the harq reception request for
7575 * TDD in case of Fomat 1B with CS for M>=2
7579 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
7582 * -Fill Harq Reception Request for Format 1B with
7585 * @param [in] RgSchDlHqProcCb *hqCb
7586 * @param [in] TfuUePucchRecpReq *hqRecpReq
7587 * @param [in] U8 noFdbks
7588 * @param [in] RgSchDlSf *dlSf
7589 * @param [in] RgSchPdcch *pdcch
7590 * @param [in] RgSchCellCb *cellCb
7591 * @param [in] U8 elemIdx
7595 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
7597 RgSchDlHqProcCb *hqCb,
7598 TfuUePucchRecpReq *hqRecpReq,
7602 RgSchCellCb *cellCb,
7606 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234(
7607 hqCb,hqRecpReq,noFdbks,dlSf,pdcch,cellCb,elemIdx)
7608 RgSchDlHqProcCb *hqCb;
7609 TfuUePucchRecpReq *hqRecpReq;
7613 RgSchCellCb *cellCb;
7618 Bool isCellSec = FALSE;
7623 {/* SPS Release pdcch or dynamic data */
7630 /* This is not supposed to happen
7631 * Error case. hqCB has to be ter
7632 * when pdcch is present . Adding
7633 * if check bcs of kwork*/
7640 if((hqCb != NULLP) && (ue != NULLP) &&
7641 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7647 {/* Sec Cell indices are 2 and 3*/
7648 servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
7649 hqCb->hqE->cell->cellId,
7652 hqRecpReq->hqInfo.hqRes[2] =
7653 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7655 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
7657 hqRecpReq->hqInfo.hqRes[3] =
7658 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7662 {/* Primary cell indices are 0 and 1 */
7664 * M > 2 if SPS occasion is present in any of the
7665 * DL subframe in the bundle, the n1Pucch(0) is
7666 * the SPS resource and n1Pucch(1) is the resource
7667 * derived from pdcch with DAI = 1
7668 * If No SPS Occasion
7669 * Then n1Pucch(0) is from pdcch with DAI =1
7670 * and n1Pucch(1) is from pdcch with DAI = 2
7674 {/* this is not sps release pdcch */
7675 if(hqCb->spsN1PucchRes.pres == TRUE)
7677 hqRes = hqCb->spsN1PucchRes.val;
7682 {/*Dynamic scheduling or SPS Release
7683 Derive from pdcch */
7684 if(pdcch->dlDai < 3)
7685 {/* No need to calcualte from DAI > 2 */
7686 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7692 hqRecpReq->hqInfo.hqRes[elemIdx] = hqRes;
7695 {/* Pdcch with DAI = 1 and 2 needs to be used
7696 for resource calculation*/
7697 if(hqCb && hqCb->spsN1PucchRes.pres == TRUE)
7698 {/* dyn or sps occasion */
7699 /* Shift the hqRes[0] if it was filled
7700 * if there was a pdcch with DAI 1 before to this
7703 {/* SPS occasion happened in the middle
7705 /* shifting the non SPS resource to n1Pucch(1) */
7706 hqRecpReq->hqInfo.hqRes[1] = hqRecpReq->hqInfo.hqRes[0];
7709 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7712 else if(pdcch && pdcch->dlDai < 3)
7714 else if(pdcch->dlDai < 3)
7716 {/* sps rel or dyn sched */
7717 /* hqCb wil not be present for sps release pdcch */
7718 if(hqCb && (pdcch->dlDai != hqCb->ulDai))
7719 {/* there was a SPS occasion before to this */
7720 if(pdcch->dlDai == 1)
7722 hqRecpReq->hqInfo.hqRes[1] = hqRes;
7723 }/* ignore the DAI 2 in this case */
7725 {/* There was no SPS occasion before to this */
7729 {/* Added check to ignore kwork warning */
7730 hqRecpReq->hqInfo.hqRes[(pdcch->dlDai)-1] = hqRes;
7739 /** @brief This function fills the harq reception request for
7740 * TDD in case of Fomat 1B with CS
7744 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7747 * -Fill Harq Reception Request for Format 1B with
7750 * @param [in] RgSchDlSf *ulSf
7751 * @param [in] RgSchCellCb *cell
7752 * @param [out]TfuUePucchRecpReq *hqRecpReq
7756 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7758 RgSchDlHqProcCb *hqCb,
7759 TfuUePucchRecpReq *hqRecpReq,
7767 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS(hqCb,hqRecpReq,noFdbks,dlSf,pdcch,
7768 n1PucchTkn,elemIdx,cellCb)
7769 RgSchDlHqProcCb *hqCb;
7770 TfuUePucchRecpReq *hqRecpReq;
7775 RgSchCellCb *cellCb;
7778 /* Update teh fdbk mode if something different is present
7779 * in L1 API file for F1BS *//* 1 --> F1BCS */
7780 hqRecpReq->hqInfo.hqFdbkMode = TFU_ACK_NACK_CHANNEL_SELECTION;
7784 case RG_SCH_M_VAL_1:
7787 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1(hqCb,hqRecpReq,
7788 noFdbks,dlSf,pdcch,cellCb);
7791 case RG_SCH_M_VAL_2:
7792 case RG_SCH_M_VAL_3:
7793 case RG_SCH_M_VAL_4:
7795 /* Spatial bundling will be applied */
7796 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234(hqCb,hqRecpReq,
7797 noFdbks,dlSf,pdcch,cellCb,elemIdx);
7807 /***********************************************************
7809 * Func : rgSCHTomUtlFillSfHqFdbkForOneUe
7811 * Desc : Fill HARQ feedback info for one UE/entry
7819 **********************************************************/
7821 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe
7823 RgSchDlHqProcCb *hqCb,
7824 TfuRecpReqInfo *recpReqInfo,
7825 RgSchCellCb *cellCb,
7833 RgrTddAckNackMode ackNackMode,
7834 RgSchUePucchRecpInfo **pucchInfoRef,
7841 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe(hqCb,recpReqInfo, cellCb, err, dlSf,
7842 noFdbks, memCp, elemIdx, nxtDlsf, rnti, ackNackMode, pucchInfoRef,
7843 pdcch, n1PucchTkn, allocRef, hqSz)
7844 RgSchDlHqProcCb *hqCb;
7845 TfuRecpReqInfo *recpReqInfo;
7846 RgSchCellCb *cellCb;
7854 RgrTddAckNackMode ackNackMode;
7855 RgSchUePucchRecpInfo **pucchInfoRef;
7862 RgSchUePucchRecpInfo *pucchInfo = *pucchInfoRef;
7865 TfuUePucchRecpReq *hqRecpReq;
7880 Bool isFirstFdbk = FALSE;
7882 if(pucchInfo == NULLP)
7884 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchInfo,
7885 sizeof(RgSchUePucchRecpInfo), memCp)) != ROK)
7887 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7888 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7889 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7893 #ifdef TFU_ALLOC_EVENT_NO_INIT
7894 pucchInfo->hashLstEnt.hashVal = 0;
7895 pucchInfo->hashLstEnt.keyLen = 0;
7896 pucchInfo->hashLstEnt.key = 0;
7897 pucchInfo->hashLstEnt.list.prev = pucchInfo->hashLstEnt.list.next = 0;
7899 if ((ret = rgSCHUtlGetEventMem((Ptr *)&(pucchInfo->pucchRecpInfo),
7900 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp))) != ROK)
7902 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7903 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7904 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7907 cmMemset((U8 *)pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
7908 #ifdef TFU_ALLOC_EVENT_NO_INIT
7909 cmMemset((U8 *)&pucchInfo->pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
7911 pucchInfo->pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
7912 pucchInfo->pucchRecpInfo->rnti = rnti;
7914 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo=TFU_PUCCH_HARQ;
7921 /* Calculation of resources same for both bundling and muxing for M = 1
7924 RgSchUeCb *ue = rgSCHDbmGetUeCb (cellCb, rnti);
7925 if((ue) && (1 == ue->numSCells))
7927 if(ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
7929 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7930 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS(hqCb,hqRecpReq,
7931 noFdbks,dlSf,pdcch,elemIdx,cellCb);
7934 {/* M = 1 case . size is same as A Value*/
7935 hqRecpReq->hqInfo.hqSz = ue->f1bCsAVal;
7936 hqRecpReq->hqInfo.pucchResCnt = hqRecpReq->hqInfo.hqSz;
7939 hqRecpReq->hqInfo.hqSz = (noFdbks * 2); /* M for 2 cells */
7940 hqRecpReq->hqInfo.pucchResCnt = 4;
7942 hqRecpReq->hqInfo.a = ue->f1bCsAVal;
7943 /* handling for SPS occasions*/
7946 /* set the datPresinFirstSUbframe to TRUE if this
7947 * is for pcell txion*/
7949 RgSchTddANInfo *anInfo = NULLP;
7951 /* if this txion is on pcell
7952 * sps occaion, dyn sched or sps release pdcch
7953 * set the sched present in first
7954 * dl subframe of the bundle to TRUE. This
7955 * is required for mapping the feedbak when SPS occasion
7956 * is present in any of the DL subframe in the bundle in
7959 /* SPS will happen only on pcell */
7960 if((hqCb == NULLP) || (!RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7963 anInfo = rgSCHUtlGetUeANFdbkInfo(ue,
7964 &recpReqInfo->timingInfo,RGSCH_PCELL_INDEX);
7966 {/* ANInfo must be there. adding block
7968 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),
7969 "ANInfo should not be NULL for cellId=%d \n", cellCb->cellId));
7977 {/* This needs to be revisited while
7978 adding support for PUCCH format 3 */
7979 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),"Invalid Pucch format configured.."));
7986 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) ||
7987 ((noFdbks == 1) && (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)))
7989 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7991 prevHqSize = hqRecpReq->hqInfo.hqSz;
7994 /* Only one index for bundling case */
7995 hqRecpReq->M = noFdbks;
7997 TFU_HQ_RECP_REQ_NORMAL;
7998 hqRecpReq->multCnt = 1;
7999 hqRecpReq->t.nCce[0] =
8004 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
8006 hqRecpReq->type = TFU_UCI_HARQ;
8008 #else /* TFU_UPGRADE */
8011 if ((TRUE == isFirstFdbk) && (TRUE == n1PucchTkn.pres))
8013 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
8014 hqRecpReq->hqInfo.pucchResCnt=1;
8015 hqRecpReq->hqInfo.hqRes[0] = n1PucchTkn.val;
8016 hqRecpReq->hqInfo.hqSz = hqSz;
8019 else if (FALSE == n1PucchTkn.pres)
8022 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
8024 P = rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
8025 nP = cellCb->rgSchTddNpValTbl[P];
8026 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
8027 m = dlSf->dlFdbkInfo.m;
8028 /* In case of no UE */
8029 pucchRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
8030 cellCb->pucchCfg.n1PucchAn;
8031 /*ccpu00130164:MOD-Changed to maitain value of
8032 hqRecpReq->hqInfo.pucchResCnt=1 in case of bundling*/
8033 /*ccpu00132284 -MOD- hqRes need to be updated after pucchReCnt set to 1
8034 * and resource should be update at index-0*/
8035 hqRecpReq->hqInfo.pucchResCnt=1;
8036 hqRecpReq->hqInfo.hqRes[hqRecpReq->hqInfo.pucchResCnt-1] = pucchRes;
8038 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) && (hqSz > prevHqSize))
8039 hqRecpReq->hqInfo.hqSz = hqSz;
8040 else if (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)
8041 hqRecpReq->hqInfo.hqSz = hqSz;
8043 hqRecpReq->hqInfo.hqSz = prevHqSize;
8045 #endif /* TFU_UPGRADE */
8047 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
8048 &(pucchInfo->pucchRecpInfo->lnk));
8049 pucchInfo->pucchRecpInfo->lnk.node =
8050 (PTR)pucchInfo->pucchRecpInfo;
8053 else /* Multiplexing */
8056 pucchInfo->pucchRecpInfo->t.pucchRecpReq.M = noFdbks;
8058 if (n1PucchTkn.pres == TRUE)
8060 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
8061 TFU_HQ_RECP_REQ_N1PUCCH;
8062 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = n1PucchTkn.val;
8067 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
8068 TFU_HQ_RECP_REQ_NORMAL;
8069 multCnt = pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt;
8070 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.nCce[multCnt] =
8072 pucchInfo->pucchRecpInfo->t.pucchRecpReq.m[multCnt] =
8074 pucchInfo->pucchRecpInfo->t.pucchRecpReq.p[multCnt] =
8075 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
8077 pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt++;
8079 #else /* TFU_UPGRADE */
8081 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
8082 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_MULT;
8083 hqRecpReq->hqInfo.hqSz = noFdbks;
8085 resIdx = hqRecpReq->hqInfo.pucchResCnt;
8086 hqRecpReq->hqInfo.pucchResCnt++;
8089 if (n1PucchTkn.pres == TRUE)
8091 hqRecpReq->hqInfo.hqRes[resIdx] = n1PucchTkn.val;
8097 m = dlSf->dlFdbkInfo.m;
8099 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
8100 nP = cellCb->rgSchTddNpValTbl[P];
8101 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
8102 hqRecpReq->hqInfo.hqRes[resIdx] = (M - m - 1)* nP +
8103 (m * nPlusOne) + pdcch->nCce +
8104 cellCb->pucchCfg.n1PucchAn;
8106 #endif /* TFU_UPGRADE */
8107 /* If all the DL subframes are scanned, then
8108 * send TFU request*/
8110 if((elemIdx != noFdbks) && alloc)
8112 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
8113 (U8 *)&rnti, (U16) sizeof(rnti));
8118 pucchInfo->pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
8119 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
8120 &(pucchInfo->pucchRecpInfo->lnk));
8121 pucchInfo->pucchRecpInfo->lnk.node =
8122 (PTR)pucchInfo->pucchRecpInfo;
8123 /* Delete the entry after addition to the list */
8124 cmHashListDelete(&cellCb->ueTfuPendLst, (PTR) pucchInfo);
8130 *pucchInfoRef = pucchInfo;
8136 #ifdef RG_ULSCHED_AT_CRC
8137 /** @brief This function does all the processing related to a single downlink
8142 * Function: rgSCHTomUtlProcDlSfAtCrc
8145 * - collate control data for all UEs and send to PHY
8146 * - collate data buffers for all UEs and send to PHY
8148 * @param [in] RgSchDlSf *ulSf
8149 * @param [in] RgSchCellCb *cell
8150 * @param [in] TfuCntrlReqInfo *cntrlInfo
8151 * @param [out] RgSchErrInfo *err
8155 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc
8158 CmLteTimingInfo crntUlFrm,
8160 TfuCntrlReqInfo *cntrlInfo,
8164 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc (ulSf, crntUlFrm, cell, cntrlInfo, err)
8166 CmLteTimingInfo crntUlFrm;
8168 TfuCntrlReqInfo *cntrlInfo;
8172 Inst inst = cell->instIdx;
8175 TRC2(rgSCHTomUtlProcDlSfAtCrc);
8178 cntrlInfo->numDlActvUes = 0;
8179 cmLListInit(&cntrlInfo->phichLst);
8180 cmLListInit(&cntrlInfo->dlPdcchLst);
8181 cmLListInit(&cntrlInfo->ulPdcchLst);
8182 #ifdef TFU_ALLOC_EVENT_NO_INIT
8183 cntrlInfo->dlTiming.sfn = cntrlInfo->dlTiming.subframe = 0;
8187 cntrlInfo->ulTiming = crntUlFrm;
8188 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cntrlInfo->ulTiming, TFU_ULCNTRL_DLDELTA);
8190 cntrlInfo->cellId = cell->cellId;
8191 /* Fill PHICH info */
8192 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
8194 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PHICH info for "
8196 RGSCH_FREE_MEM(cntrlInfo);
8201 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) != ROK)
8203 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PDCCH info for "
8205 RGSCH_FREE_MEM(cntrlInfo);
8210 if(0 == cntrlInfo->ulMpdcchLst.count)
8217 if ((cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count) || RG_SCH_EMTC_GET_PDCCHLST_CNT(cntrlInfo))
8219 if (cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count)
8222 if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
8225 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for"
8231 RGSCH_FREE_MEM(cntrlInfo);
8236 #endif /* #ifdef RG_ULSCHED_AT_CRC*/
8239 /** @brief This function sends the SFN Tick to L3
8244 * Function: rgSCHTomUtlSendSfnTick
8246 * @param [in] RgSchCellCb *cell
8249 PRIVATE Void rgSCHTomUtlSendSfnTick
8254 PRIVATE Void rgSCHTomUtlSendSfnTick (cell)
8258 RgrTtiIndInfo *rgrTtiInd;
8260 TRC2(rgSCHTomUtlSendSfnTick);
8262 /* TTI to be sent to RRM only once per system frame */
8263 /* Added support for period = 0 to disable tick to RRM */
8264 if ((cell->rrmTtiIndPrd != 0) &&
8265 ((cell->crntTime.sfn % cell->rrmTtiIndPrd) == 0) &&
8266 (cell->crntTime.subframe == 0))
8268 /* Allocate a TTI indication structure and send to RRM over RGR interface */
8269 if (rgSCHUtlAllocSBuf (cell->instIdx,
8270 (Data**)&rgrTtiInd, sizeof(RgrTtiIndInfo)) != ROK)
8272 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
8273 "Mem alloc failed for RGR TTI ind, cellId (%d))\n",
8277 rgrTtiInd->cellId = cell->cellId;
8278 rgrTtiInd->hSfn = cell->crntTime.hSfn;
8279 rgrTtiInd->sfn = cell->crntTime.sfn;
8281 if (rgSCHUtlRgrTtiInd (cell, rgrTtiInd) != ROK)
8283 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
8284 "Failed to send RGR TTI ind, cellId (%d))\n",
8286 rgSCHUtlFreeSBuf(cell->instIdx, (Data**)&rgrTtiInd,
8287 sizeof(RgrTtiIndInfo));
8297 /* @brief Mark Dyn TDD CrntSfIdx.
8301 * Function: rgSCHDynTDDMrkCrntSfIdx
8302 * Purpose: update the dyn tdd sunframe index
8303 * @param[in] Inst schInst
8307 PRIVATE Void rgSCHDynTDDMrkCrntSfIdx
8312 PRIVATE Void rgSCHDynTDDMrkCrntSfIdx(schInst)
8316 RgSchDynTddCb *rgSchDynTddInfo = &(rgSchCb[schInst].rgSchDynTdd);
8318 TRC2(rgSCHDynTDDMrkCrntSfIdx)
8320 RG_SCH_DYN_TDD_MARKTYPE(rgSchDynTddInfo, rgSchDynTddInfo->crntDTddSfIdx,
8321 RG_SCH_DYNTDD_NOTDEF);
8322 rgSchDynTddInfo->crntDTddSfIdx = (rgSchDynTddInfo->crntDTddSfIdx + 1) %
8323 RG_SCH_DYNTDD_MAX_SFINFO;
8325 //printf("Initializing Index %d \n", rgSchDynTddInfo->crntDTddSfIdx);
8331 /** @brief This function fills the TTI timinig info for each cell
8335 * Function: rgSchTomFillCellTtiInfo
8337 * @param [in] TfuTtiIndInfo *ttiInd
8338 * @param [in] Inst schInst
8339 * @param [out] U8 *nCell
8340 * @param [out] RgSchCellCb *cell[]
8346 PRIVATE Void rgSchTomFillCellTtiInfo
8348 TfuTtiIndInfo *ttiInd,
8351 RgSchCellCb *cells[]
8354 PRIVATE Void rgSchTomFillCellTtiInfo (ttiInd, schInst, nCell, cells)
8355 TfuTtiIndInfo *ttiInd;
8358 RgSchCellCb *cells[];
8363 TfuTtiCellInfo *cellInfo;
8367 CmLteTimingInfo frm;
8369 TRC2 (rgSchTomFillCellTtiInfo);
8371 if (CM_LTE_MAX_CELLS < ttiInd->numCells)
8377 rgSCHDynTDDMrkCrntSfIdx(schInst);
8380 for (i = 0; i < ttiInd->numCells; i++)
8382 cellInfo = &ttiInd->cells[i];
8383 strtCellId = rgSchCb[schInst].genCfg.startCellId;
8384 Idx1 = (U8)((cellInfo->cellId - strtCellId)&(CM_LTE_MAX_CELLS-1));
8385 cell = rgSchCb[schInst].cells[Idx1];
8386 /* Validate the cell */
8389 /* Use SCH inst 0 print buff */
8390 RGSCHDBGERRNEW(schInst,(rgSchPBuf(schInst),
8391 "RgLiTfuTtiInd()No cell exists for cellId %d\n",
8395 *nCell = *nCell + 1;
8396 cells[i] = (RgSchCellCb *)cell;
8399 if(cell->schTickDelta != cellInfo->schTickDelta)
8401 printf("\nMukesh: Delta changed for cellId=%d: curr delta=%d new delta=%d\n"
8402 "dlblankSf=%d ulblankSf=%d dummyTti=%d \n",
8403 cell->cellId, cell->schTickDelta, cellInfo->schTickDelta, cellInfo->dlBlankSf,cellInfo->ulBlankSf,
8404 cellInfo->isDummyTti);
8406 RGSCH_UPDATE_DELTA(schInst, cellInfo->schTickDelta);
8407 cell->schTickDelta = cellInfo->schTickDelta;
8410 cell->stopSiSch = cellInfo->dlBlankSf;
8411 cell->stopDlSch = cellInfo->dlBlankSf;
8412 cell->stopUlSch = cellInfo->ulBlankSf;
8413 if (cellInfo->isDummyTti)
8415 cell->stopDlSch = TRUE;
8417 if((0 == (cellInfo->timingInfo.sfn % 30)) && (0 == cellInfo->timingInfo.subframe))
8419 //printf("5GTF_CHECK rgSCHTOMTtiInd (%d : %d)\n", cellInfo->timingInfo.sfn, cellInfo->timingInfo.subframe);
8422 RGSCHCPYTIMEINFO(cellInfo->timingInfo, cell->crntTime);
8423 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->hiDci0Time,
8424 TFU_ULCNTRL_DLDELTA);
8425 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->dlDciTime,
8426 TFU_DLCNTRL_DLDELTA);
8427 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->rcpReqTime,
8428 TFU_RECPREQ_DLDELTA);
8429 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->hqRlsTime,
8430 TFU_HQFBKIND_ULDELTA);
8431 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->dlSfRlsTime,
8434 RGSCHCPYTIMEINFO_EMTC(cellInfo->timingInfo, cell->crntTime);
8435 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->hiDci0Time,
8436 TFU_ULCNTRL_DLDELTA);
8437 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->dlDciTime,
8438 TFU_DLCNTRL_DLDELTA);
8439 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->rcpReqTime,
8440 TFU_RECPREQ_DLDELTA);
8441 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->hqRlsTime,
8442 TFU_HQFBKIND_ULDELTA);
8443 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->dlSfRlsTime,
8446 rgSCHCmnUpdVars(cell);
8447 cell->isDlDataAllwd = TRUE;
8448 /* Get DownLink SubFrame */
8449 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8450 frm = cell->crntTime;
8452 RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
8454 RGSCH_INCR_SUB_FRAME_EMTC(frm, RG_SCH_CMN_DL_DELTA);
8456 cellSch->dl.time = frm;
8462 U8 idx = (cell->crntTime.subframe + RG_SCH_CMN_DL_DELTA) %
8463 RGSCH_NUM_SUB_FRAMES_5G;
8465 cell->isDlDataAllwd = RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, idx);
8467 /*ccpu00130639 -ADD - used in UL HARQ proc id calculation*/
8468 if((cell->crntTime.sfn == 0) && (cell->crntTime.subframe == 0))
8470 /* sfn Cycle used for Tdd UL Harq Proc Determination.
8471 This sfn Cycle will have values from 0 to numUl Harq-1. */
8472 cell->tddHqSfnCycle = (cell->tddHqSfnCycle + 1 ) %
8473 (rgSchTddUlNumHarqProcTbl[cell->ulDlCfgIdx]);
8477 if(cell->emtcEnable)
8479 rgSCHUtlEmtcResPrcTti(cell);
8485 /** @brief This function prepares the TTI for scheduling and
8486 * invokes the Common channel scheduler. Uplink scheduler
8487 * is invoked first if UL Scheduling at CRC is not enabled
8491 * Function: rgSchTomTtiUlAndDlCmnChSch
8493 * @param [out] RgSchCellCb *cell
8499 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch
8504 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch (cell)
8509 TRC2(rgSchTomTtiUlAndDlCmnChSch);
8511 cell->rlsHqArr[cell->crntHqIdx].numUes = 0;
8513 cell->crntHqIdx = cell->crntHqIdx % RGSCH_NUM_SUB_FRAMES;
8515 cmPrcTmr(&cell->tqCp, cell->tq, (PFV)rgSCHTmrProcTmr);
8516 rgSCHMeasGapANRepTtiHndl (cell);
8517 /* We need to fill the PHICH for the UL Data, first we need to get the UL
8518 * SF from Scheduler, next we fill the dlSf that goes out this TTI.
8519 * This must be performed prior to any other processing of the TTI
8520 * so that we do not wrap around and generate feedback prior to
8521 * reception of UL data.
8523 #ifndef RG_ULSCHED_AT_CRC
8526 U8 idx; /* Index into Uplink Sf array */
8528 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
8529 [cell->hiDci0Time.subframe];
8533 for(idx=0; idx < Mval; idx++)
8535 rgSCHCmnRlsUlSf(cell, idx);
8541 /* DTX processing for those Harq's which did not get feedback from L1 */
8542 rgSCHDhmRlsDlsfHqProc (cell, cell->hqRlsTime);
8543 /* Re-Init the Downlink subframe */
8544 rgSCHUtlDlRlsSubFrm(cell, cell->dlSfRlsTime);
8545 /* Added handling to retransmit
8546 * release PDCCH in case of DTX
8549 /*Check for DRX every TTI*/
8550 rgSCHDrxTtiInd(cell);
8552 /* For TDD, UL scheduling should happen after DL scheduling */
8554 #ifndef RG_ULSCHED_AT_CRC
8555 /* Perform UL scheduling */
8556 rgSCHCmnUlSch(cell);
8559 /* Perform DL scheduling for Common channels */
8560 rgSCHCmnDlCommonChSch(cell);
8565 /** @brief This function invokes the Non critical procedures like measurements,
8566 * and RGR configurations.
8570 * Function: rgSchTomTtiMiscFunctions
8572 * @param [in] RgSchCellCb *cell
8578 PRIVATE Void rgSchTomTtiMiscFunctions
8583 PRIVATE Void rgSchTomTtiMiscFunctions (cell)
8587 U8 suId = cell->tfuSap->sapCfg.suId;
8589 TRC2(rgSchTomTtiMiscFunctions);
8591 /* Invoke RAM Tti Handler */
8592 rgSCHRamTtiHndlr(cell);
8594 /* Handle RGR configurations */
8595 rgSCHGomTtiHndlr(cell, suId);
8597 if((RGM_PRB_REPORT_START == cell->prbUsage.prbRprtEnabld)
8598 && (!(cell->prbUsage.rprtPeriod) || ((glblTtiCnt % cell->prbUsage.rprtPeriod) == 0)))
8600 rgSCHUtlUpdAvgPrbUsage(cell);
8602 rgSCHL2Meas(cell,FALSE);
8605 /* LTE_ADV_FLAG_REMOVED_START */
8606 /* Report ABS Load information to application periodically */
8607 if((RGR_ENABLE == cell->lteAdvCb.absCfg.status) &&
8608 (cell->lteAdvCb.absCfg.absLoadPeriodicity))
8610 RgrLoadInfIndInfo *rgrLoadInf;
8613 cell->lteAdvCb.absLoadTtiCnt++;
8614 if(cell->lteAdvCb.absLoadTtiCnt >= cell->lteAdvCb.absCfg.absLoadPeriodicity)
8617 if(rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&rgrLoadInf,
8618 sizeof(RgrLoadInfIndInfo)) != ROK)
8620 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),"Could not "
8621 "allocate memory for sending LoadInfo\n"));
8624 cell->lteAdvCb.absLoadTtiCnt = 0;
8625 rgrLoadInf->cellId = cell->cellId;
8626 rgrLoadInf->bw = cell->bwCfg.dlTotalBw;
8627 rgrLoadInf->type = RGR_ABS;
8628 for(idx= 0; idx<RGR_ABS_PATTERN_LEN; idx++)
8630 rgrLoadInf->u.absLoadInfo[idx] = cell->lteAdvCb.absLoadInfo[idx];
8631 cell->lteAdvCb.absLoadInfo[idx] = 0;
8633 rgSCHUtlRgrLoadInfInd(cell, rgrLoadInf);
8638 if(cell->isDlDataAllwd)
8640 /* Calling function to update CFI parameters*/
8641 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
8645 /* Incrementing the ttiCnt in case of UL subframe */
8646 if(!cell->dynCfiCb.switchOvrInProgress)
8648 cell->dynCfiCb.ttiCnt++;
8652 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
8655 /* LTE_ADV_FLAG_REMOVED_END */
8660 /** @brief This function invokes the Downlink scheduler
8664 * Function: rgSchTomTtiDlSch
8666 * @param [in] RgSchCellCb *cell
8672 PRIVATE Void rgSchTomTtiDlSch
8677 PRIVATE Void rgSchTomTtiDlSch (cell)
8681 TRC2(rgSchTomTtiDlSch);
8683 if (cell->isDlDataAllwd && (cell->stopDlSch == FALSE))
8685 rgSCHCmnDlSch(cell);
8691 /** @brief This function invokes Consolidates the allocations
8692 * send the Subframe allocation info to MAC
8696 * Function: rgSchTomTtiCnsldtSfAlloc
8698 * @param [in] RgSchCellCb *cell
8704 PRIVATE Void rgSchTomTtiCnsldtSfAlloc
8709 PRIVATE Void rgSchTomTtiCnsldtSfAlloc (cell)
8714 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8716 dlSf = rgSCHUtlSubFrmGet(cell, cellSch->dl.time);
8718 TRC2(rgSchTomTtiCnsldtSfAlloc);
8720 /* Prepare Subframe allocation info and send to MAC */
8721 rgSCHCmnCnsldtSfAlloc(cell);
8723 /* Call ACK NACK module to add to dlsf Queue */
8724 rgSCHAckNakRepAddToQ(cell, dlSf);
8726 rgSCHTomUtlProcTA(cell);
8731 /** @brief This function prepares the DL and UL Config requests
8736 * Function: rgSchTomTtiL1DlAndUlCfg
8738 * @param [in] RgSchCellCb *cell
8744 PRIVATE Void rgSchTomTtiL1DlAndUlCfg
8747 RgTfuCntrlReqInfo *cntrlInfo
8750 PRIVATE Void rgSchTomTtiL1DlAndUlCfg (cell, cntrlInfo)
8752 RgTfuCntrlReqInfo *cntrlInfo;
8755 RgSchDlSf *dlSf = rgSCHUtlSubFrmGet (cell, cell->dlDciTime);
8756 RgSchDlSf *ulSf = rgSCHUtlSubFrmGet (cell, cell->hiDci0Time);
8759 TRC2(rgSchTomTtiL1DlAndUlCfg);
8761 rgSCHTomUtlProcDlSf (dlSf, ulSf, cell, cntrlInfo, &err);
8762 /* Mark this frame as sent */
8763 dlSf->txDone = TRUE;
8765 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
8766 rgBwAlcnt[dlSf->sfNum] ++;
8770 rgSCHTomUtlProcTddUlSf(cell);
8772 rgSCHTomUtlProcUlSf (cell, &err);
8778 /** @brief This function prepares does the Downlink subframe re-init and
8779 * Harq DTX processing
8783 * Function: rgSchTomUtlTddRlsSfAndHarq
8785 * @param [in] RgSchCellCb *cell
8791 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq
8796 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq (cell)
8800 TRC2(rgSchTomUtlTddRlsSfAndHarq);
8802 /* ccpu00132341-MOD- rgSchTddRlsDlSubfrmTbl is dependent on DELTA(=2).
8803 * Instead rgSchTddDlAscSetIdxKTbl can be used as the K set gives proper
8805 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper
8806 * output if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME()
8807 * as it is serving the purpose */
8808 if(rgSchTddDlAscSetIdxKTbl[cell->ulDlCfgIdx][cell->hqRlsTime.subframe].
8811 /* ccpu00132341-MOD- Providing the UL SF timing for avoiding
8812 * calculation inside the function */
8813 rgSCHDhmTddRlsSubFrm(cell, cell->hqRlsTime);
8814 rgSCHDhmRlsDlsfHqProc(cell, cell->hqRlsTime);
8819 /** @brief This function processes the UL subframe and fills TFU reception
8824 * Function: rgSCHTomUtlProcTddUlSf
8826 * @param [in] RgSchCellCb *cell
8832 PRIVATE Void rgSCHTomUtlProcTddUlSf
8837 PRIVATE Void rgSCHTomUtlProcTddUlSf (cell)
8843 TRC2(rgSCHTomUtlProcTddUlSf);
8845 if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8846 [cell->rcpReqTime.subframe] == RG_SCH_TDD_UL_SUBFRAME)
8848 if (rgSCHTomUtlProcUlSf (cell, &err) != ROK)
8850 /* fill in err type and call sta ind */
8851 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8852 "Unable to process Uplink subframe for cellId (%d))\n",
8856 /* TDD Fix , to allow Special SF SRS CFg */
8857 else if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8858 [cell->rcpReqTime.subframe] == RG_SCH_TDD_SPL_SUBFRAME)
8860 if (rgSCHTomUtlPrcUlTddSpclSf(cell, &err) != ROK)
8862 /* fill in err type and call sta ind */
8863 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8864 "Unable to process Sipceial subframe for cellId (%d))\n",
8874 /**********************************************************************
8877 **********************************************************************/