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