DL throughput calculation for UM [Issue-ID: ODUHIGH-319]
[o-du/l2.git] / src / 5gnrrlc / kw.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**
20   
21         Name:    LTE RLC file 
22     
23         Type:    C include file
24   
25         Desc:    This file contains all the data structures and 
26                  prototypes for LTE RLC.
27  
28         File:    kw.x
29
30 *********************************************************************21*/
31 /** @file kw.x
32 @brief RLC Product Structures, prototypes
33 */
34
35 #ifndef __KWX__
36 #define __KWX__
37  
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41
42 /** @brief Local typedefs */
43 typedef uint32_t    RlcSn;   /*!< Sequence Number length */
44
45 typedef RguDDatIndInfo KwDatIndInfo;
46
47 typedef RguDStaIndInfo KwDStaIndInfo;
48
49 typedef RguPduInfo KwPduInfo; /* kw002.201 : Aligning the structure with RGU */
50
51 typedef struct _amRlcStats
52 {
53    uint32_t   numDLStaPduSent;
54    uint32_t   numDLNacksInStaPdu;
55    uint32_t   numDLBytesUnused;
56    uint32_t   numDLPollTimerExpiresSrb;
57    uint32_t   numDLPollTimerExpiresDrb;
58    uint32_t   numDLMaxRetx;
59    uint32_t   numDLRetransPdus;
60    uint32_t   numULPdusDiscarded;
61    uint32_t   numULReAsmblTimerExpires;
62    uint32_t   numULStaPduRcvd;
63    uint32_t   numULNackInStaPduRcvd;
64    uint32_t   numRlcAmCellSduTx; /* Count of SDUs transmitted in DL for all UEs */
65    uint32_t   numRlcAmCellSduBytesTx; /*Total number of bytes transmitted in DL for all Ues */
66    uint32_t   numRlcAmCellRetxPdu; /*Count of PDUs retransmitted for all Ues */
67    uint32_t   numRlcAmMaxRetx; /*Total number of Max-RLC retransmissions hit for all the Ues */
68    uint32_t   numRlcAmCellDupPduRx; /*Count of Duplicate PDUs detected for a UE in UL for all Ues */
69    uint32_t   numRlcAmCellDropOutWinRx; /*Count of PDUs dropped due to Out of Window reception for all Ues */
70    uint32_t   numRlcAmCellSduRx; /* Count of SDUs received in UL for all UEs*/
71    uint32_t   numRlcAmCellSduBytesRx;/*Total number of bytes received in UL for all Ues*/
72    uint32_t   numRlcAmCellNackRx; /*Total number of UL PDUs nacked for all the Ues*/
73    uint32_t   numRlcAmCellWinStall; /*Number of window stalls detected for all the Ues */
74 }AMRLCStats;
75
76 typedef struct _umRlcStats
77 {
78    uint32_t   numDLBytesUnused;
79    uint32_t   numDLMaxRetx;
80    uint32_t   numULPdusDiscarded;
81    uint32_t   numULReAsmblTimerExpires;
82    uint32_t   numULPdusOutsideWindow;
83 }UMRLCStats;
84
85 typedef struct _rlcStats
86 {
87    AMRLCStats   amRlcStats;
88    UMRLCStats   umRlcStats;
89 }RLCStats;
90
91 RLCStats gRlcStats;
92
93 /* kw005.201 added support for L2 Measurement */
94 #ifdef LTE_L2_MEAS
95 typedef struct rlcSduSnMap RlcSduSnMap;
96 typedef RguLchMapInfo KwLchMapInfo;
97 #endif /*  LTE_L2_MEAS */
98
99 /** @defgroup ummode UM Module Info 
100 */
101 /** 
102  * @brief  Structure to hold an Unacknowledged Mode header
103  *
104  * @details
105  *    - si    : Segmentation Info
106  *    - sn    : Sequence number
107  *    - so    : Segmentation offset
108 */
109 typedef struct rlcUmHdr
110 {
111    uint8_t     si;              /*!< Segmentation Info */
112    RlcSn       sn;              /*!< Sequence number */
113    uint16_t    so;              /*!< Segmentation offset */
114 }RlcUmHdr;
115
116 /** 
117  * @brief  Structure to hold an Acknowledged Mode header
118  *
119  * @details
120  *    - dc    : Data/Control PDU
121  *    - rf    : Resegmentation flag
122  *    - p     : Poll bit
123  *    - fi    : Framing Info
124  *    - e     : Extension bit
125  *    - lsf   : Last segment flat
126  *    - sn    : Sequence number
127  *    - so    : Segment offset
128  *    - numLi : Number of length indicators in the following array (li)
129  *    - li    : Length indicators
130 */
131 typedef struct rlcAmHdr
132 {
133    uint8_t     dc;              /*!< Data/Control PDU */
134    uint8_t     p;               /*!< Poll bit */
135    uint8_t     si;              /*!< Segmentation Info: 5GNR */ 
136    RlcSn       sn;              /*!< Sequence number */
137    uint32_t    so;              /*!< Segment offset */
138 }RlcAmHdr;
139
140 /* structures used for encoding/decoding the headers */
141 typedef struct rlcCntrlInfo
142 {
143    uint16_t  val;
144    uint8_t   len;
145    uint16_t  idx;
146    uint8_t   emtBits;
147    uint16_t  e1Idx;
148    uint16_t  e2Idx;   
149    uint8_t   e1eb;
150 }RlcCntrlInfo;
151
152 typedef struct rlcHdrInfo
153 {
154    uint32_t  val;
155    uint8_t   len;
156    uint8_t   eb;
157    uint8_t   *hdr;
158    uint16_t  idx;
159    uint8_t   pEb;
160    uint8_t   pLen;
161 }RlcHdrInfo;
162
163 typedef struct rlcExtHdr
164 {
165    uint32_t val;
166    uint16_t len;
167    uint8_t  hdr;
168    uint8_t  pLen;
169 }RlcExtHdr;
170
171 /** 
172  * @brief  Structure to hold information about a Logical channel
173  *
174  * @details
175  *    - lChId    : Logical channel Id
176  *    - lChType  : Logical channel type 
177 */ 
178 typedef struct rlcLchInfo
179 {
180    CmLteLcId     lChId;     /*!< Logical channel Id */
181    CmLteLcType   lChType;   /*!< Logical channel type */
182 }RlcLchInfo;
183
184 /* kw005.201 added support for L2 Measurement */
185 #ifdef LTE_L2_MEAS
186
187 /** @struct RlcL2Cntr
188  * RLC L2 Counter  */
189 typedef struct rlcL2Cntr
190 {
191    struct
192    {
193       uint32_t  numActvUe;        /*!< number of active Ue */
194       uint32_t  sampOc;           /*!< Total number of sampling occasion */
195    }actUe;
196    struct
197    {
198       uint32_t  dLoss;            /*!< Total number of lost packets */  
199       uint32_t  posPkts;          /*!< Total number of positively acknowlegded 
200                                   packets */
201    }uuLoss;
202    struct                    /*!< For DL IP throughput */
203    {
204       uint32_t volSummation;      /*!< Sum of data in bytes */
205       uint32_t timeSummation;     /*!< Sum of time difference in milli sec*/
206    }dlIpThruput;
207    struct                    /*!< For UL IP throughput */
208    {
209       uint32_t volSummation;      /*!< Sum of data in bytes */
210       uint32_t timeSummation;     /*!< Sum of time difference in milli sec*/
211    }ulIpThruput;
212    /* Discard new changes starts */
213    struct                    /*!< For UL IP throughput */
214    {
215       uint32_t discSdus;          /*!< Total RLC SDUs discarded */
216       uint32_t totSdus;           /*!< Total RLC SDUs received */
217    }dlDisc;
218    struct                    /*!< For UL IP throughput */
219    {
220       uint64_t sduDelay;          /*!< Total SDUs delay */
221       uint32_t numSdus;
222    }dlPjSduDelay;
223    uint32_t    totDrbsPerQci;     /*!< Total Count of DRB's for this QCI */
224 }RlcL2Cntr;
225
226 struct rlcSduSnMap
227 {
228    CmLList     lstEnt;
229    Bool        failMarked;
230    Bool        fullySent;
231    uint32_t    sduId;
232    uint16_t    numSn;
233    uint16_t    snList[RLC_MAX_PDU_MAP];
234    uint16_t    harqAck;
235    uint16_t    reqSent;
236    uint16_t    rspRcvd;
237 };
238
239 typedef struct rlcSnSduMap
240 {
241    uint16_t         sn;
242    CmLteLcId        lChId;              /*!< Logical channel Id */
243    uint16_t         numSdu;
244 #ifdef LTE_RLC_R9
245    Bool        isBurstSplitted;    /*!< true: burst for this LCH is splitted */
246 #endif /* LTE_RLC_R9 */
247    RlcSduSnMap  *sduList[RLC_MAX_DL_LI];
248 }RlcSnSduMap;
249
250 typedef struct rlcTbSnMap
251 {
252    CmHashListEnt  hlTbEnt;
253    uint32_t       tbId;
254    uint16_t       prevNumSn;
255    uint16_t       numSn;
256    RlcSnSduMap    snSduMap[RGU_MAX_PDU * RGU_MAX_LC];
257 }RlcTbSnMap;
258
259 typedef struct rlcL2MeasCbUeMeasInfo
260 {
261    CmLteRnti   ueId;                    /*!< UE ID (Used only for IP Throughput
262                                              in UL/DL */
263    CmLteCellId cellId;                  /*!< UE ID (Used only for IP Throughput
264                                              in UL/DL */
265    Bool        isValid;                 /*! < is this UE entry valid */
266    uint8_t     numLcId;                 /*!< Holds the number of LCh for which Ul Ip
267                                              measurement is ON */
268    uint8_t     lcId[RLC_MAX_LCH_PER_UE]; /*!< Holds the list of LCh for which Ul ip
269                                              measurement is ON */
270    RlcL2Cntr    measData[LKW_MAX_QCI];
271    uint16_t     numQci;                  /*!< number of valid qcI */
272    uint8_t      qci[LKW_MAX_QCI];        /*!< list of valid qcI */
273 }RlcL2MeasCbUeMeasInfo;
274
275 typedef struct rlcL2MeasCbIpThMeas
276 {
277    uint8_t                   numUes;
278    uint8_t                   totNumQci;
279    uint8_t                   totQci[LKW_MAX_QCI];
280    RlcL2MeasCbUeMeasInfo ueInfoLst[LKW_MAX_UE]; /*Added for handling meas for multiple ues*/ 
281 }RlcL2MeasCbIpThMeas;
282
283 typedef struct rlcL2MeasCbNonIpThMeas
284 {
285    uint16_t    numSamples;              /*!< Number of samples to take on numActUe */
286    uint16_t    numQci;                  /*!< number of valid qcI */
287    uint8_t     qci[LKW_MAX_QCI];        /*!< list of valid qcI */
288    RlcL2Cntr   measData[LKW_MAX_QCI];   /*!< Measurement CB */
289 }RlcL2MeasCbNonIpThMeas;
290
291 typedef union rlcL2MeasCbIpNonIpThMeasVal
292 {
293    RlcL2MeasCbIpThMeas    ipThMeas;
294    RlcL2MeasCbNonIpThMeas nonIpThMeas;
295 }RlcL2MeasCbIpNonIpThMeasVal;
296
297 /** @struct RlcL2MeasCb
298  * RLC L2 Measurement CB */
299 typedef struct rlcL2MeasCb
300 {
301    uint8_t        measType;        /*!< Bit-wise set measurement types */
302    RlcL2MeasCbIpNonIpThMeasVal val;   /* Union of IP tpt or non-ip tpt */
303 }RlcL2MeasCb;
304
305 /** @struct RlcL2MeasEvtCb
306  * RLC L2 Measurement Evt CB */
307 typedef struct rlcL2MeasEvtCb
308 {
309    uint32_t      transId;                /*!< TransId of Measurement Req */
310    uint32_t      cbIdx;                  /*!< TransId of Measurement Req */
311    CmTimer       l2Tmr; /* NOT USED */                 /*!< L2 Timer per request */
312    TmrCfg        l2TmrCfg; /* NOT USED */               /*!< Time period of measurement */
313    RlcL2MeasCb   measCb;                 /*!< Measurement CB */ 
314    EpcTime       startTime; /* NOT USED */            /*!<  start time when meas starts*/ 
315 }RlcL2MeasEvtCb;
316
317 /** @struct RlcL2MeasRbCb
318  * RLC L2 Measurement Rb CB */
319 typedef struct rlcL2MeasRbCb
320 {
321    uint8_t        measOn;                      /*!< Measurements that are running */ 
322    RlcL2Cntr      *l2Sts[RLC_MAX_L2MEAS_EVT];  /*!< L2 Mesurement statistics */     
323 }RlcL2MeasRbCb;
324
325 /** @struct RlcL2Cb
326  * RLC L2  CB */
327 typedef struct rlcL2Cb
328 {
329    uint16_t        rlcNumMeas;                   /*!< Number of measurements going on */
330    RlcL2MeasEvtCb  rlcL2EvtCb[LKW_MAX_L2MEAS];  /*!< Pointers to Measurement Cb */
331    uint8_t         measOn[LKW_MAX_QCI];          /*!< Measurement on */
332    uint32_t        numActUe[LKW_MAX_QCI];       /*!< Measurement on */
333 }RlcL2Cb;
334
335
336 typedef enum _dlIpThrputState
337 {
338    KW_DL_IPTHRU_RESET = 0,
339    KW_DL_IPTHRU_BURST_STARTED,
340    KW_DL_IPTHRU_BURST_CONTINUE,
341    KW_DL_IPTHRU_BURST_COMPLETED
342 }DlIpThrputState;
343
344 /** 
345 * @struct rlcL2MeasSduLst
346 * Structure to hold parameters of 
347 * burst sdus in DL for a RB */
348 typedef struct rlcOutStngSduInfo
349 {
350    uint32_t  sduId;            /*!< SDU Id of sdu */
351    MsgLen    sduLen;           /*!< Size of sdu */
352    uint32_t  numTb;            /*!< Hold the number of TBs for this sdu in DL */
353 }RlcOutStngSduInfo;
354
355 /** 
356 * @struct rlcL2MeasDlIpTh
357 * Structure to hold parameters for DL ip 
358 * throughput for a RB */
359 typedef struct rlcL2MeasDlIpTh
360 {
361    Bool               isBurstAct;            /*!< Set to TRUE when burst is active in DL */
362    uint64_t           burstStartTime;        /*!< Holds the starting time of the burst */
363    uint32_t           burstEndSduId;         /*!< Sdu ID when burst ends */
364    uint8_t            lastSduIdx;            /*!< Holds the index of last outStanding sdu */
365    RlcOutStngSduInfo  outStngSduArr[RLC_L2MEAS_MAX_OUTSTNGSDU];/*!< Hold the burst sdu information */
366 }RlcL2MeasDlIpTh;
367
368 /** 
369 * @struct rlcL2MeasIpThruput
370 * Structure to hold parameters for UL/DL ip 
371 * throughput for a RB */
372 typedef struct rlcL2MeasIpThruput
373 {
374    uint32_t         dataVol;                 /*!< Holds volume of new data in bytes
375                                               for UL IP throughput */
376    uint32_t         ttiCnt;                  /*!< Holds ttiCnt received from MAC in UL */
377    uint32_t         prevTtiCnt;        /*!< Holds previous ttiCnt received from MAC in UL */
378    RlcL2MeasDlIpTh  dlIpTh;
379 }RlcL2MeasIpThruput;
380
381 #endif /* LTE_L2_MEAS */
382
383 /** 
384  * @brief  Structure to hold an UE key for the UE hast lists
385  *
386  * @details
387  *    - ueId    : UE Id
388  *    - cellId  : Cell Id 
389 */
390 typedef struct rlcUeKey
391 {
392    CmLteRnti     ueId;     /*!< UE Id */
393    CmLteCellId   cellId;   /*!< Cell Id */
394 }RlcUeKey;
395
396 /** 
397  * @brief  Structure to hold an information about the CKW SAP
398  *
399  * @details
400  *    - pst   : Service user post structure
401  *    - spId  : Service provider Id
402  *    - suId  : Service user Id
403  *    - state : State of the SAP
404  *    - sts   : SAP specific statistics 
405 */
406 typedef struct rlcCkwSapCb
407 {
408    Pst           pst;     /*!< Service user post structure */
409    SpId          spId;    /*!< Service provider Id */
410    SuId          suId;    /*!< Service user Id */
411    uint8_t       state;   /*!< Sap Status */
412    RlcCkwCntSts   sts;     /*!< Statistics */
413 }RlcCkwSapCb;
414
415 /** 
416  * @brief  Structure to hold an information about the KWU SAP
417  *
418  * @details
419  *    - pst   : Service user post structure
420  *    - spId  : Service provider Id
421  *    - suId  : Service user Id
422  *    - state : State of the SAP
423  *    - sts   : SAP specific statistics 
424 */
425 typedef struct rlcKwuSapCb
426 {
427    Pst           pst;     /*!< Service user post structure */
428    SpId          spId;    /*!< Service provider Id */
429    SuId          suId;    /*!< Service user Id */
430    uint8_t       state;   /*!< Sap Status */
431    RlcKwuSapSts  sts;     /*!< Statistics */
432 }RlcKwuSapCb;
433
434 /** 
435  * @brief  Structure to hold an information about the RGU SAP
436  *
437  * @details
438  *    - pst       : Service user post structure
439  *    - spId      : Service provider Id
440  *    - suId      : Service user Id
441  *    - state     : State of the SAP
442  *    - bndTmr    : Bind Timer
443  *    - bndTmrInt : Timer Interval
444  *    - retryCnt  : Bind Retry Count
445 */
446 typedef struct rlcRguSapCb
447 {
448    Pst       pst;         /*!< Service user post structure */
449    SpId      spId;        /*!< Service provider Id */
450    SuId      suId;        /*!< Service user Id */
451    uint8_t   state;       /*!< Sap Status */
452    CmTimer   bndTmr;      /*!< Bind Timer */
453    uint16_t  bndTmrInt;   /*!< Timer Interval */
454    uint8_t   retryCnt;    /*!< Bind Retry Count */
455 }RlcRguSapCb;
456
457 /** 
458  * @brief  Structure to hold an information about the UDX UL SAP
459  *
460  * @details
461  *    - pst       : Service user post structure
462  *    - spId      : Service provider Id
463  *    - suId      : Service user Id
464  *    - state     : State of the SAP
465  *    - bndTmr    : Bind Timer
466  *    - bndTmrInt : Timer Interval
467  *    - retryCnt  : Bind Retry Count
468 */
469 typedef struct rlcUdxUlSapCb
470 {
471    Pst       pst;         /*!< Service user post structure */
472    SpId      spId;        /*!< Service provider Id */
473    SuId      suId;        /*!< Service user Id */
474    uint8_t   state;       /*!< Sap Status */
475    CmTimer   bndTmr;      /*!< Bind Timer */
476    uint16_t  bndTmrInt;   /*!< Timer Interval */
477    uint8_t   retryCnt;    /*!< Bind Retry Count */
478 }RlcUdxUlSapCb;
479
480 /** 
481  * @brief  Structure to hold an information about the UDX DL SAP
482  *
483  * @details
484  *    - pst       : Service user post structure
485  *    - spId      : Service provider Id
486  *    - suId      : Service user Id
487  *    - state     : State of the SAP
488 */
489 typedef struct rlcUdxDlSapCb
490 {
491    Pst     pst;     /*!< Service user post structure */
492    SpId    spId;    /*!< Service provider Id */
493    SuId    suId;    /*!< Service user Id */
494    uint8_t state;   /*!< Sap Status */
495 }RlcUdxDlSapCb;
496
497 /** 
498  * @brief  Structure to hold info about memory to be freed
499  *
500  * @details
501  *    - sduLst  : The SDU queues are appended to this queue, used 
502  *                for the UM SDU queues
503  *    - txLst   : Stores to be released AM Mode TX PDUs
504  *    - reTxLst : Stores to be released AM Re TX PDU's
505  *    - rbLst   : List of AM DL RBs to be freed 
506 */
507 typedef struct rlcDlDataToBeFreed
508 {
509    CmLListCp   sduLst;     /*!< Queue of SDU's to be freed  */
510    CmLListCp   txLst;     /*!< Stores to be released TX PDUs */
511    CmLListCp   reTxLst;   /*!< Stores to be released ReTX PDUs */
512    CmLListCp   rbLst;     /*!< List of AM DL RBs to be freed */
513 }RlcDlDataToBeFreed;
514
515 /** 
516  * @brief  Structure to hold an information about DL RLC instance
517  *
518  * @details
519  *    - numKwuSaps        : Number of RLC KWU Saps
520  *    - numUdxSaps        : Number of RLC UDX Saps
521  *    - rlcKwuDlSap          : Pointer to the array of KWU SAPS
522  *    - udxDlSap          : Pointer to the array of UDX SAPS
523  *    - rguDlSap          : RGU Sap Control Block
524  *    - cellLstCp         : Hashlist of CellCb
525  *    - ueLstCp           : Hashlist of UeCb 
526  *    - toBeFreed         : Pointer to data to be freed
527  *    - shutdownReveived  : Request for shutdown recevied or not
528  *    - eventInQueue      : Event for cleanup exists in queue or not
529  */
530 typedef struct rlcDlCb
531 {
532    uint8_t             numKwuSaps;         /*!< Number of RLC Data Saps */
533    uint8_t             numUdxSaps;         /*!< Number of RLC Data Saps */
534    RlcKwuSapCb         *rlcKwuDlSap;          /*!< KWU Sap Control Block */
535    RlcUdxDlSapCb       *udxDlSap;          /*!< UDX DL Sap Control Block */
536    RlcRguSapCb         *rguDlSap;          /*!< RGU Sap Control Block */
537    CmHashListCp        cellLstCp;          /*!< Hashlist of CellCb */
538    CmHashListCp        ueLstCp;            /*!< Hashlist of UeCb */
539    RlcDlDataToBeFreed  toBeFreed;          /*!< Pointer to data to be freed */        
540    Pst                 selfPst;            /*!< Pst to post events to self */
541    Buffer              *selfPstMBuf;       /*!< Buffer used for self post */
542    Bool                shutdownReceived;   /*!< Request for shutdown recevied */
543    Bool                eventInQueue;       /*!< Event exists in queue or not */
544 #ifdef LTE_L2_MEAS
545    RlcL2Cb              rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
546 #endif /* LTE_L2_MEAS */
547 }RlcDlCb;
548
549 /** 
550  * @brief  Structure to hold an information about UL RLC instance
551  *
552  * @details
553  *    - ckwSap       : CKW Sap Conrol Block
554  *    - numKwuSaps   : Number of RLC KWU Saps
555  *    - numUdxSaps   : Number of RLC UDX Saps
556  *    - udxUlSap     : Pointer to the array of UDX SAPS 
557  *    - rlcKwuUlSap     : Pointer to the array of KWU SAPS
558  *    - rguUlSap     : RGU Sap Control Block
559  *    - cellLstCp    : Hashlist of CellCb
560  *    - ueLstCp      : Hashlist of UeCb 
561  *    - transIdLstCp : Hashlist of cfg trans
562  */
563 typedef struct rlcUlCb
564 {
565    RlcCkwSapCb     ckwSap;         /*!< CKW Sap Conrol Block */ 
566    uint8_t         numKwuSaps;     /*!< Number of RLC Data Saps */
567    uint8_t         numUdxSaps;     /*!< Number of RLC Data Saps */
568    RlcUdxUlSapCb   *udxUlSap;      /*!< UDX DL Sap Control Block */
569    RlcKwuSapCb     *rlcKwuUlSap;      /*!< KWU Sap Control Block */
570    RlcRguSapCb     *rguUlSap;      /*!< RGU Sap Control Block */
571    CmHashListCp   cellLstCp;      /*!< Hashlist of CellCb */
572    CmHashListCp   ueLstCp;        /*!< Hashlist of UeCb */
573    CmHashListCp   transIdLstCp;   /*!< Hashlist of cfg trans */
574    uint8_t        rlcUlUdxEventType;  /*!<Ue Create/ReConfig> */
575 /* kw005.201 added support for L2 Measurement */
576 #ifdef LTE_L2_MEAS
577    RlcL2Cb        rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
578 #endif /* LTE_L2_MEAS */
579 }RlcUlCb;
580
581 typedef struct rlcThptPerUe
582 {
583    uint16_t ueIdx;
584    uint64_t dataVol;
585 }RlcThptPerUe;
586
587 /**
588  * @brief  Structure to hold information about throughput at  RLC
589  * 
590  */
591 typedef struct rlcThpt
592 {
593    Inst          inst;                      /* RLC instance */
594    CmTimer       thptTmr;                   /* Throughput Timer */
595    uint8_t       numActvUe;                 /* Number of Active UEs */
596    RlcThptPerUe  thptPerUe[MAX_NUM_UE];     /* Throughput calculated per UE */
597 }RlcThpt;
598
599 /** 
600  * @brief  Structure to hold an information about a RLC instance
601  *
602  * @details
603  *    - init    : Task Initialization Info
604  *    - genCfg  : General Configuration
605  *    - genSts  : General Statistics
606  *    - trcLen  : Trace Length
607  *    - trcMask : Trace Mask
608  *    - rlcTq    : Timer queue
609  *    - rlcTqCp  : Timer queue control point
610  *    - u       : Union depending on whether the instance is UL or DL
611  *      - ulCb  : UL instance Control Block
612  *      - dlCb  : DL instance Control Block
613  */
614 typedef struct rlcCb
615 {
616    TskInit    init;               /*!< Task Initialization Info */
617    RlcGenCfg   genCfg;             /*!< General Configuration Structure */
618    RlcGenSts   genSts;             /*!< General Statistics */
619    S16        trcLen;             /*!< Trace Length */
620    uint8_t         trcMask;            /*!< Trace Mask */
621    CmTqType   rlcTq[RLC_TMR_LEN];   /*!< Timer queue */
622    CmTqCp     rlcTqCp;             /*!< Timer queue control point */
623    union 
624    {
625       RlcUlCb   *ulCb;   /*!< Ul Control Block */
626       RlcDlCb   *dlCb;   /*!< Dl Control Block */
627    } u;
628    uint8_t    dlSduId;   /*!< Downlink SDU ID */
629    RlcThpt    rlcThpt;   /*!< Throughput at RLC*/
630 }RlcCb;
631
632 RlcCb *rlcCb[MAX_RLC_INSTANCES];   /*!< RLC global control block */
633
634 /****************************************************************************
635  *                      Declarations
636  ***************************************************************************/
637 S16 rlcGetSId ARGS((SystemId *s));
638
639 Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
640
641 S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf));
642
643 void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt));
644
645 void rlcStopTmr  ARGS((RlcCb *gCb, PTR cb, uint8_t tmrType));
646
647 bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
648
649 #ifdef LTE_L2_MEAS
650 Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
651                                    uint16_t category, 
652                                    uint16_t event, 
653                                    uint16_t cause, 
654                                    SuId suId, 
655                                    uint32_t ueId, 
656                                    uint8_t qci));
657
658 S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
659 S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
660 S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
661 S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
662 S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
663 S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
664 Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData, 
665                                          RlcL2MeasRbCb *rbL2Cb,
666                                          uint8_t measType));
667 #else /* LTE_L2_MEAS */
668 Void rlcLmmSendAlarm ARGS ((RlcCb *gCb,
669                                   uint16_t category, 
670                                   uint16_t event, 
671                                   uint16_t cause, 
672                                   SuId suId, 
673                                   uint32_t ueId));
674 #endif /* LTE_L2_MEAS */
675
676 #ifdef __cplusplus
677 }
678 #endif /* __cplusplus */
679
680 #endif /* __KWX__ */
681
682 \f  
683 /********************************************************************30**
684   
685          End of file
686 **********************************************************************/