WLS code changes at Lower Mac - PHY inteface
[o-du/l2.git] / src / 5gnrmac / rg.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 layer
22  
23     Type:   X include file
24  
25     Desc:   Defines required by LTE MAC
26  
27     File:  rg.x 
28  
29 **********************************************************************/
30  
31 /** @file rg.x
32 @brief This file contains basic data structures for the Mac.
33 */
34  
35 #ifndef __RGX__
36 #define __RGX__
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41
42 #ifdef EMTC_ENABLE
43 #include "rg_emtc.x"            /* typedefs for MAC */
44 #endif
45
46 /** @brief Logical Channel Id */
47 typedef RgPrgLteLcgId      LteLcgId;        
48 typedef RguDDatReqInfo     RgRguDedDatReq;
49 typedef RguCDatReqInfo     RgRguCmnDatReq;
50 typedef RguDStaRspInfo     RgRguDedStaRsp;
51 typedef RguCStaRspInfo     RgRguCmnStaRsp;
52 typedef RguDStaIndInfo     RgRguDedStaInd;
53 typedef RguCStaIndInfo     RgRguCmnStaInd;
54 typedef RguDDatIndInfo     RgRguDedDatInd;
55 typedef RguCDatIndInfo     RgRguCmnDatInd;
56 typedef RguLchStaInd       RgRguLcStaInd;
57 typedef TfuPdschDciInfo    RgTfuPdschDciInfo;
58 typedef TfuDatReqInfo      RgTfuDatReqInfo;
59 typedef TfuDatReqPduInfo   RgTfuDatReqPduInfo;
60 typedef RguDDatReqPerUe    RgRguDDatReqPerUe;
61 #ifdef L2_OPTMZ
62 typedef TfuDatReqTbInfo    RgTfuDatReqTbInfo;
63 #endif
64
65 #ifdef LTE_L2_MEAS
66 typedef struct rgL2MeasCb     RgL2MeasCb;
67 typedef struct rgQciCb        RgQciCb;
68
69 typedef RguL2MUlThrpMeasReqInfo RgRguL2MUlThrpMeasReq;
70
71 #endif /* LTE_L2_MEAS */
72 /* Forward declarations for some structures */
73 typedef struct rgUeCb         RgUeCb;
74 typedef struct rgErrInfo      RgErrInfo;
75 typedef struct rgCellCb       RgCellCb;
76 typedef struct rgUlHqProcCb   RgUlHqProcCb;
77 typedef struct rgDlHqProcCb   RgDlHqProcCb;
78 typedef struct rgLcgCb        RgLcgCb;
79 typedef struct rgDlHqEnt      RgDlHqEnt;
80 typedef struct _rgCb          RgCb;
81 typedef RgPrgUlLcInfo         RgUlLcCb;
82 typedef RgPrgDlLcInfo         RgDlLcCb;
83
84
85 #ifdef LTE_L2_MEAS
86 /* @brief UE Specific Uplink allocation info needed for measurements */
87 typedef struct rgUeUlAlloc
88 {
89    CmLteRnti        rnti;      /*!< Ue Id */ 
90    U8               numPrb;    /*!< Number of total PRB's allocated for this UE */
91 } RgUeUlAlloc;
92 /**
93  * @brief Structure hold uplink allocation information for sub frames.
94  * */
95 typedef struct rgUlSf
96 {
97    CmLteTimingInfo schdTime;       /*!< scheduled frame and subframe number */
98    U8              numUe;          /*!< Number of UE's allocated in this uplink
99                                       subframe */
100    RgUeUlAlloc     *ueUlAllocInfo; /*!< Uplink alloc infor for this subframe */
101 } RgUlSf;
102
103 /** @brief
104  *  L2 measurement control block.
105  *  */
106 struct rgL2MeasCb
107 {
108    CmLList            measLnk;        /*!< MeasCb node */
109    RgInfL2MeasReq     measReq;        /*!< Request received for measurement */
110    CmLteTimingInfo    startTime;      /*!< Time at which measurement started */
111    U32                sfnCycle;       /*!< Count of Num of SFN wraps */ 
112 };
113 /** @brief
114  *  Control block to store Logical Channels with Qci.
115  *  */
116 struct rgQciCb
117 {
118    U8               qci;      /*< QCI for measurement */
119    U32              prbCount; /*!< Cummulative PRB count */
120    U8               mask;     /*!< Measurement Active or Not*/
121    CmLteTimingInfo  startTime;/*!< Time at which measurement started */
122 };
123 #endif /* LTE_L2_MEAS */
124 /**
125   * @brief
126   * Information about one PDCCH.
127   */
128 typedef struct rgPdcch {
129    CmLteRnti         rnti;    /*!< RNTI to who the PDCCH is allocated */
130    RgTfuPdschDciInfo dci;     /*!< PDCCH format */
131 } RgPdcch;
132
133 typedef struct rgBcchTb
134 {
135    RgPdcch        pdcch;
136    Buffer         *tb;
137    U16            txPwrOffset; /*!< PDSCH Tx Pwr offset */
138 } RgBcchTb;
139
140 typedef struct rgPcchTb
141 {
142    RgPdcch        pdcch;
143    Buffer         *tb;
144    U16            txPwrOffset; /*!< PDSCH Tx Pwr offset */
145 } RgPcchTb;
146
147 typedef struct rgRaRspAlloc
148 {
149    RgPdcch        pdcch;     /*!< NULLP if no Rsp allocation done for raRnti*/
150    Buffer         *rar;
151    U16            txPwrOffset; /*!< PDSCH Tx Pwr offset */
152 }RgRaRspAlloc;
153
154 typedef struct rgBchTb
155 {
156    Buffer         *tb;    /*!< BCH data for this frame */
157 }RgBchTb;
158
159
160 typedef struct rgDlSf
161 {
162    CmLteTimingInfo schdTime;  /*!< scheduled frame and subframe number */
163    Bool           txDone;     /*!< Flag to indicate transmission done */
164 /* ADD Changes for Downlink UE Timing Optimization */
165 #ifdef LTEMAC_DLUE_TMGOPTMZ  
166    U8            remDatReqCnt; /*!< Counter to maintain count of Ded data received.*/  
167    /* Fix [ccpu00126310]: Tracks Data Requests from RLC for both loosely and tight coupled 
168       RLC-MAC */
169    Bool           statIndDone; /*!< Marks sending of all status indication done */
170 #endif
171    RgBchTb        bch;        /*!< BCH data for this frame */
172    RgBcchTb       bcch;       /*!< BCCH allocation for this frame */
173 #ifdef EMTC_ENABLE
174    RgEmtcBcchTb   emtcBcch;   /*!< EMTC BCCH allocation for this frame */
175 #endif
176    RgPcchTb       pcch;       /*!< PCCH allocation for this frame */
177    CmLListCp      tbs;        /*!< TBs or DL HARQ processes */
178    U8             numRaRsp;   /*!< No.of RaRsp */
179    RgRaRspAlloc   raRsp[RG_MAX_RA_RNTI]; /* Array of list of Ra Rsp 
180                                        Allocations for each rarnti */
181    U8    numTbReqsSent;        /*!< Number of TB requests sent towards SMAC.
182    Total numTbReqsSent will be equal to maximum secondary cells */                               
183 } RgDlSf;
184
185 /** 
186   * @brief
187   * Logical channel control block for BCCH and PCCH channels. 
188   */
189 typedef struct rgBcchDlschLcCb
190 {
191    CmLteLcId       lcId;                     /*!< Logical channel ID */
192    Buffer          *tb;
193 } RgBcchDlschLcCb;
194
195 typedef struct rgBcchBchLcCb
196 {
197    CmLteLcId       lcId;                     /*!< Logical channel ID */
198 } RgBcchBchLcCb;
199
200 typedef struct rgPcchLcCb
201 {
202    CmLteLcId       lcId;                     /*!< Logical channel ID */
203 } RgPcchLcCb;
204
205 /** 
206   * @brief
207   * Random access information per cell. 
208   */
209 typedef struct rgRaInfoCb
210 {
211    CmLListCp       ueRachLst;                   /*!< List of RaCbs */
212 } RgRaInfoCb;
213
214 typedef struct rgSchInstMap
215 {
216    S16          cellSapId; /*!< SAP ID of the cell in scheduler instance */
217    Inst          schInst;  /*!< Scheduler instance that is serving this cell*/
218 } RgSchInstMap;
219
220 /** 
221   * @brief
222   * Configuration Information for Upper SAPs at RGU,CRG and RGR interfaces.
223   */
224 typedef struct rgUpSapCfgInfo
225 {
226    Pst  sapPst;              /*!< Post information associated with SAP */
227    SpId spId;                /*!< SpId associated with SAP */
228    SuId suId;                /*!< SuId associated with SAP */
229 }RgUpSapCfgInfo;
230
231 /** 
232   * @brief
233   * Configuration Information for Lower SAP at TFU interface
234   */
235 typedef struct rgLowSapCfgInfo
236 {
237    Pst    sapPst;            /*!< Post information associated with SAP */
238    SpId   spId;              /*!< SpId associated with SAP */
239    SuId   suId;              /*!< SuId associated with SAP */
240    TmrCfg bndTmr;            /*!< Bind Timer Value */
241 }RgLowSapCfgInfo;
242
243 /** 
244   * @brief
245   * Control Block structure for Upper SAPs at RGU,CRG and RGR interfaces.
246   */
247 typedef struct rgUpSapCb
248 {
249    RgUpSapCfgInfo sapCfg;    /*!< Configuration information */
250    RgSapSts     sapSts;      /*!< Statistics related to SAP */
251    RgSapSta     sapSta;      /*!< SAP Status */
252 }RgUpSapCb;
253
254 /** 
255   * @brief
256   * Control Block structure for Lower SAP at TFU interface.
257   */
258 typedef struct rgLowSapCb
259 {
260    RgLowSapCfgInfo sapCfg;          /*!< SAP configuration information */
261    RgSapSts        sapSts;          /*!< Statistics related to SAP */
262    RgSapSta        sapSta;          /*!< SAP Status */
263    U8              numBndRetries;   /*!< Number of Bind Retries */
264 }RgLowSapCb;
265
266 /**
267   * @brief
268   * MAC sub-header control block for 5G-NR MAC
269   * sub-hdr for fixed size MAC CE - 1 octat(R/R/LCID)
270   * sub-hdr for variable size MAC CE or MAC SDU -2/3 octat(R/F/LCID/L(8/16 bits))
271   * 
272   */
273 typedef struct RgMUXSubHdr
274 {
275    U8 shLen;  
276    U8 shData[RG_MAX_SDU_SUB_HDR_LEN]; /* RRLCID/RFLCID + F-L (O) + L (O) */
277 } RgMUXSubHdr;
278
279
280 /** 
281   * @brief
282   * Cell Control block per cell 
283   */
284 struct rgCellCb
285 {
286    CmHashListEnt  cellLstEnt;       /*!< Hash list Entity for cell list */
287    RgSchInstMap   schInstMap;      /*!< Sch Inst Info */
288    CmLteCellId    cellId;           /*!< Cell ID */
289    CmLteTimingInfo crntTime;
290    U8             maxDlHqProcPerUe;  /*!< Store based on FDD/TDD(UL/DL Index) */
291    CrgBwCfg        bwCfg;            /*!< Bandwidth Configuration */
292    CrgRachCfg      rachCfg;          /*!< RACH Configuration */
293
294    RgUpSapCb    *rguDlSap;            /*!< RGU SAP Control Block for RLC DL  */
295    RgUpSapCb    *rguUlSap;           /*!< RGU SAP Control Block  for RLC UL*/
296    Inst         macInst;            /*!< MAC Instance id for this cell */
297    U8           cellActvState;      /*!< Bitmask indicating if cell is active:
298                                        Cell is active only after BCCH, PCCH, DL
299                                        CCCH, UL CCCH and scheduler config */
300    CmLteLcId       ulCcchId;         /*!< LcId for uplink CCCH */
301    CmLteLcId       dlCcchId;         /*!< LcId for downlink CCCH */ 
302    RgBcchBchLcCb  bcchBchInfo;      /*!< BCCH mapped on BCH 
303                                        logical channel control block */
304    RgPcchLcCb      pcchInfo;        /*!< PCCH logical channel control block */
305    U8              numBcchDlschInfo;
306    RgBcchDlschLcCb bcchDlschInfo[RG_MAX_BCCH_DLSCH]; /*!< BCCH mapped on DLSCH 
307                                              logical channel control block */
308    CmHashListCp    ueLst;            /*!< Hash list of UE control 
309                                                    blocks: RgUeCb */
310    /*Added support for SPS*/
311 #ifdef LTEMAC_SPS
312    CmHashListCp    spsUeLst;         /*!< Hash list of UECbs with SPS-Rnti
313                                                   : Element is RgUeCb */
314 #endif
315    RgRaInfoCb      raInfo;           /*!< Random access related information for
316                                           cell */
317    RgDlSf          subFrms[RG_NUM_SUB_FRAMES];
318 #ifdef LTE_L2_MEAS
319    CmLListCp         l2mList;                     /*!< List of all L2M requests
320                                                      rgSchL2MeasCb */
321    RgQciCb           qciArray[LRG_MAX_QCI];       /*!< List of all qci's configured
322                                                       rgQciCb */
323    RgUlSf            ulSf[RG_NUM_UL_SUB_FRAMES];  /*!< UL Sub frame */
324    Bool              sndL2Meas;                   /*!< Send L2 Meas when No L2 Measuremnt timer is running*/
325
326    U32               ttiCycle;             /*!< Count of Number of 10240 Cycles
327                                              completed */
328
329 #endif /* LTE_L2_MEAS */
330    RguFlowCntrlInd  *flowCntrlInd;        /*!<Pre Alloced buffer for flow control */
331    /* RRM_SP1_START */
332    U32             qcisUlPrbCnt[RG_MAX_QCI_REPORTS];         /*!< GBR Lc PRB count */
333    /* RRM_SP1_END */
334 #ifdef LTE_ADV
335   //RgLaaTbReq  *laaCellHqPLst[RG_MAX_SCELL_PER_UE]; /*!< LAA: List containing of TBs requested per
336                                             //SCELL*/
337   Void * laaCb;
338 #endif
339 #ifdef EMTC_ENABLE
340     U8               emtcEnable;
341 #endif
342    /* 5GNR changes */
343    MacCellCfg macCellCfg;   /* MAC cell config paramters */
344 };
345
346 /**
347   * @brief
348   * Uplink HARQ entity information per UE.
349   */
350 typedef struct rgUlHqEnt
351 {
352    U8           maxHqRetx;        /*!< Maximum number of harq
353                                    * re-transmissions */ 
354 } RgUlHqEnt;
355 #ifdef LTE_L2_MEAS
356
357 /**
358   * @brief Structure to hold Uplink throughtput info for L2 measurement.
359   *
360   * @details
361   *   - outStndngBs     : outstanding buffer status
362   *   - firstDatSegRcvd : first dat req seg recvd
363   *   - frstSegTimInfo  : fisrt seg time information
364   *   - nextSegTimInfo  : next seg time information
365   *   - segInd          : UL thrgouthput indication
366   *   - fSegTtiCycNum   : First Seg tti cycles
367   *   - nSegTtiCycNum   : next seg tti cycles
368   */
369 typedef struct rgL2MeasUlThrP
370
371    S32 outStndngBs;                 /*!< outstanding buffer status*/
372    Bool firstDatSegRcvd;            /*!< first dat req seg recvd*/
373    CmLteTimingInfo frstSegTimInfo;  /*!< fisrt seg time information*/
374    CmLteTimingInfo nextSegTimInfo;  /*!< next seg time information*/
375    RguL2MUlThrpSegInd segInd;       /*!< UL thrgouthput indication*/
376    U32 fSegTtiCycNum;               /*!< First Seg tti cycles*/
377    U32 nSegTtiCycNum;               /*!< next seg tti cycles*/
378 } RgL2MeasUlThrP;
379 #endif
380
381 /** 
382   * @brief
383   * Logical channel group
384   */
385 struct rgLcgCb
386 {
387    /* Right now not keeping associated logical channels, searching for
388     * associated channels needed only during config */
389    LteLcgId    lcgId;  /*!< Group ID */
390    U8          lcCount;
391 #ifdef LTE_L2_MEAS
392
393    RgL2MeasUlThrP lcgBsInfo;
394
395 #endif
396    Bool        isGbr;  /*!< Indicate if LCG is GBR LCG */
397 };
398
399
400
401
402 /**
403   * @brief
404   * Uplink control block for UE specific information
405   */
406 typedef struct rgUeUlCb
407 {
408    RgUlHqEnt  hqEnt;      /*!< Uplink HARQ information for the UE */
409    RgUlLcCb   lcCb[RG_MAX_LC_PER_UE]; /*!< Dedicated Uplink logical channel 
410                                            information */
411    RgLcgCb    lcgArr[RG_MAX_LCG_PER_UE]; /*!< Logical channel groups */
412    /* Added support for SPS*/
413 #ifdef LTEMAC_SPS
414    Bool            spsLcId[RG_MAX_LC_PER_UE];  /*!< Set to TRUE for SPS LCs */ 
415    U8              implRelCntr;    /*!< Number of empty sps transmissions for
416                                     implicit(?) release */
417    U8              implRelCnt; /*!< Configured value of implicitRelAfter +
418                                     RG_ADDL_SPS_OCC_FOR_EXP_REL */
419    U8              explRelCntr;/*!< Counter to track explicit release */
420    U8              explRelCnt; /*!< Count to trigger explicit release */
421 /*Added for explicit release - start*/
422    U8              spsDatRcvd; /*!< Count to track SPS data for explicit 
423                      release*/
424    U32             totSpsDatRcvd; /*!< total number of SPS data recieved
425                      from activation*/
426 #endif
427 } RgUeUlCb;
428
429 /** 
430   * @brief
431   * Logical channel data as being scheduled by the scheduler.
432   */
433 typedef struct rgLchSchdData
434 {
435    CmLteLcId       lcId;       /*!< Logical channel ID */
436    U32             schdSz;   /*!< Scheduled logical channel data */
437 } RgLchSchdData;
438
439 /** 
440   * @brief
441   * Contention Resolution ID. 
442   */
443 typedef struct RgContResId
444 {
445    U8        resId[RG_CRES_LEN];
446 }RgContResId;
447
448 /** 
449   * @brief
450   * Used to keep sf and SfLnk in Tb. 
451   */
452 typedef struct rgTbSfLnkInfo
453 {
454    RgDlSf          *sf;   /*!< Sf pointer to check if SfAlloc came for Tb in a SF */
455    CmLList         sfLnk; /*!< Used to queue it up on a subfrm */
456 }RgTbSfLnkInfo;
457
458 /** 
459   * @brief
460   * Transport Block Info scheduled by the scheduler.
461   */
462 typedef struct rgTbInfo{
463    U8              numSchLch;
464    RgLchSchdData   schdData[RG_MAX_NUM_DED_LC];
465    TknU8           schdTa;  /*!< TA scheduled to be sent */
466    /* Changed as a result of CR timer implementation*/
467    U8              contResCe;   /*!< Contention Resolution CE scheduled 
468                                    to be sent */
469    RgContResId     *contResId;  /*!< Contention Resolution Identity */
470 #ifndef L2_OPTMZ
471    Buffer          *tb;    /*!< Multiplexed Pdu */
472 #else
473    /* L2 Optimization for mUe/Tti:Pre-allocated MAC Hdr, MAC CEs and padding
474     * will be used to store and send to CL. These pointer will be allocated
475     * during Harq Proc creation. CL shall not free these pointers.
476     * These pointers will be freed duing harq proc deletion
477     */
478     RgTfuDatReqTbInfo     tb;   /* TB to be sent to CL/PHY*/
479 #endif
480 /* Changes for MIMO feature addition */
481 /* Removed dependency on MIMO compile-time flag */
482    U32             tbSz;   /*!< TB size scheduled for the hqP */    
483    RgPdcch         pdcch;  /*!< PDCCH allocated for this HQ Proc */
484    /* Adding Array of sfLnk in case of repetitions because same lnk in mutiple
485     * list causing issues*/
486    RgTbSfLnkInfo   sfLnkInfo[2]; /*!< Used to queue it up on a subfrm */
487    RgDlSf          *sf;
488    CmLteTimingInfo timingInfo; /*!<This field holds the scheduled time */
489    TknU32           doa;
490    TfuTxMode        txMode;
491    Bool              puschRptUsd; /*!< True if Precoding Info in PDCCH has to be
492                                    in-accordance with the latest PUSCH report */
493    TfuDlCqiPuschInfo puschPmiInfo;/*!< PUSCH report details for explicit PMI
494                                        * information to PHY during a PDSCH */
495    /* LTE_ADV_FLAG_REMOVED_START */
496 #ifdef TFU_UPGRADE
497    U8            pa;                 /* DL Power control paramter P_A
498                                      configured by higher layers
499                                      Ref: RRC 36.331, 6.3.2,
500                                      PDSCH-Config*/
501 #endif
502    U8 isEnbSFR;
503 #ifdef LTE_ADV
504    TknU8           sCellActCe;     /*!< SCell Act ce scheduled to be sent */
505 #endif
506    /* LTE_ADV_FLAG_REMOVED_END */
507 }RgTbInfo;
508
509 /** 
510   * @brief
511   * Downlink HARQ process information per UE.
512   */
513 struct rgDlHqProcCb
514 {
515    U8              procId;    /*!< HARQ process ID */
516 /* Changes for MIMO feature addition */
517 /* Removed dependency on MIMO compile-time flag */
518    U8              numOfTBs;
519    RgTbInfo        tbInfo[RG_MAX_TB_PER_UE];
520    U16             saveId; // laa
521 #ifdef LTE_L2_MEAS
522
523    U32           tbId[RGU_MAX_TB];          /*!< RLC's internal tbId */                                    
524    U16           status[RGU_MAX_TB];        /*!< Status back to RLC ACK/NACK*/
525 #endif /* LTE_L2_MEAS */
526 /* Changes for MIMO feature addition */
527 /* Removed dependency on MIMO compile-time flag */
528 };
529
530
531 /** 
532   * @brief
533   * Downlink HARQ entity information per UE.
534   */
535 struct rgDlHqEnt
536 {
537    U8           numHqProcs;
538    RgDlHqProcCb *procs[RG_MAX_DL_HARQ_NUM]; /*!< Downlink harq processes */
539    CmLListCp    savedProcLst[RG_MAX_DL_HARQ_NUM]; /*!< laa: Saved TBs for the release Hq Procs*/
540 };
541
542
543
544 /**
545   * @brief
546   * Downlink control block for UE specific information.
547   */
548 typedef struct rgUeDlCb
549 {
550    RgDlHqEnt  hqEnt;        /*!< Downlink HARQ information for the UE */          
551    RgDlLcCb   lcCb[RG_MAX_LC_PER_UE];/*!< Dedicated Downlink logical channels in
552 UE */ 
553 } RgUeDlCb;                   
554
555 #ifdef LTE_ADV
556 typedef struct rgSCellAddCfgCfmInfo
557 {
558    CrgCfgTransId   transId;   /*!< Scell add transaction id*/
559    U8              numSCells; /*!< Used to check if config cfm rcvd from all Scells*/ 
560    U8              cfgCfgCount; /*!< Keep count of cfg confirms recvd */
561    U8              mask; /*!< Cfg cfm mask */
562 }RgSCellAddCfgCfmInfo;
563
564 typedef struct rgSCelInfo
565 {
566    Bool           isSCellAdded;     /*!< is Cell Added TRUE/FALSE */
567    Inst           macInst;          /*!< MAC Instance of that 
568                                          Cell Added */
569    CmLteCellId    sCellId;          /*!< Secondary Cell ID */
570 }RgSCelInfo;
571
572 #endif
573
574 /** 
575   * @brief
576   * UE control block for UE specific information
577   */
578 struct rgUeCb
579 {
580    CmHashListEnt     ueLstEnt;   /*!< Hash List entity for UE List */
581    /* Added suport for SPS*/
582 #ifdef LTEMAC_SPS
583    CmHashListEnt     spsUeLstEnt;/*!< Hash List entity for SPS Rnti */
584 #endif
585    CmLList           rachLstEnt; /*!< Link List entity for RACH UE List*/ 
586    CmLteRnti         ueId;       /*!< UE identifier */
587    /* Added suport for SPS*/
588 #ifdef LTEMAC_SPS
589    CmLteRnti         spsRnti;    /*!< SPS-Rnti for the UE */
590 #endif
591    RgContResId       contResId;  /*!< Contention Resolution Identity */
592    RgUeUlCb          ul;        /*!< UE Specific Uplink information */
593    RgUeDlCb          dl;        /*!< UE Specific Downlink information */
594 /* Changes for MIMO feature addition */
595 /* Removed dependency on MIMO compile-time flag */
596    CrgTxMode         txMode;      /*!< UE Transmission mode Cfg */
597    RgUpSapCb        *rguDlSap;    /*!< RGU SAP Control Block for RLC DL  */
598    RgUpSapCb        *rguUlSap;    /*!< RGU SAP Control Block  for RLC UL*/
599 #ifdef LTE_ADV
600    RgSCelInfo        sCelInfo[RG_MAX_SCELL_PER_UE]; /*!<sCell Information */
601    RgSCellAddCfgCfmInfo cfgCfmInfo; /*!< Scell add cfg cfm info*/
602 #endif /* LTE_ADV */
603 };
604
605 /** 
606   * @brief
607   * structure holding Layer Manager Response information cached from control
608   * request.
609   */
610 typedef struct rgLmResponse
611 {
612    TranId transId;           /*!< Transaction ID */
613    Resp   response;          /*!< Response */
614 }RgLmResponse;
615
616 /** 
617   * @brief
618   * Structure holding LTE MAC's General Configuration Information.
619   */
620 typedef struct rgGenCb
621 {
622    U8           tmrRes;           /*!< Timer resolution */
623    RgLmResponse trcResp;          /*!< Response value for Trace Indication */
624    RgLmResponse ustaResp;         /*!< Respones value for Alarms */
625    RgLmResponse bndCfmResp;       /*!< Respones value for Bind Confirm */
626    Status       memUpperThr;      /*!< upper threshold of the memory pool */
627    Status       memLowerThr;      /*!< lower threshold of the memory pool */
628 }RgGenCb;
629
630
631
632 /** 
633   * @brief
634   * Global Control block for LTE-MAC.
635   */
636 struct _rgCb
637 {
638    TskInit      rgInit;                    /*!< Task Init information */
639    S16          trcLen;                    /*!< trace length */
640    RgGenCb      genCfg;                    /*!< General Config information */
641    U8           numRguSaps;                /*!< Numb of RGU SAP Control Block */
642    RgUpSapCb    *rguSap;                     /*!< RGU SAP Control Block */
643    RgUpSapCb    crgSap;                    /*!< CRG SAP Control Block */
644    RgLowSapCb   tfuSap;                    /*!< TFU SAP Control Block */
645    RgGenSts     genSts;                    /*!< General Statistics */
646    CmTqCp       tmrTqCp;                   /*!< Timer Task Queue Cntrl Point */
647    CmTqType     tmrTq[RG_TQ_SIZE];         /*!< Timer Task Queue */
648    CmTimer      tmrBlk[RG_MAX_TIMER];      /*!< Timer Block */
649    RgCellCb *inactiveCell;                     /*!< Reference of last accessed cellCb*/
650    RgCellCb *cell;                     /*!< Reference of last accessed cellCb*/
651    RgCellCb *prevCell;                     /*!< Reference of last accessed cellCb*/
652    U8 bufCnt;                              /*!< Count of buffers in buffersToFree[] */
653    Buffer *bufToFree[RG_MAX_DFRD_FREE_BUFS];/*!< List of Shared Buffers to be freed */
654 };
655
656 /* Declaration for RgCb */
657 EXTERN RgCb rgCb[RG_MAX_INST];
658
659 /** 
660   * @brief
661   * Subheader of MAC SDU.
662   */
663 typedef struct rgMacSdu
664 {
665    CmLList  sduLstEnt;  /*!< List entry for MAC SDU subheader */
666    CmLteLcId       lcId;       /*!< Logical channel ID */
667    U16      len;        /*!< Length of the SDU */
668    Buffer   *mBuf;      /*!< SDU Buffer */
669 } RgMacSdu;
670
671 /** 
672   * @brief
673   * MAC PDU Contents.
674   */
675 typedef struct rgMacPdu
676 {
677    CmMemListCp memCp;     /*!< Memory control point */
678    CmLListCp   sduLst;    /*!< List of SDUs */
679 } RgMacPdu;
680
681 /** 
682   * @brief
683   * Carries the Error Information.
684   */
685 struct rgErrInfo
686 {
687    U8    errType;    /*!< Error Type */
688    U16   errCause;   /*!< Cause of Error */
689 };
690
691 /** 
692   * @brief
693   * Carries the Information to build PDU.
694   */
695 typedef struct rgBldPduInfo
696 {
697    Void           *datReq;    /*!< Common/Dedicated Dat Request */
698    U8             reqType;    /*!< EVTRGUCDATREQ/EVTRGUDDATREQ */
699    MsgLen         schdTbSz;   /*!< Schedule TB size */
700    U8             tbIndex;    /*!< Transport Block Index */
701    TknU8          ta;         /*!< Timing Advance */
702    RgContResId    *contResId; /*!< Contention Resolution ID */
703 #ifdef LTE_ADV
704    TknU8          sCellActCe; /*!< SCell Act CE info */
705 #endif
706 } RgBldPduInfo;
707
708
709
710 /* APIs exposed by LIM */
711
712 #ifdef LTE_L2_MEAS /*LTE_L2_MEAS_PHASE2*/
713 EXTERN S16 rgAddToL2MeasPerQci ARGS ((RgCellCb  *cell,U8 qci));
714 #endif
715 EXTERN S16 rgLIMTfuBndReq ARGS((
716          Inst                 inst,
717          SuId                 suId,
718          SpId                 spId));
719
720 EXTERN S16 rgLIMTfuUbndReq ARGS((
721          Inst                 inst,
722          SuId                 suId,
723          Reason               reason));
724
725 EXTERN S16 rgLIMTfuDatReq ARGS((
726          Inst          inst,
727          TfuDatReqInfo *datReq));
728 #ifdef L2_OPTMZ
729 EXTERN S16 rgLIMTfuDelDatReq ARGS((
730          Inst          inst,
731          TfuDelDatReqInfo *datReq));
732 #endif /*L2_OPTMZ */
733 /* APIs exposed by TOM */
734
735 EXTERN S16 rgTOMDatInd ARGS((
736          Inst          inst,
737          TfuDatIndInfo *datInd));
738
739 EXTERN S16 macProcessSlotInd ARGS((
740          Inst          inst,
741          SlotIndInfo slotInd));
742 EXTERN Void rgTOMRlsSf ARGS((Inst inst,RgDlSf *dlSf));
743
744 EXTERN S16 rgSchMacSfAllocReq ARGS((Pst *pst, RgInfSfAlloc *sfInfo));
745
746 /*
747  * APIs exposed by LMM
748  */
749 EXTERN S16 rgLMMStartTmr ARGS((Inst inst,S16 tmrEvnt, U32 tmrVal, PTR cb));
750 EXTERN S16 rgLMMStopTmr ARGS((Inst inst,S16 tmrEvnt, PTR cb));
751 EXTERN S16 rgLMMTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
752 /* To send a Unsolicited Status Indication to Layer Manager */
753 EXTERN S16 rgLMMStaInd ARGS((Inst inst,U16 category, U16 event, U16 cause, RgUstaDgn *dgn));
754 /* To send a Trace Indication to Layer Manager.
755  * srcMbuf is not freed. caller has to take care. */
756 EXTERN Void rgLMMTrcInd ARGS((Inst inst,Buffer *srcMbuf, U8 event));
757 /* LIM uses this to forward the BndCfm to LMM. This function invokes a
758  * Control Confirmation to the LM. */
759 EXTERN S16 rgLMMBndCfm ARGS((Pst *pst, SuId suId, U8 status));
760 EXTERN S16 rgActvTmr ARGS((Ent ent, Inst inst ));
761 EXTERN S16 rgActvInit ARGS((Ent entity, Inst inst, Region 
762        region, Reason reason));
763 EXTERN S16 rgActvTsk ARGS((Pst *pst, Buffer *mBuf));
764
765 /* 
766  * APIs exposed by CFG module
767  */
768 EXTERN S16 rgCFGVldtCrgCellCfg ARGS((Inst inst,CrgCellCfg *cellCfg, RgErrInfo *errInfo));
769 EXTERN S16 rgCFGVldtCrgUeCfg ARGS((Inst inst,CrgUeCfg  *ueCfg, RgCellCb  **cell, RgErrInfo
770       *errInfo));
771 EXTERN S16 rgCFGVldtCrgLcCfg ARGS((Inst inst,CrgLchCfg *lcCfg, RgCellCb **cell, RgUeCb
772       **ue, RgErrInfo  *errInfo));
773 EXTERN S16 rgCFGVldtCrgCellRecfg ARGS((Inst inst,CrgCellRecfg *cellRecfg, RgCellCb **cell,
774       RgErrInfo *errInfo));
775 EXTERN S16 rgCFGVldtCrgUeRecfg ARGS((Inst inst,CrgUeRecfg *ueRecfg, RgCellCb **cell,
776       RgUeCb **ue, RgErrInfo *errInfo));
777 EXTERN S16 rgCFGVldtCrgLcRecfg ARGS((Inst inst,CrgLchRecfg *lcRecfg, RgCellCb **cell,
778       RgUeCb **ue, RgUlLcCb **ulLc, RgErrInfo *errInfo));
779 EXTERN S16 rgCFGVldtCrgUeReset ARGS ((Inst inst,CrgRst *reset,RgCellCb **cell,RgUeCb **ue,
780          RgErrInfo   *errInfo));
781
782 EXTERN S16 rgCFGCrgCellCfg ARGS((Inst inst,CrgCellCfg *cellCfg, RgErrInfo *errInfo));
783 EXTERN S16 rgCFGCrgUeCfg ARGS((Inst inst,RgCellCb  *cell, CrgUeCfg  *ueCfg, RgErrInfo
784       *errInfo));
785
786 #ifdef LTE_ADV
787 EXTERN S16 rgFillAndAddSCellCfg ARGS((Inst inst, RgCellCb  *cell, 
788          CrgUeRecfg *ueRecfg, CrgCfgTransId transId, Bool *isCfmRqrd));
789 EXTERN S16 rgDelUeFrmAllSCell ARGS(( RgCellCb       *cell, RgUeCb         *ue));
790 EXTERN S16 rgUtlVltdAddSCellCfg ARGS ((RgPrgUeSCellCfgInfo *ueSCellCb,
791                                        RgCellCb    *cell,
792                                        Inst        inst
793                                      ));
794 EXTERN S16 rgCfgAddUeSCellCfg ARGS ((Inst        dstMacInst,
795                                     RgPrgUeSCellCfgInfo *ueSCellCb,
796                                     RgCellCb    *cell
797                                   ));
798 #endif /* LTE_ADV */
799
800 EXTERN S16 rgCFGCrgLcCfg ARGS((Inst inst,RgCellCb *cell, RgUeCb *ue, CrgLchCfg
801       *lcCfg, RgErrInfo *errInfo,Bool *isCfmRqrd,CrgCfgTransId   transId));
802 EXTERN S16 rgCFGCrgCellRecfg ARGS((Inst inst,RgCellCb *cell, CrgCellRecfg *cellRecfg,
803       RgErrInfo *errInfo));
804 EXTERN S16 rgCFGCrgUeRecfg ARGS((Inst inst,RgCellCb *cell, RgUeCb *ue, CrgUeRecfg
805       *ueRecfg, RgErrInfo *errInfo));
806 EXTERN S16 rgCFGCrgLcRecfg ARGS((Inst inst,RgCellCb *cell, RgUeCb *ue, RgUlLcCb
807       *ulLc, CrgLchRecfg *lcRecfg, RgErrInfo *errInfo, Bool *isCfmRqrd));
808 EXTERN S16 rgCFGCrgCellDel ARGS((Inst inst,CrgDel *cellDelInfo, RgErrInfo *errInfo));
809 EXTERN S16 rgCFGCrgUeDel ARGS((Inst inst,CrgDel *ueDelInfo, RgErrInfo *errInfo));
810 EXTERN S16 rgCFGCrgLcDel ARGS((Inst inst,CrgDel *lcDelInfo, RgErrInfo
811          *errInfo,Bool *isCfmRqrd,CrgCfgTransId transId));
812 EXTERN Void rgCFGFreeCellCb ARGS((RgCellCb *cell));
813 EXTERN Void rgCFGFreeInactvCellCb ARGS((RgCellCb *cell));
814 EXTERN S16 rgSchMacCellRegReq ARGS((Pst* pst,RgInfCellReg* regReq));
815 EXTERN S16 rgCFGCrgUeReset ARGS((RgCellCb *cell,RgUeCb *ue,CrgRst *reset,
816          RgErrInfo *errInfo));
817
818 /* 
819  * APIs exposed by COM module
820  */
821 EXTERN S16 rgCOMCfgReq ARGS((Inst inst,CrgCfgTransId transId, CrgCfgReqInfo
822          *cfgReqInfo));
823
824 /* APIs Exposed by UIM */
825 EXTERN S16 rgUIMRguBndCfm ARGS ((Inst inst,SuId suId, U8 status));
826 EXTERN S16 rgUIMSndDedStaInd ARGS ((Inst inst,RgUpSapCb *rguDlSap,RgRguDedStaInd  *staInd));
827 EXTERN S16 rgUIMSndCmnStaInd ARGS ((Inst inst,RgUpSapCb *rguDlSap,RgRguCmnStaInd  *staInd));
828 EXTERN S16 rgUIMSndDedDatInd ARGS ((Inst inst,RgUpSapCb *rguDlSap,RgRguDedDatInd  *datInd));
829 #ifdef LTE_L2_MEAS
830 EXTERN S16 rgL2mCreateMeasCb ARGS((
831          RgCellCb       *cell,
832          RgInfL2MeasReq *measInfo, 
833          U8              measType,
834          RgErrInfo      *err
835 ));
836 EXTERN  S16 rgL2mMeasReq ARGS((
837          RgCellCb       *cell,
838          RgInfL2MeasReq *measInfo,
839          RgErrInfo      *err
840 ));
841 EXTERN S16 rgL2Meas ARGS ((
842          RgCellCb  *cell
843 ));
844 #endif /* LTE_L2_MEAS */
845 EXTERN S16 rgUIMSndCmnDatInd ARGS ((Inst inst,RgUpSapCb *rguSap,RgRguCmnDatInd  *datInd));
846 EXTERN S16 rgUIMCrgBndCfm ARGS ((Inst inst,SuId suId,U8 status));
847 EXTERN S16 rgUIMCrgCfgCfm ARGS ((Inst inst,CrgCfgTransId transId,U8 status));
848
849
850 /* 
851  * APIs exposed by ROM module
852  */
853 EXTERN S16 rgROMDedDatReq ARGS((Inst inst,RgRguDedDatReq *datReq));
854 EXTERN S16 rgROMCmnDatReq ARGS((Inst inst,RgRguCmnDatReq *datReq));
855 EXTERN S16 rgROMDedStaRsp ARGS((Inst inst,RgRguDedStaRsp *staRsp));
856 EXTERN S16 rgROMCmnStaRsp ARGS((Inst inst,RgRguCmnStaRsp *staRsp));
857 #ifdef LTE_L2_MEAS
858
859 EXTERN S16 rgROML2MUlThrpMeasReq ARGS((Inst inst,RgRguL2MUlThrpMeasReq *measReq));
860
861 #endif
862
863 /* 
864  * APIs exposed by RAM module
865  */
866 EXTERN RgUeCb* rgRAMCreateUeCb ARGS((RgCellCb *cell,
867                      CmLteRnti tmpCrnti,Bool insert, RgErrInfo *err));
868 EXTERN S16 rgRAMFreeCell ARGS((RgCellCb    *cell));
869 EXTERN Void rgRAMFreeUeCb ARGS((Inst inst,RgUeCb *ueCb));
870 EXTERN S16 rgHndlRaResp ARGS((RgCellCb *cell,CmLteTimingInfo timingInfo,
871             RgInfRarInfo  *rarInfo,RgErrInfo *err));
872 EXTERN S16 rgSchMacRlsRntiReq ARGS((Pst *pst,RgInfRlsRnti* rlsRnti));
873 /* 
874  * APIs exposed by UHM module
875  */
876 EXTERN Void rgUHMCrgUeCfg ARGS(( RgCellCb *cellCb, RgUeCb *ueCb, 
877                                  CrgUeCfg *ueCfg));
878 EXTERN Void rgUHMCrgUeRecfg ARGS(( RgCellCb *cellCb, RgUeCb *ueCb, 
879                               CrgUeRecfg *ueRecfg));
880 /* 
881  * APIs exposed by DUX module
882  */
883 EXTERN S16 rgDUXDemuxData ARGS((Inst inst,RgMacPdu *pdu, RgInfCeInfo   *ceInfo,
884                                 Buffer **mBuf, RgErrInfo *err)); 
885 EXTERN S16 rgDUXExtSduLen ARGS
886 ((
887 Inst        inst,
888 Buffer      *mBuf,
889 U16         *sduLen,
890 RgErrInfo   *err
891 ));
892
893 /* 
894  * APIs exposed by DBM module
895  */
896
897 EXTERN S16 rgDBMInitInactvCellLst ARGS((U16 numBins));
898 EXTERN S16 rgDBMDeInitInactvCellLst ARGS((Void));
899 EXTERN S16 rgDBMInsInactvCellCb ARGS(( RgCellCb *cellCb));
900 EXTERN RgCellCb* rgDBMGetInactvCellCb ARGS(( CmLteCellId cellId));
901 EXTERN S16 rgDBMDelInactvCellCb ARGS(( RgCellCb *cellCb));
902 EXTERN RgCellCb* rgDBMGetNextInactvCellCb ARGS((RgCellCb *cellCb));
903
904 EXTERN S16 rgDBMInitCellLst ARGS(( U16 numBins));
905 EXTERN S16 rgDBMDeInitCellLst ARGS((Void));
906 EXTERN S16 rgDBMInsCellCb ARGS(( RgCellCb *cellCb));
907 EXTERN RgCellCb* rgDBMGetCellCb ARGS(( CmLteCellId cellId));
908 EXTERN S16 rgDBMDelCellCb ARGS(( RgCellCb *cellCb));
909 EXTERN RgCellCb* rgDBMGetNextCellCb ARGS((RgCellCb *cellCb));
910 EXTERN S16 rgDBMInitCell ARGS((RgCellCb *cellCb));
911
912 EXTERN S16 rgDBMDeInitUeCbLst ARGS(( RgCellCb *cellCb));
913 EXTERN S16 rgDBMInsUeCb ARGS(( RgCellCb *cellCb, RgUeCb *ueCb));
914 EXTERN RgUeCb* rgDBMGetUeCb ARGS(( RgCellCb *cellCb, CmLteRnti ueId));
915 EXTERN RgUeCb* rgDBMGetNextUeCb ( RgCellCb *cellCb, RgUeCb *ueCb);
916 EXTERN S16 rgDBMDelUeCb ARGS(( RgCellCb *cellCb, RgUeCb *ueCb));
917 EXTERN Void rgDBMInitUe ARGS((RgUeCb *ueCb));
918
919 #ifdef LTE_L2_MEAS
920 EXTERN Void rgDBMInsUlDedLcCb ARGS((RgUeCb *ueCb, CmLteLcId idx, LteLcgId  gId,
921                         U8  qci));
922 #else
923 EXTERN Void rgDBMInsUlDedLcCb ARGS((RgUeCb *ueCb, 
924                   CmLteLcId idx, LteLcgId gId));
925 #endif
926 EXTERN Void rgDBMUpdUlDedLcCb ARGS((RgUeCb *ueCb, 
927                RgUlLcCb *ulLcCb, LteLcgId gId));
928
929 EXTERN Void rgDBMInsDlDedLcCb ARGS((RgUeCb *ueCb, CmLteLcId idx));
930 EXTERN Void rgDBMDelUlDedLcCb ARGS((RgUeCb *ueCb, RgUlLcCb *ulLcCb));
931 EXTERN Void rgDBMDelDlDedLcCb ARGS((RgUeCb *ueCb, RgDlLcCb *dlLcCb));
932 EXTERN RgDlLcCb* rgDBMGetDlDedLcCb ARGS(( RgUeCb *ueCb, CmLteLcId idx));
933 EXTERN RgUlLcCb* rgDBMGetUlDedLcCb ARGS(( RgUeCb *ueCb, CmLteLcId idx));
934 EXTERN Void rgDBMFreeCmnLcLst ARGS((RgCellCb *cellCb));
935 EXTERN S16 rgDBMChkCmnLcCb ARGS(( RgCellCb *cellCb, CmLteLcId lcId));
936 EXTERN RgBcchBchLcCb* rgDBMGetBcchOnBch ARGS(( RgCellCb *cellCb ));
937 EXTERN RgBcchDlschLcCb* rgDBMGetBcchOnDlsch ARGS(( RgCellCb *cellCb, 
938                                                    CmLteLcId lcId));
939 EXTERN RgPcchLcCb* rgDBMGetPcch ARGS(( RgCellCb *cellCb));
940 EXTERN Void rgDBMInsBcchOnBch ARGS(( RgCellCb *cellCb, CmLteLcId idx));
941 EXTERN Void rgDBMInsBcchOnDlsch ARGS(( RgCellCb *cellCb, CmLteLcId idx));
942 EXTERN Void rgDBMInsPcch ARGS(( RgCellCb *cellCb, CmLteLcId idx));
943
944 EXTERN Void rgDBMInsUeCbInRachLst ARGS((RgCellCb *cellCb,RgUeCb *ueCb));
945 EXTERN RgUeCb* rgDBMGetUeCbFromRachLst ARGS((RgCellCb *cellCb,CmLteRnti key));
946 EXTERN RgUeCb* rgDBMGetNextUeCbFromRachLst ARGS((RgCellCb *cellCb,
947                                                       RgUeCb *ueCb));
948 EXTERN Void rgDBMDelUeCbFromRachLst ARGS((RgCellCb *cellCb,RgUeCb *ueCb));
949 /* Added support for SPS*/
950 #ifdef LTEMAC_SPS
951 EXTERN S16 rgDBMDeInitSpsUeCbLst ARGS((RgCellCb *cellCb));
952 EXTERN S16 rgDBMInsSpsUeCb ARGS((RgCellCb *cellCb, RgUeCb *ueCb));
953 EXTERN RgUeCb* rgDBMGetSpsUeCb ARGS((RgCellCb *cellCb, CmLteRnti ueId));
954 EXTERN RgUeCb* rgDBMGetNextSpsUeCb ARGS((RgCellCb *cellCb, RgUeCb *ueCb));
955 EXTERN S16 rgDBMDelSpsUeCb ARGS((RgCellCb *cellCb,RgUeCb *ueCb));
956 #endif /* LTEMAC_SPS */
957                         
958 /* 
959  * APIs exposed by DHM module
960  */
961 EXTERN Void rgCFGFreeUeCb ARGS((RgCellCb *cell, RgUeCb *ue));
962 EXTERN S16 rgDHMHqEntInit ARGS((Inst inst,RgDlHqEnt *hqE, U8 maxHqProcs));
963 EXTERN Void rgDHMRlsHqProc ARGS((RgDlHqProcCb *hqP));
964 EXTERN Void rgDHMUeReset ARGS ((RgCellCb *cell, RgDlHqEnt *hqE));
965 EXTERN Void rgDHMHdlBufFree ARGS((Inst inst, Buffer **mBuf));
966 EXTERN Void rgDHMFreeTbBufs ARGS((Inst inst));
967 EXTERN S16 rgDHMRlsHqProcTB ARGS((RgCellCb *cell, RgDlHqProcCb *hqP,U8 tbIndex));
968 EXTERN S16 rgDHMGetHqProcFrmId ARGS((RgUeCb *ue, U8 idx, RgDlHqProcCb **hqP));
969 /* Changes for MIMO feature addition */
970 /* Removed dependency on MIMO compile-time flag */
971 EXTERN S16 rgDHMSndDatReq ARGS((RgCellCb *cellCb, RgDlSf *dlSf, RgTfuDatReqInfo *datInfo, 
972                                 RgDlHqProcCb *hqProc, RgErrInfo *err));
973 EXTERN S16 rgDHMHndlDedDatReq ARGS((Inst inst,RgDlHqProcCb *hqProc, 
974                               RgRguDDatReqPerUe *datReq, RgDlSf *dlSf, RgErrInfo *err));
975 /* Changed for contention resolution timer implementation*/
976 EXTERN S16 rgDHMHndlCmnDatReq ARGS((Inst inst,RgDlHqProcCb *hqProc, 
977                 RgRguCmnDatReq *datReq, RgErrInfo *err));
978 /* Changes for MIMO feature addition */
979 /* Removed dependency on MIMO compile-time flag */
980
981 EXTERN S16 rgDHMSndConsolidatedStaInd ARGS ((RgCellCb *cell,RgInfUeInfo *ueInfo,
982       CmLteTimingInfo timingInfo, RgErrInfo *err));
983
984 EXTERN Void rgDHMFreeUe ARGS((Inst inst,RgDlHqEnt *hqE));
985 EXTERN S16 rgSchMacRlsHqReq ARGS((Pst *pst, RgInfRlsHqInfo *rlshqUeInfo));
986
987 /* 
988  * APIs exposed by MUX module
989  */
990 #ifndef L2_OPTMZ
991 EXTERN S16 rgMUXBldPdu ARGS((Inst inst, RgBldPduInfo *bldPdu, Buffer **txPdu, 
992          RgErrInfo *err));
993 #else
994 EXTERN S16 rgMUXBldPdu ARGS((Inst inst, RgBldPduInfo *bldPdu, RgTfuDatReqTbInfo *tb, 
995          RgErrInfo *err));
996 EXTERN Bool RgUtlIsTbMuxed ARGS((TfuDatReqTbInfo *tb));
997 #endif
998 EXTERN S16 rgMUXBldRarPdu ARGS((RgCellCb *cell, RgInfRaRntiInfo *alloc,
999          Buffer **txPdu, RgErrInfo *err));
1000
1001 /*
1002  * Utility APIs
1003  */
1004 EXTERN S16  rgAllocSBuf     ARGS((Inst inst,Data **pData, Size size));
1005 EXTERN S16  rgGetMsg        ARGS((Inst inst,Buffer **mBuf));
1006 /*ccpu00117052 - MOD  Passing double pointer for proper NULLP
1007                       assignment */
1008 EXTERN Void rgFreeSBuf      ARGS((Inst inst,Data **data, Size size));
1009 EXTERN Void rgFillDgnParams ARGS((Inst inst,RgUstaDgn *dgn,U8 dgnType));
1010 EXTERN Void rgUpdtRguDedSts ARGS((Inst inst,RgUpSapCb *rguSap,U8 stsType, RgRguDedDatReq *datReq));
1011 EXTERN Void rgUpdtRguCmnSts ARGS((Inst inst,RgUpSapCb *rguSap,U8 stsType));
1012 EXTERN Void rgUpdtCellCnt   ARGS((Inst inst,U8 updtType));
1013 EXTERN Void rgUpdtUeCnt     ARGS((Inst inst,U8 updtType));
1014 EXTERN Void rgGetPstToInst ARGS((Pst *pst,Inst srcInst, Inst dstInst));
1015 EXTERN S16 rgAllocEventMem ARGS((Inst inst,Ptr *memPtr,Size memSize));
1016 EXTERN S16 rgGetEventMem ARGS((Inst inst,Ptr *ptr,Size len,Ptr memCp));
1017 EXTERN S16 rgAllocShrablSBuf ARGS((Inst inst,Data **pData, Size size));
1018 EXTERN Void rgPrintfSubFrameInfo ARGS((RgDlSf *dlSf));
1019 EXTERN Void printMacCellInfo ARGS((Void));
1020 EXTERN Void rgFreeSharableSBuf ARGS((Inst inst,Data **data, Size size)); 
1021 EXTERN void MacSendCellCfgCfm(uint8_t response);
1022
1023
1024 EXTERN Void rgDHMFreeAllTbBufs ARGS
1025 ((
1026 Inst inst
1027 ));
1028
1029 EXTERN S16 rgMUXAddPadd ARGS((
1030 Inst           inst,
1031 MsgLen         *schdTbSz,
1032 Buffer         *sduBuf,
1033 Bool           isRar,
1034 RgErrInfo      *err
1035 ));
1036 EXTERN U16 rgMUXCalcRiv ARGS
1037 ((
1038 U8           bw,
1039 U8           rbStart,
1040 U8           numRb
1041 ));
1042
1043
1044
1045 #ifdef __cplusplus
1046 }
1047 #endif /* __cplusplus */
1048 #endif /* __RGX__ */
1049
1050
1051 /**********************************************************************
1052          End of file
1053 **********************************************************************/