d395376c2bf9bf4a70ae79972b176414fdb593a0
[o-du/l2.git] / src / 5gnrsch / rg_sch_inf.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:     C Include File 
24   
25   Desc:     Structures, variables, and typedefs required by the interface between
26             MAC and Scheduler.
27
28   File:     rg_sch_inf.x 
29
30 **********************************************************************/
31 /** 
32   @file rg_sch_inf.x 
33   @brief Structure declarations and definitions for MAC-SCH interface.
34   */
35
36 #ifndef __GKSCH_X__ 
37 #define __GKSCH_X__
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 #ifdef EMTC_ENABLE
43 /** 
44  * @brief This structure contains the uplink grant information that is sent in
45  response to the random access request from the UE for CEmodeA.
46  */
47 typedef struct rgInfEmtcCEmodeARarUlGrt
48 {
49    uint8_t msg3PUSCHNbIdx;        /*!< Indicates the Msg3 PUSCH narrowband index. */          
50    uint8_t rbStart;               /*!< Start Resource block of allocation. */
51    uint8_t numRb;                 /*!< Number of resource blocks allocated. */
52    uint8_t msg3PUSCHNumRep;       /*!< Number of repetitions for Msg3 PUSCH. */
53    uint8_t iMcsCrnt;              /*!< Current MCS index of the grant. */
54    uint8_t tpc;                   /*!< TPC command for the uplink grant. */
55    uint8_t cqiBit;                /*!< Indicates the CQI is enabled or not. */
56    uint8_t delayBit;              /*!< Indicates the Delay bit. */
57    uint8_t msg34MPDCCHNbIdx;      /*!< Indicates Msg3/4 MPDCCH narrowband index. */          
58 } RgInfEmtcCEmodeARarUlGrnt;
59
60 /** 
61  * @brief This structure contains the uplink grant information that is sent in
62  response to the random access request from the UE for CEmodeB.
63  */
64 typedef struct rgInfEmtcCEmodeBRarUlGrnt
65 {
66    uint8_t msg3PUSCHNbIdx;        /*!< Indicates the Msg3 PUSCH narrowband index. */          
67    uint8_t rbStart;               /*!< Start Resource block of allocation. */
68    uint8_t numRb;                 /*!< Number of resource blocks allocated. */
69    uint8_t msg3PUSCHNumRep;       /*!< Number of repetitions for Msg3 PUSCH. */
70    uint8_t iTbsCrnt;              /*!< Current TBS index of the grant. */
71    uint8_t msg34MPDCCHNbIdx;      /*!< Indicates Msg3/4 MPDCCH narrowband index. */          
72 }RgInfEmtcCEmodeBRarUlGrnt;
73
74 typedef enum rgEmtcCEmodeType
75 {
76    RG_EMTC_CEMODE_A,
77    RG_EMTC_CEMODE_B,
78    RG_EMTC_CEMODE_INV
79 }RgEmtcCEmodeType;
80
81 /** 
82  * @brief This structure contains the uplink grant information that is sent in
83  response to the random access request from the UE for EMTC.
84  */
85 typedef struct rgInfEmtcRarUlGrnt 
86 {
87    uint8_t rgEmtcCEmodeType;
88    union
89    {
90       RgInfEmtcCEmodeARarUlGrnt  emtcCEmodeARarUlGrnt;
91       RgInfEmtcCEmodeBRarUlGrnt  emtcCEmodeBRarUlGrnt;
92    }u;
93 }RgInfEmtcRarUlGrnt;
94
95 #endif /* EMTC_ENABLE */
96 /**
97  * @brief This structure contains common channel buffer occupancy report information.
98  */
99 typedef struct rgInfCmnBoRpt
100 {
101    S16          cellSapId;
102    CmLteCellId  cellId;         /*!< Identifies the cell. CellId value must be within the set of configured cell IDs. */
103    CmLteLcId    lcId;           /*!< Identifies the logical channel. lcId value range is defined in
104                                      Section 6.2.1 in 36.321 specification. */
105    CmLteLcType  lcType;         /*!< Identifies the Logical channel type.lcType can take the following values:
106                                       CM_LTE_LCH_BCCH
107                                       CM_LTE_LCH_PCCH
108                                       CM_LTE_LCH_CCCH
109                                       CM_LTE_LCH_DCCH
110                                       CM_LTE_LCH_DTCH */
111    S32 bo;                      /*!< Buffer occupancy reported by RLC in bytes. */
112 #ifdef EMTC_ENABLE
113    uint8_t         emtcDIReason;   /*!< Reason for DI message to send. */
114    uint8_t         pnb;            /*!< Pagging narrowBand on which Ue perfom paging reception*/
115 #endif
116    union                        /*!< lcType in the primitive is the union selector. */
117    {
118       CmLteTimingInfo timeToTx; /*!< Timing info for the BO, applicable for BCCH and PCCH. */
119       CmLteRnti       rnti;     /*!< Temporary C-RNTI, only for CCCH. RNTI range is specified 
120                                      in Section 7.1 in 36.321 specification. */
121    } u;
122 } RgInfCmnBoRpt;
123 /**
124  * @brief This structure contains dedicated channel buffer occupancy report 
125  *  information.
126  */
127 typedef struct rgInfDedBoRpt
128 {
129    S16          cellSapId;  /*!< Identifies the cell SAP. cellSapId value must be within the set of configured cell SAP IDs. */
130    CmLteCellId  cellId;     /*!< Identifies the cell. CellId value must be within the set of configured cellIds. */
131    CmLteRnti    rnti;       /*!< Identifies the UE. RNTI value range is specified in Section 7.1 in 25.321 specification. */
132    CmLteLcId    lcId;       /*!< Identifies the logical channel. lcId value range is defined in Section 6.2.1 in 36.321 specification. */
133    S32          bo;         /*!< Number of bytes reported as Buffer occupancy by RLC. */
134 #ifdef CCPU_OPT
135    Bool         staPduPrsnt;   /*!< Is status PDU present reported by RLC. */
136    uint16_t          estRlcHdrSz;/*!< Estimated hader size reported by RLC */
137 #endif
138    uint32_t          staPduBo;   /*!< Number of bytes reported as Buffer occupancy for status PDU by RLC. 
139                                  This is already included in BO.*/
140   uint32_t          oldestSduArrTime; /*!< Oldest SDU Arrival Time from Upper Layer */  
141   Bool         setMaxUlPrio; /*!< set when Pollbit is set from RLC in PDU */
142   Bool         setMaxDlPrio; /*!< Set when there is a status PDU in the DL*/                     
143 } RgInfDedBoRpt;
144
145 /*Fix: start: Indicate UE deletion from MAC to Scheduler*/
146 /**
147  * @brief This structure contains the RNTI which is deleted at MAC 
148  *  information.
149  */
150 typedef struct rgInfUeDelInd
151 {
152    S16          cellSapId;  /*!< Identifies the cell SAP. cellSapId value must be within the set of configured cell SAP IDs. */
153    CmLteCellId  cellId;     /*!< Identifies the cell. CellId value must be within the set of configured cellIds. */
154    CmLteRnti    rnti;       /*!< Identifies the UE. RNTI value range is specified in Section 7.1 in 25.321 specification. */
155 } RgInfUeDelInd;
156
157 /*Fix: end: Indicate UE deletion from MAC to Scheduler*/
158
159
160
161 /** 
162  * @brief This structure contains the uplink grant information that is sent in
163           response to the random access request from the UE.
164  */
165 typedef struct rgInfRarUlGrnt
166 {
167 #ifndef MAC_5GTF_UPDATE
168    uint8_t hop;        /*!< Indicates the hopping flag. */     
169 #else
170    uint8_t xPuschRange; /*!< xPUSCH range */
171 #endif
172    uint8_t rbStart;    /*!< Start Resource block of allocation. */
173    uint8_t numRb;      /*!< Number of resource blocks allocated. */
174    uint8_t tpc;        /*!< TPC command for the uplink grant. */
175    uint8_t iMcsCrnt;   /*!< Current MCS index of the grant. */
176    uint8_t delayBit;   /*!< Indicates the Delay bit. */
177 #ifndef MAC_5GTF_UPDATE
178    uint8_t cqiBit;     /*!< Indicates the CQI is enabled or not. */
179 #else
180    uint8_t numBsiRep;   /*!< Number of BSI reports. */
181    uint8_t bsiBetaOffIdx; /*!< Index of BSI beta offset used in Msg3 */
182    uint8_t pcrs;         /*!< UL dual PCRS */
183 #endif
184 } RgInfRarUlGrnt;
185
186 /** 
187  * @brief This structure carries timing adjustment, uplink grant information for the specific temporary C-RNTI.
188  */
189 typedef struct rgInfCrntiInfo
190 {
191     CmLteRnti       tmpCrnti;    /*!< Temporary C-RNTI. RNTI range is specified in Section 7.1 in 36.321 specification. */     
192     uint8_t              rapId;       /*!< rapId identifies the index of the Random Access Preamble. rapId ranges from 0 to 63.*/ 
193     TknUInt16          ta;          /*!< Timing Adjustment. Timing Adjustment Value range is defined in Section 6.1.3.5 in 36.321 specification. */ 
194     RgInfRarUlGrnt  grnt;        /*!< Uplink Grant to go in RAR. */ 
195     Bool            isContFree; /*!< Indicates whether the procedure is contention-free or not. */
196 #ifdef EMTC_ENABLE
197     RgInfEmtcRarUlGrnt  emtcGrnt; /*!< Uplink grant for EMTC UE to go in RAR. */
198 #endif
199 }RgInfCrntiInfo;
200
201 /** 
202  * @brief This structure carries information about downlink control format, scheduled TB size,
203           backoff indicator value, and the set of Random Access Responses within this RA-RNTI. 
204 */
205 typedef struct rgInfRaRntiInfo
206 {
207    uint16_t             raRnti;     /*!< RA-RNTI. RNTI range is specified in Section 7.1 in 36.321 specification. */
208    TfuPdschDciInfo dciInfo;    /*!< PDCCH allocated for RA-RNTI. For more information
209                                     refer to <i>TFU Interface Service Definition</i> (p/n 1100091). */
210    uint32_t             schdTbSz;   /*!< Scheduled TB size. schdTbSz value range is defined in Section 7.1.7.2.1 in 36.213
211                                     specification. */
212    TknUInt8           backOffInd; /*!< Indicates the Backoff Indicator value. backOffInd value range
213                                     is defined in Section 7.2 in 36.321 specification. */
214    uint8_t              numCrnti;   /*!< Number of valid RARs in the array. */
215    RgInfCrntiInfo  *crntiInfo; /*!< RAR information. */
216 }RgInfRaRntiInfo;
217   
218 /**
219  * @brief This structure contains information about the RA-RNTIs for which
220  *  random access responses are generated. 
221  */
222 typedef struct rgInfRarInfo
223 {
224  uint8_t              numRaRntis;    /*!< Indicates the number of valid RA-RNTIs present. */
225  RgInfRaRntiInfo *raRntiInfo;   /*!< Contains allocation information per RA-RNTI.  */
226  uint16_t             txPwrOffset;   /*!< PDSCH tx power offset for RAR transmission */ 
227 }RgInfRarInfo;
228
229 /**
230  *  @brief Logical channel allocation information. 
231  */
232 typedef struct rgInfLcDatInfo
233 {
234    CmLList  lchLstEnt;   /*!< Is not used when part of resource allocation. */
235    uint8_t       lcId;        /*!< Identifies the logical channel. lcId value range is defined
236                               in Section 6.2.1 in 36.321 specification. */
237    uint32_t      numBytes;    /*!< Number of bytes allocated/received to logical channel. */
238 } RgInfLcDatInfo; 
239
240 /**
241  * @brief This structure contains control element information received from a 
242  *  particular UE.Extended PHR information
243  */
244 typedef struct rgInfExtPhrSCellInfo
245 {
246    uint8_t    sCellIdx;      /*!< SCELL index for which PHR is reported */
247    uint8_t    phr;  /*!< PHR value. PHR value is defined in Section 6.1.3.6a in 36.321 specification. */
248    uint8_t    pCmax; /*!< PCMAX value. PCMAX value is defined in Table 6.1.3.6a-1 in 36.321 specification. */
249    uint8_t    pBackOff; /*!< If UE applied back off due to P-MPRc in 36.321 specification. */
250 }RgInfExtPhrSCellInfo;
251 typedef struct rgInfExtPhrCEInfo
252 {
253    uint8_t    type2Phr;  /*!< PHR value. PHR value is defined in Section 6.1.3.6a in 36.321 specification. */
254    uint8_t    type2PCMax; /*!< PCMAX value. PCMAX value is defined in Table 6.1.3.6a-1 in 36.321 specification. */
255    uint8_t    numServCells; /*!< Number of serving cells for which PHR is reported */
256    RgInfExtPhrSCellInfo servCellPhr[CM_LTE_MAX_CELLS];
257 }RgInfExtPhrCEInfo;  /*!< EXT PHR value. EXT PHR value is defined in Section 6.1.3.6a in 36.321 R10 specification. */
258
259 /**
260  * @brief This structure contains control element information received from a 
261  *  particular UE.
262  */
263 typedef struct rgInfCeInfo
264 {
265    uint16_t         bitMask;   /*!< Bitmask for the MAC Control elements present. */
266    struct                                                  
267    {                                                       
268       uint16_t   cRnti;        /*!< C-RNTI value. RNTI range is specified in Section 7.1 in 36.321 specification. */
269       uint8_t    phr;          /*!< PHR value. PHR value is defined in Section 6.1.3.6 in 36.321 specification. */
270       union                                                
271       {                                                    
272          uint8_t    truncBsr;  /*!< Truncated BSR value. BSR value is defined in 
273                                Section 6.1.3.1 in 36.321 specification. */
274          uint8_t    shortBsr;  /*!< Short BSR  value.BSR value is defined in 
275                                Section 6.1.3.1 in 36.321 specification. */
276          struct                                            
277          {                                                 
278             uint8_t    bs1;   /*!< Buffer size 1 of long BSR. */ 
279             uint8_t    bs2;   /*!< Buffer size 2 of long BSR. */ 
280             uint8_t    bs3;   /*!< Buffer size 3 of long BSR. */ 
281             uint8_t    bs4;   /*!< Buffer size 4 of long BSR. */ 
282          }longBsr;       /*!< BSR value is defined in Section 6.1.3.1 in 36.321 specification. */ 
283       }bsr;   
284       RgInfExtPhrCEInfo extPhr;  /*!< EXT PHR value. EXT PHR value is defined in Section 6.1.3.6a in 36.321 R10 specification. */
285 #ifdef MAC_5GTF_UPDATE
286  struct
287       {
288         uint8_t bar;         /*!< Beam Adjusment Request */
289         uint8_t numBsiFields; /*!< Number of BSI fields UE sent in BSI Feedback */
290         struct 
291         {
292            uint16_t bi;         /*!< BSI Feedback : 9 bits Beam Index */
293            uint8_t brsrp;       /*!< BSI Feedback :7 bits BRSRP */
294         }bsiFdbk[4];
295       }beam;
296 #endif
297    } ces;
298       /* L2_COUNTERS */
299 #ifdef LTE_L2_MEAS
300    uint8_t ulActLCs[RGINF_MAX_NUM_DED_LC];
301                         /*!< List of LCs for which Data is received in UL */
302 #endif
303
304
305 #ifdef LTEMAC_SPS
306    uint16_t spsSduSize;
307 #endif
308
309 } RgInfCeInfo;
310
311 typedef struct rgInfLcgInfo
312 {
313    uint8_t    lcgId;        /*!< LCGID. GBR DRB LCG */
314    uint32_t   bytesRcvd;    /*!< Contains bytes received for LCG */
315 }RgInfLcgInfo;
316
317 /** 
318  * @brief This structure contains control element information received from a 
319  *  particular UE identified by the RNTI.
320  */
321 typedef struct rgInfUeDatInd
322 {
323    CmLteRnti   rnti;      /*!< RNTI. RNTI range is specified in Section 7.1 in 36.321 specification. */
324    CmLList     ueLstEnt;  /*!< UE linked list entry. */
325    RgInfCeInfo ceInfo;    /*!< Contains the control elements received from the UE. */
326    RgInfLcgInfo lcgInfo[RGINF_MAX_LCG_PER_UE - 1];  /*!< Contains the bytes received per DRB LCG. */
327 }RgInfUeDatInd;
328
329 /** 
330  * @brief This structure carries the control element information received for a
331           set of UEs along with timing information. 
332  */
333 typedef struct rgInfSfDatInd
334 {
335    CmMemListCp       memCp;      /*!< Memory control point. */
336    CmLListCp         ueLst;      /*!< Pointer to the UE linked list. */
337    /* RRM_SP1_START */
338    uint32_t               qcisUlPrbCnt[RGINF_MAX_GBR_QCI_REPORTS];/*!< UL gbr LC's PRB count*/
339    /* RRM_SP1_END */
340    S16               cellSapId;  /*!< Cell SAP Identifier. CellSAP ID value must be within the set of configured cell SAP IDs. */
341    CmLteCellId       cellId;     /*!< Identifies the cell. CellId must be within the set of configured cell IDs. */
342    CmLteTimingInfo   timingInfo; /*!< Contains information about SFN and subframe. SFN ranges from 0 to 1023 whereas subframe ranges from 0 to 9. */
343 }RgInfSfDatInd;
344
345 /** 
346  * @brief This structure carries the information about scheduled logical 
347  *  channels within this transport block along with timing adjustment 
348  *  information. 
349  */
350 typedef struct rgInfUeTbInfo
351 {
352    Bool                 disTb;       /*!< Currently, not used, but is 
353                                           applicable in MIMO case. */
354    Bool                 isReTx;      /*!< Indicates the TB transmission type. */
355    TknUInt8                ta;          /*!< Timing Adjustment. */ 
356 #ifdef LTE_ADV
357   TknUInt8                 sCellActCe;   /* !< SCell Act values and whether
358                                           scheduled or not */
359 #endif
360
361    /* Changed as a result of CR timer implementation*/
362    uint8_t contResCe; /*!< Indicating presence of Contention Resolution CE across MAC-SCH
363                    interface to
364                   * identify CCCH SDU transmissions which need to
365                   * be done without the
366                   * contention resolution CE.*/
367
368    uint8_t                   numSchLch;   /*!< Indicates the number of logical 
369                                           channels scheduled. */    
370    uint32_t                  schdTbSz; 
371    RgInfLcDatInfo       schdDat[RGINF_MAX_NUM_DED_LC]; /*!< Contains 
372                                           information about scheduled logical
373                                           channel. */
374 } RgInfUeTbInfo;
375
376 /**
377  @brief This structure carries the information reagarding secondary MAC like its
378  instance Id and HARQ process's Id
379  */
380 typedef struct rgLaaTbReqInfo
381 {
382    uint8_t      sMacInstId;
383    uint8_t      sCellHqPId;
384    uint8_t      tbId;
385    uint16_t     hqPStamp;
386 }RgLaaTbReqInfo;
387
388 /** 
389  *  @brief This structure carries the UE-specific Resource allocation 
390  *   information like RNTI, downlink control format, HARQ process Identifier, 
391  *   scheduled TB size, and Transport Block information. 
392  */
393 typedef struct rgInfUeAlloc
394 {
395    CmLteRnti        rnti;      /*!< RNTI. RNTI range is specified in Section 7.1 in 36.321 specification. */ 
396
397 /* Added support for SPS*/
398 #ifdef LTEMAC_SPS
399    CmLteRnti            pdcchRnti;   /*!< RNTI used for PDCCH scrambling */
400 #endif
401
402
403
404    TfuPdschDciInfo  dciInfo;   /*!< Contains Downlink Control Information. For more information, 
405                                     refer to <i>TFU Interface Service Definition</i> (p/n 1100091). */
406    uint8_t               hqProcId;  /*!< HARQ process Identifier. hqProcId ranges between 1 and 8 for FDD mode and 1 and 15 for TDD mode */
407    S8                  tbStrtIdx;
408    TknUInt32              doa;
409    TfuTxMode           txMode;
410    Bool                puschRptUsd;/*!< True, if Precoding Information in PDCCH has to be
411                                    in-accordance with the latest PUSCH report */
412    TfuDlCqiPuschInfo   puschPmiInfo;/*!< PUSCH report details for explicit PMI
413                                        * information to PHY during a PDSCH */
414
415
416    uint8_t               nmbOfTBs;  /*!< Indicates the number of TBs. Currently this is set to 1. */
417    RgInfUeTbInfo    tbInfo[RGINF_MAX_TB_PER_UE]; /*!< Contains TB identifier. */
418    /* LTE_ADV_FLAG_REMOVED_START */
419 #ifdef TFU_UPGRADE
420    uint8_t                  pa;          /*!<  DL Power control paramter P_A
421                                         configured by higher layers
422                                         Ref: RRC 36.331, 6.3.2, PDSCH-Config */
423 #endif
424    uint8_t   isEnbSFR;     /*To check if SFR is enabled*/
425    /* LTE_ADV_FLAG_REMOVED_END */
426 #ifdef LTE_ADV
427    Bool                 fillCtrlPdu; /*!< Based upon this flag RLC will fill RLC Control PDU 
428                                           In a tti if P-cell is present then control PDU 
429                                           should be kept in P-cell otherwise S-cell*/
430 #endif
431    RgLaaTbReqInfo   tbReqInfo;      /*!< LAA: TB information for the TBs which
432                                      need to be fetched from the SCell*/
433 }RgInfUeAlloc;
434
435 /** 
436  * @brief This structure carries the Resource allocation information for the 
437  *  set of scheduled UEs. 
438  */
439 typedef struct rgInfUeInfo
440 {
441    uint8_t               numUes;    /*!< Number of UEs allocated. */
442    RgInfUeAlloc     *allocInfo; /*!< Allocation information per UE. */
443 }RgInfUeInfo;
444
445 /** 
446  * @brief This structure contains the RNTI and downlink control format 
447  *  information for the scheduled BCCH logical channel.  
448  */
449 typedef struct rgInfBcchInfo
450 {
451    CmLteRnti            rnti;       /*!< RNTI range is specified in Section 7.1 in 36.321 specification. */ 
452    TfuPdschDciInfo      dciInfo;    /*!< Downlink Control Information. For more information,
453                                          refer to <i>TFU Interface Service Definition</i> (p/n 1100091).*/
454 /* Modified for SI Enhancement*/
455 #ifndef RGR_SI_SCH
456    CmLteLcId            lcId;       /*!< Logical Channel Identifier.lcId value range is defined in 
457                                          Section 6.2.1 in 36.321 specification. */
458    Bool                 sndStatInd; /*!< Currently this is set to 1 for fresh transmission of BCCH data. */
459 #else
460    Buffer               *pdu;       /*!< PDU being specified for BCCH. */
461 #endif
462    uint16_t                  txPwrOffset;   /*!< PDSCH tx power offset for BCCH 
463                                             transmission */ 
464 }RgInfBcchInfo;
465
466 /** 
467  * @brief This structure contains the RNTI and the downlink control information for the scheduled PCCH logical channel. 
468  */
469 typedef struct rgInfPcchInfo
470 {
471    CmLteRnti            rnti;      /*!< RNTI range is specified in Section 7.1 in 36.321 specification. */ 
472    TfuPdschDciInfo      dciInfo;   /*!< Downlink Control Information.
473                                         For more information, refer to <i>TFU Interface Service Definition</i> (p/n 1100091). */
474    CmLteLcId            lcId;      /*!< Logical Channel Identifier. lcId value range is defined in
475                                         Section 6.2.1 in 36.321 specification. */
476                                         
477    uint16_t                  txPwrOffset;   /*!< PDSCH tx power offset for PCCH 
478                                             transmission */ 
479 }RgInfPcchInfo;
480
481 /** 
482  * @brief This structure contains the scheduled logical channel information 
483  *  mapped onto the BCH transport channel.
484  */
485 typedef struct rgInfBchInfo
486 {
487 /* Modified for SI Enhancement*/
488 #ifndef RGR_SI_SCH
489    CmLteLcId       lcId;    /*!< Logical Channel Identifier. lcId value range is defined in Section 6.2.1 in 36.321 specification. */
490 #else
491    Buffer          *pdu;    /*!< PDU being specified for BCH */
492 #endif
493 }RgInfBchInfo;
494
495 /** 
496  * @brief This structure contains the scheduling information of BCH, PCCH, and 
497  *  BCCH channel information.
498  */
499 typedef struct rgInfCmnLcInfo
500 {
501    uint16_t               bitMask;   /*!< Bitmask representing all the common channels present. */
502    RgInfBchInfo      bchInfo;   /*!< BCH channel Information. */
503    RgInfPcchInfo     pcchInfo;  /*!< Paging Logical Channel Information. */
504    RgInfBcchInfo     bcchInfo;  /*!< Broadcast Logical Channel Information. */
505 }RgInfCmnLcInfo;
506
507 #ifdef EMTC_ENABLE
508 /** 
509  * @brief This structure contains the scheduled logical channel information 
510  *  mapped onto the BCH transport channel.
511  */
512 typedef struct rgInfEmtcBcchInfo
513 {
514    CmLteRnti         rnti;    /*!< RNTI range is specified in Section 7.1 in 36.321 specification. */ 
515    TfuPdschDciInfo   dciInfo; /*!< Downlink Control Information. For more information */
516    Buffer            *pdu;    /*!< PDU being specified for BCH */
517 }RgInfEmtcBcchInfo;
518
519 /** 
520  * @brief This structure contains the scheduling information of BCH, PCCH, and 
521  *  BCCH channel information.
522  */
523 typedef struct rgInfEmtcCmnLcInfo
524 {
525    uint16_t               bitMask;   /*!< Bitmask representing all the common channels present. */
526    RgInfBchInfo      bchInfo;   /*!< BCH channel Information. */
527    RgInfPcchInfo     pcchInfo;  /*!< Paging Logical Channel Information. */
528    RgInfEmtcBcchInfo emtcBcchInfo;  /*!< Broadcast Logical Channel Information. */
529 }RgInfEmtcCmnLcInfo;
530 #endif
531
532 #ifdef LTE_L2_MEAS
533 /**
534  * @brief UE-specific allocation information needed for measurements. 
535  * */
536 typedef struct rgInfUeUlAlloc
537 {
538    CmLteRnti            rnti;        /*!< UE ID */ 
539    uint8_t                   numPrb;      /*!< Number of total PRB's allocated for this UE */
540 } RgInfUeUlAlloc;
541
542 /**
543  * @brief Allocation information of all UEs in this subframe. 
544  * */
545 typedef struct rgInfUlUeInfo
546 {
547    uint8_t                   numUes;      /*!< Number of UE's*/
548    CmLteTimingInfo      timingInfo;  /*!< Uplink timing information */
549    RgInfUeUlAlloc       *ulAllocInfo;/*!< Uplink Allocations information */
550 }RgInfUlUeInfo;
551 #endif /*LTE_L2_MEAS */
552
553 /**
554 *@brief this structure contains the lcId on which flow control need to be performed and the number of packets allowed for admission */
555 typedef struct rgInfLcInfo
556 {
557    CmLteLcId   lcId;        /*!< lcId for flow control*/
558    uint32_t         pktAdmitCnt; /*!<Pkts allowed for the LC */
559    uint32_t         maxBo4FlowCtrl; /*!< MAX BO of Queued SDUs at RLC beyond which Flow is Controlled */
560 }RgInfLcFlowCntrlInfo;
561
562
563 /** 
564  * @brief This structure contains the flow control information per UE */
565 typedef struct rgInfUeFlowCntrlInfo 
566 {
567    CmLteRnti            ueId;  /*!<ueId for flow control*/
568    uint32_t                  numLcs;/*!<numLcs in the UE*/
569    RgInfLcFlowCntrlInfo lcInfo[RGINF_MAX_NUM_DED_LC]; /*!<LC list*/
570 }RgInfUeFlowCntrlInfo;  
571 /**
572 * @brief This structure contains the flow control information to be sent to MAC */
573 typedef struct rgInfFlowCntrlInfo
574 {
575    uint32_t                   numUes;/*!<Num UEs for flow control */
576    RgInfUeFlowCntrlInfo  ueFlowCntrlInfo[RGINF_MAX_NUM_UE_PER_TTI]; /*!<Ue Info for flow control */
577 }RgInfFlowCntrlInfo;
578 #ifdef EMTC_ENABLE
579 typedef struct rgInfEmtcInfo
580 {
581    RgInfEmtcCmnLcInfo  cmnLcInfo;     /*!< Contains Information about commmon channels. */
582    RgInfRarInfo        rarInfo;       /*!< Contains Information about EMTC Random Access Responses. */
583    RgInfUeInfo         ueInfo;        /*!< Contains UE specific allocation
584                                             information for EMTC UEs. */
585 }RgInfEmtcInfo;
586 #endif
587 /** 
588  * @brief This structure contains the scheduling information of common channels, random access responses and UE specific allocations along with timing information.
589  */
590 typedef struct rgInfSfAlloc
591 {
592    CmLteCellId         cellId;        /*!< Identifies the cell. CellId value should be within the set of configured
593                                          cell IDs. */
594    CmLteTimingInfo     timingInfo;    /*!< Contains Information about SFN and subframe. SFN ranges from 0 to 1023 where as subframe is from 0 to 9. */
595    RgInfCmnLcInfo      cmnLcInfo;     /*!< Contains Information about commmon channels. */
596 #ifdef EMTC_ENABLE
597    RgInfEmtcInfo       emtcInfo;
598 #endif
599    RgInfRarInfo        rarInfo;       /*!< Contains Information about Random Access Responses. */
600    RgInfUeInfo         ueInfo;        /*!< Contains UE specific allocation information. */
601 #ifdef LTE_L2_MEAS
602    RgInfUlUeInfo       ulUeInfo;    /*!< Uplink allocation information needed at MAC */
603 #endif /* LTE_L2_MEAS */
604    RgInfFlowCntrlInfo  flowCntrlInfo; /*!<Flow Control information */
605 }RgInfSfAlloc;
606
607 /**
608 * @brief This structure contains regarding the ue for
609 *  resettng the harqentiry of a scell
610 */
611 typedef struct rgInfResetHqEnt
612 {
613    CmLteCellId cellId;        /*!< Identifies the sec cell for which harq entity reset
614                                    has to be done*/
615    CmLteRnti   crnti;          /*!< RNTI for which harq entity needs to be 
616                                             reset */
617 }RgInfResetHqEnt;
618
619 /** 
620  * @brief This structure contains the UE specific HARQ and Transport Block 
621  *  information to be released.  
622  */
623 typedef struct rgInfUeHqInfo
624 {
625    CmLteRnti   rnti;                        /*!< RNTI which uniquely identifies the UE. RNTI value range is 
626                                                  specified in Section 7.1 in 25.321 */
627    uint8_t          hqProcId;                    /*!< HARQ Process Identifier.
628                                                  hqProcId ranges between 1 and 8 for FDD mode and 1 and 15 for TDD mode. */
629    uint8_t          numOfTBs;                    /*!< Identifies the number of TBs. Currently this is set to 1. */
630    uint8_t          tbId[RGINF_MAX_TB_PER_UE];   /*!< Indicates the TB Identifier. */
631    /* MS_WORKAROUND: to increase Harq Fail Counter .
632        The status field is required for tracking the number of harq faliures at MAC.
633        As this is already present under L2_MEAS flag, we have replaced it with platform flag */
634    uint8_t                   status[RGINF_MAX_TB_PER_UE];      /*!< Indicates HARQ ACK or NACK */ 
635    uint8_t          rlsOperationType;            /*!< Decides action to be taken in MAC
636                                                  0x00 RGINF_RLS_HQ_NO_ACTION - Free Hq Procs and TBs
637                                                  0x01 RGINF_RLS_HQ_SAVE_TB - Free Hq Proc but save the TBs
638                                                  0x02 RGINF_RLS_HQ_DEL_TB - Del already saved TBs */
639    uint16_t         saveId;                     /*!< Uniquely identify an particular HqP save */                                              
640 } RgInfUeHqInfo;
641
642 /** 
643  * @brief This structure contains HARQ process information and buffer 
644  *  information for a set of UEs to be released in a cell identified by the 
645  *  cell ID. 
646  */
647 typedef struct rgInfRlsHqInfo
648 {
649    CmLteCellId   cellId;           /*!< Identifies Cell. CellId should be within
650                                         the set of configured cell IDs. */
651    uint8_t            numUes;           /*!< Indicates number of UEs present. */
652    RgInfUeHqInfo *ueHqInfo;        /*!< Contains UE specific HARQ information. */
653 }RgInfRlsHqInfo;
654
655 /** 
656  * @brief This structure contains the released RNTI in a particular cell 
657  *  identified by a cellId.
658  */
659 typedef struct rgInfRlsRnti
660 {
661    CmLteCellId   cellId;           /*!< cellId uniquely identifies the
662                                         cell. cellId value should be within the set of configured cell IDs. */
663    CmLteRnti     rnti;             /*!< RNTI which uniquely identifies the UE. 
664                                         RNTI range is specified in Section 7.1 in 25.321 specification. */
665    /* Fix : syed ueId change as part of reestablishment.
666     * Now SCH to trigger this. CRG ueRecfg for ueId change 
667     * is dummy */          
668    Bool          ueIdChng;         /*!< Indicates if there is a ueId change as part
669                                         of reestablishment */
670    CmLteRnti     newRnti;          /*!< new RNTI changed as part of reestablishment */
671 #ifdef LTE_ADV
672    Bool          isUeSCellDel;         /*!< TRUE means UeSCellDel*/
673 #endif
674 }RgInfRlsRnti;
675
676 /** 
677  * @brief This structure contains the cell information along with the 
678  *  maximum number of downlink HARQ processes configured per UE in the cell.
679  */
680 typedef struct rgInfCellReg
681 {
682    CmLteCellId cellId;            /*!< Identifies the cell. cellId value should be within the set of configured cell IDs. */
683    S16         cellSapId;         /*!< Identifies the cell SAP. cellSapId value should be within the set of configured cell SAP IDs. */
684    uint8_t          maxDlHqProcPerUe;  /*!< Indicates Maximum number of downlink HARQ processes per UE. */
685 }RgInfCellReg;
686
687 #ifdef LTE_L2_MEAS
688 /**
689  * @brief struture to hold measurement request for Uplink Average PRB usage per
690  * QCI
691  * */
692 typedef struct rgInfPrbReq
693 {
694    uint8_t                   numQci;      /*!< Number fo QCI's in Request */
695    uint8_t                   qci[LRG_MAX_QCI_PER_REQ];  /*!< QCI for which PRB has
696                                           to be measured */
697 } RgInfPrbReq;
698
699
700 typedef struct prbUsage
701 {
702    uint8_t                   qciValue;   /*!< Qci Value */
703    uint32_t                  prbUsage;   /*!<Prb Usage for this Qci */
704 }PrbUsage;
705 /**
706  * @brief struture to hold measurement confirm for Uplink Average PRB usage per
707  * QCI
708  * */
709 typedef struct rgInfPrbCfm
710 {
711    uint8_t                   numQci;      /*!< Number fo QCI's in Request */
712    PrbUsage             prbUsage[LRG_MAX_QCI_PER_REQ];  /*!< Average PRB usage
713                                           per QCI */
714 } RgInfPrbCfm;
715
716 /**
717  * @brief Structure used by Scheduler to send the measurement request to MAC 
718  * */
719 typedef struct RgInfL2MeasReq
720 {
721    uint32_t                  transId;     /*!< TransId to uniquely identify request */
722    uint16_t                  measType;    /*!< For action type Avegare PRB usage 
723                                           in Uplink */
724    uint16_t                  timePrd;     /*!< Time Period for which measurement
725                                           is done */
726    CmLteCellId          cellId;      /*!< CellId for which measurement done*/
727    union {
728       RgInfPrbReq       prbReq;      /*!< Avgerage PRB usage per QCI*/
729    } t;
730 } RgInfL2MeasReq;
731
732 /**
733  * @brief Structure used by Scheduler to send the measurement stop request to MAC 
734  * */
735 typedef struct RgInfL2MeasStopReq
736 {
737    uint32_t                  transId;     /*!< TransId to uniquely identify request */
738    uint8_t                   measType;    /*!< For action type Avegare PRB usage 
739                                           in Uplink */
740    CmLteCellId          cellId;      /*!< CellId for which measurement done*/
741 } RgInfL2MeasStopReq;
742
743
744 /**
745  * @brief Structure used by Scheduler to send the measurement send request to MAC 
746  * */
747 typedef struct RgInfL2MeasSndReq
748 {
749    uint32_t                  transId;     /*!< TransId to uniquely identify request */
750    uint8_t                   measType;    /*!< For action type Avegare PRB usage 
751                                           in Uplink */
752    uint16_t                  timePrd;     /*!< Time Period for which measurement
753                                           is done */
754    CmLteCellId          cellId;      /*!< CellId for which measurement done*/
755 } RgInfL2MeasSndReq;
756
757 /**
758  * @brief Structure used MAC to send the confirm back to scheduler 
759  * */
760 typedef struct rgInfL2MeasCfm
761 {
762    uint16_t                  transId;     /*!< transId to map to request */
763    uint8_t                   measType;    /*!< Action for which measurement done */
764    CmLteCellId          cellId;      /*!< CellId for which measurement done*/
765    CmStatus             cfm;        /*!< Confirmation possible Values when measType
766                                   is invalid status -> NOK and reason -> INVALID */
767    union {
768       RgInfPrbCfm       prbCfm;      /*!< Avgerage PRB usage per QCI*/
769    } u;
770 } RgInfL2MeasCfm;
771
772 /**
773  * @brief This API is invoked from l2 Measurements module at scheduler.
774  * When Scheduler receives a measurement request from stack manager for Average 
775  * PRB usage Per QCI in Uplink, Scheduler invokes this API towards LTE MAC 
776  * for the calculations. LTE MAC utilizes the uplink allocations information provided 
777  * by scheduler for every subframe and data indications received for this calculation.
778  * This API carries a transId to uniquely identify the confirm received for 
779  * this request from LTEMAC.
780  * */
781 S16 RgSchMacL2MeasReq ARGS((
782    Pst*                 pst,
783    RgInfL2MeasReq*      l2MeasReq
784 ));
785 /**
786  * @brief This API is invoked from l2 Measurements module at scheduler.
787  * When Scheduler receives a measurement send request from stack manager, 
788  * it sends L2 measurement to layer manager.
789  * */
790
791 S16 RgSchMacL2MeasSendReq ARGS((
792    Pst*                 pst,
793    RgInfL2MeasSndReq*      l2MeasReq
794 ));
795 /**
796  * @brief This API is invoked from l2 Measurements module at scheduler.
797  * When Scheduler receives a measurement stop request from stack manager,
798  * it stops L2 Measurement 
799  */
800 S16 RgSchMacL2MeasStopReq ARGS((
801    Pst*                 pst,
802    RgInfL2MeasStopReq*      l2MeasReq
803 ));
804
805 /**
806  * @brief This API is invoked from L2 Measurement module at LTE MAC. When LTE MAC
807  * completes calculation of Avergae PRB usage per QCI in Uplink for a given time 
808  * period, It invokes this API to indicate result back to scheduler. LTE  
809  * MAC sends the same transId received in measurement request from Scheduler.
810  * */
811 S16 RgMacSchL2MeasCfm ARGS((
812    Pst*                 pst,
813    RgInfL2MeasCfm*      l2MeasCfm
814 ));
815 /**
816  * @brief This API is invoked from L2 Measurement module at LTE MAC. When LTE MAC
817  * stops L2 measurement, it sends L2 measurement cfm.
818  * */
819
820 S16 RgMacSchL2MeasStopCfm ARGS((
821    Pst*                 pst,
822    RgInfL2MeasCfm*      l2MeasCfm
823 ));
824
825 S16 RgMacSchL2MeasStop ARGS
826 ((
827 Pst*                pst,   
828 RgInfL2MeasCfm      *measInfo
829 ));
830 #endif /* LTE_L2_MEAS */
831
832 typedef struct rgInfLcgRegReq
833 {
834    CmLteCellId          cellId;      /*!< Cell Identifier */
835    CmLteRnti            crnti;       /*!< RNTI which uniquely identifies the UE
836                                           RNTI range is specified in Section 
837                                           7.1 in 25.321 Specification. */
838    uint8_t                   lcgId;
839    Bool                 isGbr;       /* Indicate if the LCG is Gbr */
840 } RgInfLcgRegReq;
841
842
843 /* Added support for SPS*/
844 #ifdef LTEMAC_SPS
845 /** 
846  * @brief This structure contains the logical channel information related to
847  *  uplink SPS for a particular UE identified by the CRNTI.
848  */
849 typedef struct rgInfSpsLcInfo
850 {
851    CmLteCellId          cellId;      /*!< Cell Identifier */
852    CmLteRnti            crnti;       /*!< RNTI which uniquely identifies the UE
853                                           RNTI range is specified in Section 
854                                           7.1 in 25.321 Specification. */
855    CmLteRnti            spsRnti;     /*!< SPS RNTI. RNTI range is specified in
856                                           Section 7.1 in 25.321 Specification. */
857    uint8_t                   spsLcCnt;    /*!< identifies the number of SPS
858                                           configured logical channels */ 
859    uint8_t                   spsLcId[RGINF_MAX_NUM_DED_LC]; /*!< Logical Channel
860                                           Identifier. lcId value range is 
861                                           defined in Section 6.2.1
862                                           in 36.321 Specification. */
863    uint8_t                   implRelCnt;  /*!< "implicitRelAfter" vallue */  
864    uint16_t                  spsPrd;      /*!< SPS periodicity of the UE */
865 } RgInfSpsLcInfo;
866
867 /** 
868  * @brief This structure contains UL SPS param Reset related to
869  *  uplink SPS for a particular UE identified by the CRNTI.
870  */
871 typedef struct rgInfUlSpsReset
872 {
873    CmLteCellId          cellId;      /*!< Cell Identifier */
874    CmLteRnti            crnti;       /*!< RNTI which uniquely identifies the UE
875                                           RNTI range is specified in Section 
876                                           7.1 in 25.321 Specification. */
877 } RgInfUlSpsReset;
878
879
880 /** 
881  * @brief This structure contains the information to release UL SPS for a UE */
882 typedef struct rgInfSpsRelInfo
883 {
884    S16                  cellSapId;   /*!< identifies the cell SAP. Value range
885                                           should be within the set of 
886                                           configured cell SAP(s).*/
887    CmLteRnti            cRnti;       /*!< RNTI of the UE */
888    Bool                 isExplRel;    /*!< TRUE if explicit release needs to be
889                                           sent to UE */
890 } RgInfSpsRelInfo;
891 #endif /* LTEMAC_SPS */
892
893 /* 
894  * Function Prototypes 
895  */
896 /** 
897  * @brief Request from Scheduler to MAC to register a cell. 
898  * @details This primitive is used for light-weight loose coupling.
899  */
900 S16 cmPkSchMacCellRegReq ARGS((
901    Pst*                 pst,    
902    RgInfCellReg*        regReq  
903 ));
904
905 typedef S16 (*CellRegReq) ARGS((
906    Pst*                 pst,
907    RgInfCellReg*        regReq
908 ));
909
910 /** 
911  * @brief Request from Scheduler to MAC to register a cell. 
912  * @details The scheduler invokes this primitive after the scheduler cell
913  *  configuration is completed. Before calling this primitive, the scheduler
914  *  creates a mapping of the cell which is uniquely idetified by cell ID and 
915  *  scheduler instance that is serving the cell.
916  */
917 S16 RgSchMacCellRegReq ARGS((
918    Pst*                 pst,
919    RgInfCellReg*        regReq
920 ));
921 /** 
922  * @brief Request from Scheduler to MAC to register a cell. 
923  * @details This primitive is used for light-weight loose coupling.
924  */
925 S16 cmUnpkSchMacCellRegReq ARGS((
926    CellRegReq           func,
927    Pst*                 pst,
928    Buffer               *mBuf
929 ));
930 /** 
931  * @brief Request from MAC to scheduler to update dedicated BO.
932  * @details This primitive is used for light-weight loose coupling.
933  */
934 S16 cmPkMacSchDedBoUpdtReq ARGS((
935    Pst*                 pst,    
936    RgInfDedBoRpt*       boRpt  
937 ));
938
939 typedef S16 (*DedBoUpdtReq) ARGS((
940    Pst*                 pst,
941    RgInfDedBoRpt*       boRpt
942 ));
943
944 /** 
945  * @brief Request from MAC to scheduler to update dedicated BO.
946  * @details MAC layer invokes this primitive towards scheduler when it 
947  *  receives status response from the RLC for dedicated channels. Scheduler
948  *  takes the buffer occupancy information into consideration while taking
949  *  scheduling decisons. 
950  */
951 S16 RgMacSchDedBoUpdtReq ARGS((
952    Pst*                 pst,
953    RgInfDedBoRpt*       boRpt
954 ));
955 /** 
956  * @brief Request from MAC to scheduler to update dedicated BO.
957  * @details This primitive is used for light-weight loose coupling.
958  */
959 S16 cmUnpkMacSchDedBoUpdtReq ARGS((
960    DedBoUpdtReq         func,
961    Pst*                 pst,
962    Buffer               *mBuf
963 ));
964 /** 
965  * @brief Request from MAC to scheduler to update common channel BO.
966  * @details This primitive is used for light-weight loose coupling. 
967  */
968 S16 cmPkMacSchCmnBoUpdtReq ARGS((
969    Pst*                 pst,    
970    RgInfCmnBoRpt*       boRpt  
971 ));
972
973 typedef S16 (*CmnBoUpdtReq) ARGS((
974    Pst*                 pst,
975    RgInfCmnBoRpt*       boRpt
976 ));
977
978 /** 
979  * @brief Request from MAC to scheduler to update common channel BO.
980  * @details MAC layer invokes this primitive towards scheduler when it 
981  *  receives status response from the RLC for common channels. Scheduler
982  *  takes the buffer occupancy information into consideration while taking
983  *  scheduling decisons. 
984  */
985 S16 RgMacSchCmnBoUpdtReq ARGS((
986    Pst*                 pst,
987    RgInfCmnBoRpt*       boRpt
988 ));
989 /** 
990  * @brief Request from MAC to scheduler to update common channel BO.
991  * @details This primitive is used for light-weight loose coupling. 
992  */
993 S16 cmUnpkMacSchCmnBoUpdtReq ARGS((
994    CmnBoUpdtReq         func,
995    Pst*                 pst,
996    Buffer               *mBuf
997 ));
998
999 /*Fix: start:Indicate UE deletion at MAC to scheduler*/
1000 /** 
1001  * @brief UE delete indication from MAC to scheduler.
1002  * @details This primitive is used for light-weight loose coupling. 
1003  */
1004 S16 cmPkMacSchUeDelInd ARGS((
1005    Pst*                 pst,    
1006    RgInfUeDelInd*       ueDelInd
1007 ));
1008
1009 typedef S16 (*UeDelInd) ARGS((
1010    Pst*                 pst,
1011    RgInfUeDelInd*       ueDelInd
1012 ));
1013
1014 /** 
1015  * @brief UE deletion indication from MAC to scheduler.
1016  * @details MAC layer invokes this primitive towards scheduler when it 
1017  *  receives UE delete Request. As the UE is now deleted at MAC, it should 
1018  *  not be scheduled.
1019  */
1020 S16 RgMacSchUeDelInd ARGS((
1021    Pst*                 pst,
1022    RgInfUeDelInd*       ueDelInd
1023 ));
1024 /** 
1025  * @brief UE delete Indication Request from MAC to scheduler.
1026  * @details This primitive is used for light-weight loose coupling. 
1027  */
1028 S16 cmUnpkMacSchUeDelInd ARGS((
1029    UeDelInd            func,
1030    Pst*                 pst,
1031    Buffer               *mBuf
1032 ));
1033 /*Fix: end:Indicate UE deletion at MAC to scheduler*/
1034 /** 
1035  * @brief Data Indication Request from MAC to scheduler.
1036  * @details This primitive is used for light-weight loose coupling. 
1037  */
1038 S16 cmPkMacSchSfRecpInd ARGS((
1039    Pst*                 pst,    
1040    RgInfSfDatInd*       datInd
1041 ));
1042
1043 typedef S16 (*SfRecpInd) ARGS((
1044    Pst*                 pst,
1045    RgInfSfDatInd*       datInd
1046 ));
1047
1048 /** 
1049  * @brief Data Indication Request from MAC to scheduler.
1050  * @details MAC layer invokes this primitive towards scheduler when it 
1051  *  receives MAC Control Elements from the data received from the UE. Scheduler
1052  *  takes these control elements into consideration while taking scheduling 
1053  *  decisons for the uplink.
1054  */
1055 S16 RgMacSchSfRecpInd ARGS((
1056    Pst*                 pst,
1057    RgInfSfDatInd*       datInd
1058 ));
1059 /** 
1060  * @brief Data Indication Request from MAC to scheduler.
1061  * @details This primitive is used for light-weight loose coupling. 
1062  */
1063 S16 cmUnpkMacSchSfRecpInd ARGS((
1064    SfRecpInd            func,
1065    Pst*                 pst,
1066    Buffer               *mBuf
1067 ));
1068 /** 
1069  * @brief Resource Allocation Request from Scheduler to MAC.
1070  * @details This primitive is used for light-weight loose coupling.
1071  */ 
1072 S16 cmPkSchMacSfAllocReq ARGS((
1073    Pst*                 pst,    
1074    RgInfSfAlloc*        resAllocReq
1075 ));
1076
1077 typedef S16 (*SfAllocReq) ARGS((
1078    Pst*                 pst,
1079    RgInfSfAlloc*        resAllocReq
1080 ));
1081
1082 /** 
1083  * @brief Resource Allocation Request from Scheduler to MAC.
1084  * @details Scheduler invokes this primitive for every TTI towards MAC to  
1085  *  inform the scheduling decisions taken for uplink grants, common channels
1086  *  and list of UEs to be scheduling during this TTI.
1087  */
1088 S16 RgSchMacSfAllocReq ARGS((
1089    Pst*                 pst,
1090    RgInfSfAlloc*        resAllocReq
1091 ));
1092 /** 
1093  * @brief Resource Allocation Request from Scheduler to MAC.
1094  * @details This primitive is used for light-weight loose coupling.
1095  */ 
1096 S16 cmUnpkSchMacSfAllocReq ARGS((
1097    SfAllocReq           func,
1098    Pst*                 pst,
1099    Buffer               *mBuf
1100 ));
1101 /** 
1102  * @brief Request from Scheduler to release HARQ processes at MAC.
1103  * @details This primitive is used for light-weight loose coupling.
1104  */
1105 S16 cmPkSchMacRlsHqReq ARGS((
1106    Pst*                 pst,    
1107    RgInfRlsHqInfo*      sfHqInfo
1108 ));
1109
1110 typedef S16 (*RlsHqReq) ARGS((
1111    Pst*                 pst,
1112    RgInfRlsHqInfo*      sfHqInfo
1113 ));
1114
1115 /** 
1116  * @brief Request from Scheduler to release HARQ processes at MAC.
1117  * @details  Scheduler calls this primitive to send the list of UEs for  
1118  *  which the HARQ buffers are released to MAC. The Scheduler invokes this
1119  *  primitive when a positive acknowledgement is received for the TB transmitted
1120  *  or a TB is retransmitted for the allowed maximum number of retransmissions. 
1121  */
1122 S16 RgSchMacRlsHqReq ARGS((
1123    Pst*                 pst,
1124    RgInfRlsHqInfo*      sfHqInfo
1125 ));
1126 /** 
1127  * @brief Request from Scheduler to release HARQ processes at MAC.
1128  * @details This primitive is used for light-weight loose coupling.
1129  */
1130
1131 S16 cmUnpkSchMacRlsHqReq ARGS((
1132    RlsHqReq             func,
1133    Pst*                 pst,
1134    Buffer               *mBuf
1135 ));
1136
1137 /** 
1138  * @brief Request from Scheduler to reset HARQ Entity at MAC.
1139  * @details This primitive is used for light-weight loose coupling.
1140  */
1141 S16 cmPkSchMacRstHqEntReq ARGS((
1142    Pst*                 pst,    
1143    RgInfResetHqEnt*     hqEntInfo
1144 ));
1145
1146 typedef S16 (*RstHqEntReq) ARGS((
1147    Pst*                 pst,    
1148    RgInfResetHqEnt*     hqEntInfo
1149 ));
1150
1151 /** 
1152  * @brief Request from Scheduler to reset HARQ entity at MAC for a scell of an ue.
1153  * This is triggered upon deactivation of a scell
1154  */
1155 S16 RgSchMacRstHqEntReq ARGS((
1156    Pst*                 pst,
1157    RgInfResetHqEnt*     hqEntInfo
1158 ));
1159 /** 
1160  * @brief Request from Scheduler to release HARQ processes at MAC.
1161  * @details This primitive is used for light-weight loose coupling.
1162  */
1163
1164 S16 cmUnpkSchMacRstHqEntReq ARGS((
1165    RstHqEntReq          func,
1166    Pst*                 pst,
1167    Buffer               *mBuf
1168 ));
1169 /** 
1170  * @brief Request from Scheduler to release RNTI at MAC.
1171  * @details  This primitive is used for light-weight loose coupling.
1172  */
1173 S16 cmPkSchMacRlsRntiReq ARGS((
1174    Pst*                 pst,    
1175    RgInfRlsRnti*        rlsRnti
1176 ));
1177
1178 typedef S16 (*RlsRntiReq) ARGS((
1179    Pst*                 pst,
1180    RgInfRlsRnti*        rlsRnti
1181 ));
1182
1183 /** 
1184  * @brief Request from Scheduler to release RNTI at MAC.
1185  * @details The Scheduler calls this primitive to send the list of RNTIs for 
1186  *  which the RRC Connection is being rejected.
1187  */
1188 S16 RgSchMacRlsRntiReq ARGS((
1189    Pst*                 pst,
1190    RgInfRlsRnti*        rlsRnt
1191 ));
1192 /** 
1193  * @brief Request from Scheduler to release RNTI at MAC.
1194  * @details  This primitive is used for light-weight loose coupling.
1195  */
1196 S16 cmUnpkSchMacRlsRntiReq ARGS((
1197    RlsRntiReq           func,
1198    Pst*                 pst,
1199    Buffer               *mBuf
1200 ));
1201 /* Added support for SPS*/
1202
1203 typedef S16 (*LcgReg) ARGS((
1204    Pst*                 pst,    
1205    RgInfLcgRegReq       *lcgRegReq    
1206 ));
1207
1208 S16 cmPkSchMacLcgRegReq ARGS((
1209    Pst*                 pst,
1210    RgInfLcgRegReq       *lcgRegReq  
1211 ));
1212
1213 S16  RgSchMacLcgRegReq ARGS((Pst *pst, RgInfLcgRegReq *lcgRegReq));
1214
1215 S16 cmUnpkSchMacLcgRegReq ARGS((
1216    LcgReg          func,
1217    Pst             *pst,
1218    Buffer          *mBuf
1219 ));
1220
1221 S16  RgSchMacLcgReg ARGS((Pst* pst, RgInfLcgRegReq *lcgRegReq));
1222
1223 #ifdef LTEMAC_SPS
1224 /** 
1225  * @brief Primitive from Scheduler to MAC to register the logical channels of
1226  * a SPS UE
1227  * @details  This primitive is used for light-weight loose coupling.
1228  */
1229 S16 cmPkSchMacSpsLcRegReq ARGS((
1230    Pst*                 pst,
1231    RgInfSpsLcInfo       *lcInfo    
1232 ));
1233
1234 typedef S16 (*SpsLcReg) ARGS((
1235    Pst*                 pst,    
1236    RgInfSpsLcInfo       *lcInfo    
1237 ));
1238
1239 /** 
1240  * @brief Request from Scheduler to register the SPS related logical channels.
1241  * @details  Scheduler calls this primitive to send the list of logical channels
1242  *  that belong to the SPS logical channel group.   
1243  */
1244 S16  RgSchMacSpsLcRegReq ARGS((Pst *pst, RgInfSpsLcInfo *lcInfo));
1245
1246 S16 cmUnpkSchMacSpsLcRegReq ARGS((
1247    SpsLcReg        func,
1248    Pst             *pst,
1249    Buffer          *mBuf
1250 ));
1251
1252
1253 /** 
1254  * @brief Primitive from Scheduler to MAC to Reset UL SPS related Params
1255  * @details  This primitive is used for light-weight loose coupling.
1256  */
1257 S16 cmPkSchMacUlSpsResetReq ARGS((
1258    Pst*                 pst,
1259    RgInfUlSpsReset       *ulSpsResetInfo    
1260 ));
1261
1262 typedef S16 (*UlSpsReset) ARGS((
1263    Pst*                 pst,    
1264    RgInfUlSpsReset       *ulSpsResetInfo    
1265 ));
1266
1267 /** 
1268  * @brief Request from Scheduler to reset UL SPS Params
1269  * @details  Scheduler calls this primitive to reset implicit and explicit
1270  * release counters for the UE
1271  */
1272 S16  RgSchMacUlSpsResetReq ARGS((Pst *pst, RgInfUlSpsReset *ulSpsResetInfo));
1273
1274 S16 cmUnpkSchMacUlSpsResetReq ARGS((
1275    UlSpsReset        func,
1276    Pst             *pst,
1277    Buffer          *mBuf
1278 ));
1279
1280
1281
1282 /** 
1283  * @brief Primitive from Scheduler to MAC to deregister the logical channels of
1284  * a SPS UE
1285  * @details  This primitive is used for light-weight loose coupling.
1286  */
1287 S16 cmPkSchMacSpsLcDeregReq ARGS((
1288    Pst*                 pst,    
1289    CmLteCellId          cellId,
1290    CmLteRnti            crnti
1291 ));
1292
1293 typedef S16 (*SpsLcDereg) ARGS((
1294    Pst*                 pst,    
1295    CmLteCellId          cellId,
1296    CmLteRnti            crnti
1297 ));
1298
1299 /** 
1300  * @brief Request from Scheduler to deregister the SPS related logical channels.
1301  * @details  Scheduler calls this primitive to send the deregistration request
1302  * for a UE once SPS is released for it
1303  */
1304 S16  RgSchMacSpsLcDeregReq ARGS((Pst *pst, CmLteCellId cellId, CmLteRnti
1305     crnti));
1306
1307 S16 cmUnpkSchMacSpsLcDeregReq ARGS((
1308    SpsLcDereg           func,
1309    Pst*                 pst,
1310    Buffer               *mBuf
1311 ));
1312
1313 /** 
1314  * @brief Primitive from MAC to Scheduler to indicate release of UL SPS for a UE
1315  * @details  This primitive is used for light-weight loose coupling.
1316  */
1317 S16 cmPkMacSchSpsRelInd ARGS((
1318    Pst*                 pst,    
1319    RgInfSpsRelInfo*     relInfo
1320 ));
1321
1322 typedef S16 (*SpsRelInd) ARGS((
1323    Pst*                 pst,    
1324    RgInfSpsRelInfo*     relInfo
1325 ));
1326
1327 /** 
1328  * @brief Indication from  MAC to Scheduler to release UL SPS for a UE 
1329  * @details  MAC calls this primitive to inform the scheduler that UL SPS needs
1330  * to be released for a UE
1331  */
1332 S16  RgMacSchSpsRelInd ARGS((Pst *pst, RgInfSpsRelInfo *relInfo));
1333
1334 S16 cmUnpkMacSchSpsRelInd ARGS((
1335    SpsRelInd            func,
1336    Pst*                 pst,
1337    Buffer               *mBuf
1338 ));
1339
1340 #endif
1341 #ifdef LTE_L2_MEAS
1342 S16 cmPkMacSchL2MeasCfm ARGS((
1343 Pst*                 pst,
1344 RgInfL2MeasCfm       *measCfm
1345 ));
1346
1347 S16 cmPkMacSchL2MeasStopCfm ARGS((
1348 Pst*                 pst,
1349 RgInfL2MeasCfm       *measCfm
1350 ));
1351
1352
1353 S16 cmPkSchMacL2MeasReq ARGS((
1354    Pst*                 pst,
1355    RgInfL2MeasReq      *measInfo
1356 ));
1357
1358 S16 cmPkSchMacL2MeasStopReq ARGS((
1359    Pst*                 pst,
1360    RgInfL2MeasStopReq *measInfo
1361 ));
1362
1363 S16 cmPkSchMacL2MeasSendReq ARGS((
1364    Pst*                 pst,
1365    RgInfL2MeasSndReq *measInfo
1366 ));
1367 typedef S16 (*L2MeasReq) ARGS((
1368    Pst*                 pst,    
1369    RgInfL2MeasReq       *measInfo
1370 ));
1371
1372 typedef S16 (*L2MeasStopReq) ARGS((
1373    Pst*                 pst,
1374    RgInfL2MeasStopReq *measInfo
1375 ));
1376
1377 typedef S16 (*L2MeasSendReq) ARGS((
1378    Pst*                 pst,
1379    RgInfL2MeasSndReq *measInfo
1380 ));
1381 typedef S16 (*L2MeasStopCfm) ARGS((
1382    Pst                *pst,
1383    RgInfL2MeasCfm     *measCfm
1384 ));
1385
1386 typedef S16 (*L2MeasCfm) ARGS((
1387    Pst                *pst, 
1388    RgInfL2MeasCfm     *measCfm
1389 ));
1390 S16 cmUnpkMacSchL2MeasCfm ARGS
1391 ((
1392 L2MeasCfm      func,
1393 Pst            *pst,
1394 Buffer         *mBuf
1395 ));
1396 S16 cmUnpkSchMacL2MeasReq ARGS((
1397    L2MeasReq      func,
1398    Pst            *pst,
1399    Buffer         *mBuf
1400 ));
1401 S16 cmUnpkSchMacL2MeasSendReq ARGS((
1402    L2MeasSendReq      func,
1403    Pst            *pst,
1404    Buffer         *mBuf
1405 ));
1406 S16 cmUnpkSchMacL2MeasStopReq ARGS((
1407    L2MeasStopReq      func,
1408    Pst            *pst,
1409    Buffer         *mBuf
1410 ));
1411
1412 S16 cmUnpkMacSchL2MeasStopCfm ARGS((
1413    L2MeasCfm      func,
1414    Pst            *pst,
1415    Buffer         *mBuf
1416 ));
1417 #endif
1418 S16  RgSchMacRlsRnti ARGS((Pst* pst, RgInfRlsRnti* rlsRnti));
1419 S16  RgSchMacRlsHq ARGS((Pst* pst, RgInfRlsHqInfo* sfHqInfo));
1420 S16  RgSchMacSfAlloc ARGS((Pst* pst, RgInfSfAlloc* resAllocReq));
1421 S16  RgSchMacRstHqEnt ARGS((Pst* pst, RgInfResetHqEnt* hqEntInfo));
1422 S16  RgMacSchSfRecp ARGS((Pst* pst, RgInfSfDatInd* datInd));
1423 S16  RgMacSchCmnBoUpdt ARGS(( Pst* pst, RgInfCmnBoRpt* boRpt));
1424 S16 RgMacSchDedBoUpdt ARGS(( Pst* pst, RgInfDedBoRpt* boRpt));
1425 S16  RgSchMacCellReg ARGS((Pst* pst,RgInfCellReg* regReq));
1426 #ifdef LTE_L2_MEAS
1427 S16 RgSchMacL2Meas ARGS((Pst* pst, RgInfL2MeasReq* l2MeasReq));
1428 S16 RgMacSchL2Meas ARGS((Pst* pst, RgInfL2MeasCfm* l2MeasCfm));
1429 S16 RgSchMacL2MeasStop ARGS((Pst* pst, RgInfL2MeasStopReq *measInfo));
1430 S16 RgSchMacL2MeasSend ARGS((Pst* pst, RgInfL2MeasSndReq *measInfo));
1431 #endif  /* LTE_L2_MEAS */
1432 /* Added support for SPS*/
1433 #ifdef LTEMAC_SPS
1434 S16 RgSchMacSpsLcReg ARGS((Pst *pst, RgInfSpsLcInfo *lcInfo));
1435 S16 RgSchMacUlSpsReset ARGS((Pst *pst, RgInfUlSpsReset *lcInfo));
1436 S16 RgSchMacSpsLcDereg ARGS((Pst *pst, CmLteCellId cellId, CmLteRnti
1437     crnti));
1438 S16 RgMacSchSpsRel ARGS((Pst *pst, RgInfSpsRelInfo* relInfo));
1439 #endif
1440 S16 RgMacSchUeDel ARGS((Pst* pst, RgInfUeDelInd*  ueDelInd));
1441 #ifdef __cplusplus
1442 }
1443 #endif
1444 #endif /* __GKSCH_X__*/
1445
1446 /**********************************************************************
1447   
1448          End of file
1449 **********************************************************************/