ef53ab293877defca9c58d6d24150b55cf59c2a9
[o-du/l2.git] / src / 5gnrsch / rg_sch_cmn.x
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /**********************************************************************
20  
21     Name:   LTE MAC SC1 scheduler
22  
23     Type:   C include file
24  
25     Desc:   Defines required by SC1 scheduler
26  
27     File:   rg_sch_cmn.x
28  
29 **********************************************************************/
30 /** @file rg_sch_cmn.x
31 @brief This file contains data structures for the common module of the scheuler.
32 */
33
34 #ifndef __RGSCHCMNX__
35 #define __RGSCHCMNX__
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41 /*-------------------------------------*
42  * Common Scheduler DataStructure START
43  *-------------------------------------*/
44 typedef struct _rgDlSchdApis   RgDlSchdApis;
45 typedef struct _rgUlSchdApis   RgUlSchdApis;
46 typedef struct _rgDlfsSchdApis RgDlfsSchdApis;
47 typedef Void (*RgDlSchdInits[RGSCH_NUM_SCHEDULERS]) ARGS((RgDlSchdApis *apis));
48 typedef Void (*RgUlSchdInits[RGSCH_NUM_SCHEDULERS]) ARGS((RgUlSchdApis *apis));
49 typedef Void (*RgDlfsSchdInits[RGSCH_NUM_SCHEDULERS]) ARGS((RgDlfsSchdApis *apis));
50 #ifdef EMTC_ENABLE
51 typedef struct _rgDlEmtcSchdApis   RgDlEmtcSchdApis;
52 typedef Void (*RgEmtcDlSchdInits[RGSCH_NUM_EMTC_SCHEDULERS]) ARGS((RgDlEmtcSchdApis *apis));
53 typedef Void (*RgEmtcUlSchdInits[RGSCH_NUM_EMTC_SCHEDULERS]) ARGS((RgUlSchdApis *apis));
54 #endif
55 typedef struct rgSchCmnDlRbAllocInfo RgSchCmnDlRbAllocInfo;
56 typedef struct rgSchCmnUeUlAlloc RgSchCmnUeUlAlloc;
57 typedef struct rgSchCmnUlRbAllocInfo RgSchCmnUlRbAllocInfo;
58
59 /**
60   * @brief
61   * Uplink Scheduler APIs.
62   */
63 struct _rgUlSchdApis
64 {
65    S16 (*rgSCHRgrUlUeCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgrUeCfg *cfg, 
66                                                      RgSchErrInfo *err));
67    S16 (*rgSCHRgrUlUeRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgrUeRecfg *recfg, 
68                                                      RgSchErrInfo *err));
69    Void (*rgSCHFreeUlUe) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
70    S16 (*rgSCHRgrUlCellCfg) ARGS((RgSchCellCb *cell, RgrCellCfg *cfg, 
71                                                      RgSchErrInfo *err));
72    S16 (*rgSCHRgrUlCellRecfg) ARGS((RgSchCellCb *cell, RgrCellRecfg *recfg, 
73                                                      RgSchErrInfo *err));
74    Void (*rgSCHFreeUlCell) ARGS((RgSchCellCb *cell));
75    S16 (*rgSCHRgrUlLcgCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
76          RgSchLcgCb *lcg, RgrLcgCfg *cfg, RgSchErrInfo *errInfo));
77    S16 (*rgSCHRgrUlLcCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
78          RgrLchCfg *cfg, RgSchErrInfo *errInfo));
79    S16 (*rgSCHRgrUlLcgRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
80          RgSchLcgCb *lcg, RgrLcgRecfg *recfg, RgSchErrInfo *errInfo));
81    S16 (*rgSCHRgrUlLcRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
82          RgrLchRecfg *recfg, RgSchErrInfo *errInfo));
83    Void (*rgSCHFreeUlLcg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchLcgCb *lcg));
84    S16 (*rgSCHRgrUlLchDel) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, CmLteLcId lcId, uint8_t lcgId));
85    Void (*rgSCHUlActvtUe) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
86    Void (*rgSCHUpdBsrShort) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchLcgCb *ulLcg, uint8_t bsr));
87    Void (*rgSCHUpdBsrTrunc) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchLcgCb *ulLcg, uint8_t bsr));
88    Void (*rgSCHUpdBsrLong) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, uint8_t bsArr[]));
89    Void (*rgSCHContResUlGrant) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
90    Void (*rgSCHSrRcvd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
91    Void (*rgSCHUlSched) ARGS((RgSchCellCb *cell, RgSchCmnUlRbAllocInfo
92             *allocInfo));
93    Void (*rgSCHUlRetxSched) ARGS((RgSchCellCb *cell, RgSchCmnUlRbAllocInfo  *allocInfo));
94    Void (*rgSCHUlCqiInd) ARGS(( RgSchCellCb *cell, RgSchUeCb *ue, TfuUlCqiRpt *ulCqiInfo));
95    S16 (*rgSCHRgrUlLcgUpd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgInfUeDatInd *datInd));
96    Void (*rgSCHUlUeRefresh) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
97    Void (*rgSCHUlUeReset) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
98    Void (*rgSCHUlAllocFnlz) ARGS((RgSchCellCb *cell, RgSchCmnUlRbAllocInfo
99                                  *allocInfo));
100    Void (*rgSCHUlInactvtUes) ARGS((RgSchCellCb *cell, CmLListCp *lst));
101 #ifdef EMTC_ENABLE
102    Void (*rgSCHUlProcAddToRetx) ARGS((RgSchCellCb *cell,RgSchUlHqProcCb *hqP));
103    S16 (*rgSCHUlUeHqEntInit) ARGS((RgSchCellCb *cell, RgUeUlHqCb  *hqE));
104    S16 (*rgSCHUlUeHqEntDeInit) ARGS((RgSchCellCb *cell, RgUeUlHqCb  *hqE));
105 #endif
106 };
107 #ifdef EMTC_ENABLE
108 /**
109   * @brief
110   * DL Scheduler APIs For EMTC.
111   */
112 struct _rgDlEmtcSchdApis
113 {
114    S16 (*rgSCHRgrDlUeCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgrUeCfg *cfg, 
115                                                      RgSchErrInfo *err));
116    S16 (*rgSCHRgrDlUeRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgrUeRecfg *recfg, 
117                                                      RgSchErrInfo *err));
118    Void (*rgSCHFreeDlUe) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
119    S16 (*rgSCHRgrDlCellCfg) ARGS((RgSchCellCb *cell, RgrCellCfg *cfg, 
120                                                      RgSchErrInfo *err));
121    S16 (*rgSCHRgrDlCellRecfg) ARGS((RgSchCellCb *cell, RgrCellRecfg *recfg, 
122                                                      RgSchErrInfo *err));
123    Void (*rgSCHFreeDlCell) ARGS((RgSchCellCb *cell));
124    S16 (*rgSCHRgrDlLcCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
125          RgSchDlLcCb *dl, RgrLchCfg *cfg, 
126          RgSchErrInfo *errInfo));
127    S16 (*rgSCHRgrDlLcRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
128          RgSchDlLcCb *dl, RgrLchRecfg *recfg,
129          RgSchErrInfo *errInfo));
130    Void (*rgSCHFreeDlLc) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchDlLcCb *dlLc));
131    Void (*rgSCHDlActvtUe) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
132    Void (*rgSCHDlNewSched) ARGS((RgSchCellCb *cell, RgSchEmtcDlSf *cntrlDlsf,RgSchEmtcDlSf *datDlsf));
133    Void (*rgSCHDlPreSched) ARGS((RgSchCellCb *cell));
134    Void (*rgSCHDlPstSched) ARGS((Inst schInst));
135    Void (*rgSCHDlRetxSched) ARGS((RgSchCellCb *cell, RgSchEmtcDlSf *cntrlDlsf, RgSchEmtcDlSf *datDlsf));
136    Void (*rgSCHDlCeSched) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo *allocInfo));
137    Void (*rgSCHDlDedBoUpd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchDlLcCb *svc));
138    Void (*rgSCHDlProcAddToRetx) ARGS((RgSchCellCb *cell,RgSchDlHqProcCb *hqP));
139    Void (*rgSCHDlCqiInd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, Bool isPucchInfo, Void *dlCqi));
140    #ifdef TFU_UPGRADE
141    Void (*rgSCHSrsInd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, TfuSrsRpt*srsInd));
142    #endif 
143    Void (*rgSCHDlAllocFnlz) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo
144                                  *allocInfo));
145    Void (*rgSCHDlUeRefresh) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
146    Void (*rgSCHDlUeReset) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
147    Void (*rgSCHDlInactvtUes) ARGS((RgSchCellCb *cell, CmLListCp *lst));
148
149    S16 (*rgSCHDlUeHqEntInit) ARGS((RgSchCellCb *cell, RgSchDlHqEnt *hqE));
150
151    S16 (*rgSCHDlUeHqEntDeInit) ARGS((RgSchCellCb *cell, RgSchDlHqEnt *hqE));
152    Void (*rgSCHDlProcRmvFrmRetx) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchDlHqProcCb *hqP));
153 #ifdef LTE_ADV
154    S16 (*rgSCHRgrSCellDlUeCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, 
155                                                      RgSchErrInfo *err));
156    S16 (*rgSCHRgrSCellDlUeDel) ARGS((RgSchUeCellInfo *sCellInfo, RgSchUeCb *ue));
157    S16 (*rgSCHDlSCellDeactv) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
158    S16 (*rgSCHDlSCellActv) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
159 #endif
160    Void (*rgSCHDlTickForPdbTrkng ) ARGS((RgSchCellCb *cell));
161    S16  (*rgSCHDlFillFlwCtrlInfo) ARGS((RgSchCellCb *cell, RgInfSfAlloc *sfAlloc));
162 };
163
164 #endif
165 /**
166   * @brief
167   * DL Scheduler APIs.
168   */
169 struct _rgDlSchdApis
170 {
171    S16 (*rgSCHRgrDlUeCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgrUeCfg *cfg, 
172                                                      RgSchErrInfo *err));
173    S16 (*rgSCHRgrDlUeRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgrUeRecfg *recfg, 
174                                                      RgSchErrInfo *err));
175    Void (*rgSCHFreeDlUe) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
176    S16 (*rgSCHRgrDlCellCfg) ARGS((RgSchCellCb *cell, RgrCellCfg *cfg, 
177                                                      RgSchErrInfo *err));
178    S16 (*rgSCHRgrDlCellRecfg) ARGS((RgSchCellCb *cell, RgrCellRecfg *recfg, 
179                                                      RgSchErrInfo *err));
180    Void (*rgSCHFreeDlCell) ARGS((RgSchCellCb *cell));
181    S16 (*rgSCHRgrDlLcCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
182          RgSchDlLcCb *dl, RgrLchCfg *cfg, 
183          RgSchErrInfo *errInfo));
184    S16 (*rgSCHRgrDlLcRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
185          RgSchDlLcCb *dl, RgrLchRecfg *recfg,
186          RgSchErrInfo *errInfo));
187    Void (*rgSCHFreeDlLc) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchDlLcCb *dlLc));
188    Void (*rgSCHDlActvtUe) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
189    Void (*rgSCHDlNewSched) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo *allocInfo));
190    Void (*rgSCHDlPreSched) ARGS((RgSchCellCb *cell));
191    Void (*rgSCHDlPstSched) ARGS((Inst schInst));
192    Void (*rgSCHDlRetxSched) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo *allocInfo));
193    Void (*rgSCHDlCeSched) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo *allocInfo));
194    Void (*rgSCHDlDedBoUpd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchDlLcCb *svc));
195    Void (*rgSCHDlProcAddToRetx) ARGS((RgSchCellCb *cell,RgSchDlHqProcCb *hqP));
196    Void (*rgSCHDlCqiInd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, Bool isPucchInfo, Void *dlCqi));
197    #ifdef TFU_UPGRADE
198    Void (*rgSCHSrsInd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, TfuSrsRpt*srsInd));
199    #endif 
200    Void (*rgSCHDlAllocFnlz) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo
201                                  *allocInfo));
202    Void (*rgSCHDlUeRefresh) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
203    Void (*rgSCHDlUeReset) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
204    Void (*rgSCHDlInactvtUes) ARGS((RgSchCellCb *cell, CmLListCp *lst));
205
206    S16 (*rgSCHDlUeHqEntInit) ARGS((RgSchCellCb *cell, RgSchDlHqEnt *hqE));
207
208    S16 (*rgSCHDlUeHqEntDeInit) ARGS((RgSchCellCb *cell, RgSchDlHqEnt *hqE));
209    Void (*rgSCHDlProcRmvFrmRetx) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgSchDlHqProcCb *hqP));
210 #ifdef LTE_ADV
211    S16 (*rgSCHRgrSCellDlUeCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue, 
212                                                      RgSchErrInfo *err));
213    S16 (*rgSCHRgrSCellDlUeDel) ARGS((RgSchUeCellInfo *sCellInfo, RgSchUeCb *ue));
214    S16 (*rgSCHDlSCellDeactv) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
215    S16 (*rgSCHDlSCellActv) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
216 #endif
217    Void (*rgSCHDlTickForPdbTrkng ) ARGS((RgSchCellCb *cell));
218    S16  (*rgSCHDlFillFlwCtrlInfo) ARGS((RgSchCellCb *cell, RgInfSfAlloc *sfAlloc));
219 };
220
221 /**
222   * @brief
223   * DLFS Scheduler APIs.
224   */
225 struct _rgDlfsSchdApis
226 {
227    S16 (*rgSCHDlfsCellCfg) ARGS((RgSchCellCb *cell, RgrCellCfg *cfg, 
228                                                      RgSchErrInfo *err));
229    S16 (*rgSCHDlfsCellRecfg) ARGS((RgSchCellCb *cell, RgrCellRecfg *recfg, 
230                                                      RgSchErrInfo *err));
231    Void (*rgSCHDlfsCellDel) ARGS((RgSchCellCb *cell));
232    S16 (*rgSCHDlfsUeCfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
233                                RgrUeCfg *cfg, RgSchErrInfo *err));
234    S16 (*rgSCHDlfsUeRecfg) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
235                                  RgrUeRecfg *recfg, RgSchErrInfo *err));
236    Void (*rgSCHDlfsUeDel) ARGS((RgSchCellCb *cell, RgSchUeCb *ue));
237    Void (*rgSCHDlfsDlCqiInd) ARGS((RgSchCellCb *cell, RgSchUeCb *ue,
238                                   Bool isPucchInfo,
239                                   Void *dlCqiRpt, 
240                                   CmLteTimingInfo timingInfo));
241    Void (*rgSCHDlfsReinitSf) ARGS((RgSchCellCb *cell, RgSchDlSf *dlSf));
242    Void (*rgSCHDlfsAllocRb) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo
243                                  *dlRbAllocInfo));
244    /* Added for BCCH/PCCH handling */
245    Void (*rgSCHDlfsBcchPcchAllocRb) ARGS((RgSchCellCb *cell, RgSchCmnDlRbAllocInfo *dlRbAllocInfo));
246    Void (*rgSCHDlfsAddUeToLst) ARGS((RgSchCellCb *cell, CmLListCp *lCp, RgSchDlHqProcCb *hqP));
247 #ifdef LTE_ADV
248    S16 (*rgSCHDlfsSCellUeCfg) ARGS((RgSchCellCb *sCell, RgSchUeCb *ueCb, RgrUeSecCellCfg *sCellCfg,RgSchErrInfo *err));
249    S16 (*rgSCHDlfsSCellUeDel) ARGS((RgSchCellCb *sCell, RgSchUeCb *ueCb));
250 #endif
251 };
252
253 typedef enum rgSchCmnTpcAccVal
254 {
255    RG_SCH_CMN_TPC_ACC_NEG_1DB = 0,
256    RG_SCH_CMN_TPC_ACC_0DB     = 1,
257    RG_SCH_CMN_TPC_ACC_1DB     = 2,
258    RG_SCH_CMN_TPC_ACC_3DB     = 3
259 } RgSchCmnTpcAccVal;
260
261 typedef enum rgSchCmnTpcAbsVal
262 {
263    RG_SCH_CMN_TPC_ABS_NEG_4DB = 0,
264    RG_SCH_CMN_TPC_ABS_NEG_1DB = 1,
265    RG_SCH_CMN_TPC_ABS_1DB     = 2,
266    RG_SCH_CMN_TPC_ABS_4DB     = 3
267 } RgSchCmnTpcAbsVal;
268 /* Added changes of TFU_UPGRADE */
269 #ifdef TFU_UPGRADE
270 typedef enum rgSchCmnRank
271 {
272    RG_SCH_CMN_RANK_1 = 1,
273    RG_SCH_CMN_RANK_2 = 2,
274    RG_SCH_CMN_RANK_3 = 3,
275    RG_SCH_CMN_RANK_4 = 4
276 } RgSchCmnRank;
277 #endif
278
279 typedef struct rgSchCmnUlCqiInfo
280 {
281    uint8_t  qm;
282    uint16_t eff;      /* Efficiency in terms of bits/RE */
283 } RgSchCmnUlCqiInfo;
284
285 RgSchCmnUlCqiInfo rgSchCmnUlCqiTbl[RG_SCH_CMN_UL_NUM_CQI];
286 S8 rgSchCmnDlCqiDiffOfst[8];
287 /* Added changes of TFU_UPGRADE */
288 #ifdef TFU_UPGRADE
289 S8 rgSchCmnApUeSelDiffCqi[4];
290 S8 rgSchCmnApEnbConfDiffCqi[4];
291 #endif 
292
293
294 uint8_t rgSchCmnUlCqiToTbsTbl[RG_SCH_CMN_MAX_CP][RG_SCH_CMN_UL_NUM_CQI];
295
296 #if (LTEMAC_SPS & LTE_TDD)
297 /* subframe offset values to be used when twoIntervalsConfig is enabled in UL
298  * SPS for a UE */
299 typedef S8 RgSchTddSfOffTbl[RGSCH_MAX_TDD_UL_DL_CFG][RGSCH_NUM_SUB_FRAMES];
300 RgSchTddSfOffTbl rgSchTddSfOffTbl;
301
302 #endif /* LTEMAC_SPS & LTE_TDD */
303
304 /*--------------------------*
305  * SPS specific declarations 
306  *---------------------------*/
307 #ifdef LTEMAC_SPS
308
309 /**
310   * @brief
311   * Downlink SPS scheduling information per UE
312   */
313 typedef struct  rgSchCmnSpsDlUeSchdInfo
314 {
315    uint8_t              scaledCqi;    /*!< Assumed value of CQI for transmission */
316    uint16_t             actvSfTblIdx; /*!< Index into cell-wide DL SPS sub-frame 
317                                       table during activation */
318    CmLteTimingInfo schdKey;      /*!< Key into the list of DL SPS active 
319                                       UEs: next DL SPS ocassion */
320    RgSchDlRbAlloc  spsAllocInfo; /*!< Allocation information for an SPS active
321                                       UE */
322    uint8_t              allocN1PucchIdx;  /*!< Index value in UE's n1Pucch array 
323                                       of the allocated n1Pucch */
324    //Bool            pdcchPndng;      /*!< Indicates if the activaton/
325     //                                     reactivation PDCCH needs to be sent 
326     //                                     for this allocation */
327 } RgSchCmnSpsDlUeSchdInfo;
328
329 /**
330   * @brief
331   * Downlink stats information for SPS per UE
332   */
333 typedef struct rgSchCmnDlUeSpsStatInfo
334 {
335    uint32_t      numSchedSPSRnti;  /*!< Number of SPS occasions sched using SPS RNTI*/
336    uint32_t      totalSPSSchedOcc; /*!< Number of SPS occasions sched 
337                                      using SPS RNTI + CRNTI*/
338    uint32_t      numSpsReactv;     /*!< Number of Reactivations */
339    uint32_t      numSpsActv;       /*!< Number of activations */
340    uint32_t      numSpsRel;        /*!< Number of Deactivations */
341 }RgSchCmnDlUeSpsStatInfo;
342
343 /**
344   * @brief
345   * Downlink information for SPS per UE
346   */
347 typedef struct rgSchCmnDlUeSpsInfo
348 {
349    CmLteTimingInfo prevDlBoUpdTm; /*!< BO updation interval*/
350    CmLList        zeroBOSvcUesEnt;    /*!< Linked list entity for zeroBOSvcUes lst */ 
351    CmLList        actvUeLstEnt; /*!< Linked List entry for DL SPS
352                                        active UE list*/
353    CmLList        pndngUeLstEnt;/*!< Linked List entry for UE list with
354                                       pending SPS action:
355                                       activation/reactivation/release */
356   /* Added handling to retrnasmit RelPDCCH in case no
357                      feedback is received */
358    CmLList        wtngForRelFdbkUeEnt;/*!< Linked list entry for UE who
359                                           have a feedback pending for
360                                           Release PDCCH */
361    RgSchDlLcCb    *spsSvc;       /*!< Pointer to the SPS service of the 
362                                       UE */
363    CmLListCp      *spsList; /*!< Pointer to the SPS list of which
364                                       UE is a part */
365    uint32_t             measGapMask[RG_SCH_CMN_SPS_DL_MEASGAP_32BITMASK_SIZE]; 
366                                  /*!< Indicates the DL sub-frames with 
367                                       ongoing measurement gap */
368    uint16_t            n1PucchIdx[RG_SCH_CMN_SPS_DL_MAX_N1PUCCH_IDX_PER_UE]; 
369                                  /*!< N1Pucch indices configured for the UE */
370    uint8_t             actionPndng;   /*!< Indicates the action pending on the UE
371                                       activation/re-activation/release */
372    uint8_t             dlSpsStatus;     /*!< Indicates the current status of DL SPS */
373    uint8_t             prdIdx;        /*!< DL SPS periodicity index for the
374                                       configured peridicity */
375    RgSchCmnSpsDlUeSchdInfo dlSpsUeSchdInfo; /*!< Scheduled info for DL SPS 
376                                                  active UE */  
377    Bool           isRelPdcchSent; /*!< Indicates if release PDCCH is sent for
378                                        this UE. For TDD, Used while sending DAI
379                                        in DCI formats 0/1/1A/1B/1D/2/2A. 
380                                        For FDD, used to not repeat relPdcch 
381                                        till the feddback is recieved */
382    uint8_t             numRelPdcchSent; /*!< Number of times RelPdcch has been sent. */
383
384    RgSchCmnDlUeSpsStatInfo statInfo; /*!< SPS Metric Info */
385    uint8_t             dynSchedCount; /*!< To track num of consecutive times SPS BO
386                                                             is sched dynamically */
387    uint8_t             reducedBoCount; /*!< To track num of consecutive times BO
388                                                             is lesser than SPS BO */                                                         
389    uint32_t             maxChgdBo;    /* !< The Maximum of BO which is different from the 
390                                                             BO for which SPS has been activated */
391    uint32_t            spsSchedBo;    /* !< BO for which SPS is activated */
392    Bool           isDynSched;    /* !< BO is dynamically scheduled */
393 } RgSchCmnDlUeSpsInfo;
394
395 /**
396   * @brief
397   * Downlink information for SPS per Cell
398   */
399 typedef struct rgSchCmnSpsDlSf
400 {
401   uint32_t rbsAlloc;         /*!< Allocated BW for this subframe (in actual number of
402                              RBs) */ 
403   RgSchDlSfAllocInfo spsAllocInfo; /*!< Allocation information for SPS BW */
404   uint32_t n1PucchMask[RG_SCH_CMN_SPS_DL_N1PUCCH_32BITMASK_SIZE]; 
405                         /*!< N1Pucch allocation mask per Sub-frame */
406   uint8_t  numDlSpsActiveUes;   /*!<  number of DL SPS UEs that 
407                                                                   have been activated */
408 } RgSchCmnSpsDlSf;
409
410 /**
411   * @brief
412   * SPS N1Pucch Database for the cell
413   */
414 typedef struct rgSchCmnSpsDlN1Pucch RgSchCmnSpsDlN1Pucch;
415 struct rgSchCmnSpsDlN1Pucch
416 {
417  uint16_t   idx;        /*!< Index in the n1PucchLst */
418  uint16_t   n1PucchVal; /*!< Pucch Value corresponding to the index */
419  uint32_t   numUes;     /*!< Count of UEs with this N1Pucch value configured */
420  uint16_t   next;       /*!< Next available index */
421 };
422
423 /**
424   * @brief
425   * SPS N1Pucch Database for the cell
426   */
427 typedef struct rgSchCmnSpsDlN1PucchDb
428 {
429   uint16_t                   numFreeN1Pucch; /*!< Number of free n1Pucch values */
430   uint16_t                   numInUseN1Pucch; /*!< Number of inUse n1Pucch values
431                                           */
432   RgSchCmnSpsDlN1Pucch  *freeN1PucchStart; /*!< Start for free n1Pucch list */
433   RgSchCmnSpsDlN1Pucch  *inUseN1PucchStart;/*!< Start for in-use n1Pucch list
434                                            */
435   RgSchCmnSpsDlN1Pucch   n1PucchLst[RG_SCH_SPS_DL_MAX_N1PUCCH_PER_SF];
436                                             /*!< List of cell wide n1Pucch
437                                                  values*/
438 } RgSchCmnSpsDlN1PucchDb;
439
440 /**
441   * @brief
442   * Downlink information for SPS per Cell
443   */
444 typedef struct rgSchCmnDlCellSpsInfo
445 {
446   CmLListCp       zeroBOSvcUes;    /*!< List of SPS services which 
447                                        are not sched at SPS Occasion due 
448                                        to zero BO*//* REVANTH_SPS_FIX */
449   CmLListCp       toBeSchdSvcs;    /*!< List of SPS services to be scheduled */
450   CmLListCp       retxHqProcs;     /*!< List of SPS HARQ procs for 
451                                         re-transmission: all the HARQ procs 
452                                         with isSpsSvcSchd = TRUE shall be
453                                         part of this list */
454   CmLListCp       actvDlSpsUeLsts[RG_SCH_CMN_SPS_MAX_PRD];    
455                                  /*!< Array of list of UE control blocks with
456                                       DL SPS activated: index - next time of
457                                       transmission */
458   CmLListCp       toBeActvtdUes; /*!< List of DL SPS UEs with pending 
459                                       activation/re-activation */
460   CmLListCp       toBeRelUes;    /*!< List of DL SPS enabled UEs with release
461                                       pending */
462  /* Added handling when no feedback is received
463                     for the Release PDCCH sent
464   */
465   CmLListCp       wtngForRelFdbkUeLst[RGSCH_NUM_SUB_FRAMES]; /*!< List of DL SPS
466                                                              enabled UEs waiting
467                                                              for feedback for 
468                                                              Release PDCCH sent
469                                                             */
470   uint16_t             spsPrdLcmVal;  /*!< LCM value for all configured
471                                       SPS periodicities: maxVal = 640 for FDD
472                                       and (640 * 3) for TDD */
473   uint8_t              lcmIdx;        /*!< Index value for computed LCM */
474   RgSchCmnSpsDlSf *spsSfTbl;     /*!< DL sub-frame information for the cell*/
475   RgSchCmnSpsDlN1PucchDb n1PucchDb; /*!< Database of configured n1Pucch values
476                                      */  
477 } RgSchCmnDlCellSpsInfo;
478
479 /**
480   * @brief
481   *  Information per uplink SPS allocation
482   */
483 typedef struct rgSchCmnSpsUlAlloc
484 {
485    uint8_t             sbStart;        /*!< Starting subband of the alloc */
486    uint8_t             numSb;          /*!< Num of subbands in the alloc */
487 } RgSchCmnSpsUlAlloc;
488
489 /**
490   * @brief
491   * Uplink information for SPS per subframe
492   */
493 typedef struct rgSchCmnSpsUlSf
494 {
495    uint32_t            ulBwBitMask[RGSCH_SPS_ULBW_MASK_LEN];    /*!< Bitmask indicating the alloc/hole info 
496                                          for SPS BW. Bit set at position 'x'
497                                          indicates subband 'x' is occupied */
498    uint8_t             maskLen;         /*!< Length of ulBwBitMask based on numSb */
499    uint8_t             numUlSpsActiveUes;    /*!< Number of UL SPS Active UEs in this Subframe */
500    RgSchCmnSpsUlAlloc allocInfo;   /*!< Info per SPS Allocation - Used to mark
501                                         previous allocations in a subframe */
502 } RgSchCmnSpsUlSf;
503
504 /**
505   * @brief
506   * Uplink information for SPS per Cell
507   */
508 typedef struct rgSchCmnUlCellSpsInfo
509 {
510    uint8_t              spsSbStart;      /*!< Starting subband of SPS BW */
511    uint8_t              numSpsSb;        /*!< number of subbands for SPS */
512    uint16_t             spsPrdLcmVal;    /*!< LCM value for all configured UL
513                                          SPS periodicities:maxVal = 640 for FDD
514                                          and (640 * 3) for TDD */ 
515    RgSchCmnSpsUlSf *spsSfLst;       /*!< UL subframe information for the cell*/
516    CmLListCp       actvUlSpsUeLsts[RG_SCH_CMN_SPS_MAX_PRD];    
517                                     /*!< Array of list of UeCbs with
518                                          UL SPS activated: index - next time of
519                                          transmission */
520    CmLListCp       toBeActvtdUeLst; /*!< List of ULSPS enabled UEs with pending
521                                          activation */
522    CmLListCp       toBeRelUeLst;    /*!< List of ULSPS enabled UEs with release
523                                          pending */
524 } RgSchCmnUlCellSpsInfo;
525
526
527 #endif
528 /*--------------------------*
529  * SPS specific declarations End 
530  *---------------------------*/
531 /**
532   * @brief
533   * Scheduler uplink scheduling parameters related to random access.
534   */
535 typedef struct rgSchCmnUlCellRa
536 {
537    uint8_t  prmblANumSb; /*!< Number of msg3 RBs to allocate for preamble A */
538    uint8_t  prmblAIMcs;  /*!< Imcs for msg3 when preamble A was used */
539    uint8_t  prmblBNumSb; /*!< Number of msg3 RBs to allocate for preamble B */
540    uint8_t  prmblBIMcs;  /*!< Imcs for msg3 when preamble B was used */
541 } RgSchCmnUlCellRa;
542
543 typedef struct rgSchCmnCellClcITbs
544 {
545    uint8_t       iTbs2Rbs; /*!< iTbs value for 2 Rbs precomputed at cell cfg */ 
546    uint8_t       iTbs3Rbs; /*!< iTbs value for 3 Rbs precomputed at cell cfg */ 
547 }RgSchCmnCellClcITbs;
548
549 typedef struct rgSchCmnDlCell
550 {
551    Bool                isDlFreqSel;  /*!< Bool indicating if cell is frequency 
552                                           selective or not */
553    uint8_t                  maxUeNewTxPerTti; /*!< Max UEs to be considered for New Tx Alloc in DL */
554    uint8_t                  numRaSubFrms; /*!< Number of frames of RA transmission */
555    uint8_t                  iTbsCap;      /*!< Max value DL iTbs capped to */
556    uint16_t                 nCce;         /*!< Number of CCEs computed based on CFI */
557    uint8_t                  maxDlBwPerUe; /*!< Max DL B/W per UE */
558    uint8_t                  maxDlRetxBw;  /*!< Max DL retx B/W, as part of 256 */
559    uint8_t                  maxUePerDlSf;  /*!< Max UE to be considered for DL scheduling
560                                        *   in a TTI */
561    /*[ccpu00138609]-ADD- max Msg4/ DL CCCH UE configuration */                                    
562    uint8_t                  maxCcchPerDlSf; /*!< Max Msg4/DL CCCH UE sched in Dlsf */                                     
563    uint8_t                  msg4TxDelay;  /*!<  Max estimated time for HARQ tx
564                                            of msg4 based on the Harq  RTT and 
565                                            max Harq retries for msg4 */
566    RgSchCmnCellClcITbs cmnChITbs;  /*!< iTbs value for 2 Rbs precomputed at cell cfg */ 
567    CmLteAggrLvl        cmnChAggrLvl; /*!< Precomputed aggregation level for common channel */ 
568    uint8_t                  ccchCqi;      /*!< Default Cqi to be used for Msg4 and UE */
569    CmLListCp           msg4RetxLst;  /*!< Queue to hold Msg4 procs for retransmission */
570    /* Changes for CR timer */
571 #ifdef RGR_V1
572    CmLListCp           ccchSduRetxLst;  /*!< Queue to hold CCCH SDU procs for retransmission */
573 #endif
574 #ifdef EMTC_ENABLE
575    Void                *emtcCqiToTbsTbl[RGSCH_MAX_NUM_LYR_PERCW][RG_SCH_CMN_MAX_CFI]; 
576 #endif   
577    Void                *cqiToTbsTbl[RGSCH_MAX_NUM_LYR_PERCW][RG_SCH_CMN_MAX_CFI]; 
578    /* cqi to Tbs tables for each 1 and 2 layer TbSz table */
579                                         /*!< CQI to efficiency translation */
580    Void                *cqiToEffTbl[RGSCH_MAX_NUM_LYR_PERCW][RG_SCH_CMN_MAX_CFI]; 
581    uint8_t                  newCfi;          /*!< New CFI value */
582    uint8_t                  currCfi;         /*!< Current CFI value */
583                                         
584    uint16_t                 noResPerRb[RG_SCH_CMN_MAX_CFI]; /*!< Num REs per RB */   
585    CmLteTimingInfo     time;         /*!< Timing info for current allocation */
586    Void                *schSpfc;     /*!< Scheduler Specific Cell DL dereferencing */
587    Void                *dlfsCell;    /*!< DLFS specific information per cell */
588    CmLListCp           taLst;        /*!< TA queues, holds the UEs for which TA 
589                                         has to be scheduled */
590 #ifdef LTEMAC_SPS
591    RgSchCmnDlCellSpsInfo dlSpsInfo; /*!< DL SPS info for the cell */
592 #endif
593    /* Member to store no. of Bits per RB */
594    uint32_t                 bitsPerRb;   /*!< Bits per RB calculated from
595                                       BcchPcchRaRsp Code rate configured through
596                                       RGR */
597 #ifdef LTE_TDD                                      
598    uint16_t                 numReDwPts[RG_SCH_CMN_MAX_CFI-1];  /*!< Num of RE in DwPTS RB */
599    uint8_t                  splSfCfg;    /*!<Stores the special subframe cfg */  
600 #endif   
601
602    /* ccpu00132314-ADD-Tx power offsets for Common PDSCH transmissions */                                   
603    uint16_t                 bcchTxPwrOffset; /*!< Tx Pwr Offset for BCCH tx on PDSCH.
604                                              Offset to the reference signal 
605                                              power. Value: 0 -> 10000, 
606                                              representing -6 dB to 4 dB in 0.001
607                                              dB steps */                                    
608    uint16_t                 pcchTxPwrOffset; /*!< Tx Pwr Offset for PCCH tx.
609                                              Offset to the reference signal 
610                                              power. Value: 0 -> 10000, 
611                                              representing -6 dB to 4 dB in 0.001
612                                              dB steps */                                    
613    uint16_t                 rarTxPwrOffset; /*!< Tx Pwr Offset for RAR tx.
614                                              Offset to the reference signal 
615                                              power. Value: 0 -> 10000, 
616                                              representing -6 dB to 4 dB in 0.001
617                                              dB steps */                                    
618   /* ccpu00138898 - Added Tx pwr offset for PHICH Tx*/
619    uint16_t                 phichTxPwrOffset; /*!< Tx Pwr Offset for PHICH tx.
620                                              Offset to the reference signal 
621                                              power. Value: 0 -> 10000, 
622                                              representing -6 dB to 4 dB in 0.001
623                                              dB steps */                                    
624    uint32_t          ncsgPrbCnt; /*!< Cumulative sum of PDSCH PRBs assigned to non-Csg UEs */
625    uint32_t          totPrbCnt; /*!< Cumulative sum of PDSCH PRBs assigned to all UEs */
626    RgrUeDlPwrCntrlPaCfg msg4pAVal;      /*!< Default value (Enum) of PA that is 
627                                           used by Scheduler for msg4 */
628 #ifdef LTE_ADV
629    CmLListCp           secCellActCeLst; /*!< List for holding the UE's
630                                            for which sec cell act CE's needs to scheduled */ 
631                                             
632 #endif
633 #ifdef EMTC_ENABLE
634    CmLListCp           emtcTaLst;        /*!< TA queues, holds the EMTC UEs for which TA 
635                                         has to be scheduled */
636    Void                *schSpfcEmtc;     /*!< Scheduler Specific Cell DL dereferencing */
637 #endif
638 } RgSchCmnDlCell;
639
640 /**
641   @brief Information related to TPC-PUCCH-RNTI/TPC-PUSCH-RNTI. */
642 typedef struct rgSchCmnTpcRntiCb
643 {
644    CmLteRnti  tpcRnti;       /*!< TPC-PUCCH-RNTI/TPC-PUSCH-RNTI*/
645    Bool       isFmt3a;       /*!< DCI format type: 3/3A */
646    CmLListCp  toBeSchdUes;   /*!< List of UEs requiring power adjustment 
647                                for this TPC-RNTI */
648    CmLListCp  cfgdUes;         /*!< List of UEs */
649    CmLList    schdLnk;     /*!< Link to the list of TPC RNTIs to be
650                                   scheduled */
651 } RgSchCmnTpcRntiCb;
652
653 /**
654   @brief Uplink Power control related information per cell. */
655 typedef struct rgSchCmnUlPwrCb 
656 {
657    uint8_t                tpcPucchRntiCnt;/*!< Count of TPC-PUCCH-RNTIs for the cell */
658    RgSchCmnTpcRntiCb tpcPucchRntiLst[RG_SCH_CMN_MAX_NUM_TPC_PUCCH_RNTI];
659                                      /*!< List of TPC-PUCCH-RNTIs */
660    uint8_t                tpcPuschRntiCnt;/*!< Count of TPC-PUSCH-RNTIs for the cell */
661    RgSchCmnTpcRntiCb tpcPuschRntiLst[RG_SCH_CMN_MAX_NUM_TPC_PUSCH_RNTI];
662                                      /*!< List of TPC-PUSCH-RNTIs */
663    CmLListCp         pucchGrpPwr;    /*!< List of TPC-PUCCH-RNTIs for PUCCH group
664                                        power control: 'RgSchCmnTpcRntiCb' */
665    CmLListCp         puschGrpPwr;    /*!< List of  TPC-PUSCH-RNTIs for PUSCH group 
666                                        power control: 'RgSchCmnTpcRntiCb' */
667    S8                pMax;           /*!< Max allowed uplink power in cell */
668    uint8_t                trgUlCqi;       /*!< Default target CQI */
669 } RgSchCmnUlPwrCb;
670
671 /**
672   * @brief
673   * Cell specific uplink scheduling information for Scheduler type 1.
674   */
675 typedef struct rgSchCmnUlCell
676 {
677    uint8_t               maxUeNewTxPerTti; /*!< Max UEs to be considered for New Tx Alloc in UL */
678    /* Added new variable maxUlBwPerUe */
679    uint8_t               maxUlBwPerUe;      /*!< Max UL BW per UE */
680    uint8_t               maxSbPerUe;      /*!< Max subbands per UE */
681    uint8_t               dfltUlCqi;       /*!< Default uplink CQI assumed intitially */
682    uint8_t               max16qamCqi;     /*!< Highest CQI supporting 16 QAM */
683    uint8_t               maxUlSpsCqi;     /*!< Highest CQI supporting 16 QAM */
684    uint8_t               iTbsCap;         /*!< Max value UL iTbs capped to */
685    uint8_t               sbSize;          /*!< Subband size */
686    uint8_t               dmrsArrSize;     /*!< DMRS array size */
687    uint8_t               *dmrsArr;        /*!< DMRS array */
688    RgSchCmnUlCellRa ra;          /*!< RA related info */
689    uint8_t               idx;             /*!< Current subframe - maps to HARQ process ID */
690    uint8_t               schdIdx;         /*!< Subframe to schedule for */
691    uint8_t               schdHqProcIdx;   /*!< Proc to schedule for */
692    uint8_t               msg3SchdIdx;     /*!< Subframe to schedule for msg3 */
693 #ifdef EMTC_ENABLE
694    RgSchCmnUlCellRa emtcRa;          /*!< RA related info */
695    uint8_t               emtcMsg3SchdIdx;
696    Void             *schSpfcEmtc;        /*!< Scheduler Specific Cell UL dereferencing */
697 #endif
698    uint8_t               msg3SchdHqProcIdx;/*!< Proc to schedule for */
699    uint8_t               rcpReqIdx;       /*!< Subframe to send reception req for */
700    /* ccpu00130688 -MOD- for config-0 changes */
701    uint8_t               hqFdbkIdx[2];    /*!< In FDD only Idx 0 is used. 
702                                           In TDD n+k value is updated at idx 0.
703                                           For TDD Cfg 0 both indices are used */ 
704    uint8_t               reTxIdx[2];      /*!< Retransmission Index corresponding to 
705                                           the hqFdbkIdx */
706 #ifdef LTEMAC_SPS
707    uint8_t               spsUlRsrvIdx;     /*!< Subframe to reserve UL SPS cfgd grant */
708    uint8_t               spsUlRsrvHqProcIdx;/*!< Proc for the cfgd UL SPS grant */
709 #endif
710    CmLteTimingInfo  schdTime;
711 #ifdef LTE_TDD
712    uint8_t               numUlSubfrms;    /*!< Number of UL subframes */
713    RgSchUlSf        *ulSfArr;        /*!< no msg3 alloc info here */
714 #else
715    RgSchUlSf        ulSfArr[RG_SCH_CMN_UL_NUM_SF];      /*!< no msg3 alloc info here */
716 #endif
717    Void             *schSpfc;        /*!< Scheduler Specific Cell UL dereferencing */
718    RgSchCmnUlPwrCb  ulPwrCb;     /*!< Uplink power control block */
719    uint8_t               ulNumRePerRb;  /*!< Number of REs per RB in UL */
720    /* Added support for non-adaptive retransmission in uplink */
721    uint8_t               maxAllocPerUlSf; /*!< Max Allocations in a given SF */
722 #ifdef RGR_V1
723 /* Added a param to limit msg3 allocations */
724    uint8_t               maxMsg3PerUlSf; /*!< Max msg3 alocs in a given SF */
725 #endif
726
727 #ifdef LTEMAC_SPS
728    RgSchCmnUlCellSpsInfo ulSpsInfo; /*!< UL SPS info for the cell */
729    uint16_t                   schdTti;   /*< 0..1023, corresponding to scheduling time,
730                                      * can theoretically used for non-SPS
731                                      * purposes as well */
732 #endif
733    uint32_t          ncsgPrbCnt; /*!< Cumulative sum of PDSCH PRBs assigned to non-Csg UEs */
734    uint32_t          totPrbCnt; /*!< Cumulative sum of PDSCH PRBs assigned to all UEs */
735    CmLListCp    reTxLst;  /*!< Retransmission List*/
736 } RgSchCmnUlCell;
737
738 /**
739   @brief ACK-NACK repetition related information per cell. */
740 typedef struct rgSchCmnAckNakRepCb 
741 {
742 #ifdef LTE_TDD
743    CmLListCp  ackNakRepQ[2*RGSCH_NUM_SUB_FRAMES];  /*!< ACK NACK repetition queue */
744 #else
745    CmLListCp  ackNakRepQ[RGSCH_NUM_SUB_FRAMES];  /*!< ACK NACK repetition queue */
746 #endif
747 } RgSchCmnAckNakRepCb;
748
749 /**
750   @brief Measurement Gap related information per cell. */
751 typedef struct rgSchCmnMeasGapCb 
752 {
753    CmLListCp  gapPrd40Q[RG_SCH_CMN_MEAS_GAPPRD40]; /*!< Measurement Gap queue
754                                                for UEs with 40 ms gap period */
755    CmLListCp  gapPrd80Q[RG_SCH_CMN_MEAS_GAPPRD80]; /*!< Measurement Gap queue 
756                                                for UEs with 80 ms gap period */
757 } RgSchCmnMeasGapCb;
758
759 /**
760   * @brief
761   * common scheduler specific information for rapId to UE mapping.  */
762 typedef struct rgSchCmnRapIdMap
763 {
764    uint8_t            rapId;
765    CmLListCp     assgndUes;   /*!< List of UEs for which this rapId is 
766                                assigned. */
767 } RgSchCmnRapIdMap;
768
769 /**
770   * @brief
771   * common scheduler specific information for RACH Dedicated Preambles.  */
772 typedef struct rgSchCmnRachCfg
773 {
774    uint8_t                numDedPrm;   /*!< number of configured dedicated prmbls */
775    uint8_t                dedPrmStart; /*!< starting rapId Number */
776    uint8_t                remDedPrm;   /*!< remaining number of ded Prm available
777                                     for the "applFrm" */
778    CmLteTimingInfo   applFrm;     /*!< Frame under consideration for dedPrm
779                                      distribution */
780    uint8_t                prachMskIndx;/*!< Prach Mask Idx corresponding to
781                                       applFrm*/
782    RgSchCmnRapIdMap  rapIdMap[RG_SCH_MAX_DED_PRMBLS]; /*!< mapping of RapId 
783                                                        *   to assigned UEs */
784    CmLListCp         hoUeLst;  /*!< List of UEs undergoing Handover */
785    CmLListCp         pdcchOdrLst;  /*!< Pdcch Order Q, holds the UEs for which
786                                        PO has to be generated. */
787 } RgSchCmnRachCfg;
788
789 /**
790   @brief Uplink Power control related information per UE. */
791 typedef struct rgSchCmnUeUlPwrCb 
792 {
793    Bool              isAccumulated;   /*!< Indicates if power is accumulative or not */
794    Bool              deltaMcsEnbld;   /*!< Indicates if coding effeciency is 
795                                        * considered or not for PUSCH power computation */
796    uint8_t                pucchIdx;        /*!< Index for TPC-PUCCH-RNTI */
797    uint8_t                puschIdx;        /*!< Index for TPC-PUSCH-RNTI */
798    uint8_t                isPhrAvail;      /*!< Indicates if PHR is recieved */
799    S8                phVal;           /*!< Power headroom value in dB */
800    S8                pwrPerRb;        /*!< UL power computed per RB */
801    S8                maxUePwr;        /*!< Maximum power with which UE can transmit */
802    uint8_t                maxUlRbs;        /*!< Maximum number of UL Rbs for UL scheduling */
803    S8                delta;           /*!< Delta corresponding to TPC, for PUSCH */
804    uint8_t                numRb;           /*!< Number of RBs used in last allocation */
805    S8                remPuschPwr;     /*!< PUSCH power remaining to be adjusted
806                                         (in db) */ /* chk if needed */
807    S8                remPucchPwr;     /*!< PUCCH Power remaining to be adjusted (in db) */
808    uint8_t                pucchTpc;        /*!< TPC to be used for PUCCH power control */
809    uint8_t                puschTpc;        /*!< TPC to be used for PUSCH power control */
810    uint8_t                trgCqi;          /*!< Target CQI */
811    RgSchCmnTpcRntiCb *tpcPucchRntiCb; /*!< Pointer to tpcPucchRntiCb for the UE */
812    CmLList           pucchGrpLnk;     /*!< To link together UEs in
813                                        * RgSchCmnTpcRntiCb */
814    CmLList           schdPucchGrpLnk; /*!< To link together scheduled
815                                        * UEs in RgSchCmnTpcRntiCb */
816    RgSchCmnTpcRntiCb *tpcPuschRntiCb; /*!< Pointer to tpcPuschRntiCb for the UE */
817    CmLList           puschGrpLnk;     /*!< To link together UEs in
818                                        * RgSchCmnTpcRntiCb */
819    CmLList           schdPuschGrpLnk; /*!< To link together scheduled
820                                        * UEs in RgSchCmnTpcRntiCb */
821    S8                p0UePusch;         /*!< P_0UE_PUSCH*/
822    S8                p0UePucch;         /*!< P_0_PUCCH*/
823    S8                maxPwrPerRb;
824    S8                maxPwrDeltaByPhr;
825 } RgSchCmnUeUlPwrCb;
826
827 /**
828   @brief Uplink RB allocation information. */
829 struct rgSchCmnUeUlAlloc
830 {
831    /* Request */
832    uint32_t          reqBytes;     /*!< Requested bytes */
833
834    /* Allocation to be filled by UL RB allocator module */
835    uint32_t          allocdBytes;  /*!< Allocated bytes */
836    RgSchUlAlloc *alloc;       /*!< Alloc assgnd by Allocator */
837    CmLList      reqLnk;       /*!< To link UL Tx UEs */
838    CmLList      schdLstLnk;   /*!< To link scheduled/non-scheduled UL UEs */
839 };
840
841 typedef struct rgSchCmnAllocRecord
842 {
843    uint32_t             alloc;      /* allocation amount */
844    CmLteTimingInfo allocTime;  /* Time at which allocation made */
845    CmLList         lnk;        /* To link in ulAllocLst */
846    uint8_t              numRb;      /* Number of RBs */
847    uint8_t              cqi;        /* CQI assumed for allocation */
848    uint8_t              tpc;        /* TPC */
849 }RgSchCmnAllocRecord;
850
851
852 /**
853   * @brief
854   * Uplink Bler LA information for UE
855   */
856 #ifdef UL_LA
857 typedef struct ueUlLaCb 
858 {
859    S32             deltaiTbs;  
860    uint32_t             iTbsUpperCap;
861    S32             cqiBasediTbs;
862    Bool            lastiTbsIgnored;
863 } UeUlLaCb;
864 #endif 
865
866 /**
867   * @brief
868   * Uplink information for scheduler per UE
869   */
870 typedef struct rgSchCmnUlUe
871 {
872    uint8_t                maxUlCqi;        /*!< CQI for which no better Imcs can be granted */
873    uint8_t                crntUlCqi[RG_SCH_MAX_UL_TX_ANT]; /*!< Current CQI */
874 /* Added changes of TFU_UPGRADE */
875 #ifdef TFU_UPGRADE
876    uint8_t                validUlCqi;
877 #endif 
878    uint8_t                lastCfi;          /* last CFI, updated in case of SPS */
879    CmLListCp         ulAllocLst;      /*!< To track the outstanding Allocations 
880                                        *   node type RgSchCmnAllocRecord */
881    
882
883    Void              *schSpfc;        /*!< scheduler specific UE DL Info */
884    RgSchCmnUeUlPwrCb ulPwrCb;         /*!< Uplink power control block */
885    RgSchCmnUeUlAlloc alloc;           /*!< Allocation info */
886 #ifdef SCH_STATS
887    uint32_t            schedOccns;      /*!< Number of scheduling occassions in a refresh period */
888    uint32_t            schedRetxOccns;
889    uint32_t            avgCqi;          /*!< AvgCqi in a refresh period */
890    uint32_t            numCqiOccns;
891    uint32_t            prbAlloc;
892 #endif
893 #ifdef UL_LA
894    UeUlLaCb       ulLaCb;  /*!< Uplink LA structure */
895 #endif
896    RgUeUlHqCb     hqEnt;      /*!< Uplink HARQ information for the UE */
897    uint8_t             subbandShare; /*!< New variable added to store the number
898                                     * of subbands alowed for this UE */
899    uint32_t            subbandRequired; /*!< Number of subbands required to
900                                       * serve the total BO */
901    CmLList        ulSchedLnk; /*!< To link UE UL Cb to toBeSchedList */
902 #ifdef EMTC_ENABLE
903    RgSchUlHqProcCb    *tempProc; /*!< To identify UE is serverd for Retx */
904 #endif
905 #ifdef RG_5GTF
906    uint8_t            vrbgRequired;
907    uint8_t            vrbgAllocated;
908 #endif
909 } RgSchCmnUlUe;
910
911 /**
912   @brief Downlink RB allocation information for Msg4. */
913 typedef struct rgSchCmnMsg4RbAlloc
914 {
915    RgSchDlSf     *msg4DlSf;         /*!< DL sub-frame for which allocation is to
916                                          be done: filled in by RR/MAX C/I/PFS */ 
917    CmLListCp     msg4TxLst;          /*!< List of RgSchDlRbAllocs for Msg4 Tx */ 
918    CmLListCp     msg4RetxLst;        /*!< List of RgSchDlRbAllocs for Msg4 ReTx */ 
919    CmLListCp     schdMsg4TxLst;      /*!< List of Msg4 Txs scheduled per TTI */
920    CmLListCp     schdMsg4RetxLst;    /*!< List of Msg4 ReTxs scheduled in the TTI */
921    CmLListCp     nonSchdMsg4TxLst;   /*!< List of transmitting MSG4 not scheduled in the TTI */
922    CmLListCp     nonSchdMsg4RetxLst; /*!< List of re-transmitting MSG4 not 
923                                           scheduled in the TTI */
924 } RgSchCmnMsg4RbAlloc;
925 #ifdef RGR_V1
926 /* Changes for CR timer implementation*/
927 typedef struct rgSchCmnCcchSduRbAlloc
928 {
929    RgSchDlSf     *ccchSduDlSf;         /*!< DL sub-frame for which allocation is to
930                                          be done: filled in by RR/MAX C/I/PFS */ 
931    CmLListCp     ccchSduTxLst;          /*!< List of RgSchDlRbAllocs for CcchSdu Tx */ 
932    CmLListCp     ccchSduRetxLst;        /*!< List of RgSchDlRbAllocs for CcchSdu ReTx */ 
933    CmLListCp     schdCcchSduTxLst;      /*!< List of CcchSdu Txs scheduled per TTI */
934    CmLListCp     schdCcchSduRetxLst;    /*!< List of CcchSdu ReTxs scheduled in the TTI */
935    CmLListCp     nonSchdCcchSduTxLst;   /*!< List of transmitting MSG4 not scheduled in the TTI */
936    CmLListCp     nonSchdCcchSduRetxLst; /*!< List of re-transmitting MSG4 not 
937                                           scheduled in the TTI */
938 } RgSchCmnCcchSduRbAlloc;
939 #endif
940
941 /**
942   @brief Downlink RB allocation information for UEs. */
943 typedef struct rgSchCmnUeRbAlloc
944 {
945    RgSchDlSf     *dedDlSf;      /*!< DL sub-frame for which dedicated
946                                      allocation is to be done: filled in
947                                      by RR/MAX C/I/PFS */ 
948    CmLListCp     txHqPLst;       /*!< List of HqPs to be scheduled for Tx per 
949                                      TTI: RgSchUeCb list  */
950    CmLListCp     retxHqPLst;     /*!< List of HqPs scheduled for ReTx per 
951                                      TTI: RgSchUeCb list */
952    CmLListCp     errIndTxHqPLst; /*!< LAA SCELL: List of transmitting LAA Err Ind Tx HqPs scheduled per TTI */
953 #ifdef LTEMAC_SPS
954    CmLListCp     retxSpsHqPLst;   /*!< List of SPS HqPs scheduled for ReTx per 
955                                      TTI: RgSchUeCb list */
956    CmLListCp     txSpsHqPLst;     /*!< List of SPS HqPs scheduled for Tx per 
957                                      TTI: RgSchUeCb list */
958 #endif
959    CmLListCp     txLaaHqPLst;     /*!< List of LAA HqPs scheduled on PCell for Tx per
960 TTI*/
961    CmLListCp     schdTxHqPLst;     /*!< List of transmitting HqPs scheduled per TTI */
962    CmLListCp     schdRetxHqPLst;   /*!< List of re-transmitting HqPs scheduled per TTI */
963    CmLListCp     nonSchdTxHqPLst;  /*!< List of transmitting HqPs not scheduled in the TTI */
964    CmLListCp     nonSchdRetxHqPLst;/*!< List of re-transmitting HqPs not scheduled in the TTI */
965 /* Changes for MIMO feature addition */
966    /* MIMO Tx+Retx hqProc scheduling handling */
967    CmLListCp     txRetxHqPLst;   /*!< List of HqPs scheduled for tx and retx per 
968                                      TTI(MIMO case): RgSchUeCb list */
969    CmLListCp     schdTxRetxHqPLst; /*!< List of TX&RETXing(MIMO case) HqPs scheduled per TTI */
970    CmLListCp     nonSchdTxRetxHqPLst; /*!< List of TX&RETXing(MIMO case) HqPs not scheduled in the TTI */
971 #ifdef LTEMAC_SPS
972    CmLListCp     schdRetxSpsHqPLst;   /*!< List of re-transmitting SPS HqPs scheduled per TTI */
973    CmLListCp     nonSchdRetxSpsHqPLst;/*!< List of re-transmitting SPS HqPs 
974                                           not scheduled in the TTI */
975    CmLListCp     schdTxSpsHqPLst;     /*!< List of transmitting SPS HqPs scheduled per TTI */
976    CmLListCp     nonSchdTxSpsHqPLst; /*!< List of transmitting SPS HqPs not scheduled per TTI */
977 #endif
978    CmLListCp     schdTxLaaHqPLst;     /*!< List of transmitting LAA TBs scheduled on PCell per TTI */
979    CmLListCp     nonSchdTxLaaHqPLst; /*!< List of transmitting LAA TBs not scheduled on PCell per TTI */
980    CmLListCp     schdErrIndTxHqPLst;     /*!< List of transmitting LAA ErrInd TBs scheduled per TTI */
981    CmLListCp     nonSchdErrIndTxHqPLst;  /*!< List of transmitting LAA ErrInd not scheduled per TTI */
982 } RgSchCmnUeRbAlloc;
983
984 /**
985   @brief Downlink RB allocation information. */
986 struct rgSchCmnDlRbAllocInfo
987 {
988    RgSchDlRbAlloc      pcchAlloc;  /*!< Allocation for PCCH */
989    RgSchDlRbAlloc      bcchAlloc;  /*!< Allocation for BCCH on DLSCH */
990    RgSchDlRbAlloc      raRspAlloc[RG_SCH_CMN_MAX_CMN_PDCCH]; /*!< Allocation for RAR */
991    RgSchCmnMsg4RbAlloc msg4Alloc;  /*!< Alloction for Msg4  */
992 #ifdef RGR_V1
993    /* Changes for CR timer implementation*/
994    RgSchCmnCcchSduRbAlloc ccchSduAlloc;  /*!< Alloction for ccchSdu  */
995 #endif
996    RgSchCmnUeRbAlloc   dedAlloc;   /*!< Alloction information for UEs */
997 };
998
999 /**
1000   * @brief
1001   * Cell specific common scheduler information for all Scheduler types.
1002   */
1003 typedef struct rgSchCmnCell
1004 {
1005    RgrCfiCfg           cfiCfg;         /*!< CFI for PDCCH */
1006    RgrUlTrgCqiCfg      trgUlCqi;       /*!< Target UL CQI */
1007    CmTqCp              tmrTqCp; /*!< Refresh Timer Task Queue
1008                                  * Control Point */
1009    CmTqType            tmrTq[RG_SCH_CMN_NUM_REFRESH_Q]; /*!< Timer Task Queue */
1010    RgrDlCmnCodeRateCfg dlCmnCodeRate;  /*!< Coding rate for common DL channels: 
1011                                             Expressed in multiples of 1024 */
1012    RgrPuschSubBandCfg  puschSubBand;   /*!< UL subband information */
1013    RgrUlCmnCodeRateCfg ulCmnCodeRate;  /*!< Coding rate for common UL channels: 
1014                                             Expressed in multiples of 1024 */
1015    RgSchCmnRachCfg     rachCfg;    /*!< Rach configuration for schCmn */
1016    RgSchCmnUlCell      ul;         /*!< Scheduler UL info */
1017    RgSchCmnDlCell      dl;         /*!< Scheduler DL info */
1018    RgUlSchdApis        *apisUl;    /*!< Specific UL Scheduler APIs */
1019    RgDlSchdApis        *apisDl;    /*!< Specific DL Scheduler APIs */
1020    RgDlfsSchdApis      *apisDlfs; /*!< APIs specific to DLFS scheduler */
1021 #ifdef EMTC_ENABLE   
1022    RgUlSchdApis        *apisEmtcUl;    /*!< Specific UL Scheduler APIs for EMTC*/
1023    RgDlEmtcSchdApis    *apisEmtcDl;    /*!< Specific DL Scheduler APIs for EMTC*/
1024 #endif   
1025    CmLteAggrLvl        dciAggrLvl[RG_SCH_CMN_MAX_CQI][10]; 
1026                                            /*!< Aggr Level for each CQI for 
1027                                             * each DCI Format */
1028    RgSchCmnDlRbAllocInfo  allocInfo;
1029 }RgSchCmnCell;
1030
1031
1032 /**
1033   * @brief
1034   * RACHO information for scheduler per UE.
1035   */
1036 typedef struct rgSchCmnDlUeRachInfo
1037 {
1038    CmLList         inActUeLnk; /*!< Link UE to PO inactUeList */
1039    CmLList         poLnk;    /*!< To link UE to PDCCH Order Q */
1040    CmLList         hoLnk;    /*!< To link UE to HandOver UE lst */
1041    CmLList         rapIdLnk; /*!< Link to the list assgndUes */
1042    CmLteTimingInfo asgnOppr; /*!< PRACH oppurtunity time assgined to UE */
1043    uint8_t              hoRapId;  /*!< RAPID assigned to UE for HandOver */
1044    uint8_t              poRapId;  /*!< RAPID assigned to UE for PdcchOrder */
1045 }RgSchCmnDlUeRachInfo;
1046
1047
1048 /**
1049   * @brief
1050   * Downlink CodeWord information for scheduler per UE.
1051   */
1052 typedef struct rgSchCmnDlUeCwInfo
1053 {
1054    uint8_t     cqi;     /*!< CQI reported for this CW */
1055    uint8_t     iTbs[2]; /*!< [0]ITBS for CW for 1 Layer,
1056                         corresponding to this CW's cqi. */
1057                    /*!< [1]ITBS for CW for 2 Layer,
1058                         corresponding to this CW's cqi. */
1059    uint32_t    eff[2];  /*!< [0]eff for CW for 1 Layer,
1060                         corresponding to this CW's cqi. */
1061                    /*!< [1]eff for CW for 2 Layer,
1062                         corresponding to this CW's cqi. */
1063    uint8_t     noLyr;   /*!< No. of layers this CW shall be using 
1064                     *   for transmission */
1065    uint16_t    dtxCnt;
1066    uint16_t    ackCnt;
1067    uint16_t    nackCnt;
1068 }RgSchCmnDlUeCwInfo;
1069 /**
1070   * @brief UE cmn scheduler specific MIMO Info.
1071   */
1072 typedef struct rgSchCmnUeMimoInfo
1073 {
1074    RgSchCmnDlUeCwInfo   cwInfo[RG_SCH_CMN_MAX_CW_PER_UE];/*!< Codeword related feddback Information */ 
1075    uint8_t                   ri;       /*!< Maximum allowable number of TX layers for SM */ 
1076    uint8_t                   pmi;      /*!< Precoding matrix indicator(if any) */
1077    uint8_t                   btrCwIdx; /*!< Index of a better(efficient) CW (0 or 1) */ 
1078    uint8_t                   forceTD;  /*!< Flag to indicate transmission scheme as TD
1079                                    *   beyond any other consideration */
1080 }RgSchCmnUeMimoInfo;
1081
1082 typedef struct ueLaCb {
1083    S32                  deltaiTbs;  
1084    uint32_t                  iTbsUpperCap;
1085    S32                  cqiBasediTbs;
1086    Bool                 lastiTbsIgnored;
1087    uint8_t                   notFirstCqi;
1088    uint8_t                   numLastiTbsIgnored;
1089 } UeLaCb;
1090
1091 /**
1092   * @brief
1093   * Downlink information for scheduler per UE.
1094   */
1095 typedef struct rgSchCmnDlUe
1096 {
1097    uint32_t                  maxSbSz;  /*!< Max soft channel bits per Hq proc per TTI */
1098    uint32_t                  maxTbSz;  /*!< Max DLSCH TB bits per TB per TTI */ 
1099    uint8_t                   maxRb;    /*!< updated based on SoftBuffer Limitation and MaxDlBwPerUE */
1100    uint32_t                  maxTbBits;/*!< Max Transport Block Bits this UE can receive per TTI*/
1101    RgSchCmnUeMimoInfo   mimoInfo; /*!< UE cmn scheduler specific MIMO Info */
1102    RgSchDlHqProcCb      *proc;    /*!< Proc which is picked for Trans for this Subfrm,"dlSf" */
1103    Void                 *schSpfc; /*!< scheduler specific UE DL Info */
1104    Void                 *dlfsUe;  /*!< DLFS Specific information */
1105    uint32_t                  outStndAlloc; /*!< UEs outstanding allocation, for a given TTI.
1106                                        * valid for a single scheduling index */
1107    RgSchCmnDlUeRachInfo rachInfo; /*!< Ue specific RACH HO Info */
1108 #ifdef LTEMAC_SPS
1109    RgSchCmnDlUeSpsInfo  dlSpsInfo;/*!< DL SPS information for the UE */
1110 #endif
1111 #if defined(SCH_STATS) || defined(TENB_STATS)
1112    uint32_t            schedOccns;
1113    uint32_t            currPdbLvl;
1114    uint32_t            prevOccnLvlUpd;
1115  /*  uint32_t            schedRetxOccns;
1116    uint32_t            prbAlloc;*/
1117 #endif
1118 #ifdef SCH_STATS
1119    uint32_t            schedRetxOccns;
1120    uint32_t            avgCqi;
1121    uint32_t            numCqiOccns;
1122    uint32_t            numRi1;
1123    uint32_t            numRi2;
1124    uint32_t            boReported;
1125    uint32_t            prbAlloc;
1126    uint32_t            remAmbrForStats;
1127 #endif
1128    UeLaCb         laCb[RG_SCH_CMN_MAX_CW_PER_UE];
1129    uint8_t             cqiFlag;
1130    uint8_t             lastCfi;
1131 #ifdef RG_5GTF
1132    uint8_t            vrbgRequired;
1133    uint8_t            vrbgAllocated;
1134 #endif
1135 } RgSchCmnDlUe;
1136
1137 /**
1138   @brief Uplink RB allocation information. */
1139 struct rgSchCmnUlRbAllocInfo
1140 {
1141 #ifdef EMTC_ENABLE
1142    RgSchEmtcUlSf *ulsf;
1143 #endif
1144    RgSchUlSf     *sf;             /*!< Subframe to schedule for */
1145    CmLListCp     contResLst;      /*!< UEs to schedule for cnt resn */
1146    CmLListCp     schdContResLst; /*!< Final UEs scheduled for cnt resn */
1147    CmLListCp     nonSchdContResLst; /*!< UEs not scheduled for  cnt resn*/
1148    CmLListCp     ueLst;           /*!< UEs to schedule for data */
1149    CmLListCp     schdUeLst;      /*!< Final UEs scheduled for data */
1150    CmLListCp     nonSchdUeLst;   /*!< Final UEs not scheduled for data */
1151 };
1152
1153 /**
1154   * @brief
1155   * Information common to DL and UL scheduler per UE.
1156   */
1157 typedef struct rgSchCmnUeInfo
1158 {
1159    uint8_t                      ueCat;         /*!< UE category */
1160    CmTimer                 tmr;
1161 } RgSchCmnUeInfo;
1162 /**
1163   * @brief
1164   * Information for scheduler per UE. 
1165   */
1166 typedef struct rgSchCmnUe
1167 {
1168   RgSchCmnUeInfo  cmn; /*!< UE specific scheduler information common to
1169                                   uplink and downlink */ 
1170   RgSchCmnUlUe   ul;  /*!< UE specific UL scheduler information */
1171   RgSchCmnDlUe   dl;  /*!< UE specific DL scheduler informaion */ 
1172 } RgSchCmnUe;
1173
1174 typedef struct rgSchCmnLcg
1175 {
1176    uint32_t      bs;            /*!< Effective Buffer Status */
1177    uint32_t      cfgdGbr;       /*!< Configured GBR */
1178    uint32_t      effGbr;        /*!< Effective GBR */
1179    uint32_t      deltaMbr;      /*!< Configured MBR in excess of configured GBR */
1180    uint32_t      effDeltaMbr;   /*!< Effective MBR */
1181    uint32_t      reportedBs;    /*!< Latest Buffer Status */
1182    Void     *schSpfc;
1183 }RgSchCmnLcg;
1184
1185 #ifdef LTEMAC_SPS
1186 /**
1187   * @brief
1188   * SPS information for DL service 
1189   */
1190 typedef struct rgSchCmnDlSvcSpsInfo
1191 {
1192    CmLList   toBeSchdSvcEnt;    /*!< Linked list entity for toBeSchdSvcs lst */
1193    uint16_t       zeroBoOcassionCnt; /*!< Number of contiguous SPS ocassions for 
1194                                      which BO=0 */
1195    uint32_t       effSpsBo;          /*!< Effective BO of the SPS service */
1196    uint32_t       bytesReq;          /*!< Bytes Requested for this SPS service */
1197    uint8_t        hdrEst;            /*!< Header estimate for SPS service */
1198    
1199 } RgSchCmnDlSvcSpsInfo;
1200 #endif
1201
1202 typedef struct rgSchCmnDlSvc {
1203    uint8_t           qci;    /*!< Prio computed against Qci */
1204    uint8_t           prio;    /*!< Prio computed against Qci */
1205    uint32_t          gbr;     /*!< scaled GBR as per Refresh time resolution */
1206    uint32_t          mbr;     /*!< scaled MBR as per Refresh time resolution */
1207    Void         *schSpfc[CM_LTE_MAX_CELLS];/*!< Scheduler specific Info */
1208 #ifdef LTEMAC_SPS
1209    RgSchCmnDlSvcSpsInfo dlSvcSpsInfo; /*!< SPS related information for DL
1210                                            service */
1211 #endif
1212 }RgSchCmnDlSvc;
1213
1214 typedef struct rgSchCmnDlHqProc {
1215    CmLList        retxLnk; /*!< To link retransmitting HARQ processes in cell */
1216    uint32_t            totBytes;/*!< This maintains total allocation */ 
1217 #ifdef LTEMAC_SPS
1218    Bool          isSpsSvcSchd;/*!< Indicates if this HARQ process is having SPS
1219                                    service scheduled: TRUE for SPS and non-SPS
1220                                    ocassions */
1221    Bool          isSpsActv;   /*!< Indicates if this HARQ proc
1222                                    is in-use for SPS transmission: TRUE only for
1223                                    SPS ocassions */
1224    uint8_t            spsAction;   /*!< SPS action associated with this HARQ proc:
1225                                    activation/reactivation */
1226    CmLteTimingInfo maxRetxTime; /*!< Maximum retransmission time for SPS HARQ
1227                                   proc */
1228 #endif 
1229    Void           *schSpfc;/*!< Scheduler specific Info */
1230 }RgSchCmnDlHqProc;
1231
1232 /*--------------------------*
1233  * UL specific declarations END
1234  *---------------------------*/
1235
1236 /* Inappropriate name of CQI to ITbs table for DL. */
1237 typedef uint8_t RgSchCmnCqiToTbs[16];
1238 /* The following data type is used to store computed efficiency */
1239 /* for each MCS and consequently, will be used to derive MCS    */
1240 /* for a CQI. The last row is used for storing the average   */
1241 typedef uint32_t RgSchCmnTbSzEff[RG_SCH_CMN_NUM_TBS];
1242
1243 /* Inappropriate name of CQI to ITbs table for DL. */
1244 /* Changes for MIMO feature addition */
1245 RgSchCmnTbSzEff rgSchCmnNorCfi1Eff[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnNorCfi2Eff[RGSCH_MAX_NUM_LYR_PERCW];
1246 RgSchCmnTbSzEff rgSchCmnNorCfi3Eff[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnNorCfi4Eff[RGSCH_MAX_NUM_LYR_PERCW];
1247 /* Added new variable for Ul eff */
1248 RgSchCmnTbSzEff rgSchCmnNorUlEff[1],rgSchCmnExtUlEff[1];
1249 RgSchCmnCqiToTbs rgSchCmnNorCfi1CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnNorCfi2CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW];
1250 RgSchCmnCqiToTbs rgSchCmnNorCfi3CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnNorCfi4CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW];
1251 RgSchCmnCqiToTbs *rgSchCmnCqiToTbs[RGSCH_MAX_NUM_LYR_PERCW][RG_SCH_CMN_MAX_CP][RG_SCH_CMN_MAX_CFI]; 
1252 RgSchCmnTbSzEff rgSchCmnExtCfi1Eff[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnExtCfi2Eff[RGSCH_MAX_NUM_LYR_PERCW];
1253 RgSchCmnTbSzEff rgSchCmnExtCfi3Eff[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnExtCfi4Eff[RGSCH_MAX_NUM_LYR_PERCW];
1254 RgSchCmnCqiToTbs rgSchCmnExtCfi1CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnExtCfi2CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW];
1255 RgSchCmnCqiToTbs rgSchCmnExtCfi3CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW], rgSchCmnExtCfi4CqiToTbs[RGSCH_MAX_NUM_LYR_PERCW];
1256 /* Include CRS REs while calculating Efficiency */
1257 RgSchCmnTbSzEff
1258 *rgSchCmnEffTbl[RGSCH_MAX_NUM_LYR_PERCW][RG_SCH_CMN_MAX_CP][RG_SCH_CMN_MAX_ANT_CONF][RG_SCH_CMN_MAX_CFI];
1259 /* Added new variable for Ul eff */
1260 RgSchCmnTbSzEff *rgSchCmnUlEffTbl[RG_SCH_CMN_MAX_CP];
1261
1262 RgSchTbSzTbl rgTbSzTbl;
1263
1264 Void rgSCHCmnInit ARGS((Void
1265 ));
1266 S16 rgSCHCmnRgrCellCfg ARGS((
1267 RgSchCellCb   *cell,
1268 RgrCellCfg    *cellCfg,
1269 RgSchErrInfo  *err
1270 ));
1271 S16 rgSCHCmnRgrCellRecfg ARGS((
1272 RgSchCellCb             *cell,
1273 RgrCellRecfg            *recfg,
1274 RgSchErrInfo            *err
1275 ));
1276 Void rgSCHCmnFreeDlLc ARGS((
1277 RgSchCellCb                *cell,
1278 RgSchUeCb                  *ue,
1279 RgSchDlLcCb                *svc
1280 ));
1281 Void rgSCHCmnCellDel ARGS((
1282 RgSchCellCb     *cell
1283 ));
1284 Void rgSCHCmnDlRlsSubFrm ARGS((
1285 RgSchCellCb        *cell,
1286 CmLteTimingInfo   frm
1287 ));
1288 #ifdef LTE_ADV
1289 S16  rgSCHCmnRgrSCellUeCfg ARGS((
1290 RgSchCellCb  *cell,
1291 RgSchUeCb    *ue,
1292 RgrUeSecCellCfg  *sCellInfoCfg,
1293 RgSchErrInfo *err
1294 ));
1295
1296 Void rgSchFreeTpcIdxForSCell ARGS((
1297 RgSchUeCb *ue, 
1298 RgSchDlHqProcCb   *proc, 
1299 RgSchDlSf  *dlsf
1300 ));
1301
1302 Bool rgSchIsN1PucchResAvail ARGS((
1303   CmLListCp *lst, 
1304   RgSchUeCb *ue, 
1305   uint8_t        n1Idx,
1306   uint8_t        resCount
1307 ));
1308 Bool rgSchIsN3PucchResAvail ARGS((
1309   CmLListCp *lst, 
1310   RgSchUeCb *ue, 
1311   uint8_t        n1Idx
1312 ));
1313
1314 S16 rgSchGetAvlTpcIdx ARGS((
1315  RgSchUeCb *ue, 
1316  uint8_t        *tpcIdx, 
1317  RgSchDlSf *dlsf,
1318  RgSchCellCb   *cell
1319 ));
1320
1321 Void rgSCHSCellDelUeSCell ARGS((
1322  RgSchCellCb  *cellCb,
1323  RgSchUeCb    *ueCb,
1324  uint8_t            sCellIdx
1325 ));
1326
1327 S16 rgSCHCmnRgrSCellUeDel ARGS((
1328  RgSchUeCellInfo *sCellInfo,
1329  RgSchUeCb    *ue
1330 ));
1331
1332 #endif /* LTE_ADV */
1333 S16 rgSCHCmnRgrUeCfg ARGS((
1334 RgSchCellCb  *cell,
1335 RgSchUeCb    *ue,
1336 RgrUeCfg     *ueCfg,
1337 RgSchErrInfo *err
1338 ));
1339 S16 rgSCHCmnRgrUeRecfg ARGS((
1340 RgSchCellCb  *cell,
1341 RgSchUeCb    *ue,
1342 RgrUeRecfg   *ueRecfg,
1343 RgSchErrInfo *err
1344 ));
1345 Void rgSCHCmnUeDel ARGS((
1346 RgSchCellCb  *cell,
1347 RgSchUeCb    *ue
1348 ));
1349 Void rgSCHCmnUeReset ARGS((
1350 RgSchCellCb  *cell,
1351 RgSchUeCb    *ue
1352 ));
1353 S16 rgSCHCmnRgrLcgRecfg ARGS((
1354 RgSchCellCb  *cell,
1355 RgSchUeCb    *ue,
1356 RgSchLcgCb   *lcg,
1357 RgrLcgRecfg  *reCfg,
1358 RgSchErrInfo *err
1359 ));
1360 S16 rgSCHCmnRgrLcgCfg ARGS((
1361 RgSchCellCb  *cell,
1362 RgSchUeCb    *ue,
1363 RgSchLcgCb   *lcg,
1364 RgrLcgCfg    *lcgCfg,
1365 RgSchErrInfo *err
1366 ));
1367 S16 rgSCHCmnRgrLchCfg ARGS((
1368 RgSchCellCb  *cell,
1369 RgSchUeCb    *ue,
1370 RgSchDlLcCb  *dlLc,
1371 RgrLchCfg *lcCfg,
1372 RgSchErrInfo *err
1373 ));
1374 S16 rgSCHCmnRgrLchDel ARGS((
1375 RgSchCellCb   *cell,
1376 RgSchUeCb     *ue,
1377 CmLteLcId     lcId,    
1378 uint8_t            lcgId
1379 ));
1380 S16 rgSCHCmnRgrLchRecfg ARGS((
1381 RgSchCellCb  *cell,
1382 RgSchUeCb    *ue,
1383 RgSchDlLcCb  *dlLc,
1384 RgrLchRecfg  *lcRecfg,
1385 RgSchErrInfo *err
1386 ));
1387 Void rgSCHCmnLcgDel ARGS((
1388 RgSchCellCb   *cell,
1389 RgSchUeCb     *ue,
1390 RgSchLcgCb    *lcg
1391 ));
1392 S16 rgSCHCmnUpdBsrShort ARGS((
1393 RgSchCellCb  *cell,
1394 RgSchUeCb    *ue,
1395 RgSchLcgCb   *ulLcg,
1396 uint8_t           bsr,
1397 RgSchErrInfo *err
1398 ));
1399 S16 rgSCHCmnUpdBsrTrunc ARGS((
1400 RgSchCellCb  *cell,
1401 RgSchUeCb    *ue,
1402 RgSchLcgCb   *ulLcg,
1403 uint8_t           bsr,
1404 RgSchErrInfo *err
1405 ));
1406 S16 rgSCHCmnUpdBsrLong ARGS((
1407 RgSchCellCb  *cell,
1408 RgSchUeCb    *ue,
1409 uint8_t           bsArr[],
1410 RgSchErrInfo *err
1411 ));
1412 S16 rgSCHCmnDataRcvd ARGS((
1413 RgSchCellCb  *cell,
1414 RgSchUeCb    *ue,
1415 uint8_t           numLc,
1416 RgSchUlLcCb     *lcArr[],
1417 uint16_t          bytesArr[],
1418 RgSchErrInfo *err
1419 ));
1420 Void rgSCHCmnUlCqiInd ARGS((
1421 RgSchCellCb          *cell,
1422 RgSchUeCb            *ue,
1423 TfuUlCqiRpt          *ulCqiInfo
1424 ));
1425 S16 rgSCHCmnUpdExtPhr ARGS((
1426 RgSchCellCb  *cell,
1427 RgSchUeCb    *ue,
1428 RgInfExtPhrCEInfo *extPhr,
1429 RgSchErrInfo *err
1430 ));
1431 S16 rgSCHCmnUpdPhr ARGS((
1432 RgSchCellCb  *cell,
1433 RgSchUeCb    *ue,
1434 uint8_t           phr,
1435 RgSchErrInfo *err
1436 ));
1437 S16 rgSCHCmnUpdUlHqProc ARGS((
1438 RgSchCellCb      *cell,
1439 RgSchUlHqProcCb  *curProc,
1440 RgSchUlHqProcCb  *oldProc
1441 ));
1442 S16 rgSCHCmnContResUlGrant ARGS((
1443 RgSchCellCb  *cell,
1444 RgSchUeCb    *ue,
1445 RgSchErrInfo *err
1446 ));
1447 Void rgSCHCmnActvtUlUe ARGS((
1448 RgSchCellCb  *cell,
1449 RgSchUeCb    *ue
1450 ));
1451 Void rgSCHCmnActvtDlUe ARGS((
1452 RgSchCellCb  *cell,
1453 RgSchUeCb    *ue
1454 ));
1455 Void rgSCHCmnHdlUlTransInd ARGS((
1456 RgSchCellCb     *cell,
1457 RgSchUeCb       *ue,
1458 CmLteTimingInfo timingInfo
1459 ));
1460 S16 rgSCHCmnSrRcvd ARGS((
1461 RgSchCellCb  *cell,
1462 RgSchUeCb    *ue,
1463 CmLteTimingInfo frm,
1464 RgSchErrInfo *err
1465 ));
1466 Void rgSCHCmnUlRbAllocAddUeToLst ARGS((
1467 RgSchCellCb           *cell,
1468 RgSchUeCb             *ue,
1469 CmLListCp             *lst
1470 ));
1471 S16 rgSCHCmnTti ARGS((
1472 RgSchCellCb  *cell,
1473 RgSchErrInfo *err
1474 ));
1475 Void rgSCHCmnUlHqProcForUe ARGS((
1476 RgSchCellCb         *cell,
1477 CmLteTimingInfo     frm,
1478 RgSchUeCb           *ue,
1479 RgSchUlHqProcCb     **procRef
1480 ));
1481 RgSchUlAlloc *rgSCHCmnFirstRcptnReq ARGS((
1482 RgSchCellCb      *cell
1483 ));
1484 RgSchUlAlloc *rgSCHCmnNextRcptnReq ARGS((
1485 RgSchCellCb      *cell,
1486 RgSchUlAlloc     *alloc
1487 ));
1488 RgSchUlAlloc *rgSCHCmnFirstHqFdbkAlloc ARGS((
1489 RgSchCellCb      *cell,
1490 uint8_t                idx
1491 ));
1492 RgSchUlAlloc *rgSCHCmnNextHqFdbkAlloc ARGS((
1493 RgSchCellCb      *cell,
1494 RgSchUlAlloc     *alloc,
1495 uint8_t                idx
1496 ));
1497 Void rgSCHCmnDlDedBoUpd ARGS((
1498 RgSchCellCb                *cell,
1499 RgSchUeCb                  *ue,
1500 RgSchDlLcCb                *svc
1501 ));
1502 /* Fix: syed Remove the msg4Proc from cell
1503  * msg4Retx Queue. I have used CMN scheduler function
1504  * directly. Please define a new API and call this
1505  * function through that. */     
1506 Void rgSCHCmnDlMsg4ProcRmvFrmRetx ARGS((
1507 RgSchCellCb                *cell,
1508 RgSchDlHqProcCb            *hqP
1509 ));
1510 Void rgSCHCmnDlProcAddToRetx ARGS((
1511 RgSchCellCb                *cell,
1512 RgSchDlHqProcCb            *hqP
1513 ));
1514
1515 #ifdef EMTC_ENABLE
1516 Void rgSCHCmnEmtcUlProcAddToRetx ARGS((
1517 RgSchCellCb                *cell,
1518 RgSchUlHqProcCb            *hqP
1519 ));
1520 #endif
1521
1522 Void rgSCHCmnDlCqiInd ARGS((
1523 RgSchCellCb        *cell,
1524 RgSchUeCb          *ue,
1525 Bool               isPucchInfo,
1526 Void               *dlCqi,
1527 CmLteTimingInfo    timingInfo
1528 ));
1529 /* Added changes of TFU_UPGRADE */
1530 #ifdef TFU_UPGRADE
1531  Void rgSCHCmnRawCqiInd ARGS
1532 ((
1533 RgSchCellCb        *cellCb,
1534 RgSchUeCb          *ueCb,
1535 TfuRawCqiRpt      *rawCqiRpt,
1536 CmLteTimingInfo    timingInfo
1537 ));
1538
1539  Void rgSCHCmnSrsInd ARGS
1540 ((
1541 RgSchCellCb        *cellCb,
1542 RgSchUeCb          *ueCb,
1543 TfuSrsRpt      *srsRpt,
1544 CmLteTimingInfo    timingInfo
1545 ));
1546 #endif /* TFU_UPGRADE */ 
1547
1548 Void rgSCHCmnDlTARpt ARGS((
1549 RgSchCellCb        *cell,
1550 RgSchUeCb          *ue
1551 ));
1552 RgSchPdcch *rgSCHCmnCmnPdcchAlloc ARGS((
1553 RgSchCellCb                *cell,
1554 RgSchDlSf                  *subFrm
1555 ));
1556 RgSchUlAlloc *rgSCHCmnUlSbAlloc ARGS((
1557 RgSchUlSf       *sf,
1558 uint8_t              numSb,
1559 RgSchUlHole     *hole
1560 ));
1561 Void rgSCHCmnRlsUlSf ARGS((
1562 RgSchCellCb    *cell,
1563 uint8_t idx
1564 ));
1565
1566 /* PHR handling for MSG3 */
1567 Void rgSCHCmnUlRecMsg3Alloc ARGS((
1568 RgSchCellCb                *cell,
1569 RgSchUeCb                  *ue,
1570 RgSchRaCb                  *raCb
1571 ));
1572
1573 /* Added periodic BSR timer */
1574
1575 /*ccpu00117180 - ADD - Added Prototype in .x since the function access is now */
1576 Void rgSCHCmnUpdVars ARGS((
1577 RgSchCellCb *cell
1578 ));
1579
1580 #ifdef LTEMAC_SPS
1581 Void rgSCHCmnFillHqPTb ARGS((
1582 RgSchCellCb                *cell,
1583 RgSchDlRbAlloc             *rbAllocInfo,
1584 uint8_t                         tbAllocIdx,
1585 RgSchPdcch                 *pdcch
1586 ));
1587
1588 Void rgSCHCmnDlProcAck ARGS((
1589 RgSchCellCb        *cell,
1590 RgSchDlHqProcCb    *hqP
1591 ));
1592 Void rgSCHCmnHdlCrntiCE ARGS((
1593 RgSchCellCb        *cell,
1594 RgSchUeCb          *ue
1595 ));
1596 Void rgSCHCmnDlRelPdcchFbk ARGS((
1597 RgSchCellCb        *cell,
1598 RgSchUeCb          *ue,
1599 Bool               isAck
1600 ));
1601 Void rgSCHCmnDlGetRbgInfo ARGS((
1602 uint8_t             dlTotalBw,
1603 uint8_t             dlSubsetBw,
1604 uint8_t             maxRaType1SubsetBw,
1605 uint8_t             rbgSize,
1606 RgSchBwRbgInfo *rbgInfo
1607 ));
1608 uint8_t rgSCHCmnDlRaType0Alloc ARGS((
1609 RgSchDlSfAllocInfo *allocedInfo, 
1610 uint8_t                 rbsReq,
1611 RgSchBwRbgInfo     *rbgInfo,
1612 uint8_t                 *numAllocRbs,
1613 RgSchDlSfAllocInfo *resAllocInfo, 
1614 Bool               isPartialAlloc
1615 ));
1616 #ifdef RGSCH_SPS_UNUSED
1617 uint8_t rgSCHCmnDlRaType1Alloc ARGS((
1618 RgSchDlSfAllocInfo *allocedInfo, 
1619 uint8_t                 rbsReq,
1620 RgSchBwRbgInfo     *rbgInfo,
1621 uint8_t                 startRbgSubset,
1622 uint8_t                 *allocRbgSubset,
1623 RgSchDlSfAllocInfo *resAllocInfo, 
1624 Bool               isPartialAlloc
1625 ));
1626 #endif
1627 uint8_t rgSCHCmnDlRaType2Alloc ARGS((
1628 RgSchDlSfAllocInfo *allocedInfo, 
1629 uint8_t                 rbsReq,
1630 RgSchBwRbgInfo     *rbgInfo,
1631 uint8_t                 *rbStart,
1632 RgSchDlSfAllocInfo *resAllocInfo, 
1633 Bool               isPartialAlloc
1634 ));
1635 Bool rgSCHCmnAllocUeInSpsBw ARGS((
1636 RgSchDlSf           *dlSf,
1637 RgSchCellCb         *cell,
1638 RgSchUeCb           *ue,
1639 RgSchDlRbAlloc      *rbAllocInfo,
1640 Bool                isPartialAlloc
1641 ));
1642 #endif
1643 Void rgSCHCmnDrxStrtInActvTmrInUl ARGS((RgSchCellCb *cell));
1644 Void rgSCHCmnUpdUeDataIndLcg ARGS((RgSchCellCb *cell, RgSchUeCb *ue, RgInfUeDatInd  *datInd));
1645 #ifdef LTE_TDD
1646 uint8_t  rgSCHCmnGetPhichUlSfIdx ARGS((CmLteTimingInfo *timeInfo, RgSchCellCb *cell));
1647 uint8_t  rgSCHCmnGetUlSfIdx ARGS((CmLteTimingInfo *timeInfo, RgSchCellCb *cell));
1648 uint8_t rgSCHCmnGetPValFrmCCE ARGS((RgSchCellCb *cell, uint8_t cce));
1649 #endif
1650 uint8_t  rgSCHCmnGetUlHqProcIdx ARGS((CmLteTimingInfo *timeInfo, RgSchCellCb *cell));
1651
1652 Void rgSchCmnSetCqiReqField ARGS((
1653  RgSchUeCellInfo   *cellInfo,
1654  RgSchUeCb         *ue,
1655  RgSchCqiReqField  *cqiReq 
1656 ));
1657
1658 /* APIs exposed by COMMON SCHEDULER to
1659  * SPECIFIC SCHEDULER */
1660 /* UL_ALLOC_CHANGES */
1661 Void rgSCHCmnUlFreeAlloc ARGS((
1662 RgSchCellCb     *cell,
1663 RgSchUlAlloc    *alloc  
1664 ));
1665 #ifndef EMTC_ENABLE
1666 Void rgSCHCmnUlFreeAllocation ARGS((
1667 RgSchCellCb     *cell,
1668 RgSchUlSf       *sf,    
1669 RgSchUlAlloc    *alloc  
1670 ));
1671 #else
1672 Void rgSCHCmnUlFreeAllocation ARGS((
1673 RgSchCellCb     *cell,
1674 RgSchUlSf       *sf,    
1675 RgSchUlAlloc    *alloc,
1676 Bool             isEmtcUe
1677 ));
1678 #endif
1679 /* APIs exposed by DL RB allocation module */
1680 S16 rgSCHCmnAllocDlRb ARGS((
1681 RgSchCellCb         *cell, 
1682 RgSchCmnDlRbAllocInfo  *dlRbAllocInfo
1683 ));
1684
1685 /* APIs exposed by UL RB allocation module */
1686 Void rgSCHCmnAllocUlRb ARGS((
1687 RgSchCellCb            *cell, 
1688 RgSchCmnUlRbAllocInfo  *ulRbAllocInfo
1689 ));
1690
1691 /* APIs Exposed to Specific Scheduler */
1692 RgSchPdcch *rgSCHCmnPdcchAllocCrntSf ARGS((
1693 RgSchCellCb                *cell,
1694 RgSchUeCb                  *ue
1695 ));
1696 Void rgSCHCmnPdcchRlsCrntSf ARGS((
1697 RgSchCellCb                *cell,
1698 RgSchPdcch                 *pdcch
1699 ));
1700 Void rgSCHCmnUlFillPdcchWithAlloc ARGS((
1701 RgSchPdcch      *pdcch,
1702 RgSchUlAlloc    *alloc,
1703 RgSchUeCb       *ue
1704 ));
1705 Void rgSCHCmnUlAllocFillTpc ARGS((
1706 RgSchCellCb  *cell,
1707 RgSchUeCb    *ue,
1708 RgSchUlAlloc *alloc
1709 ));
1710 Void rgSCHCmnUlAllocFillNdmrs ARGS((
1711 RgSchCmnUlCell *cellUl,
1712 RgSchUlAlloc   *alloc
1713 ));
1714 Void rgSCHCmnUlAllocLnkHqProc ARGS((
1715 RgSchUeCb       *ue,
1716 RgSchUlAlloc    *alloc,
1717 RgSchUlHqProcCb *proc,
1718 Bool            isReTx
1719 ));
1720 RgSchPdcch *rgSCHCmnPdcchAlloc ARGS((
1721 RgSchCellCb                *cell,
1722 RgSchUeCb                  *ue,
1723 RgSchDlSf                  *subFrm,
1724 uint8_t                         cqi,
1725 TfuDciFormat               dciFrmt,
1726 Bool                       isDtx 
1727 ));
1728 Void rgSCHCmnRdcImcsTxTb ARGS((
1729 RgSchDlRbAlloc   *allocInfo,
1730 uint8_t               tbInfoIdx,
1731 uint32_t              cnsmdBytes
1732 ));
1733 Void rgSCHCmnFillPdcch ARGS((
1734 RgSchCellCb                *cell,
1735 RgSchPdcch                 *pdcch,
1736 RgSchDlRbAlloc             *rbAllocInfo
1737 ));
1738 uint8_t rgSCHCmnUpdDai ARGS((
1739 RgSchUeCb         *ue,
1740 CmLteTimingInfo   *fdbkTime,
1741 uint8_t                 m,
1742 Bool               havePdcch,
1743 RgSchDlHqProcCb   *hqP,
1744 uint8_t                *ulDai
1745
1746 ));
1747 Void rgSCHCmnFillHqPPdcch ARGS((
1748 RgSchCellCb                *cell,
1749 RgSchDlRbAlloc             *rbAllocInfo,
1750 RgSchDlHqProcCb            *hqP
1751 ));
1752 S16 rgSCHCmnDlChkResAvl ARGS((
1753 RgSchCellCb                *cell,
1754 RgSchDlSf                  *subFrm,
1755 RgSchUeCb                  *ue,
1756 RgSchDlHqProcCb            *proc,
1757 uint32_t                        *bo,
1758 uint8_t                         *iTbs,
1759 uint32_t                        *maxRb
1760 ));
1761 S16 rgSCHCmnDlDedAlloc ARGS((
1762 RgSchCellCb                *cell,
1763 RgSchDlSf                  *subFrm,
1764 RgSchUeCb                  *ue,
1765 RgSchDlHqProcCb            *proc,
1766 uint32_t                        bo,
1767 uint8_t                         iTbs,
1768 uint32_t                        maxRb,
1769 uint32_t                        *bytes
1770 ));
1771 Void rgSCHCmnUlUeFillAllocInfo  ARGS((
1772 RgSchCellCb      *cell,
1773 RgSchUeCb        *ue
1774 ));
1775 /* Fixing incorrect Imcs derivation */
1776 uint8_t rgSCHCmnUlGetITbsFrmIMcs ARGS((
1777 uint8_t          iMcs
1778 ));
1779 /* Adding ueCtg to argument list */
1780 uint8_t rgSCHCmnUlGetIMcsFrmITbs ARGS((
1781 uint8_t              iTbs,
1782 CmLteUeCategory ueCtg
1783 ));
1784 uint32_t rgSCHCmnUlMinTbBitsForITbs ARGS((
1785 RgSchCmnUlCell     *cellUl,
1786 uint8_t                 iTbs
1787 ));
1788 uint8_t rgSCHCmnUlGetITbs ARGS((
1789 RgSchCellCb      *cell,
1790 RgSchUeCb        *ue,
1791 Bool              isEcp
1792 ));
1793 Void rgSCHCmnUlAllocFillRbInfo ARGS((
1794 RgSchCellCb    *cell,
1795 RgSchUlSf      *sf,
1796 RgSchUlAlloc   *alloc
1797 ));
1798 Void rgSCHCmnDlUeResetTemp ARGS((
1799 RgSchUeCb               *ue,
1800 RgSchDlHqProcCb         *hqP
1801 ));
1802 Void rgSCHCmnUlUeResetTemp ARGS((
1803 RgSchCellCb             *cell,
1804 RgSchUeCb               *ue
1805 ));
1806 /* proc is added for DTX support */
1807 /* DL per UE RB allocation API */
1808 S16 rgSCHCmnDlAllocTxRb ARGS((
1809 RgSchCellCb                *cell,
1810 RgSchDlSf                  *subFrm,
1811 RgSchUeCb                  *ue,
1812 uint32_t                        bo,
1813 uint32_t                        *effBo,
1814 RgSchDlHqProcCb            *proc,
1815 RgSchCmnDlRbAllocInfo      *cellWdAllocInfo
1816 ));
1817 Bool rgSCHCmnIsDlCsgPrio ARGS((
1818 RgSchCellCb    *cell
1819 ));
1820 Bool rgSCHCmnIsUlCsgPrio ARGS((
1821 RgSchCellCb    *cell
1822 ));
1823 S16 rgSCHCmnDlAllocRetxRb ARGS((
1824 RgSchCellCb                *cell,
1825 RgSchDlSf                  *subFrm,
1826 RgSchUeCb                  *ue,
1827 uint32_t                        bo,
1828 uint32_t                        *effBo,
1829 RgSchDlHqProcCb            *proc,
1830 RgSchCmnDlRbAllocInfo      *cellWdAllocInfo
1831 ));
1832 #ifdef LTEMAC_SPS
1833 Void rgSCHCmnClcRbAlloc ARGS((
1834 RgSchCellCb             *cell,
1835 uint32_t                     bo,
1836 uint8_t                      cqi,
1837 uint8_t                      *rb,
1838 uint32_t                     *tbs,
1839 uint8_t                      *mcs,
1840 uint8_t                      *iTbs,
1841 Bool                    isSpsBo,
1842 RgSchDlSf               *sf 
1843 ));
1844 uint32_t rgSCHCmnCalcRiv ARGS((
1845 uint8_t           bw,
1846 uint8_t           rbStart,
1847 uint8_t           numRb
1848 ));
1849 #endif /* LTEMAC_SPS */
1850
1851 /* end: Apis to add Ues in to DlRbAllocInfo Lists */
1852 /* start: Apis to add Ues in to UlRbAllocInfo Lists */
1853 Void rgSCHCmnUlAdd2UeLst ARGS((
1854 RgSchCellCb           *cell,
1855 RgSchCmnUlRbAllocInfo *allocInfo,
1856 RgSchUeCb             *ue
1857 ));
1858 Void rgSCHCmnUlAdd2CntResLst ARGS((
1859 RgSchCmnUlRbAllocInfo *allocInfo,
1860 RgSchUeCb             *ue
1861 ));
1862 Void rgSCHCmnRmvFrmTaLst ARGS((
1863 RgSchCellCb                *cell,
1864 RgSchUeCb                  *ue
1865 ));
1866 /* end: Apis to add Ues in to UlRbAllocInfo Lists */
1867 Void rgSCHCmnUlUpdOutStndAlloc ARGS((
1868 RgSchCellCb *cell,
1869 RgSchUeCb   *ue,
1870 uint32_t alloc
1871 ));
1872
1873 Void rgSCHCmnUlRecordUeAlloc ARGS((
1874 RgSchCellCb *cell,
1875 RgSchUeCb   *ue
1876 ));
1877
1878
1879
1880 /* APIs exposed by common power module */
1881 Void rgSCHPwrInit ARGS((
1882          Void));
1883 uint8_t rgSCHPwrPuschTpcForUe ARGS((
1884          RgSchCellCb *cell,
1885          RgSchUeCb   *ue));
1886 uint8_t rgSCHPwrGetMaxUlRb ARGS((
1887          RgSchCellCb *cell,
1888          RgSchUeCb   *ue));
1889 uint8_t rgSCHPwrPucchTpcForUe ARGS((
1890          RgSchCellCb *cell,
1891          RgSchUeCb   *ue));
1892 Void rgSCHPwrGrpCntrlPucch ARGS((
1893          RgSchCellCb *cell,
1894          RgSchDlSf   *dlSf));
1895 Void rgSCHPwrGrpCntrlPusch ARGS((
1896          RgSchCellCb *cell,
1897          RgSchDlSf   *dlSf,
1898          RgSchUlSf   *ulSf));
1899 Void rgSCHPwrPucchDeltaInd ARGS((
1900          RgSchCellCb *cell,
1901          RgSchUeCb   *ue,
1902          S8          pwrDelta));
1903 Void rgSCHPwrUpdExtPhr ARGS((
1904          RgSchCellCb           *cell,
1905          RgSchUeCb             *ue,
1906          RgInfExtPhrCEInfo     *extPhr,
1907          RgSchCmnAllocRecord   *allocInfo));
1908 Void rgSCHPwrUpdPhr ARGS((
1909          RgSchCellCb           *cell,
1910          RgSchUeCb             *ue,
1911          uint8_t                     phr,
1912          RgSchCmnAllocRecord   *allocInfo,
1913          S8                     maxUePwr));
1914 Void rgSCHPwrUlCqiInd ARGS((
1915          RgSchCellCb           *cell,
1916          RgSchUeCb             *ue
1917          ));
1918 Void rgSCHPwrRecordRbAlloc ARGS((
1919          RgSchCellCb           *cell,
1920          RgSchUeCb             *ue,
1921          uint8_t                     numRb
1922          ));
1923 S16 rgSCHPwrCellCfg ARGS((
1924          RgSchCellCb          *cell,
1925          RgrCellCfg           *cfg));
1926 S16 rgSCHPwrCellRecfg ARGS((
1927          RgSchCellCb          *cell,
1928          RgrCellRecfg         *recfg));
1929 Void rgSCHPwrCellDel ARGS((
1930          RgSchCellCb *cell));
1931
1932 #ifdef LTE_ADV
1933 S16 rgSCHPwrUeSCellCfg ARGS((
1934          RgSchCellCb *cell,
1935          RgSchUeCb   *ue,
1936          RgrUeSecCellCfg  *sCellInfoCfg));
1937 #endif
1938
1939 S16 rgSCHPwrUeCfg ARGS((
1940          RgSchCellCb *cell,
1941          RgSchUeCb   *ue,
1942          RgrUeCfg    *cfg));
1943 S16 rgSCHPwrUeRecfg ARGS((
1944          RgSchCellCb   *cell,
1945          RgSchUeCb     *ue,
1946          RgrUeRecfg    *recfg));
1947 Void rgSCHPwrUeDel ARGS((
1948          RgSchCellCb   *cell,
1949          RgSchUeCb     *ue));
1950 Void rgSCHPwrUeReset ARGS((
1951          RgSchCellCb   *cell,
1952          RgSchUeCb     *ue));
1953
1954 #ifdef LTEMAC_SPS
1955 S16 rgSCHCmnSpsUlProcCrcInd ARGS((
1956 RgSchCellCb          *cell,
1957 RgSchUeCb            *ue,
1958 CmLteTimingInfo      crcTime
1959 ));
1960 Void rgSCHCmnSpsInit ARGS((Void));
1961
1962 Void rgSCHCmnSpsRelDlSpsActHqP ARGS((
1963 RgSchCellCb        *cell,
1964 RgSchDlHqProcCb    *hqP));
1965
1966 S16 rgSCHCmnSpsCellCfg ARGS((
1967 RgSchCellCb        *cell,
1968 RgrCellCfg         *cellCfg,
1969 RgSchErrInfo       *err));
1970 Void rgSCHCmnSpsCellDel ARGS((
1971 RgSchCellCb        *cell
1972 ));
1973 S16 rgSCHCmnSpsUeCfg ARGS((
1974 RgSchCellCb        *cell,
1975 RgSchUeCb          *ue,
1976 RgrUeCfg           *ueCfg,
1977 RgSchErrInfo       *err
1978 ));
1979 S16 rgSCHCmnSpsUeRecfg ARGS((
1980 RgSchCellCb        *cell,
1981 RgSchUeCb          *ue,
1982 RgrUeRecfg         *ueRecfg,
1983 RgSchErrInfo       *err
1984 ));
1985 Void rgSCHCmnSpsUeDel ARGS((
1986 RgSchCellCb      *cell,
1987 RgSchUeCb        *ue
1988 ));
1989 S16 rgSCHCmnSpsDlLcRecfg ARGS((
1990 RgSchCellCb        *cell,
1991 RgSchUeCb          *ue,
1992 RgSchDlLcCb        *dlLc,
1993 RgrLchRecfg        *lcRecfg,
1994 RgSchErrInfo       *err
1995 ));
1996 S16 rgSCHCmnSpsDlLcCfg ARGS((
1997 RgSchCellCb        *cell,
1998 RgSchUeCb          *ue,
1999 RgSchDlLcCb        *dlLc,
2000 RgrLchCfg          *lcCfg,
2001 RgSchErrInfo       *err
2002 ));
2003 Void rgSCHCmnSpsDlLcDel ARGS((
2004 RgSchCellCb        *cell,
2005 RgSchUeCb          *ue,
2006 RgSchDlLcCb        *dlLc
2007 ));
2008 Void rgSCHCmnSpsDlCqiIndHndlr ARGS((
2009 RgSchCellCb          *cell,
2010 RgSchUeCb            *ue,
2011 CmLteTimingInfo      timingInfo
2012 ));
2013 Void rgSCHCmnSpsDlDedBoUpd ARGS((
2014 RgSchCellCb            *cell,
2015 RgSchUeCb              *ue,
2016 RgSchDlLcCb            *dlLc
2017 ));
2018 Void rgSCHCmnSpsDlUeReset ARGS((
2019 RgSchCellCb         *cell,
2020 RgSchUeCb           *ue
2021 ));
2022 Void rgSCHCmnSpsDlProcAddToRetx ARGS((
2023 RgSchCellCb           *cell,
2024 RgSchDlHqProcCb       *hqP
2025 ));
2026 Void rgSCHCmnSpsDlProcAck ARGS((
2027 RgSchCellCb           *cell,
2028 RgSchDlHqProcCb       *hqP
2029 ));
2030
2031 Void rgSCHCmnSpsDlRelPdcchFbk ARGS((
2032 RgSchCellCb           *cell,
2033 RgSchUeCb             *ue,
2034 Bool                  isAck
2035 ));
2036 Void rgSCHCmnSpsDlSched ARGS((
2037 RgSchCellCb           *cell,
2038 RgSchCmnDlRbAllocInfo *allocInfo
2039 ));
2040 #ifdef RG_UNUSED
2041 S16 rgSCHCmnSpsGetDlActvUe ARGS((
2042 RgSchCellCb     *cell,
2043 CmLteTimingInfo *timingInfo,
2044 CmLListCp       *dlSpsActvUeLst
2045 ));
2046 #endif
2047 Void rgSCHCmnSpsDlAllocFnlz ARGS((
2048 RgSchCellCb           *cell,
2049 RgSchCmnDlRbAllocInfo *allocInfo
2050 ));
2051
2052 Void rgSCHCmnSpsDlUpdDlSfAllocWithSps ARGS((
2053 RgSchCellCb           *cell,
2054 CmLteTimingInfo       schdTime,
2055 RgSchDlSf             *dlSf
2056 ));
2057
2058
2059 /* APIs exposed by UL SPS */
2060 Void rgSCHCmnSpsUlLcgDel ARGS(( 
2061 RgSchCellCb      *cell,
2062 RgSchUeCb        *ue,
2063 RgSchLcgCb       *lcg
2064 ));
2065 Void rgSCHCmnSpsUlUeReset ARGS((
2066 RgSchCellCb         *cell,
2067 RgSchUeCb           *ue
2068 ));
2069 Void rgSCHCmnSpsUlProcRelInd ARGS((
2070 RgSchCellCb         *cell,
2071 RgSchUeCb           *ue,
2072 Bool                isExplRel
2073 ));
2074
2075 Void rgSCHCmnSpsUlProcActInd ARGS((
2076 RgSchCellCb         *cell,
2077 RgSchUeCb           *ue,
2078 uint16_t                 spsSduSize
2079 ));
2080 Void rgSCHCmnSpsPhrInd ARGS((
2081 RgSchCellCb         *cell,
2082 RgSchUeCb           *ue
2083 ));
2084
2085
2086 S16 rgSCHCmnSpsBsrRpt ARGS((
2087 RgSchCellCb  *cell,
2088 RgSchUeCb    *ue,
2089 RgSchLcgCb   *ulLcg
2090 ));
2091
2092
2093 S16 rgSCHCmnSpsUlCqiInd ARGS((
2094 RgSchCellCb          *cell,
2095 RgSchUeCb            *ue
2096 ));
2097 S16 rgSCHCmnSpsUlProcDtxInd ARGS((
2098 RgSchCellCb          *cell,
2099 RgSchUeCb            *ue,
2100 CmLteTimingInfo      dtxTime
2101 ));
2102 S16 rgSCHCmnSpsUlTti ARGS((
2103 RgSchCellCb             *cell,
2104 RgSchCmnUlRbAllocInfo   *allocInfo
2105 ));
2106 #ifdef RG_UNUSED
2107 S16 rgSCHCmnSpsUlGetActvUeLst  ARGS((
2108 RgSchCellCb     *cell,
2109 CmLteTimingInfo timingInfo,
2110 CmLListCp       *ulSpsActvUeLst
2111 ));
2112 #endif
2113 Void rgSCHCmnUlSpsRelInd ARGS((
2114 RgSchCellCb        *cell,
2115 RgSchUeCb          *ue,
2116 Bool               isExplRel
2117 ));
2118
2119
2120 Void rgSCHCmnUlSpsActInd ARGS((
2121 RgSchCellCb        *cell,
2122 RgSchUeCb          *ue,
2123 uint16_t                spsSduSize
2124 ));
2125
2126 Void rgSCHCmnUlCrcFailInd ARGS((
2127 RgSchCellCb        *cell,
2128 RgSchUeCb          *ue,
2129 CmLteTimingInfo    crcTime
2130 ));
2131 Void rgSCHCmnUlCrcInd ARGS((
2132 RgSchCellCb        *cell,
2133 RgSchUeCb          *ue,
2134 CmLteTimingInfo    crcTime
2135 ));
2136
2137 /* Added handling to retrnasmit RelPDCCH in case no
2138                              feedback is received */
2139 Void rgSCHCmnSpsDlReTxRelPdcch ARGS((
2140 RgSchCellCb        *cell
2141 ));
2142 #endif
2143
2144 Void rgSCHCmnChkRetxAllowDtx
2145 ARGS((
2146 RgSchCellCb        *cell,
2147 RgSchUeCb          *ueCb,
2148 RgSchDlHqProcCb    *proc,
2149 Bool               *reTxAllwd
2150 ));
2151
2152 S16 PtUiRgmBndCfm ARGS((Pst* pst, SuId suId, uint8_t status));
2153
2154  S16 rgSCHCmnDlInitHqEnt 
2155 ARGS((
2156 RgSchCellCb  *cell,
2157 RgSchDlHqEnt  *hqEnt
2158 ));
2159
2160 Void rgSchCmnDlSfHqDel 
2161 ARGS((
2162 RgSchUeCb    *ue,
2163 RgSchCellCb  *cell
2164 ));
2165
2166 Void rgSCHCmnDlDeInitHqEnt 
2167 ARGS((
2168 RgSchCellCb  *cell,
2169 RgSchDlHqEnt *hqE
2170 ));
2171 uint8_t rgSCHCmnUlGetCqi
2172 ARGS ((
2173 RgSchCellCb  *cell,
2174 RgSchUeCb *ue,
2175 CmLteUeCategory  ueCtgy
2176 ));
2177 #ifdef DL_LA
2178 S16 rgSCHDhmUpdBlerBasediTbsEff ARGS((
2179          RgSchCellCb  *cell,
2180          RgSchUeCb               *ueCb,
2181          uint8_t                      tbCnt
2182          ));
2183 #endif
2184
2185 Void rgSchCmnUpdCfiDb ARGS((
2186          RgSchCellCb     *cell,
2187          uint8_t              delta                
2188          ));
2189 S16 RgUiRgmChangeTransModeInd ARGS((
2190          Pst               *pst, 
2191          SuId              suId, 
2192          RgmTransModeInd   *transModeInd));
2193
2194 Void rgSchCheckAndTriggerModeChange ARGS((
2195 RgSchCellCb    *cell,
2196 RgSchUeCb      *ue,
2197 uint8_t             reportediTbs,
2198 uint8_t             previTbs,
2199 uint8_t             maxiTbs
2200 ));
2201 Void rgSCHRrDlProcRmvFrmRetx ARGS((
2202 RgSchCellCb                *cell,
2203 RgSchDlHqProcCb            *hqP
2204 ));
2205 uint8_t rgSchUtlGetServCellIdx ARGS((
2206          Inst         inst,
2207          uint16_t          cellId,
2208          RgSchUeCb    *ue
2209          ));
2210 S16 rgSchUtlVldtCellId ARGS ((
2211  Inst         inst,
2212  uint16_t          cellId
2213 ));
2214 Void rgSCHCmnInitUlRbAllocInfo ARGS((
2215 RgSchCmnUlRbAllocInfo  *allocInfo
2216 ));
2217 TfuDciFormat rgSCHCmnSlctPdcchFrmt ARGS((
2218 RgSchCellCb                *cell,
2219 RgSchUeCb                  *ue,
2220 uint8_t                         *raType
2221 ));
2222
2223 Void rgSCHCmnNonDlfsDedRbAlloc ARGS((
2224 RgSchCellCb        *cell,
2225 RgSchCmnUeRbAlloc  *allocInfo,
2226 CmLListCp          *ueLst,
2227 CmLListCp          *schdUeLst,
2228 CmLListCp          *nonSchdUeLst
2229 ));
2230
2231 Bool rgSCHCmnRetxAvoidTdd ARGS 
2232 ((
2233 RgSchDlSf                  *curSf,
2234 RgSchCellCb                *cell,
2235 RgSchDlHqProcCb            *proc
2236 ));
2237
2238
2239
2240 #ifdef __cplusplus
2241 }
2242 #endif /* __cplusplus */
2243 #endif /* __RGSCHCMNX__ */
2244
2245 \f
2246 /**********************************************************************
2247          End of file
2248 **********************************************************************/