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 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;
1843 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1844 RgSchCellCb *iterCellP;
1855 TRC2(rgSCHTomRawCqiInd);
1857 if(cell->cellId != rawCqiInd->cellId)
1859 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
1860 ":%d", rawCqiInd->cellId);
1865 node = rawCqiInd->rawCqiRpt.first;
1866 for (;node; node=node->next)
1868 rawCqiInfo = (TfuRawCqiRpt *)node->node;
1869 ue = rgSCHDbmGetUeCb (cell, rawCqiInfo->crnti);
1870 raCb = rgSCHDbmGetRaCb (cell, rawCqiInfo->crnti);
1874 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"CRNTI:%d Unable to get the UECB",
1881 if (rawCqiInfo->numBits >= 5)
1882 printf("cellId [%d] crnti [%d] numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n",
1883 cell->cellId, rawCqiInfo->crnti, rawCqiInfo->numBits, rawCqiInfo->uciPayload,
1884 rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.subframe);
1886 if (rawCqiInfo->numBits == 1)
1888 rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1889 U8 fdbk = TFU_HQFDB_NACK;
1890 /* Process HARQ FdbkInd */
1891 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1894 fdbk = TFU_HQFDB_ACK;
1895 hqInfo.isAck[0] = fdbk;
1897 if (ue != NULLP && raCb == NULLP)
1899 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
1901 err.errType = RGSCHERR_TOM_HARQACKIND;
1902 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
1903 "HARQ feedback processing failed errType(%d)errCause(%d)n",
1904 err.errType, err.errCause);
1908 else if (ue == NULLP && raCb != NULLP)
1910 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1911 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1913 err.errType = RGSCHERR_TOM_HARQACKIND;
1914 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1915 " feedback processing failed errType(%d) errCause(%d)",
1916 err.errType, err.errCause);
1921 else if (ue != NULLP && raCb != NULLP)
1923 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
1924 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
1926 err.errType = RGSCHERR_TOM_HARQACKIND;
1927 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
1928 " feedback processing failed errType(%d) errCause(%d).",
1929 err.errType, err.errCause);
1935 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
1936 "UE CB or RA CB ", rawCqiInfo->crnti);
1937 err.errType = RGSCHERR_TOM_HARQACKIND;
1941 printf("rawCqiInfo->numBits [%d] uciPayload [0x%08x] sfn/sf [%d:%d]\n", rawCqiInfo->numBits,
1942 rawCqiInfo->uciPayload, rawCqiInd->timingInfo.sfn, rawCqiInd->timingInfo.subframe);
1945 else if (rawCqiInfo->numBits == 5)
1947 /* Process CQI-RI Ind*/
1948 ri = (rawCqiInfo->uciPayload >> 27) & 0x1;
1949 cqi = (rawCqiInfo->uciPayload >> 28) & 0xF;
1953 printf("\n UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1956 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1957 ue->ue5gtfCb.rank = ri + 1;
1959 if (rawCqiInfo->numBits > 1)
1961 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1962 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1963 ueDl->cqiFlag = TRUE;
1964 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1965 // rgSCHCheckAndSetTxScheme(cell, ue);
1970 printf("UE[%d] CQI[%d] MCS[%d] RI[%d]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri);
1973 else if (rawCqiInfo->numBits == 6)
1975 RgInfRlsHqInfo *rlsHqBufs = &(cell->rlsHqArr[cell->crntHqIdx]);
1976 TfuHqFdbk fdbk = TFU_HQFDB_NACK;
1977 /* Process both HARQ and CQI-RI Ind*/
1978 ri = (rawCqiInfo->uciPayload >> 26) & 0x1;
1979 cqi = (rawCqiInfo->uciPayload >> 27) & 0xF;
1980 hqAck = (rawCqiInfo->uciPayload >> 31) & 0x1;
1983 printf("UE[%d] CQI[%d] Invalid\n", ue->ueId, cqi);
1986 ue->ue5gtfCb.mcs = rgSch5gtfCqi2Mcs[cqi - 1];
1987 ue->ue5gtfCb.rank = ri + 1;
1989 if (rawCqiInfo->numBits > 1)
1991 ueDl = RG_SCH_CMN_GET_DL_UE(ue,cell);
1992 ueDl->mimoInfo.cwInfo[0].cqi = cqi;
1993 ueDl->cqiFlag = TRUE;
1994 rgSCHCmnDlSetUeAllocLmtLa(cell, ue);
1995 // rgSCHCheckAndSetTxScheme(cell, ue);
2000 fdbk = TFU_HQFDB_ACK;
2001 hqInfo.isAck[0] = fdbk;
2003 if (ue != NULLP && raCb == NULLP)
2005 if ((rgSCHDhm5gtfHqFdbkInd (ue, cell, rawCqiInd->timingInfo, fdbk, &err)) != ROK)
2007 err.errType = RGSCHERR_TOM_HARQACKIND;
2008 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() "
2009 "HARQ feedback processing failed errType(%d)errCause(%d)n",
2010 err.errType, err.errCause);
2014 else if (ue == NULLP && raCb != NULLP)
2016 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
2017 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
2019 err.errType = RGSCHERR_TOM_HARQACKIND;
2020 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
2021 " feedback processing failed errType(%d) errCause(%d)",
2022 err.errType, err.errCause);
2027 else if (ue != NULLP && raCb != NULLP)
2029 if ((rgSCHDhmHqFdbkInd (raCb, RGSCH_HQ_FDB_IND_CB_TYPE_RA_CB,
2030 cell, rawCqiInd->timingInfo, &hqInfo, rlsHqBufs, &err)) != ROK)
2032 err.errType = RGSCHERR_TOM_HARQACKIND;
2033 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomHarqAckInd() HARQ"
2034 " feedback processing failed errType(%d) errCause(%d).",
2035 err.errType, err.errCause);
2041 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
2042 "UE CB or RA CB ", rawCqiInfo->crnti);
2043 err.errType = RGSCHERR_TOM_HARQACKIND;
2048 printf("\nUE[%u] CQI[%u] MCS[%u] RI[%u] HQ[%u]\n", ue->ueId, cqi, ue->ue5gtfCb.mcs, ri, hqAck);
2053 if ((rgSCHDhmRlsDlsfHqProc (cell, rawCqiInd->timingInfo)) != ROK)
2055 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Release Downlink "
2056 "subframe for cellId (%d) ", cell->cellId);
2057 err.errType = RGSCHERR_TOM_HARQACKIND;
2060 for (cellIdx = 0; cellIdx < CM_LTE_MAX_CELLS; cellIdx++)
2062 if (NULLP != rgSchCb[cell->instIdx].cells[cellIdx])
2064 iterCellP = rgSchCb[cell->instIdx].cells[cellIdx];
2066 rlsHqBufs = &(iterCellP->rlsHqArr[iterCellP->crntHqIdx]);
2067 if(rlsHqBufs->numUes)
2069 rgSCHUtlGetPstToLyr(&pst, &rgSchCb[cell->instIdx], iterCellP->macInst);
2070 RgSchMacRlsHq (&pst, rlsHqBufs);
2072 rlsHqBufs->numUes = 0;
2076 } /* rgSCHTomRawCqiInd */
2079 * @brief Handler for processing SRS indication recieved from
2084 * Function: rgSCHTomSrsInd
2086 * Handler for SRS indication recieved from PHY
2089 * Invoked by: RgLiTfuSrsInd
2093 * - Invoke scheduler to indicate UL SRS rgSCHUtlSrsInd
2095 * @param[in] TfuSrsIndInfo *srsInd
2101 PUBLIC S16 rgSCHTomSrsInd
2104 TfuSrsIndInfo *srsInd
2107 PUBLIC S16 rgSCHTomSrsInd(cell, srsInd)
2109 TfuSrsIndInfo *srsInd;
2116 TRC2(rgSCHTomSrsInd);
2118 if(cell->cellId != srsInd->cellId)
2120 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2121 ":%d", srsInd->cellId);
2125 node = srsInd->srsRpt.first;
2126 for (;node; node=node->next)
2128 srsInfo = (TfuSrsRpt *)node->node;
2129 ue = rgSCHDbmGetUeCb (cell, srsInfo->ueId);
2132 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the "
2133 "UE CB", srsInfo->ueId);
2136 rgSCHUtlSrsInd(cell, ue, srsInfo, srsInd->timingInfo);
2137 rgSCHUtlHdlUlTransInd(cell, ue, srsInd->timingInfo);
2140 } /* rgSCHTomSrsInd */
2144 * Fun: rgSCHTomUtlGenIndices
2146 * Desc: This function reconstructs the Subband Indices for
2147 * of M selected Subbands conveyed by the UE for APeriodic Modes
2148 * 2-0 and 2-2. It decodes the Label which uniquely encodes M out
2156 * File: rg_sch_utl.c
2160 PRIVATE S16 rgSCHTomUtlGenIndices
2166 TfuSubbandInfo* sbInfo
2169 PRIVATE S16 rgSCHTomUtlGenIndices(label, posM, valN, valK, sbInfo)
2174 TfuSubbandInfo* sbInfo;
2177 U8 idx, kval, xval, xmin;
2180 for(kval=0; kval<posM;kval++)
2183 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe, (posM-kval-1));
2184 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2185 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2189 RGSCH_ARRAY_BOUND_CHECK_WITH_POS_IDX(0, rgSCHTomBinCoe[posM-kval-1], (valN-xval-1));
2190 binCoe = rgSCHTomBinCoe[posM-kval-1][valN-xval-1];
2193 sbInfo[kval].numRb = valK;
2194 sbInfo[kval].rbStart = idx*valK;
2196 label = label-binCoe;
2199 } /* end of rgSCHTomUtlGenIndices*/
2202 * @brief Handler for processing decode failure indication recieved from
2207 * Function: rgSCHTomCrcInd
2209 * Handler for processing decode failure indication recieved from
2210 * PHY for a set of UEs.
2212 * Invoked by: RgLiTfuCrcInd of rg_sch.x
2215 * - Validate the information received and retrieve cell and ue.
2216 * - Process Decode failure Indication: Call rgSCHUhmProcHqFailure().
2218 * @param[in] TfuCrcIndInfo *crcInd
2224 PUBLIC S16 rgSCHTomCrcInd
2227 TfuCrcIndInfo *crcInd
2230 PUBLIC S16 rgSCHTomCrcInd(cell, crcInd)
2232 TfuCrcIndInfo *crcInd;
2235 RgSchUeCb *ue = NULLP;
2236 RgSchRaCb *raCb = NULLP;
2238 TfuCrcInfo *crcInfo;
2239 #ifdef RG_ULSCHED_AT_CRC
2242 CmLteTimingInfo crntHiDci0Frm;
2243 //RgSchCmnUlCell *cellUl;
2244 Inst inst = cell->instIdx;
2245 TfuCntrlReqInfo *cntrlInfo;
2253 RgSchUlHqProcCb *hqProc;
2257 RgSchUlHqProcCb *ulHqProc;
2260 TRC2(rgSCHTomCrcInd);
2262 if(cell->cellId != crcInd->cellId)
2264 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2265 ":%d", crcInd->cellId);
2268 #ifdef RG_ULSCHED_AT_CRC
2271 static CmLteTimingInfo lastCrc = {2000,0};
2272 CmLteTimingInfo crntCrc = cell->crntTime;
2273 if (RGSCH_TIMEINFO_SAME(lastCrc, crntCrc))
2275 /*Removed the WA to drop 2nd CRC*/
2276 RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,"Recieved CRC "
2277 "twice per TTI @(%u,%u)", cell->crntTime.sfn,
2278 cell->crntTime.subframe);
2284 node = crcInd->crcLst.first;
2285 for (;node; node=node->next)
2287 crcInfo = (TfuCrcInfo*)node->node;
2288 ue = rgSCHDbmGetUeCb (cell, crcInfo->rnti);
2292 /* Fetch from SPS List */
2293 ue = rgSCHDbmGetSpsUeCb(cell, crcInfo->rnti);
2297 raCb = rgSCHDbmGetRaCb (cell, crcInfo->rnti);
2304 /* Added Ul TB count for Uplink data scheduled*/
2308 ulHqProc = &(raCb->msg3HqProc);
2309 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2311 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2316 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2317 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2319 cell->dlUlTbCnt.tbTransUlTotalCnt++;
2324 if (crcInfo->isFailure == FALSE)
2328 rgSCHRamMsg3DatInd(raCb);
2330 /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
2331 hqProc = &(raCb->msg3HqProc);
2332 RGSCH_UPD_PHICH(cell->ulDlCfgIdx, crcInd->timingInfo.subframe,
2340 gUlCrcPassCounter++;
2345 RGSCHCPYTIMEINFO(crcInd->timingInfo, ue->datIndTime);
2346 #ifndef MAC_SCH_STATS
2347 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo);
2350 /** Stats update over here
2353 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2355 rgSCHUhmProcDatInd(cell, ue, crcInd->timingInfo, cmnUe->ul.crntUlCqi[0]);
2357 #endif /* MAC_SCH_STATS */
2359 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2361 rgSCHUtlHdlCrcInd(cell, ue, crcInd->timingInfo);
2369 /* SR_RACH_STATS : MSG3 Nack / DTX*/
2370 if (crcInfo->isDtx == TRUE)
2376 rgNumMsg3CrcFailed++;
2378 rgSCHRamMsg3FailureInd(raCb);
2380 rgSCHCmnEmtcHdlCrcFailInd(cell, raCb);
2382 /* Added Ul TB count for CRC Failure of MSG3 */
2384 ulHqProc = &(raCb->msg3HqProc);
2385 if(ulHqProc->remTx == (cell->rachCfg.maxMsg3Tx -1))
2387 cell->dlUlTbCnt.tbTransUlFaulty++;
2395 gUlCrcFailCounter++;
2400 #ifndef MAC_SCH_STATS
2401 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv);
2404 RgSchCmnUe *cmnUe = RG_SCH_CMN_GET_UE(ue,cell);
2406 rgSCHUhmProcHqFailure (cell, ue, crcInd->timingInfo, crcInfo->rv, cmnUe->ul.crntUlCqi[0]);
2408 #endif /* MAC_SCH_STATS */
2409 rgSCHUtlHdlUlTransInd(cell, ue, crcInd->timingInfo);
2411 rgSCHUtlHdlCrcFailInd(cell, ue, crcInd->timingInfo);
2413 /* Added Ul TB count for CRC Failure of Uplink data */
2415 rgSCHUtlUlHqProcForUe(cell, crcInd->timingInfo, ue, &ulHqProc);
2416 if(ulHqProc->remTx == ((RgUeUlHqCb*)ulHqProc->hqEnt)->maxHqRetx)
2418 cell->dlUlTbCnt.tbTransUlFaulty++;
2425 /* ccpu00132653-ADD Added Sched_At_Crc Changes for TDD and optimized here
2426 the codebase across TDD and FDD*/
2427 #ifdef RG_ULSCHED_AT_CRC
2428 /* Changes to do uplink scheduling at CRC Indication */
2429 //cellUl = RG_SCH_CMN_GET_UL_CELL(cell);
2430 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, crntHiDci0Frm, TFU_ULCNTRL_DLDELTA);
2433 rgSCHCmnRlsUlSf(cell,0);
2436 /* Allocating memory for CntrlReq as it required for both EMTC and
2438 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&cntrlInfo,
2439 sizeof(TfuCntrlReqInfo))) != ROK)
2441 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuCntrlReqInfo "
2445 rgSCHCmnUlSch(cell);
2447 rgSCHL2Meas(cell,TRUE);
2449 /* Also, sending UL DCI and PHICH for just scheduled subframe */
2450 ulSf = rgSCHUtlSubFrmGet (cell, crntHiDci0Frm);
2452 if ((rgSCHTomUtlProcDlSfAtCrc (ulSf, crntHiDci0Frm, cell, cntrlInfo, &err)) != ROK)
2454 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomCrcInd() Unable to process"
2455 " downlink subframe for cellId %d", crcInd->cellId);
2456 err.errType = RGSCHERR_TOM_TTIIND;
2459 #endif /* RG_ULSCHED_AT_CRC */
2461 } /* rgSCHTomCrcInd */
2464 * @brief Handler for processing timing Advance indication recieved from
2469 * Function: rgSCHTomTimingAdvInd
2471 * Handler for processing timing advance indication recieved from PHY
2474 * Invoked by: RgLiTfuTimingAdvInd
2478 * - Call DHM to update value of Timing Advance rgSCHDhmUpdTa.
2480 * @param[in] TfuTimingAdvIndInfo *timingAdvInd
2486 PUBLIC S16 rgSCHTomTimingAdvInd
2489 TfuTimingAdvIndInfo *timingAdvInd
2492 PUBLIC S16 rgSCHTomTimingAdvInd(cell, timingAdvInd)
2494 TfuTimingAdvIndInfo *timingAdvInd;
2499 TfuTimingAdvInfo *timingAdvInfo;
2502 TRC2(rgSCHTomTimingAdvInd);
2504 if(cell->cellId != timingAdvInd->cellId)
2506 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to get the cell for cellId"
2507 "=(%d)", timingAdvInd->cellId);
2512 node = timingAdvInd->timingAdvLst.first;
2513 for (;node; node=node->next)
2515 timingAdvInfo = (TfuTimingAdvInfo *)node->node;
2516 ue = rgSCHDbmGetUeCb (cell, timingAdvInfo->rnti);
2519 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to get the UE CB",
2520 timingAdvInfo->rnti);
2523 rgSCHDhmUpdTa (cell, ue, timingAdvInfo->timingAdv);
2526 } /* rgSCHTomTimingAdvInd */
2529 * @brief Handler for processing TTI indication recieved from
2530 * PHY for 'n' cells.
2534 * Function: rgSCHTomTtiInd
2536 * Handler for processing TTI indication recieved from PHY
2537 * for a cell. This is split into the below Steps.
2539 * 1: Complete the Uplink and Common Channel Scheduling for each Cell
2540 * 2: Complete the UE specific Scheduling for each Cell / across Cells.
2541 * 3: Consolidate the subframe allocations and send to each MAC instance
2542 * 4: Fill the Tfu structures for DL and UL Config requests
2543 * 5: Handle the RGR Config messages per Cell
2545 * @param[in] TfuTtiIndInfo *ttiInd
2546 * @param[in] Inst schInst
2550 PUBLIC Void rgSCHTomTtiInd
2552 TfuTtiIndInfo *ttiInd,
2556 PUBLIC Void rgSCHTomTtiInd(ttiInd, schInst)
2557 TfuTtiIndInfo *ttiInd;
2561 RgInfSfAlloc *subfrmAlloc;
2562 RgTfuCntrlReqInfo *cntrlInfo = NULLP;
2566 RgSchCellCb *cell[CM_LTE_MAX_CELLS];
2567 RgSchCellCb *cellLst[CM_LTE_MAX_CELLS];
2569 TRC2(rgSCHTomTtiInd);
2575 rgSchTomFillCellTtiInfo(ttiInd, schInst, &nCell, &cell[0]);
2576 for (i = 0; i < nCell; i++)
2578 /* Perform UL and DL Common Channel scheduling */
2579 rgSchTomTtiUlAndDlCmnChSch (cell[i]);
2582 /* Perform scheduling in Order of
2586 for (i = 0; i < nCell; i++)
2589 if (cell[i]->isDlDataAllwd && (cell[i]->stopDlSch == FALSE))
2591 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell[i]);
2592 /* Perform DL Retx scheduling */
2593 cellSch->apisDl->rgSCHDlRetxSched(cell[i], &cellSch->allocInfo);
2597 rgSchCmnPreDlSch(cell, nCell, cellLst);
2598 for (i = 0; i < nCell; i++)
2600 /* Perform DL scheduling */
2601 rgSchTomTtiDlSch (cellLst[i]);
2603 rgSchCmnPstDlSch(cell[0]);
2605 for (i = 0; i < nCell; i++)
2608 #ifndef RG_ULSCHED_AT_CRC
2609 /* Perform UL scheduling for TDD */
2610 rgSCHCmnUlSch (cell[i]);
2614 /* Init SF Alloc info per Cell */
2615 for (i = 0; i < nCell; i++)
2617 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2618 rgSCHUtlResetSfAlloc(subfrmAlloc,FALSE,TRUE);
2620 for (i = 0; i < nCell; i++)
2622 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2624 subfrmAlloc = &(cell[i]->sfAllocArr[cell[i]->crntSfIdx]);
2626 * TFU_DLDATA_DLDELTA is used in this calculation because the subfrmAlloc
2627 * timingInfo which is being calculated here will be used by MAC
2629 RG_SCH_ADD_TO_CRNT_TIME(cell[i]->crntTime, subfrmAlloc->timingInfo,
2630 RG_DL_DELTA - TFU_DLDATA_DLDELTA);
2631 /* Consolidate the Allocations and send response to MAC instances */
2632 rgSchTomTtiCnsldtSfAlloc (cell[i]);
2636 for (i = 0; i < nCell; i++)
2638 if (cell[i]->isDlDataAllwd && (cell[i]->stopSiSch == FALSE))
2640 /* Send the consolidated Alloc Info to MAC instances */
2641 rgSCHCmnSndCnsldtInfo (cell[i]);
2645 for (i = 0; i < nCell; i++)
2647 /* Fill control data from scheduler to PHY */
2648 if ((ret = rgSCHUtlAllocEventMem((cell[i]->instIdx), (Ptr *)&cntrlInfo,
2649 sizeof(RgTfuCntrlReqInfo))) != ROK)
2651 RLOG_ARG0(L_ERROR,DBG_CELLID,cell[i]->cellId,"Unable to Allocate TfuCntrlReqInfo"
2657 /* Fill the TFU structures and send to CL */
2658 if(TRUE == cell[i]->emtcEnable)
2660 ret = rgSchEmtcTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2664 && (NULLP != cntrlInfo))
2666 /* Fill the TFU structures and send to CL */
2667 rgSchTomTtiL1DlAndUlCfg (cell[i], cntrlInfo);
2671 rgSCHTomUtlSendSfnTick(cell[0]);
2674 for (i = 0; i < nCell; i++)
2676 /* Invoke non critical functions like measurements, etc */
2677 rgSchTomTtiMiscFunctions (cell[i]);
2682 U32 dbgUeIdChngAndDatReqInClCnt = 0;
2683 static U32 gTtiCount = 0;
2686 if(gTtiCount == 3000)
2688 #ifdef XEON_SPECIFIC_CHANGES
2689 printf("SChed:: (P/S)::(%u/%u) \n",
2690 gPrimarySchedCount,gSCellSchedCount);
2692 printf("\n HQFDBK :: %u\n",gHqFdbkCount);
2697 total = gPCellTb1AckCount + gPCellTb1NackCount + gPCellTb1DtxCount;
2698 total2 = gPCellTb2AckCount + gPCellTb2NackCount + gPCellTb2DtxCount;
2700 printf("\n PCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2701 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2702 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2703 if ((total != 0 ) && total2 != 0)
2705 printf("\n PCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2706 (float)gPCellTb1AckCount/total * 100,(float)gPCellTb1NackCount/total * 100,(float)gPCellTb1DtxCount/total * 100,
2707 (float)gPCellTb2AckCount/total2 *100 ,(float)gPCellTb2NackCount/total2 *100 ,(float)gPCellTb2DtxCount/total2 *2);
2710 total = gSCellTb1AckCount + gSCellTb1NackCount + gSCellTb1DtxCount;
2711 total2 = gSCellTb2AckCount + gSCellTb2NackCount + gSCellTb2DtxCount;
2714 printf("\n SCell:: TB1:: (A/N/D)::(%u/%u/%u) TB2:: (A/N/D)::(%u/%u/%u)\n",
2715 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2716 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2717 if ((total != 0 ) && total2 != 0)
2719 printf("\n SCell:: TB1:: (AP/NP/DP)::(%.2f/%.2f/%.2f) TB2:: (AP/NP/DP)::(%.2f/%.2f/%.2f)\n",
2720 (float)gSCellTb1AckCount/total * 100,(float)gSCellTb1NackCount/total * 100,(float)gSCellTb1DtxCount/total * 100,
2721 (float)gSCellTb2AckCount/total2 *100 ,(float)gSCellTb2NackCount/total2 *100 ,(float)gSCellTb2DtxCount/total2 *2);
2725 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%u/%u):(%u/%u/%u/%u)\n",
2726 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2727 gACqiRcvdCount,gCqiReptToAppCount);
2729 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%u/%u/%u/%u/%u/%u)\n",
2730 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2732 printf("UL::(DCI0/CrcPass/CrcFail)::(%u/%u/%u)\n"
2733 "gPcellZeroBoOcc:%u\t gScellZeroBoOcc:%u dbgUeIdChngAndDatReqInClCnt: %u\n"
2734 "DelayedDatReqInMac: %u DelayedDatReqInCl : %u gIccPktRcvrMemDropCnt :%u\n",
2740 dbgUeIdChngAndDatReqInClCnt,
2741 dbgDelayedDatReqInMac,
2742 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2744 printf("SChed:: (P/S)::(%ld/%ld) \n",
2745 gPrimarySchedCount,gSCellSchedCount);
2747 printf("\n HQFDBK :: %ld\n",gHqFdbkCount);
2749 printf("\n PCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2750 gPCellTb1AckCount,gPCellTb1NackCount,gPCellTb1DtxCount,
2751 gPCellTb2AckCount,gPCellTb2NackCount,gPCellTb2DtxCount);
2753 printf("\n SCell:: TB1:: (A/N/D)::(%ld/%ld/%ld) TB2:: (A/N/D)::(%ld/%ld/%ld)\n",
2754 gSCellTb1AckCount,gSCellTb1NackCount,gSCellTb1DtxCount,
2755 gSCellTb2AckCount,gSCellTb2NackCount,gSCellTb2DtxCount);
2757 printf("\n CQI:: Recp(Pucch/Pusch):Rcvd(pcqi/rawacqireport/apcqi/AppReprt)::(%ld/%ld):(%ld/%ld/%ld/%ld)\n",
2758 gCqiRecpCount,gCqiRecpPuschCount,gCqiRcvdCount,gRawACqiCount,
2759 gACqiRcvdCount,gCqiReptToAppCount);
2760 printf("\n CQI:: PucchCqiSnrDropCnt/PucchCqiConfBitMaskDropCnt/PuschCqiConfMaskDropCount :: (%ld/%ld/%ld) \n",gCqiPucchLowSnrDropCount,gCqiPucchConfMaskDropCount,gCqiPuschConfMaskDropCount);
2762 printf("\n (F1BCS Count/Cqi/Ri/CqiDrop/PucchDrop/PuschCqiDrop)::(%ld/%ld/%ld/%ld/%ld/%ld)\n",
2763 gF1bCsCount,gCqiReqCount,gRiReqCount,gCqiDropCount,gPucchDropCount,gPuschCqiDropCount);
2765 printf("UL::(DCI0/CrcPass/CrcFail)::(%ld/%ld/%ld)\n"
2766 "gPcellZeroBoOcc:%ld\t gScellZeroBoOcc:%ld dbgUeIdChngAndDatReqInClCnt: %ld\n"
2767 "DelayedDatReqInMac: %ld DelayedDatReqInCl : %ld gIccPktRcvrMemDropCnt :%ld\n",
2773 dbgUeIdChngAndDatReqInClCnt,
2774 dbgDelayedDatReqInMac,
2775 gDropDatReqCnt, gIccPktRcvrMemDropCnt);
2776 //printf ("\n delayedApiCnt:%ld",delayedApiCnt);
2780 rgSCHLaaPrintStats();
2782 gCaDbgNonCaFrmt = gIccPktRcvrMemDropCnt = 0;
2794 gCqiPucchLowSnrDropCount = 0;
2795 gCqiPucchConfMaskDropCount = 0;
2796 gCqiPuschConfMaskDropCount = 0;
2797 gPuschCqiDropCount = 0;
2800 gUlCrcPassCount = 0;
2801 gUlCrcFailCount = 0;
2804 gCqiRecpPuschCount = 0;
2807 gCqiReptToAppCount = 0;
2812 gPrimarySchedCount = 0;
2813 gSCellSchedCount = 0;
2814 gSCellTb1AckCount = 0;
2815 gSCellTb2AckCount = 0;
2816 gSCellTb2AckCount = 0;
2817 gSCellTb2NackCount = 0;
2818 gPCellTb1AckCount = 0;
2819 gPCellTb1NackCount = 0;
2820 gPCellTb2AckCount = 0;
2821 gPCellTb2NackCount = 0;
2822 gSCellTb1NackCount=0;
2824 gPCellTb1DtxCount = 0;
2825 gPCellTb2DtxCount = 0;
2826 gSCellTb1DtxCount = 0;
2827 gSCellTb2DtxCount = 0;
2828 gPcellZeroBoOcc = 0;
2829 gScellZeroBoOcc = 0;
2837 } /* rgSCHTomTtiInd */
2839 /** @brief This function does the TTI processin for the uplink subframe,
2840 * already populated by the scheduler.
2844 * Function: rgSCHTomUtlProcUlSf
2847 * - Loop through the Uplink allocations present in the uplink subframe.
2848 * - For each allocation Fill a data reception request to be sent to PHY
2849 * - Also fills the harq reception requests for the expected HQ feedbacks.
2852 * @param [in] RgSchCellCb *cell
2853 * @param [out] RgSchErrInfo *err
2860 PRIVATE S16 rgSCHTomUtlProcUlSf
2866 PRIVATE S16 rgSCHTomUtlProcUlSf (cell, err)
2872 TfuRecpReqInfo *recpReqInfo;
2874 U16 validIdx = 0; /* Index computed from recreq's timing info*/
2876 Inst inst = cell->instIdx;
2878 TRC2(rgSCHTomUtlProcUlSf)
2880 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2881 sizeof(TfuRecpReqInfo))) != ROK)
2883 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate TfuRecpReqInfo "
2885 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2888 recpReqInfo->cellId = cell->cellId;
2889 cmLListInit(&recpReqInfo->ueRecpReqLst);
2891 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo,
2892 TFU_RECPREQ_DLDELTA);
2894 /* Filling data Reception requests */
2895 ret = rgSCHTomUtlFillDatRecpReq(recpReqInfo, cell,
2900 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Data recption "
2901 "requests for cell");
2902 RGSCH_FREE_MEM(recpReqInfo);
2905 /* Filling HARQ Reception requests */
2906 ret = rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, validIdx,err);
2909 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to fill Harq Feedback "
2910 "reception requests for cell");
2911 RGSCH_FREE_MEM(recpReqInfo);
2914 /* sending the RecpReq to Phy */
2915 if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
2917 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for cell");
2920 } /* end of rgSCHTomUtlProcUlSf */
2924 /** @brief This function does the TTI processin for the uplink subframe,
2925 * already populated by the scheduler.
2929 * Function: rgSCHTomUtlPrcUlTddSpclSf
2932 * - Fill the SRS Info for the Special Subframe in Reception Req.
2933 * - Send the Reception Req to TFU
2936 * @param [in] RgSchCellCb *cell
2937 * @param [out] RgSchErrInfo *err
2943 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf
2949 PRIVATE S16 rgSCHTomUtlPrcUlTddSpclSf (cell, err)
2955 TfuRecpReqInfo *recpReqInfo;
2956 U16 validIdx; /* Index computed from recreq's timing info*/
2957 Inst inst = cell->instIdx;
2959 TRC2(rgSCHTomUtlPrcUlTddSpclSf)
2961 if ((ret = rgSCHUtlAllocEventMem(inst, (Ptr *)&recpReqInfo,
2962 sizeof(TfuRecpReqInfo))) != ROK)
2964 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to "
2965 "Allocate TfuRecpReqInfo for cell");
2966 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
2969 recpReqInfo->cellId = cell->cellId;
2970 cmLListInit(&recpReqInfo->ueRecpReqLst);
2972 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, recpReqInfo->timingInfo, TFU_RECPREQ_DLDELTA);
2974 RG_SCH_GET_IDX_PCQISRSSR(recpReqInfo->timingInfo, validIdx);
2977 if(cell->srsCfg.isSrsCfgPres &&
2978 rgSchTddCellSpSrsSubfrmTbl[cell->srsCfg.srsSubFrameCfg][recpReqInfo->timingInfo.subframe])
2980 recpReqInfo->srsPres = TRUE;
2984 recpReqInfo->srsPres = FALSE;
2987 /* Filling SRS Reception requests */
2988 ret = rgSCHTomUtlFillSrsRecpReq (recpReqInfo, cell, validIdx, err);
2991 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to fill"
2992 " SRS recption requests for cell");;
2993 RGSCH_FREE_MEM(recpReqInfo);
2996 /* sending the RecpReq to Phy */
2997 if (rgSCHUtlTfuRecpReq(inst, cell->tfuSap->sapCfg.suId, recpReqInfo) != ROK)
2999 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHTomUtlPrcUlTddSpclSf() Unable to send "
3000 "Cntrl info for cell");
3003 } /* end of rgSCHTomUtlPrcUlTddSpclSf */
3006 /** @brief This function does all the processing related to a single downlink
3011 * Function: rgSCHTomUtlProcDlSf
3014 * - collate control data for all UEs and send to PHY
3015 * - collate data buffers for all UEs and send to PHY
3017 * @param [in] RgSchDlSf *dlSf
3018 * @param [in] RgSchDlSf *ulSf
3019 * @param [in] RgSchCellCb *cell
3020 * @param [out] RgSchErrInfo *err
3024 PRIVATE S16 rgSCHTomUtlProcDlSf
3029 RgTfuCntrlReqInfo *cntrlInfo,
3033 PRIVATE S16 rgSCHTomUtlProcDlSf (dlSf, ulSf, cell, cntrlInfo, err)
3037 RgTfuCntrlReqInfo *cntrlInfo;
3041 Inst inst = cell->instIdx;
3043 U8 sfTyp = 1; /* Dl Subframe */
3045 TRC2(rgSCHTomUtlProcDlSf);
3047 cmLListInit(&cntrlInfo->phichLst);
3048 cmLListInit(&cntrlInfo->dlPdcchLst);
3049 cmLListInit(&cntrlInfo->ulPdcchLst);
3051 #ifdef TFU_ALLOC_EVENT_NO_INIT
3052 cntrlInfo->ulTiming.sfn = cntrlInfo->ulTiming.subframe = 0;
3054 cntrlInfo->dlTiming = cell->dlDciTime;
3055 cntrlInfo->cellId = cell->cellId;
3056 cntrlInfo->ulTiming = cell->hiDci0Time;
3057 if((0 == (cntrlInfo->dlTiming.sfn % 30)) && (0 == cntrlInfo->dlTiming.subframe))
3059 //printf("5GTF_CHECK rgSCHTomUtlProcDlSf Cntrl dl (%d : %d) ul (%d : %d)\n", cntrlInfo->dlTiming.sfn, cntrlInfo->dlTiming.subframe, cntrlInfo->ulTiming.sfn, cntrlInfo->ulTiming.subframe);
3061 /* Fill PCFICH info */
3062 /* Fix for DCFI FLE issue: when DL delta is 1 and UL delta is 0 and CFI
3063 *change happens in that SF then UL PDCCH allocation happens with old CFI
3064 *but CFI in control Req goes updated one since it was stored in the CELL
3066 cntrlInfo->cfi = dlSf->pdcchInfo.currCfi;
3067 #ifndef RG_ULSCHED_AT_CRC
3070 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
3071 [cell->hiDci0Time.subframe];
3072 if(dlSf->sfType == RG_SCH_SPL_SF_DATA)
3074 RGSCH_GET_SPS_SF_CFI(cell->bwCfg.dlTotalBw, cntrlInfo->cfi);
3079 /* Fill PHICH info */
3080 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
3082 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PHICH info "
3083 "for cellId (%d)\n", cell->cellId));
3084 RGSCH_FREE_MEM(cntrlInfo);
3087 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) !=
3090 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
3091 "for cellId (%d)\n", cell->cellId));
3092 RGSCH_FREE_MEM(cntrlInfo);
3097 if(0 == cntrlInfo->ulMpdcchLst.count)
3104 sfTyp = rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
3105 [cell->dlDciTime.subframe];
3107 if (sfTyp != 2) /* Uplink subframe */
3109 /* Fill PDCCH info */
3110 if ((ret = rgSCHTomUtlFillDlPdcch(cell,cntrlInfo, dlSf, err)) != ROK)
3112 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to send PDCCH info "
3113 "for cellId (%d)\n", cell->cellId));
3114 RGSCH_FREE_MEM(cntrlInfo);
3117 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
3118 rgBwAlcnt[dlSf->sfNum] ++;
3121 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
3122 cntrlInfo->isSPSOcc = dlSf->isSPSOcc;
3124 cntrlInfo->numDlActvUes += dlSf->numDlActvUes; /* 4UE_TTI_DELTA */
3125 dlSf->numDlActvUes = 0;
3127 if(0 == cntrlInfo->dlMpdcchLst.count)
3132 /* Now always sending down a cntrl req */
3133 /* sending the cntrl data to Phy */
3134 if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
3137 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info "
3145 /** @brief This function handles sending of the PHICH information for the
3146 * downlink subframe to be sent in the next TTI.
3153 * - Loop through the PHICH information present in the downlink
3154 * subframe and fill the information in cntrlInfo.
3156 * @param [out] TfuCntrlReqInfo *cntrlInfo
3157 * @param [in] RgSchDlSf *dlSf
3158 * @param [out] RgSchErrInfo *err
3164 PRIVATE S16 rgSCHTomUtlFillPhich
3167 TfuCntrlReqInfo *cntrlInfo,
3172 PRIVATE S16 rgSCHTomUtlFillPhich(cell, cntrlInfo, dlSf, err)
3174 TfuCntrlReqInfo *cntrlInfo;
3182 TfuPhichInfo *harqAck;
3184 RgSchCmnDlCell *cellDl = RG_SCH_CMN_GET_DL_CELL(cell);
3187 TRC2(rgSCHTomUtlFillPhich)
3189 /* Traversing the list of Phichs */
3190 node = dlSf->phichInfo.phichs.first;
3193 phich = (RgSchPhich*)node->node;
3194 if ((ret = rgSCHUtlGetEventMem((Ptr *)&harqAck, sizeof(TfuPhichInfo),
3195 &(cntrlInfo->memCp))) != ROK)
3197 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3200 #ifdef TFU_ALLOC_EVENT_NO_INIT
3201 harqAck->txPower = 0;
3203 /* fill in the tfu structure from the information present in the
3205 harqAck->rbStart = phich->rbStart;
3206 harqAck->nDmrs = phich->nDmrs;
3207 harqAck->isAck = phich->hqFeedBack;
3208 harqAck->isForMsg3 = phich->isForMsg3; /*SR_RACH_STATS : PHICH ACK/NACK for MSG3 */
3210 /* Changes for passing iPhich at TFU interface*/
3211 harqAck->iPhich = phich->iPhich;
3213 /* ccpu00138898 - Added Tx pwr offset for PHICH Tx*/
3215 harqAck->txPower = cellDl->phichTxPwrOffset;
3217 cmLListAdd2Tail(&cntrlInfo->phichLst, &(harqAck->lnk));
3218 harqAck->lnk.node = (PTR)harqAck;
3220 } /* end of while */
3226 /** @brief This function is a utility function to restart
3227 * deactivation timer.
3231 * Function: rgSCHTmrRestartScellDeactTmr
3234 * - Starts timer at scheduler
3236 * @param[in] RgSchCellCb *cell
3237 * @param[in] CmLteRnti rnti
3241 PRIVATE Void rgSCHTmrRestartScellDeactTmr
3247 PRIVATE Void rgSCHTmrRestartScellDeactTmr (cell, ueCb)
3253 RgSchUeCellInfo *sCellInfo = NULLP;
3257 if(RG_SCH_IS_CELL_SEC(ueCb, cell))
3259 sCellInfo = ueCb->cellInfo[(ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)])];
3261 if(sCellInfo->deactTmr.tmrEvnt != TMR_NONE)
3263 rgSCHTmrStopTmr(cell, RG_SCH_TMR_SCELL_DEACT, sCellInfo);
3265 if(PRSNT_NODEF == ueCb->sCellDeactTmrVal.pres)
3268 rgSCHTmrStartTmr(cell,sCellInfo,RG_SCH_TMR_SCELL_DEACT,
3269 ueCb->sCellDeactTmrVal.val);
3274 }/*end of rgSCHTmrRestartScellDeactTmr*/
3277 /** @brief This function will send all the PDCCH's for the given downlink
3285 * - Loop through all the scheduled HARQ processes and fill
3286 * the PDCCH information in cntrlInfo.
3288 * @param [out] TfuCntrlReqInfo *cntrlInfo
3289 * @param [in] RgSchDlSf *dlSf
3290 * @param [out] RgSchErrInfo *err
3295 EXTERN U32 numdlSpsRelSentToTf;
3297 PRIVATE S16 rgSCHTomUtlFillDlPdcch
3300 TfuCntrlReqInfo *cntrlInfo,
3305 PRIVATE S16 rgSCHTomUtlFillDlPdcch(cell,cntrlInfo, dlSf, err)
3307 TfuCntrlReqInfo *cntrlInfo;
3315 TfuPdcchInfo *tfuPdcch;
3316 U8 isDcivld = FALSE;
3319 TRC2(rgSCHTomUtlFillDlPdcch)
3321 /* Traversing the scheduled Harq processes */
3322 node = dlSf->pdcchInfo.pdcchs.first;
3325 pdcch = (RgSchPdcch*)node->node;
3326 switch(pdcch->dci.dciFormat)
3328 case TFU_DCI_FORMAT_3:
3329 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? TRUE : FALSE;
3332 case TFU_DCI_FORMAT_3A:
3333 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? TRUE : FALSE;
3346 /*ccpu00117179 - ADD - Build only non DCI format-0 messages */
3347 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_0) ||
3348 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A1) ||
3349 (pdcch->dci.dciFormat == TFU_DCI_FORMAT_A2))
3356 #ifdef RGSCH_SPS_STATS
3357 if((pdcch->dci.dciFormat == TFU_DCI_FORMAT_1A) &&
3358 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.mcs == 0x1F) &&
3359 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.type == TFU_ALLOC_TYPE_RIV) &&
3360 (pdcch->dci.u.format1aInfo.t.pdschInfo.allocInfo.alloc.u.riv == 0xFFFFFFFF))
3362 numdlSpsRelSentToTf++;
3366 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3367 &(cntrlInfo->memCp))) != ROK)
3369 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3373 tfuPdcch->crnti = pdcch->crnti;
3374 tfuPdcch->isSpsRnti = pdcch->isSpsRnti;
3376 tfuPdcch->rnti = pdcch->rnti;
3379 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3381 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3383 tfuPdcch->nCce = pdcch->nCce;
3384 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3385 tfuPdcch->dci = pdcch->dci;
3387 //TODO_SID: Need to check these values during INT
3388 tfuPdcch->sectorId = 0;
3389 tfuPdcch->sccIdx = 0;
3392 /* SR_RACH_STATS : Reset isTBMsg4 */
3393 pdcch->dci.u.format1aInfo.t.pdschInfo.isTBMsg4 = FALSE;
3394 /* To be enhanced later for 2.1 */
3395 cmLListAdd2Tail(&cntrlInfo->dlPdcchLst, &(tfuPdcch->lnk));
3396 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3398 if((pdcch->rnti > 60) && (pdcch->rnti < 5000))
3400 #if defined (TENB_STATS) && defined (RG_5GTF)
3401 cell->tenbStats->sch.dl5gtfPdcchSend++;
3405 } /* end of while */
3407 if((numUePerTti) && (numUePerTti < RG_MAX_NUM_UE_PER_TTI ))
3409 cell->dlNumUeSchedPerTti[numUePerTti-1]++;
3411 gDlNumUePerTti[numUePerTti-1]++;
3415 } /* end of rgSCHTomUtlFillDlPdcch*/
3417 #ifdef RGSCH_SPS_STATS
3418 extern U32 rgSchSpsRelSentToTf;
3419 extern U32 rgSchSpsRelPdcchAllocd;
3421 /** @brief This function will send all the UL PDCCH's for the given
3429 * - Loop through all the scheduled HARQ processes and fill
3430 * the PDCCH information in cntrlInfo.
3432 * @param [out] TfuCntrlReqInfo *cntrlInfo
3433 * @param [in] RgSchDlSf *dlSf
3434 * @param [out] RgSchErrInfo *err
3440 PRIVATE S16 rgSCHTomUtlFillUlPdcch
3443 TfuCntrlReqInfo *cntrlInfo,
3448 PRIVATE S16 rgSCHTomUtlFillUlPdcch(cntrlInfo, dlSf, err)
3450 TfuCntrlReqInfo *cntrlInfo;
3458 TfuPdcchInfo *tfuPdcch;
3459 U8 isDcivld = FALSE;
3461 TRC2(rgSCHTomUtlFillUlPdcch)
3463 /* Traversing the scheduled Harq processes */
3464 node = dlSf->pdcchInfo.pdcchs.first;
3467 pdcch = (RgSchPdcch*)node->node;
3469 /*ccpu00116712- Function should pick only UL allocation related control
3471 switch(pdcch->dci.dciFormat)
3473 case TFU_DCI_FORMAT_A1:
3477 case TFU_DCI_FORMAT_A2:
3481 case TFU_DCI_FORMAT_3:
3482 isDcivld = (pdcch->dci.u.format3Info.isPucch) ? FALSE : TRUE;
3485 case TFU_DCI_FORMAT_3A:
3486 isDcivld = (pdcch->dci.u.format3AInfo.isPucch) ? FALSE : TRUE;
3501 /*ccpu00116712- Function should pick only UL allocation related control
3503 if ((ret = rgSCHUtlGetEventMem((Ptr *)&tfuPdcch, sizeof(TfuPdcchInfo),
3504 &(cntrlInfo->memCp))) != ROK)
3506 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3509 tfuPdcch->rnti = pdcch->rnti;
3511 rgSCHTmrRestartScellDeactTmr(cell,pdcch->ue);
3513 tfuPdcch->dciNumOfBits = pdcch->dciNumOfBits;
3515 tfuPdcch->nCce = pdcch->nCce;
3516 tfuPdcch->aggrLvl = pdcch->aggrLvl;
3517 tfuPdcch->dci = pdcch->dci;
3519 //TODO_SID: Need to check these values during INT
3520 tfuPdcch->sectorId = 0;
3521 tfuPdcch->sccIdx = 0;
3524 /* To be enhanced later for 2.1 */
3526 #if defined (TENB_STATS) && defined (RG_5GTF)
3527 cell->tenbStats->sch.ul5gtfPdcchSend++;
3529 cmLListAdd2Tail(&cntrlInfo->ulPdcchLst, &(tfuPdcch->lnk));
3530 tfuPdcch->lnk.node = (PTR)tfuPdcch;
3531 } /* end of while */
3533 #ifdef RGSCH_SPS_STATS
3534 if (rgSchSpsRelSentToTf != rgSchSpsRelPdcchAllocd)
3540 } /* end of rgSCHTomUtlFillUlPdcch*/
3542 /** @brief This function does the processing for Timing adjustment.
3549 * - Loop through the ue present ueTimeLst, decrement the remaining
3553 * @param [in] RgSchCellCb *cell
3559 PRIVATE S16 rgSCHTomUtlProcTA
3564 PRIVATE S16 rgSCHTomUtlProcTA (cell)
3571 TRC2(rgSCHTomUtlProcTA);
3573 node = cell->taUeLst.first;
3576 ue = (RgSchUeCb *)node->node;
3578 if (ue->dl.taCb.numRemSf == 0)
3580 ue->dl.taCb.state = RGSCH_TA_IDLE;
3581 /* If Outstanding Ta is present, schedule it */
3582 if(ue->dl.taCb.outStndngTa == TRUE)
3584 rgSCHUtlReTxTa(cell, ue);
3588 /* We need to reset state and also value of TA,
3589 * then we start the timer */
3590 ue->dl.taCb.ta = RGSCH_NO_TA_RQD;
3591 /* Start the timer only if TA is cfgd as FINITE value */
3592 if (ue->dl.taCb.cfgTaTmr)
3594 rgSCHTmrStartTmr (cell, ue, RG_SCH_TMR_TA, ue->dl.taCb.cfgTaTmr);
3597 /* need to delete from the link list */
3598 cmLListDelFrm(&(cell->taUeLst), &(ue->taLnk));
3599 ue->taLnk.node = NULLP;
3603 ue->dl.taCb.numRemSf--;
3605 } /* end of taUeLst */
3608 } /* end of rgSCHTomUtlProcTA */
3610 /** @brief This function handles filling of Hq reception request to
3625 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo
3627 TfuRecpReqInfo *recpReqInfo,
3630 RgSchDlHqProcCb *hqCb,
3632 TfuUeRecpReqInfo *pucchRecpInfo,
3633 RgSchDlHqProcCb *prvHqCb,
3637 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, validIdx, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err)
3638 TfuRecpReqInfo *recpReqInfo;
3641 RgSchDlHqProcCb *hqCb;
3643 TfuUeRecpReqInfo *pucchRecpInfo;
3644 RgSchDlHqProcCb *prvHqCb;
3649 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo
3651 TfuRecpReqInfo *recpReqInfo,
3653 RgSchDlHqProcCb *hqCb,
3655 TfuUeRecpReqInfo *pucchRecpInfo,
3656 RgSchDlHqProcCb *prvHqCb,
3660 PUBLIC S16 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err)
3661 TfuRecpReqInfo *recpReqInfo;
3663 RgSchDlHqProcCb *hqCb;
3665 TfuUeRecpReqInfo *pucchRecpInfo;
3666 RgSchDlHqProcCb *prvHqCb;
3672 RgSchDlHqTbCb *tbCb;
3674 Bool isAddToLst = FALSE;
3676 for (idx = 0 ;idx < 2; idx++)
3678 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
3680 tbCb = &hqCb->tbInfo[idx];
3682 /* FOR ACK NAK REP */
3683 if ((hqCb->hqE->ue != NULLP) &&
3684 (hqCb->hqE->ue->measGapCb.isMeasuring == TRUE))
3686 if ((tbCb->fbkRecpRepCntr) &&
3687 (--tbCb->fbkRecpRepCntr))
3689 /* Add to next subfarme */
3690 /* Add this hqCb to the next dlSf's ackNakRepQ */
3691 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3692 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3693 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3694 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3697 rgSCHTomUtlMoveNxtOccasion(cell, hqCb->hqE->ue, validIdx);
3705 /* Go to the next node */
3711 //if (hqCb != prvHqCb)
3713 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3714 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3717 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
3718 "TfuUeRecpReqInfo for cell");
3719 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3722 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3723 if ((hqCb->hqE->ue != NULLP) /*&&
3724 ((tbCb->lchSchdData[0].lcId != 0) || (tbCb->taSnt ==
3728 pucchRecpInfo->rnti = hqCb->hqE->ue->ueId;
3732 if (hqCb->hqE->raCb)
3734 pucchRecpInfo->rnti = hqCb->hqE->raCb->tmpCrnti;
3740 if (!hqCb->spsN1PucchRes.pres)
3743 pucchRecpInfo->t.pucchRecpReq.hqType =
3744 TFU_HQ_RECP_REQ_NORMAL;
3745 pucchRecpInfo->t.pucchRecpReq.t.nCce =
3751 pucchRecpInfo->t.pucchRecpReq.hqType =
3752 TFU_HQ_RECP_REQ_N1PUCCH;
3753 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch =
3754 hqCb->spsN1PucchRes.val;
3758 /* Handling of other types */
3759 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
3760 #else /* TFU_UPGRADE */
3761 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
3762 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
3763 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
3765 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 2; /* MIMO */
3769 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz = 1; /* NON-MIMO */
3773 /* PucchRecpReq needs to be filled up for n1Pucch resource for SPS
3775 if (hqCb->spsN1PucchRes.pres)
3777 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
3780 #endif /* LTEMAC_SPS */
3782 pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
3783 cell->pucchCfg.n1PucchAn);
3786 rgSCHEmtcFillPucchRecpInfo(cell, hqCb, &(pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes[0]));
3789 #endif/*TFU_UPGRADE*/
3792 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, hqCb->hqE->ue,
3793 pucchRecpInfo, validIdx,FALSE);
3796 /* Passing last parameter as FALSE in this case as it will be verified from hqCb*/
3797 isAddToLst = rgSCHEmtcAddRecpInfoToLst(hqCb,recpReqInfo, pucchRecpInfo,FALSE);
3801 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3803 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3806 if ((tbCb->fbkRecpRepCntr) &&
3807 (--tbCb->fbkRecpRepCntr))
3809 /* Add to next subfarme */
3810 /* Add this hqCb to the next dlSf's ackNakRepQ */
3811 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
3812 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
3813 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
3814 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
3820 }/* end of rgSCHTomUtlFillHqFdbkInfo */
3823 /** @brief This function handles filling of Hq reception request to
3828 * Function:rgSCHTomUtlFillHqFdbkFor5gtf
3832 * @param [out] TfuRecpReqInfo *recpReqInfo
3833 * @param [in] RgSchCellCb *cell
3834 * @param [in] U16 validIdx,
3835 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3836 * @param [in] RgSchDlSf *dlSf,
3837 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3838 * @param [out] RgSchErrInfo *err
3845 PRIVATE S16 rgSCHTomUtlFillHqFdbkFor5gtf
3847 TfuRecpReqInfo *recpReqInfo,
3850 RgSchDlHqInfo *dlSfHqInfo,
3852 TfuUeRecpReqInfo *pucchRecpInfo,
3856 PRIVATE S16 rgSCHTomUtlFillHqFdbkFor5gtf (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
3857 TfuRecpReqInfo *recpReqInfo;
3860 RgSchDlHqInfo *dlSfHqInfo;
3862 TfuUeRecpReqInfo *pucchRecpInfo;
3867 Inst inst = cell->instIdx;
3872 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3874 hqPNode = dlSfHqInfo->hqPLst.first;
3875 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
3881 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
3882 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
3885 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
3886 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
3887 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
3890 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
3891 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
3892 * instead of SPS-CRNTI */
3894 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
3896 pucchReqInfo->uciInfo = TFU_XPUCCH_UCI_INFO;
3898 /* 5gtf TODO : Hardcoded nPUCCHIdx */
3899 pucchReqInfo->uciPduInfo.pucchIndex = 0;
3901 pucchReqInfo->uciPduInfo.numBits = 1;
3903 /* 5gtf TODO : CQI Periodicity Hardcoded to (n,0)*/
3904 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
3906 pucchReqInfo->uciPduInfo.numBits += 5;
3907 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
3908 ue->ue5gtfCb.cqiRiPer);
3911 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
3912 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
3914 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
3918 /** @brief This function handles filling of Hq reception request to
3923 * Function:rgSCHTomUtlFillHqFdbkForFrmt1B
3926 * Allocates the N1Pucch Resources based on teh A Value
3928 * @param [out] TfuRecpReqInfo *recpReqInfo
3929 * @param [in] RgSchCellCb *cell
3930 * @param [in] U16 validIdx,
3931 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
3932 * @param [in] RgSchDlSf *dlSf,
3933 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
3934 * @param [out] RgSchErrInfo *err
3942 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3944 TfuRecpReqInfo *recpReqInfo,
3947 RgSchDlHqInfo *dlSfHqInfo,
3949 TfuUeRecpReqInfo *pucchRecpInfo,
3953 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
3954 TfuRecpReqInfo *recpReqInfo;
3957 RgSchDlHqInfo *dlSfHqInfo;
3959 TfuUeRecpReqInfo *pucchRecpInfo;
3964 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B
3966 TfuRecpReqInfo *recpReqInfo,
3968 RgSchDlHqInfo *dlSfHqInfo,
3970 TfuUeRecpReqInfo *pucchRecpInfo,
3974 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt1B (recpReqInfo, cell, hqCb, dlSf, pucchRecpInfo, err)
3975 TfuRecpReqInfo *recpReqInfo;
3977 RgSchDlHqInfo *dlSfHqInfo;
3979 TfuUeRecpReqInfo *pucchRecpInfo;
3985 Inst inst = cell->instIdx;
3989 RgSchDlHqProcCb *hqCb = NULLP;
3991 TfuUePucchRecpReq *pucchReqInfo = NULLP;
3992 Bool isDatPresOnSecCell = FALSE;
3993 U8 primCellTbCount = 0;
3995 hqPNode = dlSfHqInfo->hqPLst.first;
3996 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
4002 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4003 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
4006 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
4007 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
4008 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4011 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4012 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
4013 * instead of SPS-CRNTI */
4015 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
4018 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
4019 /* Handling of other types */
4020 pucchReqInfo->type = TFU_UCI_HARQ;
4021 #else /* TFU_UPGRADE */
4022 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
4023 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
4024 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4025 /* Fill HqSz by using totalTbCnt based on the TM mode and
4026 * the number of serv cells configured*/
4028 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
4029 pucchReqInfo->hqInfo.pucchResCnt = ue->f1bCsAVal;
4031 cmMemset((U8 *)pucchReqInfo->hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
4033 /* Two Resources needs to be configured if the
4034 * serving cell is in mimo mode else single
4036 if ((dlSf->relPdcch != NULLP) &&
4037 (RGSCH_TIMEINFO_SAME(recpReqInfo->timingInfo, ue->relPdcchFbkTiming)))
4038 {/* Pcell is having sps rel pdcch present */
4039 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
4040 {/* prim cell is in mimo mode, use 0 and 1 */
4041 pucchReqInfo->hqInfo.hqRes[0] = (dlSf->relPdcch->nCce +
4042 cell->pucchCfg.n1PucchAn);
4043 pucchReqInfo->hqInfo.hqRes[1] = pucchReqInfo->hqInfo.hqRes[0] + 1;
4048 pucchReqInfo->hqInfo.hqRes[2] = (dlSf->relPdcch->nCce +
4049 cell->pucchCfg.n1PucchAn);
4051 /* Release the pdcch so that it will not further processed */
4052 rgSCHUtlPdcchPut(ue->cell,&dlSf->pdcchInfo, dlSf->relPdcch);
4053 dlSf->relPdcch = NULLP;/* only one UE will be scheduled for release pdcch order in one tti */
4055 #endif/*LTEMAC_SPS*/
4056 #endif/*TFU_UPGRADE*/
4059 hqCb = (RgSchDlHqProcCb *)hqPNode->node;
4060 hqPNode = hqPNode->next;
4061 /* In case of CSI + 1BCS , CSI will be
4062 * dropped if scheduling is present on
4063 * seconday cell.36.213 10.1.1
4065 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4067 isDatPresOnSecCell = TRUE;
4070 if ((hqCb->tbInfo[0].state == HQ_TB_WAITING) &&
4071 (hqCb->tbInfo[1].state == HQ_TB_WAITING))
4073 primCellTbCount = 2;
4076 primCellTbCount = 1;
4080 pucchReqInfo->t.nCce = hqCb->pdcch->nCce;
4083 switch(ue->f1bCsAVal)
4085 case RG_SCH_A_VAL_2:
4086 /* harq(0) is primary harq(1) is secondary) */
4087 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4089 pucchReqInfo->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.\
4090 cw1N1Res[hqCb->tpc].n1PucchIdx;
4092 else/* primary cell */
4095 /* Need to consider only sps occasions */
4096 if (hqCb->spsN1PucchRes.pres)
4098 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4101 #endif /* LTEMAC_SPS */
4104 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4105 cell->pucchCfg.n1PucchAn);
4109 case RG_SCH_A_VAL_3:
4110 /* Serving cell in mimo mode should be
4111 * in 0 and 1 and the serving cell in siso
4112 * mode should be in 2 indices */
4113 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4115 U8 cellIdx = ue->cellIdToCellIdxMap[RG_SCH_CELLINDEX(hqCb->hqE->cell)];
4116 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[cellIdx]->txMode.txModeEnum) > 1)
4117 {/* Sec cell is in mimo mode, use 0 and 1 */
4118 pucchReqInfo->hqInfo.hqRes[0] =
4119 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4121 pucchReqInfo->hqInfo.hqRes[1] =
4122 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
4125 {/* Sec cell is in siso mode, use 2 */
4126 pucchReqInfo->hqInfo.hqRes[2] =
4127 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4131 {/* primary cell hq */
4132 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
4133 {/* prim cell is in mimo mode, use 0 and 1 */
4135 if (hqCb->spsN1PucchRes.pres)
4136 {/* SPS occasions */
4137 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4138 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
4141 #endif /* LTEMAC_SPS */
4143 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4144 cell->pucchCfg.n1PucchAn);
4145 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
4146 cell->pucchCfg.n1PucchAn + 1);
4150 {/* prim cell is in siso mode use 2 */
4152 /* Need to consider only sps occasions */
4153 if (hqCb->spsN1PucchRes.pres)
4155 pucchReqInfo->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
4158 #endif /* LTEMAC_SPS */
4161 pucchReqInfo->hqInfo.hqRes[2] = (hqCb->pdcch->nCce +
4162 cell->pucchCfg.n1PucchAn);
4168 case RG_SCH_A_VAL_4:
4170 if(RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell))
4171 {/* 2 and 3 for sec cell */
4172 pucchReqInfo->hqInfo.hqRes[2] =
4173 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
4174 pucchReqInfo->hqInfo.hqRes[3] =
4175 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
4177 else/* primary cell */
4178 {/* 0 and 1 are for primary cell */
4180 /* Need to consider only sps occasions */
4181 if (hqCb->spsN1PucchRes.pres)
4183 pucchReqInfo->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
4184 pucchReqInfo->hqInfo.hqRes[1] = hqCb->spsN1PucchRes.val + 1;
4187 #endif /* LTEMAC_SPS */
4190 pucchReqInfo->hqInfo.hqRes[0] = (hqCb->pdcch->nCce +
4191 cell->pucchCfg.n1PucchAn);
4192 pucchReqInfo->hqInfo.hqRes[1] = (hqCb->pdcch->nCce +
4193 cell->pucchCfg.n1PucchAn + 1);
4200 /* TOD:: Add error print */
4204 #endif/*TFU_UPGRADE*/
4215 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
4216 pucchRecpInfo, validIdx,isDatPresOnSecCell);
4218 /* Channel selection wil not be used in case of
4219 * CQI + HARQ. if the data was present only on
4221 if((isDatPresOnSecCell == FALSE) &&
4222 (dlSfHqInfo->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
4223 {/* Data is present only on primary cell */
4225 switch(pucchReqInfo->uciInfo)
4227 case TFU_PUCCH_HARQ_SRS:
4228 case TFU_PUCCH_HARQ_CQI:
4229 case TFU_PUCCH_HARQ_SR_SRS:
4230 case TFU_PUCCH_HARQ_SR_CQI:
4232 dlSfHqInfo->uciFrmtTyp = RG_SCH_UCI_FORMAT1A_1B;
4233 pucchReqInfo->hqInfo.hqSz = primCellTbCount;
4234 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4243 #endif/*TFU_UPGRADE*/
4244 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4245 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4247 }/* end of rgSCHTomUtlFillHqFdbkForFrmt1B */
4248 /** @brief This function handles filling of Hq reception request to
4253 * Function:rgSCHTomUtlFillHqFdbkForFrmt3
4256 * Allocates the N1Pucch Resources based on teh A Value
4258 * @param [out] TfuRecpReqInfo *recpReqInfo
4259 * @param [in] RgSchCellCb *cell
4260 * @param [in] U16 validIdx,
4261 * @param [in] RgSchDlHqInfo *dlSfHqInfo,
4262 * @param [in] RgSchDlSf *dlSf,
4263 * @param [in] TfuUeRecpReqInfo *pucchRecpInfo,
4264 * @param [out] RgSchErrInfo *err
4272 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3
4274 TfuRecpReqInfo *recpReqInfo,
4277 RgSchDlHqInfo *dlSfHqInfo,
4279 TfuUeRecpReqInfo *pucchRecpInfo,
4283 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3 (recpReqInfo, cell, validIdx, hqCb, dlSf, pucchRecpInfo, err)
4284 TfuRecpReqInfo *recpReqInfo;
4287 RgSchDlHqInfo *dlSfHqInfo;
4289 TfuUeRecpReqInfo *pucchRecpInfo;
4294 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3
4296 TfuRecpReqInfo *recpReqInfo,
4298 RgSchDlHqInfo *dlSfHqInfo,
4300 TfuUeRecpReqInfo *pucchRecpInfo,
4304 PRIVATE S16 rgSCHTomUtlFillHqFdbkForFrmt3 (recpReqInfo, cell, hqCb, dlSf, pucchRecpInfo, err)
4305 TfuRecpReqInfo *recpReqInfo;
4307 RgSchDlHqInfo *dlSfHqInfo;
4309 TfuUeRecpReqInfo *pucchRecpInfo;
4315 Inst inst = cell->instIdx;
4320 TfuUePucchRecpReq *pucchReqInfo = NULLP;
4322 //hqPNode = dlSfHqInfo->hqPLst.first;
4323 ue = (RgSchUeCb*)dlSfHqInfo->dlSfUeLnk.node;
4329 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4330 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
4333 RGSCHDBGERRNEW(inst,(rgSchPBuf(inst),"Unable to Allocate "
4334 "TfuUeRecpReqInfo for cellId=%d \n", cell->cellId));
4335 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4338 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4339 pucchRecpInfo->rnti = ue->ueId; /* Even for Rel pdcch also setting CRNTI
4340 * instead of SPS-CRNTI */
4342 pucchReqInfo = &(pucchRecpInfo->t.pucchRecpReq);
4345 pucchReqInfo->hqType = TFU_HQ_RECP_REQ_NORMAL;
4346 /* Handling of other types */
4347 pucchReqInfo->type = TFU_UCI_HARQ;
4348 #else /* TFU_UPGRADE */
4349 pucchReqInfo->uciInfo = TFU_PUCCH_HARQ;
4350 /* Fill hqFdbkMode by using uciFrmtTyp from dlSfHqInfo */
4351 pucchReqInfo->hqInfo.hqFdbkMode = rgSchUtlGetFdbkMode(dlSfHqInfo->uciFrmtTyp);
4352 /* Fill HqSz by using totalTbCnt based on the TM mode and
4353 * the number of serv cells configured*/
4355 pucchReqInfo->hqInfo.hqSz = ue->f1bCsAVal;
4356 pucchReqInfo->hqInfo.pucchResCnt = 1;
4358 cmMemset((U8 *)pucchReqInfo->hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
4359 #endif/*TFU_UPGRADE*/
4360 pucchReqInfo->hqInfo.hqRes[0] = dlSfHqInfo->n3ScellPucch.n3PucchIdx;
4362 rgSCHTomUtlFillCqiSrSrsWithHq(cell,recpReqInfo, ue,
4363 pucchRecpInfo, validIdx,TRUE);
4364 #endif/*TFU_UPGRADE*/
4365 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4366 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4368 }/* end of rgSCHTomUtlFillHqFdbkForFrmt3 */
4372 /** @brief This function handles filling of HARQ feedback recption request to
4381 * @param [out] TfuRecpReqInfo *recpReqInfo
4382 * @param [in] RgSchCellCb *cell
4383 * @param [out] RgSchErrInfo *err
4390 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq
4392 TfuRecpReqInfo *recpReqInfo,
4398 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, validIdx, err)
4399 TfuRecpReqInfo *recpReqInfo;
4406 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq
4408 TfuRecpReqInfo *recpReqInfo,
4413 PRIVATE S16 rgSCHTomUtlFillHqFdbkRecpReq (recpReqInfo, cell, err)
4414 TfuRecpReqInfo *recpReqInfo;
4421 RgSchDlHqProcCb *hqCb;
4422 CmLteTimingInfo futTime;
4425 TfuUeRecpReqInfo *pucchRecpInfo = NULLP;
4427 RgSchDlHqProcCb *prvHqCb=NULLP;
4429 TRC2(rgSCHTomUtlFillHqFdbkRecpReq);
4436 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper output
4437 * if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME() as it is
4438 * serving the purpose */
4439 RGSCHDECRFRMCRNTTIME(cell->crntTime, futTime, (RG_SCH_CMN_HARQ_INTERVAL -
4440 TFU_RECPREQ_DLDELTA));
4441 dlSf = rgSCHUtlSubFrmGet (cell, futTime);
4442 /* Get the next dlsf as well */
4443 RG_SCH_ADD_TO_CRNT_TIME(futTime, futTime, 1)
4444 nxtDlsf = rgSCHUtlSubFrmGet (cell, futTime);
4448 if (dlSf->ueLst.count != 0)
4450 node = dlSf->ueLst.first;
4453 ue = (RgSchUeCb *)(node->node);
4456 if(ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx].isPuschHarqRecpPres == TRUE)
4457 {/* This UE is already considered for PUSCH
4461 rgSCHTomUtlFillHqFdbkFor5gtf(recpReqInfo, cell, validIdx,
4462 &ue->dl.dlSfHqInfo[cell->cellId][dlSf->dlIdx], dlSf, pucchRecpInfo, err);
4463 } /* end of while */
4464 } /* If hq is expected */
4466 if (dlSf->msg4HqPLst.count != 0)
4469 node = dlSf->msg4HqPLst.first;
4472 hqCb = (RgSchDlHqProcCb*)(node->node);
4474 //TODO_SID: need to check validIdx
4475 rgSCHTomUtlFillHqFdbkInfo (recpReqInfo, cell, validIdx, hqCb, nxtDlsf, pucchRecpInfo, prvHqCb, err);
4477 } /* end of while */
4480 /* Check with TDD Code */
4481 /* FOR ACK NACK REP */
4483 } /* end of rgSCHTomUtlFillHqFdbkRecpReq */
4485 /** @brief This function handles filling of SR reception request to
4494 * @param [out] TfuRecpReqInfo *recpReqInfo
4495 * @param [in] RgSchCellCb *cell
4496 * @param [out] RgSchErrInfo *err
4502 PRIVATE S16 rgSCHTomUtlFillSrRecpReq
4504 TfuRecpReqInfo *recpReqInfo,
4510 PRIVATE S16 rgSCHTomUtlFillSrRecpReq (recpReqInfo, cell, validIdx, err)
4511 TfuRecpReqInfo *recpReqInfo;
4518 TfuUeRecpReqInfo *pucchRecpInfo;
4524 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
4528 TRC2(rgSCHTomUtlFillSrRecpReq);
4532 node = cell->pCqiSrsSrLst[validIdx].srLst.first;
4535 ue = (RgSchUeCb *)(node->node);
4536 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4542 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4543 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4545 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4546 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4547 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4550 #ifdef TFU_ALLOC_EVENT_NO_INIT
4551 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4552 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4558 /* Should we check for Rel8 and above???
4559 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
4561 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
4562 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
4563 if((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
4564 (ulSpsUe->isUlSpsActv))
4566 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4571 pucchRecpInfo->rnti = ue->ueId;
4572 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
4573 ue->srCb.srCfg.srSetup.srResIdx;
4574 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR;
4575 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
4576 rgSCHTomUtlFillCqiSrsWithSr(cell, ue, recpReqInfo,
4577 pucchRecpInfo, validIdx);
4579 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4583 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4585 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4588 }/* end of rgSCHTomUtlFillSrRecpReq */
4591 /** @brief This function tells will the UE has a periodic CQI/PMI/RI
4600 * @param [in] RgSchUeCb *ue
4601 * @param [out] Bool *willueRprtCqiRi
4608 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi
4611 Bool *willueRprtCqiRi
4614 PRIVATE S16 rgSCHTomUtlWillUeRprtCqiRi ( ue, willueRprtCqiRi)
4616 Bool *willueRprtCqiRi;
4619 TRC2(rgSCHTomUtlWillUeRprtCqiRi);
4621 /* Intialising Reporting probability as TRUE */
4622 *willueRprtCqiRi = TRUE;
4624 /* Checking the cases in which UE will not report CQIPMI/RI */
4625 if(ue->isDrxEnabled && ue->drxCb)
4628 if(ue->drxCb->cqiMask.pres && ue->drxCb->cqiMask.val == RGR_DRX_SETUP)
4629 {/*cqiMask is setup by upper layers */
4630 if((ue->drxCb->drxUlInactvMask & RG_SCH_DRX_ONDUR_BITMASK) ==
4631 RG_SCH_DRX_ONDUR_BITMASK)
4632 {/*onDuration NOT running, do not expect cqi/pmi/ri*/
4633 *willueRprtCqiRi = FALSE;
4637 #endif /*end of LTEMAC_R9*/
4638 /* ccpu00134258: Fix for CQI DRX issue*/
4639 if(ue->drxCb->onDurTmrLen > 2)
4641 if ( !RG_SCH_DRX_UL_IS_UE_ACTIVE(ue->drxCb) )
4642 {/*UE is not active, do not expect cqi/pmi/ri*/
4643 *willueRprtCqiRi = FALSE;
4646 }/*ue->isDrxEnabled*/
4649 } /*End of rgSCHTomUtlWillUeRprtCqiRi*/
4651 /** @brief This function handles filling of RI reception request to
4660 * @param [out] TfuRecpReqInfo *recpReqInfo
4661 * @param [in] RgSchCellCb *cell
4662 * @param [in] U16 validIdx
4663 * @param [out] RgSchErrInfo *err
4669 PRIVATE S16 rgSCHTomUtlFillRiRecpReq
4671 TfuRecpReqInfo *recpReqInfo,
4677 PRIVATE S16 rgSCHTomUtlFillRiRecpReq (recpReqInfo, cell, validIdx, err)
4678 TfuRecpReqInfo *recpReqInfo;
4685 TfuUeRecpReqInfo *pucchRecpInfo;
4688 Bool willUeRprtCqi; /* Flag set due to CQI Mask
4689 and UE inactive state (DRX) */
4690 RgSchUePCqiCb *riCb = NULLP;
4691 TRC2(rgSCHTomUtlFillRiRecpReq);
4693 node = cell->pCqiSrsSrLst[validIdx].riLst.first;
4696 riCb = (RgSchUePCqiCb *)(node->node);
4697 ue = riCb->servCellInfo->ue;
4698 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4700 if(riCb->riRecpPrcsd)
4702 /*ccpu00140578:: RI Proecssing is already done for this TTI
4703 * as part of PUSCH reception process or HARQ
4704 * Reception processing. Hence skipping this UE
4706 riCb->riRecpPrcsd = FALSE;
4709 if(riCb->riDist ==0)
4711 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4712 #ifdef XEON_SPECIFIC_CHANGES
4713 if(RGSCH_TIMEINFO_SAME(cell->crntTime, ue->riRecpTime))
4719 if((TRUE == riCb->isRiIgnoByCollsn)
4720 || (willUeRprtCqi == FALSE))
4722 if(willUeRprtCqi == FALSE)
4725 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4728 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4729 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4731 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4732 "TfuUeRecpReqInfo for cell RNTI:%d",ue->ueId);
4733 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4736 #ifdef TFU_ALLOC_EVENT_NO_INIT
4737 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4738 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4741 pucchRecpInfo->rnti = ue->ueId;
4742 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4743 riCb->cqiCfg.cqiSetup.cqiPResIdx;
4744 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = riCb->riNumBits;
4745 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4746 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4748 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4749 riCb->servCellInfo->sCellIdx;
4751 rgSCHTomUtlFillRiBitWidthInfo(ue);
4752 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
4753 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
4755 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
4757 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4759 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4761 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4762 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4770 }/* end of rgSCHTomUtlFillRiRecpReq */
4773 /** @brief This function handles filling of 5GTF CQI-RI reception request to
4782 * @param [out] TfuRecpReqInfo *recpReqInfo
4783 * @param [in] RgSchCellCb *cell
4784 * @param [in] U16 validIdx
4785 * @param [out] RgSchErrInfo *err
4791 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq
4793 TfuRecpReqInfo *recpReqInfo,
4799 PRIVATE S16 rgSCHTomUtlFillCqiRiRecpReq (recpReqInfo, cell, validIdx, err)
4800 TfuRecpReqInfo *recpReqInfo;
4806 TfuUeRecpReqInfo *pucchRecpInfo;
4807 RgSchUeCb *ue = NULLP;
4810 TRC2(rgSCHTomUtlFillCqiRiRecpReq);
4812 while ((ue = rgSCHDbmGetNextUeCb(cell, ue)) != NULLP)
4814 if (RGSCH_TIMEINFO_SAME (recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn))
4816 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4817 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4819 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4820 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4821 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4824 #ifdef TFU_ALLOC_EVENT_NO_INIT
4825 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4826 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4828 pucchRecpInfo->rnti = ue->ueId;
4829 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_XPUCCH_UCI_INFO;
4830 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.pucchIndex = 0;
4831 pucchRecpInfo->t.pucchRecpReq.uciPduInfo.numBits = 5;
4833 RG_SCH_ADD_TO_CRNT_TIME(recpReqInfo->timingInfo, ue->ue5gtfCb.nxtCqiRiOccn,
4834 ue->ue5gtfCb.cqiRiPer);
4835 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4836 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4841 }/* end of rgSCHTomUtlFillCqiRiRecpReq */
4844 /** @brief This function handles filling of PCQI reception request to
4853 * @param [out] TfuRecpReqInfo *recpReqInfo
4854 * @param [in] RgSchCellCb *cell
4855 * @param [in] U16 validIdx
4856 * @param [out] RgSchErrInfo *err
4862 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq
4864 TfuRecpReqInfo *recpReqInfo,
4870 PRIVATE S16 rgSCHTomUtlFillPcqiRecpReq (recpReqInfo, cell, validIdx, err)
4871 TfuRecpReqInfo *recpReqInfo;
4878 TfuUeRecpReqInfo *pucchRecpInfo;
4883 Bool willUeRprtCqi; /* Flag set due to CQI Mask
4884 and UE Inactive state (DRX)*/
4886 RgSchUePCqiCb *cqiCb = NULLP;
4887 Bool isAddToLst = FALSE;
4889 TRC2(rgSCHTomUtlFillPcqiRecpReq);
4891 node = cell->pCqiSrsSrLst[validIdx].cqiLst.first;
4894 cqiCb = (RgSchUePCqiCb*)(node->node);
4895 ue = cqiCb->servCellInfo->ue;
4896 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
4898 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
4900 if ((cqiCb->isCqiIgnoByCollsn == TRUE) ||
4901 (willUeRprtCqi == FALSE))
4903 if(willUeRprtCqi == FALSE)
4906 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4910 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
4912 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
4913 cqiCb->servCellInfo->sCellIdx;
4915 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
4918 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d Unable to Fill CqiPmi "
4923 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
4924 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
4926 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
4927 "TfuUeRecpReqInfo for cell RNTI:%d ", ue->ueId);
4928 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
4931 #ifdef TFU_ALLOC_EVENT_NO_INIT
4932 cmMemset((U8 *)&pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
4933 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
4936 /*Fill PCQI params*/
4937 pucchRecpInfo->rnti = ue->ueId;
4938 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
4939 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
4940 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz = cqiPmiSz;
4941 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_CQI;
4942 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
4943 if((ue->srsCb.nSrsTrIdx == validIdx) && (ue->srsCb.srsDist ==0))
4945 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
4948 isAddToLst = rgSCHEmtcAddRecpInfoToLst(NULLP,recpReqInfo, pucchRecpInfo,ue->isEmtcUe);
4952 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
4954 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
4957 }/* end of rgSCHTomUtlFillPcqiRecpReq */
4959 /** @brief This function handles filling of SRS reception request to
4968 * @param [out] TfuRecpReqInfo *recpReqInfo
4969 * @param [in] RgSchCellCb *cell
4970 * @param [in] U16 validIdx
4971 * @param [out] RgSchErrInfo *err
4977 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq
4979 TfuRecpReqInfo *recpReqInfo,
4985 PRIVATE S16 rgSCHTomUtlFillSrsRecpReq (recpReqInfo, cell, validIdx, err)
4986 TfuRecpReqInfo *recpReqInfo;
4993 TfuUeRecpReqInfo *pucchRecpInfo;
4997 TRC2(rgSCHTomUtlFillSrsRecpReq);
4999 node = cell->pCqiSrsSrLst[validIdx].srsLst.first;
5002 ue = (RgSchUeCb *)(node->node);
5003 /* Fix: ccpu00124011: Fix for missing reception request for UE with same offset */
5005 if(ue->srsCb.srsRecpPrcsd)
5007 /* ccpu00140578::SRS Proecssing is already done for this TTI
5008 * as part of PUSCH or HARQ reception process and
5009 * hence skipping this UE */
5010 ue->srsCb.srsRecpPrcsd = FALSE;
5014 if(ue->srsCb.srsDist ==0)
5016 /* We need to add the recp request to be sent on the pucchANRep value. */
5017 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
5018 sizeof(TfuUeRecpReqInfo),&(recpReqInfo->memCp))) != ROK)
5020 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5021 "TfuUeRecpReqInfo for RNTI:%d ",ue->ueId);
5022 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5026 #ifdef TFU_ALLOC_EVENT_NO_INIT
5027 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
5031 pucchRecpInfo->rnti = ue->ueId;
5032 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
5033 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
5034 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
5035 ue->srsCb.srsCfg.srsSetup.fDomPosi;
5036 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
5037 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
5038 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
5039 ue->srsCb.srsCfg.srsSetup.txComb;
5040 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
5041 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
5042 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
5043 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
5045 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SRS;
5046 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
5047 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
5048 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
5052 ue->srsCb.srsDist--;
5056 }/* end of rgSCHTomUtlFillSrsRecpReq */
5059 /** @brief This function handles filling of data reception requests for
5068 * @param [out] TfuRecpReqInfo *recpReqInfo
5069 * @param [in] RgSchCellCb *cell
5070 * @param [out] RgSchErrInfo *err
5076 PRIVATE S16 rgSCHTomUtlFillDatRecpReq
5078 TfuRecpReqInfo *recpReqInfo,
5083 PRIVATE S16 rgSCHTomUtlFillDatRecpReq (recpReqInfo, cell, err)
5084 TfuRecpReqInfo *recpReqInfo;
5090 RgSchUlAlloc *alloc;
5091 TfuUeRecpReqInfo *datRecpInfo;
5093 TRC2(rgSCHTomUtlFillDatRecpReq)
5095 /* processing steps are
5096 * - Run through the UL allocations going out in this subframe.
5097 * - Run through the UL receptions expected the next subframe.
5099 alloc = rgSCHUtlFirstRcptnReq (cell);
5102 /* FOR ACK NACK REP */
5103 if (NULLP != alloc->ue)
5105 /* If measuring or ackNakRep we shall not send dat RecpReq */
5106 if ((alloc->ue->measGapCb.isMeasuring == TRUE) ||
5107 (alloc->ue->ackNakRepCb.isAckNakRep == TRUE))
5109 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5114 if ((ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
5115 sizeof(TfuUeRecpReqInfo),
5116 &(recpReqInfo->memCp))) != ROK)
5118 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5119 "TfuUeRecpReqInfo for RNTI:%d ", alloc->ue->ueId);
5120 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5123 if (!alloc->forMsg3)
5125 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
5126 rgSCHUtlAllocRcptInfo (alloc,
5128 &datRecpInfo->t.puschRecpReq.mcs,
5129 &datRecpInfo->t.puschRecpReq.rbStart,
5130 &datRecpInfo->t.puschRecpReq.numRb,
5131 &datRecpInfo->t.puschRecpReq.rv,
5132 &datRecpInfo->t.puschRecpReq.size,
5133 &datRecpInfo->t.puschRecpReq.modType,
5134 &datRecpInfo->t.puschRecpReq.isRtx,
5135 &datRecpInfo->t.puschRecpReq.nDmrs,
5136 &datRecpInfo->t.puschRecpReq.ndi,
5137 &datRecpInfo->t.puschRecpReq.harqProcId
5142 datRecpInfo->type = TFU_RECP_REQ_MSG3;
5143 rgSCHUtlAllocRcptInfo (alloc,
5145 &datRecpInfo->t.msg3RecpReq.mcs,
5146 &datRecpInfo->t.msg3RecpReq.rbStart,
5147 &datRecpInfo->t.msg3RecpReq.numRb,
5148 /*ccpu00128993 - MOD - fix for msg3 softcombining bug*/
5149 &datRecpInfo->t.msg3RecpReq.rv,
5150 &datRecpInfo->t.msg3RecpReq.size,
5151 &datRecpInfo->t.msg3RecpReq.modType,
5152 &datRecpInfo->t.msg3RecpReq.isRtx,
5153 &datRecpInfo->t.msg3RecpReq.nDmrs,
5154 &datRecpInfo->t.msg3RecpReq.ndi,
5155 &datRecpInfo->t.msg3RecpReq.harqProcId
5159 /* Other fields of datRecpInfo shall be filled
5160 * here for new features */
5161 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
5162 datRecpInfo->lnk.node = (PTR)datRecpInfo;
5164 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5165 } /* end of while */
5167 } /* end of rgSCHTomUtlFillDatRecpReq */
5170 /** @brief This function handles filling of data reception requests for
5179 * @param [out] TfuRecpReqInfo *recpReqInfo
5180 * @param [in] RgSchCellCb *cell
5181 * @param [in] U16 validIdx
5182 * @param [out] RgSchErrInfo *err
5188 PRIVATE S16 rgSCHTomUtlFillDatRecpReq
5190 TfuRecpReqInfo *recpReqInfo,
5196 PRIVATE S16 rgSCHTomUtlFillDatRecpReq (recpReqInfo, cell, validIdx, err)
5197 TfuRecpReqInfo *recpReqInfo;
5203 CmLteTimingInfo dci0Time;
5206 RgSchUlAlloc *alloc;
5207 TfuUeRecpReqInfo *datRecpInfo;
5209 Bool hqPres; /*Set when HARQ Rec Req is present*/
5210 Bool isAperiodic = FALSE; /*Set when Aperiodic CQI is expected */
5213 TRC2(rgSCHTomUtlFillDatRecpReq);
5215 if((0 == (recpReqInfo->timingInfo.sfn % 30)) && (0 == recpReqInfo->timingInfo.subframe))
5217 //printf("5GTF_CHECK rgSCHTomUtlFillDatRecpReq (%d : %d)\n", recpReqInfo->timingInfo.sfn, recpReqInfo->timingInfo.subframe);
5219 /* processing steps are
5220 * - Run through the UL allocations going out in this subframe.
5221 * - Run through the UL receptions expected the next subframe.
5224 alloc = rgSCHUtlFirstRcptnReq (cell);
5227 isAperiodic = FALSE;
5228 ret = rgSCHUtlGetEventMem((Ptr *)&datRecpInfo,
5229 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
5232 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Allocate "
5233 "TfuUeRecpReqInfo for RNTI:%d ", alloc->rnti);
5234 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
5237 #ifdef TFU_ALLOC_EVENT_NO_INIT
5238 datRecpInfo->t.puschRecpReq.initialNSrs.pres = FALSE;
5239 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
5241 datRecpInfo->type = TFU_RECP_REQ_PUSCH;
5242 /* ccpu00131944 - Intializing hqPres in each iteration*/
5244 /* Check if this if for MSG3 - no scope for feedback along with it. */
5245 if ((FALSE == alloc->forMsg3))
5247 /* Check if any DL HARQ processes has a feedback coming at the time of
5248 * this reception request.
5253 RGSCHDECRFRMCRNTTIME(cell->crntTime,dci0Time,(RGSCH_ULCTRL_RECP_DIST));
5255 idx = (dci0Time.sfn * RGSCH_NUM_SUB_FRAMES_5G + dci0Time.subframe)%
5256 RGSCH_ULCTRL_RECP_DIST;
5258 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
5259 datRecpInfo->rnti = alloc->rnti;
5260 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
5261 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5264 else /*Enters for Msg3 == TRUE condition*/
5266 /* ccpu00130884 - ADD - HO case when Msg3 alloc and Cqi/Ri/SRS opportunity
5267 * occur at same time */
5268 if(NULLP != alloc->ue)
5271 /* Only DATA is expected */
5272 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA;
5273 datRecpInfo->rnti = alloc->rnti;
5274 rgSCHUtlAllocRcptInfo (cell,alloc, &recpReqInfo->timingInfo,
5275 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5280 if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA &&
5281 datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_SRS &&
5282 isAperiodic == FALSE)
5284 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = TRUE;
5285 datRecpInfo->t.puschRecpReq.initialNumRbs.val = alloc->ue->initNumRbs;
5289 datRecpInfo->t.puschRecpReq.initialNumRbs.pres = FALSE;
5292 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(datRecpInfo->lnk));
5293 datRecpInfo->lnk.node = (PTR)datRecpInfo;
5294 alloc = rgSCHUtlNextRcptnReq (cell, alloc);
5296 } /* end of while */
5298 if(numUePerTti && (numUePerTti < RG_MAX_NUM_UE_PER_TTI))
5300 cell->ulNumUeSchedPerTti[numUePerTti-1]++;
5301 gUlNumUePerTti[numUePerTti - 1]++;
5304 } /* end of rgSCHTomUtlFillDatRecpReq */
5306 /* rg009.201. Added changes of TFU_UPGRADE */
5308 /***********************************************************
5310 * Func : rgSCHTomUtlFillRiBitWidthInfo
5313 * Desc : Fills the RI BitWidth and stores it for decoding.
5322 **********************************************************/
5324 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo
5329 PUBLIC S16 rgSCHTomUtlFillRiBitWidthInfo(ueCb)
5333 RgSchUePCqiCb *riCb = ueCb->nPRiCb;
5334 TRC2(rgSCHTomUtlFillRiBitWidthInfo);
5336 if (ueCb->mimoInfo.txMode != RGR_UE_TM_3 &&
5337 ueCb->mimoInfo.txMode != RGR_UE_TM_4)
5342 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
5343 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
5344 (TfuDlCqiPucchMode)riCb->cqiCfg.cqiSetup.prdModeEnum;
5345 switch(ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode)
5347 case TFU_PUCCH_CQI_MODE10:
5348 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.type = TFU_RPT_RI;
5349 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info.u.ri =
5352 case TFU_PUCCH_CQI_MODE11:
5353 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.type = TFU_RPT_RI;
5354 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info.u.ri =
5357 case TFU_PUCCH_CQI_MODE20:
5358 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.type = TFU_RPT_RI;
5359 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info.u.ri =
5362 case TFU_PUCCH_CQI_MODE21:
5363 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.type = TFU_RPT_RI;
5364 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info.u.ri =
5371 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5375 /***********************************************************
5377 * Func : rgSCHTomUtlFetchPcqiBitSz
5380 * Desc : Fetch the CQI/PMI bits for a UE based on the mode, periodicity.
5389 **********************************************************/
5391 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz
5398 PUBLIC U8 rgSCHTomUtlFetchPcqiBitSz(ueCb, numTxAnt, ri)
5406 TfuCqiPucchMode10 *mode10Info;
5407 TfuCqiPucchMode11 *mode11Info;
5408 TfuCqiPucchMode20 *mode20Info;
5409 TfuCqiPucchMode21 *mode21Info;
5410 RgSchUePCqiCb *cqiCb = ueCb->nPCqiCb;
5412 TRC3(rgSCHTomUtlFetchPcqiBitSz);
5414 confRepMode = cqiCb->cqiCfg.cqiSetup.prdModeEnum;
5415 if((ueCb->mimoInfo.txMode != RGR_UE_TM_3) &&
5416 (ueCb->mimoInfo.txMode != RGR_UE_TM_4))
5422 *ri = cqiCb->perRiVal;
5424 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUCCH;
5425 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.mode=
5426 (TfuDlCqiPucchMode)confRepMode;
5429 case RGR_PRD_CQI_MOD10:
5431 mode10Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode10Info;
5433 mode10Info->type = TFU_RPT_CQI;
5434 mode10Info->u.cqi = 4;
5438 case RGR_PRD_CQI_MOD11:
5440 mode11Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode11Info;
5441 mode11Info->type = TFU_RPT_CQI;
5447 mode11Info->u.cqi.cqi = 4;
5448 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5449 mode11Info->u.cqi.pmi = 2;
5454 mode11Info->u.cqi.cqi = 4;
5455 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5456 mode11Info->u.cqi.wideDiffCqi.val = 3;
5457 mode11Info->u.cqi.pmi = 1;
5460 else if(numTxAnt == 4)
5465 mode11Info->u.cqi.cqi = 4;
5466 mode11Info->u.cqi.wideDiffCqi.pres = FALSE;
5467 mode11Info->u.cqi.pmi = 4;
5472 mode11Info->u.cqi.cqi = 4;
5473 mode11Info->u.cqi.wideDiffCqi.pres = TRUE;
5474 mode11Info->u.cqi.wideDiffCqi.val = 3;
5475 mode11Info->u.cqi.pmi = 4;
5480 /* This is number of antenna case 1.
5481 * This is not applicable for Mode 1-1.
5482 * So setting it to invalid value */
5488 case RGR_PRD_CQI_MOD20:
5490 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode20Info;
5491 mode20Info->type = TFU_RPT_CQI;
5495 mode20Info->u.cqi.isWideband = TRUE;
5496 mode20Info->u.cqi.u.wideCqi = 4;
5500 pcqiSz = 4 + cqiCb->label;
5501 mode20Info->u.cqi.isWideband = FALSE;
5502 mode20Info->u.cqi.u.subCqi.cqi = 4;
5503 mode20Info->u.cqi.u.subCqi.l = cqiCb->label;
5508 case RGR_PRD_CQI_MOD21:
5510 mode21Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pucch.pucchRawCqiInfo.u.mode21Info;
5511 mode21Info->type = TFU_RPT_CQI;
5512 //pcqiSz = rgSCHTomUtlFetchPcqiBitSzPucchMode21(ueCb,
5513 // mode21Info, numTxAnt, ri);
5521 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5526 /***********************************************************
5528 * Func : rgSCHTomUtlPcqiSbCalcBpIdx
5531 * Desc : Determines the BP index from the timing info
5540 **********************************************************/
5542 PUBLIC S16 rgSCHTomUtlPcqiSbCalcBpIdx
5544 CmLteTimingInfo crntTimInfo,
5546 RgSchUePCqiCb *cqiCb
5549 PUBLIC S16 rgSCHTomUtlPcqiSbCalcBpIdx(crntTimInfo, ueCb, cqiCb)
5550 CmLteTimingInfo crntTimInfo;
5552 RgSchUePCqiCb *cqiCb;
5555 U16 tti = (crntTimInfo.sfn * RGSCH_NUM_SUB_FRAMES_5G + crntTimInfo.subframe);
5556 U16 prdNum = tti/cqiCb->cqiPeri;
5558 TRC2(rgSCHTomUtlPcqiSbCalcBpIdx);
5559 if((prdNum % cqiCb->h) == 0)
5563 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_1;
5568 cqiCb->isWb = FALSE;
5569 cqiCb->bpIdx = ((prdNum % cqiCb->h) - 1) % cqiCb->J;
5571 cqiCb->prioLvl = RG_SCH_CQI_PRIO_LVL_0;
5579 * @brief Function which moves PCQI, RI, SR and SRS to next periodicity
5580 * Occasions as that needs to be done in case of Ack/Nack repetition
5581 * reception request occasions or during Measurement Gap occasions.
5585 * Function: rgSCHTomUtlMoveNxtOccasion
5587 * Function which moves PCQI, RI, SR and SRS to next perodicity
5588 * Occasions as that needs to be done in case of Ack/Nack repetition
5589 * reception request occasions or during Measurement Gap occasions.
5591 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5594 * - Check whether the current Tx Instance matches with the rec req time
5595 * - If true, then move them to their next Tx Instance
5597 * @param[in] RgSchCellCb *cell,
5605 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion
5612 PUBLIC S16 rgSCHTomUtlMoveNxtOccasion(cell, ue, validIdx)
5618 RgSchUePCqiCb *cqiCb = ue->nPCqiCb;
5619 RgSchUePCqiCb *riCb = ue->nPRiCb;
5620 TRC2(rgSCHTomUtlMoveNxtOccasion);
5622 /* ccpu00140578::Skip the UE if already RI recpetion
5623 * is processed in the same subframe */
5624 if ((riCb->nRiTrIdx == validIdx) &&
5625 (riCb->riRecpPrcsd == FALSE))
5627 if(riCb->riDist ==0)
5629 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
5635 /* ccpu00140578:: As this UE is considered for this TTI
5636 * Same UE should not get processed for RI reception
5637 * or for updating th RI distance.*/
5638 if(riCb->nRiTrIdx == validIdx)
5640 riCb->riRecpPrcsd = TRUE;
5643 if (cqiCb->nCqiTrIdx == validIdx)
5645 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
5648 /* ccpu00140578::Skip the UE if SRS recpetion
5649 * is already processed in the same subframe */
5650 if ((ue->srsCb.nSrsTrIdx == validIdx) &&
5651 (ue->srsCb.srsRecpPrcsd == FALSE))
5653 if(ue->srsCb.srsDist ==0)
5655 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
5659 ue->srsCb.srsDist--;
5661 /* ccpu00140578:: As this UE is considered for this TTI
5662 * Same UE should not get processed for SRS reception
5663 * or for updating th SRS distance.*/
5664 if(ue->srsCb.nSrsTrIdx == validIdx)
5666 ue->srsCb.srsRecpPrcsd = TRUE;
5669 if (ue->srCb.nSrTrIdx == validIdx)
5671 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
5674 } /* rgSCHTomUtlMoveNxtOccasion */
5677 /***********************************************************
5679 * Func : rgSCHTomPrepareAcqiRecp
5682 * Desc : Fetch the CQI/PMI bits for a UE based on the mode and store them
5683 * for decoding. Fill RECP request and prepare the scartchpad
5684 * to aid decoding of Aperiodic CQI.
5693 **********************************************************/
5695 PUBLIC Void rgSCHTomPrepareAcqiRecp
5699 TfuUePuschCqiRecpInfo *cqiRecpReqInfo,
5703 PUBLIC Void rgSCHTomPrepareAcqiRecp(ueCb, cell, cqiRecpReqInfo, ccIdx)
5706 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5711 RgSchCqiRawPuschMode12 *mode12Info;
5712 RgSchCqiRawPuschMode20 *mode20Info;
5713 RgSchCqiRawPuschMode22 *mode22Info;
5714 RgSchCqiRawPuschMode30 *mode30Info;
5715 RgSchCqiRawPuschMode31 *mode31Info;
5716 U8 numTxAnt = cell->numTxAntPorts;
5717 U8 sCellIdx = ueCb->cellIdToCellIdxMap[RG_SCH_CELLINDEX(cell)];
5719 RgSchUeACqiCb *acqiCb = &ueCb->cellInfo[sCellIdx]->acqiCb;
5721 TRC2(rgSCHTomPrepareAcqiRecp);
5724 cqiRecpReqInfo->reportType = TFU_APERIODIC_CQI_TYPE; /* Aperiodic */
5725 if (ueCb->mimoInfo.txMode == RGR_UE_TM_3 ||
5726 ueCb->mimoInfo.txMode == RGR_UE_TM_4)
5728 cqiRecpReqInfo->riSz[ccIdx].pres = TRUE;
5729 cqiRecpReqInfo->riSz[ccIdx].val = acqiCb->riNumBits;
5731 /* This flag will be rmeoved after making changes in BRDCM CL
5732 * Sachin is doing the change
5734 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
5736 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5737 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5739 if(ueCb->nPCqiCb->perRiVal == 1)
5741 cqiRecpReqInfo->cqiPmiSzR1[ccIdx] = acqiCb->cqiPmiSzR1;
5745 cqiRecpReqInfo->cqiPmiSzRn1[ccIdx] = acqiCb->cqiPmiSzRn1;
5748 /* Fill scratchpad to aid decoding of aper CQI upon
5750 confRepMode = acqiCb->aCqiCfg.aprdModeEnum;
5751 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].type = TFU_RECP_REQ_PUSCH;
5753 numOfCells = ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells;
5755 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5756 puschRawCqiInfo.mode = (TfuDlCqiPuschMode)confRepMode;
5758 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5759 puschRawCqiInfo.ri.pres = cqiRecpReqInfo->riSz[ccIdx].pres;
5761 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5762 puschRawCqiInfo.ri.val = cqiRecpReqInfo->riSz[ccIdx].val;
5764 /* Setting the sCellIdx */
5765 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.cqiBitWidth[numOfCells].\
5766 sCellIdx = sCellIdx;
5770 case RGR_APRD_CQI_MOD12:
5772 mode12Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5773 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode12Info;
5774 mode12Info->wideBCqiCw0 = 4;
5775 mode12Info->r1WideBCqiCw1 = 0;
5776 mode12Info->rg1WideBCqiCw1 = 4;
5779 mode12Info->r1TotalPmiBitLen = 2*acqiCb->N;
5780 mode12Info->rg1TotalPmiBitLen = acqiCb->N;
5782 else if(numTxAnt == 4)
5784 mode12Info->r1TotalPmiBitLen = 4*acqiCb->N;
5785 mode12Info->rg1TotalPmiBitLen = 4*acqiCb->N;
5790 case RGR_APRD_CQI_MOD20:
5792 mode20Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5793 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode20Info;
5794 mode20Info->wideBCqiCw = 4;
5795 mode20Info->subBandDiffCqi = 2;
5796 mode20Info->posOfM = acqiCb->L;
5800 case RGR_APRD_CQI_MOD22:
5802 mode22Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5803 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode22Info;
5804 mode22Info->wideBCqiCw0 = 4;
5805 mode22Info->sBDiffCqiCw0 = 2;
5806 mode22Info->r1WideBCqiCw1 = 0;
5807 mode22Info->r1SbDiffCqiCw1 = 0;
5808 mode22Info->rg1WideBCqiCw1 = 4;
5809 mode22Info->rg1SbDiffCqiCw1 = 2;
5810 mode22Info->posOfM = acqiCb->L;
5813 mode22Info->r1PmiBitLen = 4;
5814 mode22Info->rg1PmiBitLen = 2;
5816 else if(numTxAnt == 4)
5818 mode22Info->r1PmiBitLen = 8;
5819 mode22Info->rg1PmiBitLen = 8;
5824 case RGR_APRD_CQI_MOD30:
5826 mode30Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5827 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode30Info;
5828 mode30Info->wideBCqiCw = 4;
5829 mode30Info->totLenSbDiffCqi = 2*acqiCb->N;
5833 case RGR_APRD_CQI_MOD31:
5835 mode31Info = &ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.\
5836 cqiBitWidth[numOfCells].puschRawCqiInfo.u.mode31Info;
5837 mode31Info->wideBCqiCw0 = 4;
5838 mode31Info->totLenSbDiffCqiCw0 = 2*acqiCb->N;
5839 mode31Info->r1WideBCqiCw1 = 0;
5840 mode31Info->r1TotLenSbDiffCqiCw1 =0;
5841 mode31Info->rg1WideBCqiCw1 = 4;
5842 mode31Info->rg1TotLenSbDiffCqiCw1 = 2*acqiCb->N;
5845 mode31Info->r1PmiBitLen = 2;
5846 mode31Info->rg1PmiBitLen = 1;
5848 else if(numTxAnt == 4)
5850 mode31Info->r1PmiBitLen = 4;
5851 mode31Info->rg1PmiBitLen = 4;
5862 * @brief Function which handles the filling of Aperiodic CQI/RI reception
5867 * Function: rgSCHTomUtlFillDatAperRecpReq
5869 * Function which handles the filling of Aperiodic CQI/RI reception
5872 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5875 * - Fill the reception request for the data arriving on the ULSCH
5876 * - Fill the reception request information for the Aperiodic CQI/PMI/RI
5878 * @param[in] RgSchCellCb *cell,
5879 * RgSchUlAlloc *alloc,
5880 * TfuUeRecpReqInfo *datRecpInfo,
5881 * CmLteTimingInfo *timeInfo,
5888 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq
5892 RgSchUlAlloc *alloc,
5893 TfuUeRecpReqInfo *datRecpInfo,
5894 CmLteTimingInfo *timeInfo,
5899 PUBLIC S16 rgSCHTomUtlFillDatAperRecpReq(cell, cqiReq, alloc, datRecpInfo, timeInfo, hqPres, validIdx)
5902 RgSchUlAlloc *alloc;
5903 TfuUeRecpReqInfo *datRecpInfo;
5904 CmLteTimingInfo *timeInfo;
5909 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
5910 RgSchUeCb *ueCb = alloc->ue;
5915 TRC2(rgSCHTomUtlFillDatAperRecpReq);
5917 /*Fill RI Reception Params*/
5918 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
5919 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
5920 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
5923 cqiRecpReqInfo->cCNum = 0;
5924 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells = 0;
5927 rgSCHTomUtlGetTrigSet(cell, ueCb, cqiReq, &triggerSet);
5928 for (sIdx = 0; sIdx < CM_LTE_MAX_CELLS; sIdx++)
5930 /* The Aperiodic request for SCell index sIdx */
5931 if ((triggerSet >> (7 - sIdx)) & 0x01)
5933 /* The Aperiodic request for SCell index sIdx */
5934 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[sIdx]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5935 cqiRecpReqInfo->cCNum++;
5936 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5940 rgSCHTomPrepareAcqiRecp(ueCb, ueCb->cellInfo[0]->cell, cqiRecpReqInfo, cqiRecpReqInfo->cCNum);
5941 ueCb->rawCqiBitW[ueCb->cqiRiWritIdx].u.pusch.numOfCells++;
5944 RG_SCH_INCR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
5946 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
5948 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
5949 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
5953 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
5955 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
5959 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
5961 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
5963 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
5965 datRecpInfo->rnti = alloc->rnti;
5966 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
5967 &datRecpInfo->t.puschRecpReq.ulSchInfo);
5969 } /* rgSCHTomUtlFillDatAperRecpReq */
5974 * @brief Function which handles the filling of Periodic RI reception
5975 * request values which arrives along with UL Data on ULSCH
5979 * Function: rgSCHTomUtlFillDatPriRecpReq
5981 * Function which handles the filling of Periodic RI reception
5982 * request values which arrives along with UL Data on ULSCH
5984 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
5987 * - Fill the reception request for the data arriving on the ULSCH
5988 * - Fill the reception request information for the Periodic RI
5990 * @param[in] RgSchCellCb *cell,
5991 * RgSchUlAlloc *alloc,
5992 * TfuUeRecpReqInfo *datRecpInfo,
5993 * CmLteTimingInfo *timeInfo,
6000 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq
6003 RgSchUlAlloc *alloc,
6004 TfuUeRecpReqInfo *datRecpInfo,
6005 CmLteTimingInfo *timeInfo,
6010 PUBLIC S16 rgSCHTomUtlFillDatPriRecpReq(cell, alloc, datRecpInfo, timeInfo,
6013 RgSchUlAlloc *alloc;
6014 TfuUeRecpReqInfo *datRecpInfo;
6015 CmLteTimingInfo *timeInfo;
6020 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
6021 TRC2(rgSCHTomUtlFillDatPriRecpReq);
6023 /*Fill RI Reception Params*/
6024 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
6025 #ifdef TFU_ALLOC_EVENT_NO_INIT
6026 cqiRecpReqInfo->cqiBetaOff = 0;
6027 /* Fill only the first RI index since Periodic can come
6029 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
6030 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
6032 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* periodic */
6033 cqiRecpReqInfo->riBetaOff = alloc->ue->ul.betaRiOffst;
6035 /* Fill only the first RI index since Periodic can come
6037 cqiRecpReqInfo->cCNum = 1;
6038 cqiRecpReqInfo->riSz[0].pres = TRUE;
6039 cqiRecpReqInfo->riSz[0].val = alloc->ue->nPRiCb->riNumBits;
6041 rgSCHTomUtlFillRiBitWidthInfo(alloc->ue);
6042 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
6044 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6045 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
6049 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
6051 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
6055 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
6057 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
6059 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
6061 datRecpInfo->rnti = alloc->rnti;
6062 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6063 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6065 } /* rgSCHTomUtlFillDatPriRecpReq */
6069 * @brief Function which handles the filling of Periodic CQI/PMI reception
6070 * request values which arrives along with UL Data on ULSCH
6074 * Function: rgSCHTomUtlFillDatPCqiRecpReq
6076 * Function which handles the filling of Periodic CQI/PMI reception
6077 * request values which arrives along with UL Data on ULSCH
6079 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
6082 * - Fill the reception request for the data arriving on the ULSCH
6083 * - Fill the reception request information for the Periodic CQI/PMI
6085 * @param[in] RgSchCellCb *cell,
6086 * RgSchUlAlloc *alloc,
6087 * TfuUeRecpReqInfo *datRecpInfo,
6088 * CmLteTimingInfo *timeInfo,
6096 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq
6099 RgSchUlAlloc *alloc,
6100 TfuUeRecpReqInfo *datRecpInfo,
6101 CmLteTimingInfo *timeInfo,
6106 PUBLIC S16 rgSCHTomUtlFillDatPCqiRecpReq(cell, alloc, datRecpInfo,
6107 timeInfo, hqPres, validIdx)
6109 RgSchUlAlloc *alloc;
6110 TfuUeRecpReqInfo *datRecpInfo;
6111 CmLteTimingInfo *timeInfo;
6116 TfuUePuschCqiRecpInfo *cqiRecpReqInfo;
6117 U8 cqiPmiSz; /*Raw CQI/PMI Size*/
6120 TRC2(rgSCHTomUtlFillDatPCqiRecpReq);
6123 /*Fill CQI Reception Params*/
6124 cqiRecpReqInfo = &datRecpInfo->t.puschRecpReq.cqiRiInfo;
6125 #ifdef TFU_ALLOC_EVENT_NO_INIT
6126 cqiRecpReqInfo->riBetaOff = 0;
6128 cqiRecpReqInfo->cqiBetaOff = alloc->ue->ul.betaCqiOffst;
6129 cqiPmiSz = rgSCHTomUtlFetchPcqiBitSz(alloc->ue, cell->numTxAntPorts, &ri);
6132 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Unable to Fill "
6133 "CqiPmi size RNTI:%d",alloc->rnti);
6137 /* Fill only the first RI index since Periodic can come
6139 cqiRecpReqInfo->cCNum = 1;
6140 cqiRecpReqInfo->reportType = TFU_PERIODIC_CQI_TYPE; /* Periodic */
6141 /* This flags will be removed once Sachin does changes
6143 #if (defined (TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD))
6144 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
6145 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
6149 cqiRecpReqInfo->cqiPmiSzR1[0] = cqiPmiSz;
6150 cqiRecpReqInfo->cqiPmiSzRn1[0] = 0;
6154 cqiRecpReqInfo->cqiPmiSzRn1[0] = cqiPmiSz;
6155 cqiRecpReqInfo->cqiPmiSzR1[0] = 0;
6158 cqiRecpReqInfo->riSz[0].pres = FALSE;
6160 if((alloc->ue->srsCb.nSrsTrIdx == validIdx) && (alloc->ue->srsCb.srsDist ==0))
6162 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6163 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_SRS;
6166 (datRecpInfo->t.puschRecpReq.rcpInfo == TFU_PUSCH_DATA_CQI_SRS))
6168 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ_SRS;
6172 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI_HARQ;
6174 else if(datRecpInfo->t.puschRecpReq.rcpInfo != TFU_PUSCH_DATA_CQI_SRS)
6176 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_CQI;
6178 datRecpInfo->rnti = alloc->rnti;
6179 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6180 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6182 } /* rgSCHTomUtlFillDatPCqiRecpReq */
6185 * @brief Function which handles the filling of SRS reception
6186 * request values which arrives along with UL Data on ULSCH
6190 * Function: rgSCHTomUtlFillDatSrsRecpReq
6192 * Function which handles the filling of SRS reception
6193 * request values which arrives along with UL Data on ULSCH
6195 * Invoked by: rgSCHTomUtlFillDatRecpReq of rg_sch_tom.c
6198 * - Fill the reception request for the data arriving on the ULSCH
6199 * - Fill the reception request information for the SRS
6201 * @param[in] RgSchCellCb *cell,
6202 * RgSchUlAlloc *alloc,
6203 * TfuUeRecpReqInfo *datRecpInfo,
6204 * CmLteTimingInfo *timeInfo,
6211 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq
6214 RgSchUlAlloc *alloc,
6215 TfuUeRecpReqInfo *datRecpInfo,
6216 CmLteTimingInfo *timeInfo,
6220 PUBLIC S16 rgSCHTomUtlFillDatSrsRecpReq(cell, alloc, datRecpInfo, timeInfo,
6223 RgSchUlAlloc *alloc;
6224 TfuUeRecpReqInfo *datRecpInfo;
6225 CmLteTimingInfo *timeInfo;
6229 TRC2(rgSCHTomUtlFillDatSrsRecpReq);
6230 datRecpInfo->rnti = alloc->rnti;
6231 rgSCHTomFillOnlySrsRecpReq(cell,alloc, datRecpInfo);
6234 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_HARQ_SRS;
6238 datRecpInfo->t.puschRecpReq.rcpInfo = TFU_PUSCH_DATA_SRS;
6240 datRecpInfo->rnti = alloc->rnti;
6241 rgSCHUtlAllocRcptInfo (cell, alloc, timeInfo,
6242 &datRecpInfo->t.puschRecpReq.ulSchInfo);
6244 } /* rgSCHTomUtlFillDatSrsRecpReq */
6247 * @brief Function which handles the filling of only SRS reception
6248 * request values on ULSCH
6252 * Function: rgSCHTomFillOnlySrsRecpReq
6254 * Function which handles the filling of SRS reception
6255 * request values which arrives along with UL Data on ULSCH
6257 * Invoked by: rgSCHTomUtlFillDatSrsRecpReq of rg_sch_tom.c
6260 * - Fill the reception request for the data arriving on the ULSCH
6261 * - Fill the reception request information for the SRS
6263 * @param[in] RgSchCellCb *cell,
6264 * RgSchUlAlloc *alloc,
6265 * TfuUeRecpReqInfo *datRecpInfo,
6271 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq
6274 RgSchUlAlloc *alloc,
6275 TfuUeRecpReqInfo *datRecpInfo
6278 PUBLIC S16 rgSCHTomFillOnlySrsRecpReq(cell, alloc, datRecpInfo)
6280 RgSchUlAlloc *alloc;
6281 TfuUeRecpReqInfo *datRecpInfo;
6284 TfuUePuschSrsRecpInfo *srsRecpReqInfo;
6285 TRC2(rgSCHTomFillOnlySrsRecpReq);
6287 srsRecpReqInfo = &datRecpInfo->t.puschRecpReq.srsInfo;
6288 srsRecpReqInfo->srsBw = (TfuUlSrsBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsBw;
6289 srsRecpReqInfo->nRrc = alloc->ue->srsCb.srsCfg.srsSetup.fDomPosi;
6290 srsRecpReqInfo->srsHopBw = (TfuUlSrsHoBwInfo)alloc->ue->srsCb.srsCfg.srsSetup.srsHopBw;
6291 srsRecpReqInfo->transComb = alloc->ue->srsCb.srsCfg.srsSetup.txComb;
6292 srsRecpReqInfo->srsCfgIdx = alloc->ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6293 srsRecpReqInfo->srsCyclicShft = (TfuUlSrsCycShiftInfo)alloc->ue->srsCb.srsCfg.srsSetup.cycShift;
6295 /* ccpu00117050 - ADD - nSrs setting
6296 * Refer Section 5.2.2.6 of TS 36.212 V8.5.0*/
6297 datRecpInfo->t.puschRecpReq.ulSchInfo.nSrs = 1;
6300 } /* rgSCHTomFillOnlySrsRecpReq */
6303 * @brief Function which handles the filling of PCQI/RI, SRS and SR
6304 * Reception Request Information along
6305 * with the HARQ reception Request
6309 * Function: rgSCHTomUtlFillCqiSrSrsWithHq
6311 * Function which handles the filling of PCQI/RI, SRS ans SR
6312 * Reception Request Information along
6313 * with the HARQ reception Request
6316 * Invoked by: rgSCHTomUtlFillHqFdbkRecpReq &
6317 * rgSCHTomUtlFillSfHqFdbk of rg_sch_tom.c
6320 * - Fill the reception request for the Control Info arriving on the PUCCH
6321 * - Fill the reception request information for the SR, RI, CQI, SRS
6323 * @param[in] RgSchCellCb *cell,
6324 * TfuRecpReqInfo *recpReqInfo,
6325 * RgSchDlHqProcCb *hqCb,
6326 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
6327 * @param[in] U16 validIdx
6333 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq
6336 TfuRecpReqInfo *recpReqInfo,
6338 TfuUeRecpReqInfo *pucchRecpInfo,
6340 Bool isDatPresOnSecCell
6343 PRIVATE S16 rgSCHTomUtlFillCqiSrSrsWithHq(cell, recpReqInfo, ue,
6344 pucchRecpInfo, validIdx,isDatPresOnSecCell)
6346 TfuRecpReqInfo *recpReqInfo;
6348 TfuUeRecpReqInfo *pucchRecpInfo;
6350 Bool isDatPresOnSecCell;
6353 RgSchUePCqiCb *cqiCb;
6354 RgSchUePCqiCb *riCb;
6355 U8 ri; /*To fetch RI value*/
6356 Bool willUeRprtCqi; /* Flag set due to CQI Mask and
6357 UE Inactive state (DRX)*/
6358 Bool willUeRprtSr = TRUE;
6359 TfuAckNackMode hqFdbkMode;
6362 Bool dropCqi = FALSE;
6364 RgSchCmnUlUeSpsInfo *ulSpsUe = NULL;
6367 RgSchEmtcUeInfo *emtcUe = NULLP;
6370 TRC2(rgSCHTomUtlFillCqiSrSrsWithHq);
6374 /*Changes for PUCCH Format3 */
6375 hqFdbkMode = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqFdbkMode;
6376 numCqiBit = rgSCHCmnCalcPcqiBitSz (ue,cell->numTxAntPorts);
6377 totalPucchBits = pucchRecpInfo->t.pucchRecpReq.hqInfo.hqSz + numCqiBit;
6380 emtcUe = RG_GET_EMTC_UE_CB(ue);
6382 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
6383 #ifdef EMTC_ENABLE /*VINU*/
6386 if((emtcUe->pucchRepNumFr1 > 1) || (emtcUe->pucchRepNumFr2 > 1))
6388 willUeRprtCqi = FALSE;
6389 willUeRprtSr = FALSE;
6393 if(ue->srCb.nSrTrIdx == validIdx)
6397 /* Should we check for Rel8 and above???
6398 * Dont send SR recp req if logicalChannelSR-Mask enabled and UL SPS is
6400 ulSpsUe = RG_SCH_CMN_GET_UL_SPS_UE(ue, cell);
6401 /* Avoiding check for ulSpsEnabled as isUlSpsActv FALSE if sps is not enabled*/
6402 if(!((ue->ul.ulSpsCfg.isLcSRMaskEnab) &&
6403 (ulSpsUe->isUlSpsActv)))
6410 pucchRecpInfo->t.pucchRecpReq.srInfo.n1PucchIdx =
6411 ue->srCb.srCfg.srSetup.srResIdx;
6412 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
6413 /* FORMAT3: If SR is present it will be appended after HARQ */
6414 totalPucchBits = totalPucchBits + 1;
6421 rgSCHTomUtlMoveSrNxtOccasion(cell, ue);
6423 /* LTE_ADV:: UE will drop CSI during CSI+1BCS if data is present
6424 * on sec cell(isDatPresOnSecCell)*/
6426 if (hqFdbkMode == TFU_ACK_NACK_CHANNEL_SELECTION)
6428 if (hqFdbkMode == TFU_UCI_FORMAT_1B_CS)
6431 if (isDatPresOnSecCell == TRUE)
6438 /* Format 3 Changes : If Hq + SR + CQI bits < 22 and simultaneousAckNackAndCQI-Format3
6439 is enabled then CQI will be multiplexed with HQ otherwise CQI will be dropped
6440 Spec 36.213 Sec 10.1.1 */
6441 else if (hqFdbkMode == TFU_UCI_FORMAT_3)
6443 if ((isDatPresOnSecCell == TRUE) &&
6444 ((!ue->simulAckNackCQIFormat3) || (totalPucchBits > 22)))
6452 cqiCb = ue->nPCqiCb;
6453 if(riCb->nRiTrIdx == validIdx)
6455 /*ccpu00140578:: Skip the UE if the RI is already processed
6457 if(riCb->riRecpPrcsd == FALSE)
6459 if(riCb->riDist == 0)
6461 if((riCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
6462 (isDatPresOnSecCell == FALSE))
6465 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6466 riCb->cqiCfg.cqiSetup.cqiPResIdx;
6467 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6469 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
6471 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
6475 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
6477 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6479 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6480 ue->nPRiCb->servCellInfo->sCellIdx;
6482 rgSCHTomUtlFillRiBitWidthInfo(ue);
6483 if (ue->nPCqiCb->nCqiTrIdx == validIdx)
6485 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, ue->nPCqiCb);
6500 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
6506 /* Skip the UE for RI processing on PUCCH
6507 * in the same subframe as it already processed */
6508 if(riCb->nRiTrIdx == validIdx)
6510 /* As the new idx is same is current idx
6511 * then PUCCH reception processing will consider
6512 * RI also in the same subframe. To block this
6513 * below flag is used*/
6514 riCb->riRecpPrcsd = TRUE;
6518 else if(cqiCb->nCqiTrIdx == validIdx)
6520 if((cqiCb->cqiCfg.cqiSetup.sANCQI == TRUE) && (willUeRprtCqi == TRUE)&&
6521 (isDatPresOnSecCell == FALSE))
6524 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6525 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6527 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6529 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6530 cqiCb->servCellInfo->sCellIdx;
6532 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6533 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6534 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6536 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d "
6537 "Unable to Fill CqiPmi size", ue->ueId);
6540 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_HARQ_SR)
6542 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI;
6546 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_CQI;
6559 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6561 if(ue->srsCb.nSrsTrIdx == validIdx)
6563 /* ccpu00140578::Skip the UE for SRS reception processing
6564 * if already done as part of PUSCH recpetion
6566 if(ue->srsCb.srsRecpPrcsd == FALSE)
6568 if(ue->srsCb.srsDist ==0 )
6570 if((pucchRecpInfo->t.pucchRecpReq.uciInfo != TFU_PUCCH_HARQ_CQI)
6571 && (ue->srsCb.srsCfg.srsSetup.sANSrs)
6572 && (isDatPresOnSecCell == FALSE))
6575 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6576 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6577 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6578 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6579 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6580 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6581 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6582 ue->srsCb.srsCfg.srsSetup.txComb;
6583 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6584 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6585 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6586 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6587 /* ccpu00116923 - ADD - New Reception Request types for CQI and SRS with SR */
6588 switch(pucchRecpInfo->t.pucchRecpReq.uciInfo)
6590 case TFU_PUCCH_HARQ_SR:
6591 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
6593 case TFU_PUCCH_HARQ_SR_CQI:
6594 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_CQI_SRS;
6597 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SRS;
6601 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6605 ue->srsCb.srsDist--;
6607 /* Skip the UE for SRS processing on PUCCH
6608 * in the same subframe as it already processed */
6609 if(ue->srsCb.nSrsTrIdx == validIdx)
6611 /* As the new idx is same is current idx
6612 * then PUCCH reception processing will consider
6613 * SRS also in the same subframe. To block this
6614 * below flag is used*/
6615 ue->srsCb.srsRecpPrcsd = TRUE;
6623 } /* rgSCHTomUtlFillCqiSrSrsWithHq */
6626 * @brief Function which handles the filling of PCQI/RI, SRS
6627 * Reception Request Information along with SR reception
6632 * Function: rgSCHTomUtlFillCqiSrsWithSr
6634 * Function which handles the filling of PCQI/RI, SRS
6635 * Reception Request Information along
6636 * with the SR reception Request
6639 * Invoked by: rgSCHTomUtlFillSrRecpReq of rg_sch_tom.c
6642 * - Fill the reception request for CQI/RI, SRS if they occur
6643 * in the same instance as of SR.
6645 * @param[in] RgSchCellCb *cell,
6647 * TfuRecpReqInfo *recpReqInfo,
6648 * @param[out] TfuUeRecpReqInfo *pucchRecpInfo
6649 * @param[in] U16 validIdx
6655 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr
6659 TfuRecpReqInfo *recpReqInfo,
6660 TfuUeRecpReqInfo *pucchRecpInfo,
6664 PRIVATE S16 rgSCHTomUtlFillCqiSrsWithSr(cell, ue, recpReqInfo,
6665 pucchRecpInfo, validIdx)
6668 TfuRecpReqInfo *recpReqInfo;
6669 TfuUeRecpReqInfo *pucchRecpInfo;
6673 RgSchUePCqiCb *cqiCb;
6674 RgSchUePCqiCb *riCb;
6675 U8 ri; /*To fetch RI value*/
6676 Bool willUeRprtCqi; /* Flag set due to CQI Mask and
6677 UE Inactive state (DRX)*/
6678 TRC2(rgSCHTomUtlFillCqiSrsWithSr);
6681 cqiCb = ue->nPCqiCb;
6682 rgSCHTomUtlWillUeRprtCqiRi(ue, &willUeRprtCqi);
6684 rgSCHEmtcWillUeRptCqi(ue, &willUeRprtCqi);
6686 if(riCb->nRiTrIdx == validIdx)
6688 /*ccpu00140578:: Skip the UE if the RI is already processed
6690 if(riCb->riRecpPrcsd == FALSE)
6692 if(riCb->riDist == 0)
6694 if(willUeRprtCqi == TRUE)
6697 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6698 riCb->cqiCfg.cqiSetup.cqiPResIdx;
6699 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6702 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6703 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6705 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6706 ue->nPRiCb->servCellInfo->sCellIdx;
6708 rgSCHTomUtlFillRiBitWidthInfo(ue);
6709 /* TODO:: syed Shouldn't this be done outside this if condition */
6710 if (cqiCb->nCqiTrIdx == validIdx)
6712 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6715 rgSCHTomUtlMovePriNxtOccasion(cell, ue, riCb);
6721 if(riCb->nRiTrIdx == validIdx)
6722 {/* Need to skip this UE during PUCCH RI recpetion process
6723 in the current subframe */
6724 riCb->riRecpPrcsd = TRUE;
6728 else if(cqiCb->nCqiTrIdx == validIdx)
6730 if(willUeRprtCqi == TRUE)
6733 pucchRecpInfo->t.pucchRecpReq.cqiInfo.n2PucchIdx =
6734 cqiCb->cqiCfg.cqiSetup.cqiPResIdx;
6736 ue->rawCqiBitW[ue->cqiRiWritIdx].recvTime = recpReqInfo->timingInfo;
6739 ue->rawCqiBitW[ue->cqiRiWritIdx].u.pucch.sCellIdx =
6740 cqiCb->servCellInfo->sCellIdx;
6742 pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz =
6743 rgSCHTomUtlFetchPcqiBitSz(ue, cell->numTxAntPorts, &ri);
6744 if(0 == pucchRecpInfo->t.pucchRecpReq.cqiInfo.cqiPmiSz)
6746 RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"RNTI:%d"
6747 " Unable to Fill CqiPmi size", ue->ueId);
6751 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI;
6753 rgSCHTomUtlMovePcqiNxtOccasion(cell, ue, cqiCb);
6755 if(ue->srsCb.nSrsTrIdx == validIdx)
6757 /* ccpu00140578:: Cnsider the SRS processing
6758 * only if not done in the same TTI
6759 * as part of PUSCH or HARQ reception process*/
6760 if(ue->srsCb.srsRecpPrcsd == FALSE)
6762 if(ue->srsCb.srsDist ==0 )
6764 if(ue->srsCb.srsCfg.srsSetup.sANSrs)
6767 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsBw =
6768 (TfuUlSrsBwInfo)ue->srsCb.srsCfg.srsSetup.srsBw;
6769 pucchRecpInfo->t.pucchRecpReq.srsInfo.nRrc =
6770 ue->srsCb.srsCfg.srsSetup.fDomPosi;
6771 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsHopBw =
6772 (TfuUlSrsHoBwInfo)ue->srsCb.srsCfg.srsSetup.srsHopBw;
6773 pucchRecpInfo->t.pucchRecpReq.srsInfo.transComb =
6774 ue->srsCb.srsCfg.srsSetup.txComb;
6775 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCfgIdx =
6776 ue->srsCb.srsCfg.srsSetup.srsCfgIdx;
6777 pucchRecpInfo->t.pucchRecpReq.srsInfo.srsCyclicShft =
6778 (TfuUlSrsCycShiftInfo)ue->srsCb.srsCfg.srsSetup.cycShift;
6779 /* ccpu00116923 - ADD - New Reception Request types for CQI and
6781 if(pucchRecpInfo->t.pucchRecpReq.uciInfo == TFU_PUCCH_SR_CQI)
6783 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_CQI_SRS;
6787 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_SR_SRS;
6791 rgSCHTomUtlMoveSrsNxtOccasion(cell, ue);
6795 ue->srsCb.srsDist--;
6797 /* Skip the UE for SRS processing on PUCCH
6798 * in the same subframe as it already processed */
6799 if(ue->srsCb.nSrsTrIdx == validIdx)
6801 /* As the new idx is same is current idx
6802 * then PUCCH reception processing will consider
6803 * SRS also in the same subframe. To block this
6804 * below flag is used*/
6805 ue->srsCb.srsRecpPrcsd = TRUE;
6811 } /* rgSCHTomUtlFillCqiSrsWithSr */
6817 /** @brief This function handles filling of HARQ feedback repetition
6818 * recption request for each subframe
6822 * Function: rgSCHTomUtlFillSfRepHqFdbk
6826 * @param [out] TfuRecpReqInfo *recpReqInfo
6827 * @param [in] RgSchCellCb *cell
6828 * @param [out] RgSchErrInfo *err
6829 * @param [in] RgSchDlSf *dlSf
6830 * @param [in] U8 noFdbks
6831 * @param [in] CmMemListCp *memCp
6832 * @param [in] U8 elemIdx
6833 * @param [in] RgSchDlSf *nxtDlsf
6840 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk
6842 TfuRecpReqInfo *recpReqInfo,
6843 RgSchCellCb *cellCb,
6853 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk (recpReqInfo, cellCb, err, dlSf,
6854 noFdbks, memCp, elemIdx, nxtDlsf, validIdx)
6855 TfuRecpReqInfo *recpReqInfo;
6856 RgSchCellCb *cellCb;
6867 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk
6869 TfuRecpReqInfo *recpReqInfo,
6870 RgSchCellCb *cellCb,
6879 PRIVATE S16 rgSCHTomUtlFillSfRepHqFdbk (recpReqInfo, cellCb, err, dlSf,
6880 noFdbks, memCp, elemIdx, nxtDlsf)
6881 TfuRecpReqInfo *recpReqInfo;
6882 RgSchCellCb *cellCb;
6892 RgSchDlHqProcCb *hqCb;
6896 TfuUeRecpReqInfo *pucchRecpInfo;
6898 TfuUePucchHqRecpInfo *hqRecpReq;
6900 RgSchDlHqTbCb *tbCb;
6901 RgSchDlHqProcCb *prvHqCb = NULLP;
6903 TRC2(rgSCHTomUtlFillSfRepHqFdbk)
6905 node = dlSf->ackNakRepQ.first;
6908 tbCb = (RgSchDlHqTbCb *)(node->node);
6910 ueCb = hqCb->hqE->ue;
6912 if (--tbCb->fbkRecpRepCntr)
6914 /* Add to next subfarme */
6915 /* Add this hqCb to the next dlSf's ackNakRepQ */
6916 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
6917 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
6918 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
6919 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
6926 /* Go to the next node */
6931 if ((hqCb->hqE->ue != NULLP) &&
6932 (hqCb->hqE->ue->measGapCb.isMeasuring != TRUE)
6933 && (hqCb != prvHqCb)
6936 /* We need to add the recp request to be sent on the pucchANRep
6939 ret = rgSCHUtlGetEventMem((Ptr *)&pucchRecpInfo,
6940 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp));
6943 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to"
6944 "Allocate TfuUeRecpReqInfo for RNTI:%d ", ueCb->ueId);
6945 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
6948 pucchRecpInfo->rnti = ueCb->ueId;
6950 pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
6952 pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
6955 /* FOR repetition Feedback shall come on n1PucchAnRep Configured per
6959 pucchRecpInfo->t.pucchRecpReq.hqType = TFU_HQ_RECP_REQ_N1PUCCH;
6960 pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = ueCb->ackNakRepCb.pucchRes;
6962 pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
6963 hqRecpReq = &(pucchRecpInfo->t.pucchRecpReq.hqInfo);
6964 /* ACK NACK rep works only in bundling mode . */
6965 hqRecpReq->hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_BUNDL;
6966 if ((hqCb->hqPSfLnk.node != NULLP) &&
6967 (hqCb->hqPSfLnk.node != NULLP))
6970 hqRecpReq->hqSz = 2;
6974 hqRecpReq->hqSz = 1;
6976 hqRecpReq->pucchResCnt = 1;
6977 hqRecpReq->hqRes[0] = ueCb->ackNakRepCb.pucchRes;
6979 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst, &(pucchRecpInfo->lnk));
6980 pucchRecpInfo->lnk.node = (PTR)pucchRecpInfo;
6982 /* In a given dlSf, if there is 2 TBs context
6983 * stored for a given harq, then they are added
6984 * adjacent to each other in the subframe. To avoid
6985 * adding duplicate recpnInfo for each TB, store this
6986 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
6987 * do not add reception req info.*/
6990 RGSCH_NULL_CHECK(cellCb->instIdx, hqCb->hqE->ue);
6991 rgSCHTomUtlMoveNxtOccasion(cellCb, hqCb->hqE->ue, validIdx);
6993 /* Go to the next node */
7000 /** @brief This function handles filling of HARQ feedback recption request
7005 * Function: rgSCHTomUtlFillSfHqFdbkInfo
7009 * @param [out] TfuRecpReqInfo *recpReqInfo
7010 * @param [in] RgSchCellCb *cell
7011 * @param [out] RgSchErrInfo *err
7012 * @param [in] RgSchDlSf *dlSf
7013 * @param [in] U8 noFdbks
7014 * @param [in] CmMemListCp *memCp
7015 * @param [in] U8 elemIdx
7016 * @param [in] RgSchDlSf *nxtDlsf
7017 * @param [in] U16 validIdx;
7024 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo
7026 TfuRecpReqInfo *recpReqInfo,
7027 RgSchCellCb *cellCb,
7035 RgSchDlHqProcCb *hqCb,
7036 RgSchUePucchRecpInfo *pucchInfo,
7038 RgSchDlHqProcCb *prvHqCb
7041 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo (recpReqInfo, cellCb, err, dlSf,
7042 noFdbks, memCp, elemIdx, nxtDlsf, validIdx, hqCb, pucchInfo, alloc, prvHqCb)
7043 TfuRecpReqInfo *recpReqInfo;
7044 RgSchCellCb *cellCb;
7052 RgSchDlHqProcCb *hqCb;
7053 RgSchUePucchRecpInfo *pucchInfo;
7055 RgSchDlHqProcCb *prvHqCb;
7059 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo
7061 TfuRecpReqInfo *recpReqInfo,
7062 RgSchCellCb *cellCb,
7069 RgSchDlHqProcCb *hqCb,
7070 RgSchUePucchRecpInfo *pucchInfo,
7072 RgSchDlHqProcCb *prvHqCb
7075 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkInfo (recpReqInfo, cellCb, err, dlSf,
7076 noFdbks, memCp, elemIdx, nxtDlsf, hqCb, pucchInfo, alloc, prvHqCb)
7077 TfuRecpReqInfo *recpReqInfo;
7078 RgSchCellCb *cellCb;
7085 RgSchDlHqProcCb *hqCb;
7086 RgSchUePucchRecpInfo *pucchInfo;
7088 RgSchDlHqProcCb *prvHqCb;
7093 RgSchUeCb *ueCb = hqCb->hqE->ue;
7095 CmLteTimingInfo futTime;
7096 RgSchTddANInfo *anInfo;
7099 RgrTddAckNackMode ackNackMode;
7100 RgSchDlHqTbCb *tbCb;
7105 TRC2(rgSCHTomUtlFillSfHqFdbkInfo)
7108 RG_SCH_ADD_TO_CRNT_TIME(cellCb->crntTime, futTime, TFU_RECPREQ_DLDELTA);
7112 for (idx = 0 ;idx < 2; idx++)
7114 if (HQ_TB_WAITING == hqCb->tbInfo[idx].state)
7117 tbCb = &hqCb->tbInfo[idx];
7121 ackNackMode = ueCb->dl.ackNackMode;
7123 if(ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL)
7125 anInfo = rgSCHUtlGetUeANFdbkInfo(ueCb, &futTime);
7126 /* Only the last scheduled TB for the UE is for HARQ
7127 * ACK/NACK reception in Bundling case */
7128 if((anInfo == NULLP) ||
7129 (anInfo->latestMIdx != dlSf->dlFdbkInfo.m))
7136 /* Get the TFU reception request pointer, if present */
7137 cmHashListFind(&cellCb->ueTfuPendLst, (U8*) &ueCb->ueId,
7138 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
7141 /* For upgrade we shall use the existing logic of pending list. */
7142 cmHashListFind(&cellCb->ueTfuPendLst, (U8*) &ueCb->ueId,
7143 sizeof(ueCb->ueId), 0, (PTR *) &pucchInfo);
7146 else if(hqCb->hqE->raCb != NULLP)
7148 /* For RACH it is set to Bundling */
7149 ackNackMode = RGR_TDD_ACKNACK_MODE_BUNDL;
7150 rnti = hqCb->hqE->raCb->tmpCrnti;
7157 /* Do not proceed if PUSCH
7158 reception req is already filled*/
7163 /* Go to the next node */
7167 if(((ueCb == NULLP) || (ueCb->measGapCb.isMeasuring != TRUE))
7171 TknU16 n1PucchTkn = {FALSE, 0};
7174 pdcch = tbCb->hqP->pdcch;
7176 n1PucchTkn = hqCb->spsN1PucchRes;
7178 for (tbIndx = 0; tbIndx < TFU_MAX_TB; tbIndx++)
7180 if (hqCb->tbInfo[tbIndx].state == HQ_TB_WAITING &&
7181 (RGSCH_TIMEINFO_SAME(hqCb->tbInfo[tbIndx].fdbkTime,
7182 recpReqInfo->timingInfo)))
7185 hqCb->tbInfo[tbIndx].pucchFdbkIdx = hqCb->ulDai;
7188 ret = rgSCHTomUtlFillSfHqFdbkForOneUe(hqCb,recpReqInfo, cellCb, err, dlSf, noFdbks,
7189 memCp, elemIdx, nxtDlsf, rnti, ackNackMode, &pucchInfo, pdcch,
7190 n1PucchTkn, &alloc, hqSz);
7195 /* TODO:: In case of F1BCS and CSI in same subframe
7196 * UE shall drop the CSI if there was at least one
7197 * PDSCH transmission in any of the DL subframe
7198 * mapping to this UL subframe
7201 rgSCHTomUtlFillCqiSrSrsWithHq(cellCb,recpReqInfo, hqCb->hqE->ue,
7202 pucchInfo->pucchRecpInfo, validIdx,FALSE);
7204 if((hqCb->hqE->ue) &&
7205 (hqCb->hqE->ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS))
7208 if(RG_SCH_IS_CELL_SEC(hqCb->hqE->ue,hqCb->hqE->cell))
7210 switch(pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo)
7212 case TFU_PUCCH_HARQ_SR_CQI:
7213 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
7214 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7216 case TFU_PUCCH_HARQ_CQI:
7217 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
7218 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7220 case TFU_PUCCH_HARQ_SR_CQI_SRS:
7221 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR_SRS;
7222 RG_SCH_DECR_CQIRI_INDEX(ueCb->cqiRiWritIdx);
7224 case TFU_PUCCH_HARQ_SR_SRS:
7225 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ_SR;
7227 case TFU_PUCCH_HARQ_SRS:
7228 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo = TFU_PUCCH_HARQ;
7239 /* TODO antz - pushing the following code (under TFU_UPGRADE)
7240 * into the above function (...ForOneUe) did not work (caused
7241 * two additional TCs to fail). Don't know why. If this
7242 * is done later, make sure that the code branch
7243 * for relPdcch (later in this func) is also modified appropriately.
7245 /* Now add to the recp request or pending list */
7246 //if((elemIdx != (noFdbks - 1)))
7248 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
7249 (U8 *)&rnti ,(U16) sizeof(CmLteRnti));
7253 } /* If measuring */
7254 /* Go to the next node */
7255 if ((tbCb->fbkRecpRepCntr) && (--tbCb->fbkRecpRepCntr))
7257 /* Add to next subfarme */
7258 /* Add this hqCb to the next dlSf's ackNakRepQ */
7259 cmLListAdd2Tail (&(nxtDlsf->ackNakRepQ),
7260 &(tbCb->anRepLnk[tbCb->fbkRecpRepCntr]));
7261 tbCb->anRepLnk[tbCb->fbkRecpRepCntr].node = (PTR)tbCb;
7262 tbCb->crntSubfrm[tbCb->fbkRecpRepCntr] = nxtDlsf;
7264 /* In a given dlSf, if there is 2 TBs context
7265 * stored for a given harq, then they are added
7266 * adjacent to each other in the subframe. To avoid
7267 * adding duplicate recpnInfo for each TB, store this
7268 * hqCb in prvHqCb. If nextHqCb is same as prvHqCb then
7269 * do not add reception req info.*/
7277 /** @brief This function calculates the pucch resource idx
7278 * that is to be filled in harq reception request
7282 * Function: rgSCHTomUtlGethqRes
7285 * -Calculate the pucch resource idx
7286 * Harq Reception Request for Format 1B with
7289 * @param [in] U8 noFdbks
7290 * @param [in] RgSchDlSf *dlSf
7291 * @param [in] RgSchPdcch *pdcch
7292 * @param [in] RgSchCellCb *cellCb
7293 * @param [out]U16 *hqRes
7297 PRIVATE Void rgSCHTomUtlGethqRes
7302 RgSchCellCb *cellCb,
7306 PRIVATE Void rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,hqRes)
7310 RgSchCellCb *cellCb;
7322 m = dlSf->dlFdbkInfo.m;
7324 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
7325 nP = cellCb->rgSchTddNpValTbl[P];
7326 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
7327 *hqRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
7328 cellCb->pucchCfg.n1PucchAn;
7333 /** @brief This function fills the harq reception request for
7334 * TDD in case of Fomat 1B with CS for M=1
7338 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
7341 * -Fill Harq Reception Request for Format 1B with
7344 * @param [in] RgSchDlHqProcCb *hqCb
7345 * @param [in] TfuUePucchRecpReq *hqRecpReq
7346 * @param [in] U8 noFdbks
7347 * @param [in] RgSchDlSf *dlSf
7348 * @param [in] RgSchPdcch *pdcch
7349 * @param [in] RgSchCellCb *cellCb
7353 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1
7355 RgSchDlHqProcCb *hqCb,
7356 TfuUePucchRecpReq *hqRecpReq,
7363 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1(hqCb, hqRecpReq,
7364 noFdbks,dlSf,pdcch,cellCb)
7365 RgSchDlHqProcCb *hqCb;
7366 TfuUePucchRecpReq *hqRecpReq;
7370 RgSchCellCb *cellCb;
7373 RgSchUeCb *ue = NULLP;
7374 Bool isCellSec = FALSE;
7377 /*ccpu00147920: UeCb is NULL for SPS activation*/
7378 if(pdcch && pdcch->ue)
7379 {/* SPS Release pdcch or dynamic data */
7386 /* This is not supposed to happen
7387 * Error case. hqCB has to be ter
7388 * when pdcch is present . Adding
7389 * if check bcs of kwork*/
7396 if((hqCb != NULLP) &&
7397 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7402 switch(ue->f1bCsAVal)
7404 case RG_SCH_A_VAL_2:
7405 /* harq(0) is primary harq(1) is secondary) */
7408 hqRecpReq->hqInfo.hqRes[1] = ue->n1PucchF1bResCb.
7409 cw1N1Res[hqCb->tpc].n1PucchIdx;
7411 else/* primary cell */
7414 /* hqCb will be null in case of sps rel pdcch */
7415 if ((hqCb) && hqCb->spsN1PucchRes.pres)
7416 {/* SPS occasion or dyn sched*/
7417 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7420 #endif /* LTEMAC_SPS */
7421 {/* dyn data or sps release */
7425 /* This is not supposed to happen
7426 * Error case. hqCB has to be ter
7427 * when pdcch is present . Adding
7428 * if check bcs of kwork*/
7433 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7434 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7438 case RG_SCH_A_VAL_3:
7440 /* Serving cell in mimo mode should be
7441 * in 0 and 1 and the serving cell in siso
7442 * mode should be in 2 indices */
7445 U8 servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
7446 hqCb->hqE->cell->cellId,
7449 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
7450 {/* Sec cell is in mimo mode, use 0 and 1 */
7451 hqRecpReq->hqInfo.hqRes[0] =
7452 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7453 hqRecpReq->hqInfo.hqRes[1] =
7454 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7457 {/* Sec cell is in siso mode, use 2 */
7458 hqRecpReq->hqInfo.hqRes[2] =
7459 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7463 {/* primary cell hq */
7465 if(rgSCHUtlGetMaxTbSupp(ue->mimoInfo.txMode) > 1)
7466 {/* prim cell is in mimo mode, use 0 and 1 */
7468 if (hqCb && hqCb->spsN1PucchRes.pres)
7469 {/* Not sps release */
7470 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7473 #endif /* LTEMAC_SPS */
7474 {/* sps rel or dyn */
7478 /* This is not supposed to happen
7479 * Error case. hqCB has to be ter
7480 * when pdcch is present . Adding
7481 * if check bcs of kwork*/
7486 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7487 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7488 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
7492 {/* prim cell is in siso mode use 2 */
7494 /* Consider sps occasions */
7495 if (hqCb && hqCb->spsN1PucchRes.pres)
7496 {/* Not sps release */
7497 hqRecpReq->hqInfo.hqRes[2] = hqCb->spsN1PucchRes.val;
7500 #endif /* LTEMAC_SPS */
7505 /* This is not supposed to happen
7506 * Error case. hqCB has to be ter
7507 * when pdcch is present . Adding
7508 * if check bcs of kwork*/
7513 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7514 hqRecpReq->hqInfo.hqRes[2] = hqRes;
7520 case RG_SCH_A_VAL_4:
7521 {/* Both the serv cells are in mimo mode */
7523 {/* 2 and 3 for sec cell */
7524 hqRecpReq->hqInfo.hqRes[2] =
7525 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7526 hqRecpReq->hqInfo.hqRes[3] =
7527 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7529 else/* primary cell */
7530 {/* 0 and 1 are for primary cell */
7532 if (hqCb && hqCb->spsN1PucchRes.pres)
7533 {/* Not sps release */
7534 hqRecpReq->hqInfo.hqRes[0] = hqCb->spsN1PucchRes.val;
7537 #endif /* LTEMAC_SPS */
7542 /* This is not supposed to happen
7543 * Error case. hqCB has to be ter
7544 * when pdcch is present . Adding
7545 * if check bcs of kwork*/
7550 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7551 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7552 hqRecpReq->hqInfo.hqRes[1] = hqRes + 1;
7563 /** @brief This function fills the harq reception request for
7564 * TDD in case of Fomat 1B with CS for M>=2
7568 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
7571 * -Fill Harq Reception Request for Format 1B with
7574 * @param [in] RgSchDlHqProcCb *hqCb
7575 * @param [in] TfuUePucchRecpReq *hqRecpReq
7576 * @param [in] U8 noFdbks
7577 * @param [in] RgSchDlSf *dlSf
7578 * @param [in] RgSchPdcch *pdcch
7579 * @param [in] RgSchCellCb *cellCb
7580 * @param [in] U8 elemIdx
7584 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234
7586 RgSchDlHqProcCb *hqCb,
7587 TfuUePucchRecpReq *hqRecpReq,
7591 RgSchCellCb *cellCb,
7595 PRIVATE Void rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234(
7596 hqCb,hqRecpReq,noFdbks,dlSf,pdcch,cellCb,elemIdx)
7597 RgSchDlHqProcCb *hqCb;
7598 TfuUePucchRecpReq *hqRecpReq;
7602 RgSchCellCb *cellCb;
7607 Bool isCellSec = FALSE;
7612 {/* SPS Release pdcch or dynamic data */
7619 /* This is not supposed to happen
7620 * Error case. hqCB has to be ter
7621 * when pdcch is present . Adding
7622 * if check bcs of kwork*/
7629 if((hqCb != NULLP) && (ue != NULLP) &&
7630 (RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7636 {/* Sec Cell indices are 2 and 3*/
7637 servCellIdx = rgSchUtlGetServCellIdx(hqCb->hqE->cell->instIdx,
7638 hqCb->hqE->cell->cellId,
7641 hqRecpReq->hqInfo.hqRes[2] =
7642 ue->n1PucchF1bResCb.cw1N1Res[hqCb->tpc].n1PucchIdx;
7644 if(rgSCHUtlGetMaxTbSupp(ue->cellInfo[servCellIdx]->txMode.txModeEnum) > 1)
7646 hqRecpReq->hqInfo.hqRes[3] =
7647 ue->n1PucchF1bResCb.cw2N1Res[hqCb->tpc].n1PucchIdx;
7651 {/* Primary cell indices are 0 and 1 */
7653 * M > 2 if SPS occasion is present in any of the
7654 * DL subframe in the bundle, the n1Pucch(0) is
7655 * the SPS resource and n1Pucch(1) is the resource
7656 * derived from pdcch with DAI = 1
7657 * If No SPS Occasion
7658 * Then n1Pucch(0) is from pdcch with DAI =1
7659 * and n1Pucch(1) is from pdcch with DAI = 2
7663 {/* this is not sps release pdcch */
7664 if(hqCb->spsN1PucchRes.pres == TRUE)
7666 hqRes = hqCb->spsN1PucchRes.val;
7671 {/*Dynamic scheduling or SPS Release
7672 Derive from pdcch */
7673 if(pdcch->dlDai < 3)
7674 {/* No need to calcualte from DAI > 2 */
7675 rgSCHTomUtlGethqRes(noFdbks,dlSf,pdcch,cellCb,&hqRes);
7681 hqRecpReq->hqInfo.hqRes[elemIdx] = hqRes;
7684 {/* Pdcch with DAI = 1 and 2 needs to be used
7685 for resource calculation*/
7686 if(hqCb && hqCb->spsN1PucchRes.pres == TRUE)
7687 {/* dyn or sps occasion */
7688 /* Shift the hqRes[0] if it was filled
7689 * if there was a pdcch with DAI 1 before to this
7692 {/* SPS occasion happened in the middle
7694 /* shifting the non SPS resource to n1Pucch(1) */
7695 hqRecpReq->hqInfo.hqRes[1] = hqRecpReq->hqInfo.hqRes[0];
7698 hqRecpReq->hqInfo.hqRes[0] = hqRes;
7701 else if(pdcch && pdcch->dlDai < 3)
7703 else if(pdcch->dlDai < 3)
7705 {/* sps rel or dyn sched */
7706 /* hqCb wil not be present for sps release pdcch */
7707 if(hqCb && (pdcch->dlDai != hqCb->ulDai))
7708 {/* there was a SPS occasion before to this */
7709 if(pdcch->dlDai == 1)
7711 hqRecpReq->hqInfo.hqRes[1] = hqRes;
7712 }/* ignore the DAI 2 in this case */
7714 {/* There was no SPS occasion before to this */
7718 {/* Added check to ignore kwork warning */
7719 hqRecpReq->hqInfo.hqRes[(pdcch->dlDai)-1] = hqRes;
7728 /** @brief This function fills the harq reception request for
7729 * TDD in case of Fomat 1B with CS
7733 * Function: rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7736 * -Fill Harq Reception Request for Format 1B with
7739 * @param [in] RgSchDlSf *ulSf
7740 * @param [in] RgSchCellCb *cell
7741 * @param [out]TfuUePucchRecpReq *hqRecpReq
7745 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS
7747 RgSchDlHqProcCb *hqCb,
7748 TfuUePucchRecpReq *hqRecpReq,
7756 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS(hqCb,hqRecpReq,noFdbks,dlSf,pdcch,
7757 n1PucchTkn,elemIdx,cellCb)
7758 RgSchDlHqProcCb *hqCb;
7759 TfuUePucchRecpReq *hqRecpReq;
7764 RgSchCellCb *cellCb;
7767 /* Update teh fdbk mode if something different is present
7768 * in L1 API file for F1BS *//* 1 --> F1BCS */
7769 hqRecpReq->hqInfo.hqFdbkMode = TFU_ACK_NACK_CHANNEL_SELECTION;
7773 case RG_SCH_M_VAL_1:
7776 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM1(hqCb,hqRecpReq,
7777 noFdbks,dlSf,pdcch,cellCb);
7780 case RG_SCH_M_VAL_2:
7781 case RG_SCH_M_VAL_3:
7782 case RG_SCH_M_VAL_4:
7784 /* Spatial bundling will be applied */
7785 rgSCHTomUtlFillSfHqFdbkForFrmt1BCSForM234(hqCb,hqRecpReq,
7786 noFdbks,dlSf,pdcch,cellCb,elemIdx);
7796 /***********************************************************
7798 * Func : rgSCHTomUtlFillSfHqFdbkForOneUe
7800 * Desc : Fill HARQ feedback info for one UE/entry
7808 **********************************************************/
7810 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe
7812 RgSchDlHqProcCb *hqCb,
7813 TfuRecpReqInfo *recpReqInfo,
7814 RgSchCellCb *cellCb,
7822 RgrTddAckNackMode ackNackMode,
7823 RgSchUePucchRecpInfo **pucchInfoRef,
7830 PRIVATE S16 rgSCHTomUtlFillSfHqFdbkForOneUe(hqCb,recpReqInfo, cellCb, err, dlSf,
7831 noFdbks, memCp, elemIdx, nxtDlsf, rnti, ackNackMode, pucchInfoRef,
7832 pdcch, n1PucchTkn, allocRef, hqSz)
7833 RgSchDlHqProcCb *hqCb;
7834 TfuRecpReqInfo *recpReqInfo;
7835 RgSchCellCb *cellCb;
7843 RgrTddAckNackMode ackNackMode;
7844 RgSchUePucchRecpInfo **pucchInfoRef;
7851 RgSchUePucchRecpInfo *pucchInfo = *pucchInfoRef;
7854 TfuUePucchRecpReq *hqRecpReq;
7869 Bool isFirstFdbk = FALSE;
7871 if(pucchInfo == NULLP)
7873 if ((ret = rgSCHUtlGetEventMem((Ptr *)&pucchInfo,
7874 sizeof(RgSchUePucchRecpInfo), memCp)) != ROK)
7876 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7877 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7878 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7882 #ifdef TFU_ALLOC_EVENT_NO_INIT
7883 pucchInfo->hashLstEnt.hashVal = 0;
7884 pucchInfo->hashLstEnt.keyLen = 0;
7885 pucchInfo->hashLstEnt.key = 0;
7886 pucchInfo->hashLstEnt.list.prev = pucchInfo->hashLstEnt.list.next = 0;
7888 if ((ret = rgSCHUtlGetEventMem((Ptr *)&(pucchInfo->pucchRecpInfo),
7889 sizeof(TfuUeRecpReqInfo), &(recpReqInfo->memCp))) != ROK)
7891 RLOG_ARG1(L_ERROR,DBG_CELLID,cellCb->cellId,"Unable to "
7892 "Allocate TfuUeRecpReqInfo for cell RNTI:%d",rnti);
7893 err->errCause = RGSCHERR_TOM_MEM_EXHAUST;
7896 cmMemset((U8 *)pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqInfo.hqRes,0xff,sizeof(U16)*TFU_MAX_HQ_RES);
7897 #ifdef TFU_ALLOC_EVENT_NO_INIT
7898 cmMemset((U8 *)&pucchInfo->pucchRecpInfo->t.pucchRecpReq, 0, sizeof(TfuUePucchRecpReq));
7900 pucchInfo->pucchRecpInfo->type = TFU_RECP_REQ_PUCCH;
7901 pucchInfo->pucchRecpInfo->rnti = rnti;
7903 pucchInfo->pucchRecpInfo->t.pucchRecpReq.uciInfo=TFU_PUCCH_HARQ;
7910 /* Calculation of resources same for both bundling and muxing for M = 1
7913 RgSchUeCb *ue = rgSCHDbmGetUeCb (cellCb, rnti);
7914 if((ue) && (1 == ue->numSCells))
7916 if(ue->uciFrmtTyp == RG_SCH_UCI_FORMAT1B_CS)
7918 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7919 rgSCHTomUtlFillSfHqFdbkForFrmt1BCS(hqCb,hqRecpReq,
7920 noFdbks,dlSf,pdcch,elemIdx,cellCb);
7923 {/* M = 1 case . size is same as A Value*/
7924 hqRecpReq->hqInfo.hqSz = ue->f1bCsAVal;
7925 hqRecpReq->hqInfo.pucchResCnt = hqRecpReq->hqInfo.hqSz;
7928 hqRecpReq->hqInfo.hqSz = (noFdbks * 2); /* M for 2 cells */
7929 hqRecpReq->hqInfo.pucchResCnt = 4;
7931 hqRecpReq->hqInfo.a = ue->f1bCsAVal;
7932 /* handling for SPS occasions*/
7935 /* set the datPresinFirstSUbframe to TRUE if this
7936 * is for pcell txion*/
7938 RgSchTddANInfo *anInfo = NULLP;
7940 /* if this txion is on pcell
7941 * sps occaion, dyn sched or sps release pdcch
7942 * set the sched present in first
7943 * dl subframe of the bundle to TRUE. This
7944 * is required for mapping the feedbak when SPS occasion
7945 * is present in any of the DL subframe in the bundle in
7948 /* SPS will happen only on pcell */
7949 if((hqCb == NULLP) || (!RG_SCH_IS_CELL_SEC(ue,hqCb->hqE->cell)))
7952 anInfo = rgSCHUtlGetUeANFdbkInfo(ue,
7953 &recpReqInfo->timingInfo,RGSCH_PCELL_INDEX);
7955 {/* ANInfo must be there. adding block
7957 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),
7958 "ANInfo should not be NULL for cellId=%d \n", cellCb->cellId));
7966 {/* This needs to be revisited while
7967 adding support for PUCCH format 3 */
7968 RGSCHDBGERRNEW(cellCb->instIdx,(rgSchPBuf(cellCb->instIdx),"Invalid Pucch format configured.."));
7975 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) ||
7976 ((noFdbks == 1) && (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)))
7978 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
7980 prevHqSize = hqRecpReq->hqInfo.hqSz;
7983 /* Only one index for bundling case */
7984 hqRecpReq->M = noFdbks;
7986 TFU_HQ_RECP_REQ_NORMAL;
7987 hqRecpReq->multCnt = 1;
7988 hqRecpReq->t.nCce[0] =
7993 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
7995 hqRecpReq->type = TFU_UCI_HARQ;
7997 #else /* TFU_UPGRADE */
8000 if ((TRUE == isFirstFdbk) && (TRUE == n1PucchTkn.pres))
8002 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
8003 hqRecpReq->hqInfo.pucchResCnt=1;
8004 hqRecpReq->hqInfo.hqRes[0] = n1PucchTkn.val;
8005 hqRecpReq->hqInfo.hqSz = hqSz;
8008 else if (FALSE == n1PucchTkn.pres)
8011 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)ackNackMode;
8013 P = rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
8014 nP = cellCb->rgSchTddNpValTbl[P];
8015 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
8016 m = dlSf->dlFdbkInfo.m;
8017 /* In case of no UE */
8018 pucchRes = (M - m - 1)* nP + (m * nPlusOne) + pdcch->nCce +
8019 cellCb->pucchCfg.n1PucchAn;
8020 /*ccpu00130164:MOD-Changed to maitain value of
8021 hqRecpReq->hqInfo.pucchResCnt=1 in case of bundling*/
8022 /*ccpu00132284 -MOD- hqRes need to be updated after pucchReCnt set to 1
8023 * and resource should be update at index-0*/
8024 hqRecpReq->hqInfo.pucchResCnt=1;
8025 hqRecpReq->hqInfo.hqRes[hqRecpReq->hqInfo.pucchResCnt-1] = pucchRes;
8027 if((ackNackMode == RGR_TDD_ACKNACK_MODE_BUNDL) && (hqSz > prevHqSize))
8028 hqRecpReq->hqInfo.hqSz = hqSz;
8029 else if (ackNackMode == RGR_TDD_ACKNACK_MODE_MULT)
8030 hqRecpReq->hqInfo.hqSz = hqSz;
8032 hqRecpReq->hqInfo.hqSz = prevHqSize;
8034 #endif /* TFU_UPGRADE */
8036 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
8037 &(pucchInfo->pucchRecpInfo->lnk));
8038 pucchInfo->pucchRecpInfo->lnk.node =
8039 (PTR)pucchInfo->pucchRecpInfo;
8042 else /* Multiplexing */
8045 pucchInfo->pucchRecpInfo->t.pucchRecpReq.M = noFdbks;
8047 if (n1PucchTkn.pres == TRUE)
8049 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
8050 TFU_HQ_RECP_REQ_N1PUCCH;
8051 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.n1Pucch = n1PucchTkn.val;
8056 pucchInfo->pucchRecpInfo->t.pucchRecpReq.hqType =
8057 TFU_HQ_RECP_REQ_NORMAL;
8058 multCnt = pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt;
8059 pucchInfo->pucchRecpInfo->t.pucchRecpReq.t.nCce[multCnt] =
8061 pucchInfo->pucchRecpInfo->t.pucchRecpReq.m[multCnt] =
8063 pucchInfo->pucchRecpInfo->t.pucchRecpReq.p[multCnt] =
8064 rgSCHCmnGetPValFrmCCE(cellCb, pdcch->nCce);
8066 pucchInfo->pucchRecpInfo->t.pucchRecpReq.multCnt++;
8068 #else /* TFU_UPGRADE */
8070 hqRecpReq = &(pucchInfo->pucchRecpInfo->t.pucchRecpReq);
8071 hqRecpReq->hqInfo.hqFdbkMode = (TfuAckNackMode)RGR_TDD_ACKNACK_MODE_MULT;
8072 hqRecpReq->hqInfo.hqSz = noFdbks;
8074 resIdx = hqRecpReq->hqInfo.pucchResCnt;
8075 hqRecpReq->hqInfo.pucchResCnt++;
8078 if (n1PucchTkn.pres == TRUE)
8080 hqRecpReq->hqInfo.hqRes[resIdx] = n1PucchTkn.val;
8086 m = dlSf->dlFdbkInfo.m;
8088 P = rgSCHCmnGetPValFrmCCE(cellCb, nCce);
8089 nP = cellCb->rgSchTddNpValTbl[P];
8090 nPlusOne = cellCb->rgSchTddNpValTbl[P + 1];
8091 hqRecpReq->hqInfo.hqRes[resIdx] = (M - m - 1)* nP +
8092 (m * nPlusOne) + pdcch->nCce +
8093 cellCb->pucchCfg.n1PucchAn;
8095 #endif /* TFU_UPGRADE */
8096 /* If all the DL subframes are scanned, then
8097 * send TFU request*/
8099 if((elemIdx != noFdbks) && alloc)
8101 cmHashListInsert(&cellCb->ueTfuPendLst, (PTR) pucchInfo,
8102 (U8 *)&rnti, (U16) sizeof(rnti));
8107 pucchInfo->pucchRecpInfo->t.pucchRecpReq.type = TFU_UCI_HARQ;
8108 cmLListAdd2Tail(&recpReqInfo->ueRecpReqLst,
8109 &(pucchInfo->pucchRecpInfo->lnk));
8110 pucchInfo->pucchRecpInfo->lnk.node =
8111 (PTR)pucchInfo->pucchRecpInfo;
8112 /* Delete the entry after addition to the list */
8113 cmHashListDelete(&cellCb->ueTfuPendLst, (PTR) pucchInfo);
8119 *pucchInfoRef = pucchInfo;
8125 #ifdef RG_ULSCHED_AT_CRC
8126 /** @brief This function does all the processing related to a single downlink
8131 * Function: rgSCHTomUtlProcDlSfAtCrc
8134 * - collate control data for all UEs and send to PHY
8135 * - collate data buffers for all UEs and send to PHY
8137 * @param [in] RgSchDlSf *ulSf
8138 * @param [in] RgSchCellCb *cell
8139 * @param [in] TfuCntrlReqInfo *cntrlInfo
8140 * @param [out] RgSchErrInfo *err
8144 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc
8147 CmLteTimingInfo crntUlFrm,
8149 TfuCntrlReqInfo *cntrlInfo,
8153 PRIVATE S16 rgSCHTomUtlProcDlSfAtCrc (ulSf, crntUlFrm, cell, cntrlInfo, err)
8155 CmLteTimingInfo crntUlFrm;
8157 TfuCntrlReqInfo *cntrlInfo;
8161 Inst inst = cell->instIdx;
8164 TRC2(rgSCHTomUtlProcDlSfAtCrc);
8167 cntrlInfo->numDlActvUes = 0;
8168 cmLListInit(&cntrlInfo->phichLst);
8169 cmLListInit(&cntrlInfo->dlPdcchLst);
8170 cmLListInit(&cntrlInfo->ulPdcchLst);
8171 #ifdef TFU_ALLOC_EVENT_NO_INIT
8172 cntrlInfo->dlTiming.sfn = cntrlInfo->dlTiming.subframe = 0;
8176 cntrlInfo->ulTiming = crntUlFrm;
8177 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cntrlInfo->ulTiming, TFU_ULCNTRL_DLDELTA);
8179 cntrlInfo->cellId = cell->cellId;
8180 /* Fill PHICH info */
8181 if ((ret = rgSCHTomUtlFillPhich (cell, cntrlInfo, ulSf, err)) != ROK)
8183 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PHICH info for "
8185 RGSCH_FREE_MEM(cntrlInfo);
8190 if ((ret = rgSCHTomUtlFillUlPdcch (cell, cntrlInfo, ulSf, err)) != ROK)
8192 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send PDCCH info for "
8194 RGSCH_FREE_MEM(cntrlInfo);
8199 if(0 == cntrlInfo->ulMpdcchLst.count)
8206 if ((cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count) || RG_SCH_EMTC_GET_PDCCHLST_CNT(cntrlInfo))
8208 if (cntrlInfo->ulPdcchLst.count || cntrlInfo->phichLst.count)
8211 if (rgSCHUtlTfuCntrlReq(inst, cell->tfuSap->sapCfg.suId, cntrlInfo)
8214 RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Unable to send Cntrl info for"
8220 RGSCH_FREE_MEM(cntrlInfo);
8225 #endif /* #ifdef RG_ULSCHED_AT_CRC*/
8228 /** @brief This function sends the SFN Tick to L3
8233 * Function: rgSCHTomUtlSendSfnTick
8235 * @param [in] RgSchCellCb *cell
8238 PRIVATE Void rgSCHTomUtlSendSfnTick
8243 PRIVATE Void rgSCHTomUtlSendSfnTick (cell)
8247 RgrTtiIndInfo *rgrTtiInd;
8249 TRC2(rgSCHTomUtlSendSfnTick);
8251 /* TTI to be sent to RRM only once per system frame */
8252 /* Added support for period = 0 to disable tick to RRM */
8253 if ((cell->rrmTtiIndPrd != 0) &&
8254 ((cell->crntTime.sfn % cell->rrmTtiIndPrd) == 0) &&
8255 (cell->crntTime.subframe == 0))
8257 /* Allocate a TTI indication structure and send to RRM over RGR interface */
8258 if (rgSCHUtlAllocSBuf (cell->instIdx,
8259 (Data**)&rgrTtiInd, sizeof(RgrTtiIndInfo)) != ROK)
8261 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
8262 "Mem alloc failed for RGR TTI ind, cellId (%d))\n",
8266 rgrTtiInd->cellId = cell->cellId;
8267 rgrTtiInd->hSfn = cell->crntTime.hSfn;
8268 rgrTtiInd->sfn = cell->crntTime.sfn;
8270 if (rgSCHUtlRgrTtiInd (cell, rgrTtiInd) != ROK)
8272 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
8273 "Failed to send RGR TTI ind, cellId (%d))\n",
8275 rgSCHUtlFreeSBuf(cell->instIdx, (Data**)&rgrTtiInd,
8276 sizeof(RgrTtiIndInfo));
8286 /* @brief Mark Dyn TDD CrntSfIdx.
8290 * Function: rgSCHDynTDDMrkCrntSfIdx
8291 * Purpose: update the dyn tdd sunframe index
8292 * @param[in] Inst schInst
8296 PRIVATE Void rgSCHDynTDDMrkCrntSfIdx
8301 PRIVATE Void rgSCHDynTDDMrkCrntSfIdx(schInst)
8305 RgSchDynTddCb *rgSchDynTddInfo = &(rgSchCb[schInst].rgSchDynTdd);
8307 TRC2(rgSCHDynTDDMrkCrntSfIdx)
8309 RG_SCH_DYN_TDD_MARKTYPE(rgSchDynTddInfo, rgSchDynTddInfo->crntDTddSfIdx,
8310 RG_SCH_DYNTDD_NOTDEF);
8311 rgSchDynTddInfo->crntDTddSfIdx = (rgSchDynTddInfo->crntDTddSfIdx + 1) %
8312 RG_SCH_DYNTDD_MAX_SFINFO;
8314 //printf("Initializing Index %d \n", rgSchDynTddInfo->crntDTddSfIdx);
8320 /** @brief This function fills the TTI timinig info for each cell
8324 * Function: rgSchTomFillCellTtiInfo
8326 * @param [in] TfuTtiIndInfo *ttiInd
8327 * @param [in] Inst schInst
8328 * @param [out] U8 *nCell
8329 * @param [out] RgSchCellCb *cell[]
8335 PRIVATE Void rgSchTomFillCellTtiInfo
8337 TfuTtiIndInfo *ttiInd,
8340 RgSchCellCb *cells[]
8343 PRIVATE Void rgSchTomFillCellTtiInfo (ttiInd, schInst, nCell, cells)
8344 TfuTtiIndInfo *ttiInd;
8347 RgSchCellCb *cells[];
8352 TfuTtiCellInfo *cellInfo;
8356 CmLteTimingInfo frm;
8358 TRC2 (rgSchTomFillCellTtiInfo);
8360 if (CM_LTE_MAX_CELLS < ttiInd->numCells)
8366 rgSCHDynTDDMrkCrntSfIdx(schInst);
8369 for (i = 0; i < ttiInd->numCells; i++)
8371 cellInfo = &ttiInd->cells[i];
8372 strtCellId = rgSchCb[schInst].genCfg.startCellId;
8373 Idx1 = (U8)((cellInfo->cellId - strtCellId)&(CM_LTE_MAX_CELLS-1));
8374 cell = rgSchCb[schInst].cells[Idx1];
8375 /* Validate the cell */
8378 /* Use SCH inst 0 print buff */
8379 RGSCHDBGERRNEW(schInst,(rgSchPBuf(schInst),
8380 "RgLiTfuTtiInd()No cell exists for cellId %d\n",
8384 *nCell = *nCell + 1;
8385 cells[i] = (RgSchCellCb *)cell;
8388 if(cell->schTickDelta != cellInfo->schTickDelta)
8390 printf("\nMukesh: Delta changed for cellId=%d: curr delta=%d new delta=%d\n"
8391 "dlblankSf=%d ulblankSf=%d dummyTti=%d \n",
8392 cell->cellId, cell->schTickDelta, cellInfo->schTickDelta, cellInfo->dlBlankSf,cellInfo->ulBlankSf,
8393 cellInfo->isDummyTti);
8395 RGSCH_UPDATE_DELTA(schInst, cellInfo->schTickDelta);
8396 cell->schTickDelta = cellInfo->schTickDelta;
8399 cell->stopSiSch = cellInfo->dlBlankSf;
8400 cell->stopDlSch = cellInfo->dlBlankSf;
8401 cell->stopUlSch = cellInfo->ulBlankSf;
8402 if (cellInfo->isDummyTti)
8404 cell->stopDlSch = TRUE;
8406 if((0 == (cellInfo->timingInfo.sfn % 30)) && (0 == cellInfo->timingInfo.subframe))
8408 //printf("5GTF_CHECK rgSCHTOMTtiInd (%d : %d)\n", cellInfo->timingInfo.sfn, cellInfo->timingInfo.subframe);
8411 RGSCHCPYTIMEINFO(cellInfo->timingInfo, cell->crntTime);
8412 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->hiDci0Time,
8413 TFU_ULCNTRL_DLDELTA);
8414 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->dlDciTime,
8415 TFU_DLCNTRL_DLDELTA);
8416 RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, cell->rcpReqTime,
8417 TFU_RECPREQ_DLDELTA);
8418 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->hqRlsTime,
8419 TFU_HQFBKIND_ULDELTA);
8420 RGSCHDECRFRMCRNTTIME(cell->crntTime, cell->dlSfRlsTime,
8423 RGSCHCPYTIMEINFO_EMTC(cellInfo->timingInfo, cell->crntTime);
8424 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->hiDci0Time,
8425 TFU_ULCNTRL_DLDELTA);
8426 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->dlDciTime,
8427 TFU_DLCNTRL_DLDELTA);
8428 RG_SCH_ADD_TO_CRNT_TIME_EMTC(cell->crntTime, cell->rcpReqTime,
8429 TFU_RECPREQ_DLDELTA);
8430 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->hqRlsTime,
8431 TFU_HQFBKIND_ULDELTA);
8432 RGSCHDECRFRMCRNTTIME_EMTC(cell->crntTime, cell->dlSfRlsTime,
8435 rgSCHCmnUpdVars(cell);
8436 cell->isDlDataAllwd = TRUE;
8437 /* Get DownLink SubFrame */
8438 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8439 frm = cell->crntTime;
8441 RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
8443 RGSCH_INCR_SUB_FRAME_EMTC(frm, RG_SCH_CMN_DL_DELTA);
8445 cellSch->dl.time = frm;
8451 U8 idx = (cell->crntTime.subframe + RG_SCH_CMN_DL_DELTA) %
8452 RGSCH_NUM_SUB_FRAMES_5G;
8454 cell->isDlDataAllwd = RG_SCH_CMN_CHK_DL_DATA_ALLOWED(cell, idx);
8456 /*ccpu00130639 -ADD - used in UL HARQ proc id calculation*/
8457 if((cell->crntTime.sfn == 0) && (cell->crntTime.subframe == 0))
8459 /* sfn Cycle used for Tdd UL Harq Proc Determination.
8460 This sfn Cycle will have values from 0 to numUl Harq-1. */
8461 cell->tddHqSfnCycle = (cell->tddHqSfnCycle + 1 ) %
8462 (rgSchTddUlNumHarqProcTbl[cell->ulDlCfgIdx]);
8466 if(cell->emtcEnable)
8468 rgSCHUtlEmtcResPrcTti(cell);
8474 /** @brief This function prepares the TTI for scheduling and
8475 * invokes the Common channel scheduler. Uplink scheduler
8476 * is invoked first if UL Scheduling at CRC is not enabled
8480 * Function: rgSchTomTtiUlAndDlCmnChSch
8482 * @param [out] RgSchCellCb *cell
8488 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch
8493 PRIVATE Void rgSchTomTtiUlAndDlCmnChSch (cell)
8498 TRC2(rgSchTomTtiUlAndDlCmnChSch);
8500 cell->rlsHqArr[cell->crntHqIdx].numUes = 0;
8502 cell->crntHqIdx = cell->crntHqIdx % RGSCH_NUM_SUB_FRAMES;
8504 cmPrcTmr(&cell->tqCp, cell->tq, (PFV)rgSCHTmrProcTmr);
8505 rgSCHMeasGapANRepTtiHndl (cell);
8506 /* We need to fill the PHICH for the UL Data, first we need to get the UL
8507 * SF from Scheduler, next we fill the dlSf that goes out this TTI.
8508 * This must be performed prior to any other processing of the TTI
8509 * so that we do not wrap around and generate feedback prior to
8510 * reception of UL data.
8512 #ifndef RG_ULSCHED_AT_CRC
8515 U8 idx; /* Index into Uplink Sf array */
8517 Mval = rgSchTddPhichMValTbl[cell->ulDlCfgIdx]
8518 [cell->hiDci0Time.subframe];
8522 for(idx=0; idx < Mval; idx++)
8524 rgSCHCmnRlsUlSf(cell, idx);
8530 /* DTX processing for those Harq's which did not get feedback from L1 */
8531 rgSCHDhmRlsDlsfHqProc (cell, cell->hqRlsTime);
8532 /* Re-Init the Downlink subframe */
8533 rgSCHUtlDlRlsSubFrm(cell, cell->dlSfRlsTime);
8534 /* Added handling to retransmit
8535 * release PDCCH in case of DTX
8538 /*Check for DRX every TTI*/
8539 rgSCHDrxTtiInd(cell);
8541 /* For TDD, UL scheduling should happen after DL scheduling */
8543 #ifndef RG_ULSCHED_AT_CRC
8544 /* Perform UL scheduling */
8545 rgSCHCmnUlSch(cell);
8548 /* Perform DL scheduling for Common channels */
8549 rgSCHCmnDlCommonChSch(cell);
8554 /** @brief This function invokes the Non critical procedures like measurements,
8555 * and RGR configurations.
8559 * Function: rgSchTomTtiMiscFunctions
8561 * @param [in] RgSchCellCb *cell
8567 PRIVATE Void rgSchTomTtiMiscFunctions
8572 PRIVATE Void rgSchTomTtiMiscFunctions (cell)
8576 U8 suId = cell->tfuSap->sapCfg.suId;
8578 TRC2(rgSchTomTtiMiscFunctions);
8580 /* Invoke RAM Tti Handler */
8581 rgSCHRamTtiHndlr(cell);
8583 /* Handle RGR configurations */
8584 rgSCHGomTtiHndlr(cell, suId);
8586 if((RGM_PRB_REPORT_START == cell->prbUsage.prbRprtEnabld)
8587 && (!(cell->prbUsage.rprtPeriod) || ((glblTtiCnt % cell->prbUsage.rprtPeriod) == 0)))
8589 rgSCHUtlUpdAvgPrbUsage(cell);
8591 rgSCHL2Meas(cell,FALSE);
8594 /* LTE_ADV_FLAG_REMOVED_START */
8595 /* Report ABS Load information to application periodically */
8596 if((RGR_ENABLE == cell->lteAdvCb.absCfg.status) &&
8597 (cell->lteAdvCb.absCfg.absLoadPeriodicity))
8599 RgrLoadInfIndInfo *rgrLoadInf;
8602 cell->lteAdvCb.absLoadTtiCnt++;
8603 if(cell->lteAdvCb.absLoadTtiCnt >= cell->lteAdvCb.absCfg.absLoadPeriodicity)
8606 if(rgSCHUtlAllocSBuf (cell->instIdx,(Data**)&rgrLoadInf,
8607 sizeof(RgrLoadInfIndInfo)) != ROK)
8609 RGSCHDBGERRNEW(cell->instIdx,(rgSchPBuf(cell->instIdx),"Could not "
8610 "allocate memory for sending LoadInfo\n"));
8613 cell->lteAdvCb.absLoadTtiCnt = 0;
8614 rgrLoadInf->cellId = cell->cellId;
8615 rgrLoadInf->bw = cell->bwCfg.dlTotalBw;
8616 rgrLoadInf->type = RGR_ABS;
8617 for(idx= 0; idx<RGR_ABS_PATTERN_LEN; idx++)
8619 rgrLoadInf->u.absLoadInfo[idx] = cell->lteAdvCb.absLoadInfo[idx];
8620 cell->lteAdvCb.absLoadInfo[idx] = 0;
8622 rgSCHUtlRgrLoadInfInd(cell, rgrLoadInf);
8627 if(cell->isDlDataAllwd)
8629 /* Calling function to update CFI parameters*/
8630 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
8634 /* Incrementing the ttiCnt in case of UL subframe */
8635 if(!cell->dynCfiCb.switchOvrInProgress)
8637 cell->dynCfiCb.ttiCnt++;
8641 rgSchCmnUpdCfiDb(cell, RG_SCH_CMN_DL_DELTA);
8644 /* LTE_ADV_FLAG_REMOVED_END */
8649 /** @brief This function invokes the Downlink scheduler
8653 * Function: rgSchTomTtiDlSch
8655 * @param [in] RgSchCellCb *cell
8661 PRIVATE Void rgSchTomTtiDlSch
8666 PRIVATE Void rgSchTomTtiDlSch (cell)
8670 TRC2(rgSchTomTtiDlSch);
8672 if (cell->isDlDataAllwd && (cell->stopDlSch == FALSE))
8674 rgSCHCmnDlSch(cell);
8680 /** @brief This function invokes Consolidates the allocations
8681 * send the Subframe allocation info to MAC
8685 * Function: rgSchTomTtiCnsldtSfAlloc
8687 * @param [in] RgSchCellCb *cell
8693 PRIVATE Void rgSchTomTtiCnsldtSfAlloc
8698 PRIVATE Void rgSchTomTtiCnsldtSfAlloc (cell)
8703 RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
8705 dlSf = rgSCHUtlSubFrmGet(cell, cellSch->dl.time);
8707 TRC2(rgSchTomTtiCnsldtSfAlloc);
8709 /* Prepare Subframe allocation info and send to MAC */
8710 rgSCHCmnCnsldtSfAlloc(cell);
8712 /* Call ACK NACK module to add to dlsf Queue */
8713 rgSCHAckNakRepAddToQ(cell, dlSf);
8715 rgSCHTomUtlProcTA(cell);
8720 /** @brief This function prepares the DL and UL Config requests
8725 * Function: rgSchTomTtiL1DlAndUlCfg
8727 * @param [in] RgSchCellCb *cell
8733 PRIVATE Void rgSchTomTtiL1DlAndUlCfg
8736 RgTfuCntrlReqInfo *cntrlInfo
8739 PRIVATE Void rgSchTomTtiL1DlAndUlCfg (cell, cntrlInfo)
8741 RgTfuCntrlReqInfo *cntrlInfo;
8744 RgSchDlSf *dlSf = rgSCHUtlSubFrmGet (cell, cell->dlDciTime);
8745 RgSchDlSf *ulSf = rgSCHUtlSubFrmGet (cell, cell->hiDci0Time);
8748 TRC2(rgSchTomTtiL1DlAndUlCfg);
8750 rgSCHTomUtlProcDlSf (dlSf, ulSf, cell, cntrlInfo, &err);
8751 /* Mark this frame as sent */
8752 dlSf->txDone = TRUE;
8754 rgBwAlloInfo[dlSf->sfNum] += dlSf->bwAssigned;
8755 rgBwAlcnt[dlSf->sfNum] ++;
8759 rgSCHTomUtlProcTddUlSf(cell);
8761 rgSCHTomUtlProcUlSf (cell, &err);
8767 /** @brief This function prepares does the Downlink subframe re-init and
8768 * Harq DTX processing
8772 * Function: rgSchTomUtlTddRlsSfAndHarq
8774 * @param [in] RgSchCellCb *cell
8780 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq
8785 PRIVATE Void rgSchTomUtlTddRlsSfAndHarq (cell)
8789 TRC2(rgSchTomUtlTddRlsSfAndHarq);
8791 /* ccpu00132341-MOD- rgSchTddRlsDlSubfrmTbl is dependent on DELTA(=2).
8792 * Instead rgSchTddDlAscSetIdxKTbl can be used as the K set gives proper
8794 /* ccpu00133109: Removed RGSCHSUBFRMCRNTTIME as it is not giving proper
8795 * output if diff is more than 10. Instead using RGSCHDECRFRMCRNTTIME()
8796 * as it is serving the purpose */
8797 if(rgSchTddDlAscSetIdxKTbl[cell->ulDlCfgIdx][cell->hqRlsTime.subframe].
8800 /* ccpu00132341-MOD- Providing the UL SF timing for avoiding
8801 * calculation inside the function */
8802 rgSCHDhmTddRlsSubFrm(cell, cell->hqRlsTime);
8803 rgSCHDhmRlsDlsfHqProc(cell, cell->hqRlsTime);
8808 /** @brief This function processes the UL subframe and fills TFU reception
8813 * Function: rgSCHTomUtlProcTddUlSf
8815 * @param [in] RgSchCellCb *cell
8821 PRIVATE Void rgSCHTomUtlProcTddUlSf
8826 PRIVATE Void rgSCHTomUtlProcTddUlSf (cell)
8832 TRC2(rgSCHTomUtlProcTddUlSf);
8834 if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8835 [cell->rcpReqTime.subframe] == RG_SCH_TDD_UL_SUBFRAME)
8837 if (rgSCHTomUtlProcUlSf (cell, &err) != ROK)
8839 /* fill in err type and call sta ind */
8840 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8841 "Unable to process Uplink subframe for cellId (%d))\n",
8845 /* TDD Fix , to allow Special SF SRS CFg */
8846 else if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx]
8847 [cell->rcpReqTime.subframe] == RG_SCH_TDD_SPL_SUBFRAME)
8849 if (rgSCHTomUtlPrcUlTddSpclSf(cell, &err) != ROK)
8851 /* fill in err type and call sta ind */
8852 RGSCHDBGERRNEW(cell->instIdx, (rgSchPBuf(cell->instIdx),
8853 "Unable to process Sipceial subframe for cellId (%d))\n",
8863 /**********************************************************************
8866 **********************************************************************/