66366449d06a0ca696863ba2a3eb1c16a0e66133
[o-du/l2.git] / src / 5gnrrlc / kw_dl.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_dl.x
29   
30 *********************************************************************21*/
31 /** 
32  * @file kw_dl.x
33  * @brief RLC downlink structures, prototypes
34 */
35
36 #ifndef __KW_DLX__
37 #define __KW_DLX__
38  
39 #ifdef __cplusplus
40 extern "C" {
41 #endif /* __cplusplus */
42 #ifdef TENB_STATS
43 #ifndef L2_l3_SPLIT
44 #include "pj_tenb_stats.x"
45 #else
46 #include "l2_tenb_stats.x"
47 #endif
48 #endif
49 typedef struct rlcDlUeCb RlcDlUeCb;
50
51 /** 
52  * @brief  Structure to hold the SN of the PDU onto which a SDU is mapped
53  *
54  * @details
55  *    - sn : Sequence number of the AM pdu
56 */
57 typedef struct rlcPduMap
58 {
59   RlcSn   sn;     /*!< Mapped PDU's SN */
60 }RlcPduMap;
61
62 /** 
63  * @brief  Structure to hold information regarding a SDU received from PDCP
64  *
65  * @details
66  *    - lstEnt : Used for linking ( we have linked list of SDUs) which forms
67  *               the SDU queue
68  *    - mBuf   : Pointer to the SDU data
69  *    - sduSz  : Size of the mBuf above
70  *    - actSz  : Length of the SDU when received from PDCP, this might be 
71  *               different from sduSz, in case when the SDU is split
72  *    - mode   : Depending on the type, holds AM, UM or TM mode information
73  *      - tm
74  *        - sfn      : System Frame number for BCCH/PCCH
75  *        - subframe : Subframe number
76  *        - rnti     : RNTI for CCCH
77  *      - um
78  *        - sduId       : Unique identity for the SDU
79  *        - isSegmented : Whether this SDU is segmented into multiple PDUs
80  *      - am
81  *        - sduId       : Unique identity for the SDU
82  *        - rcvdSz      : Length of this SDU which is received by the peer
83  *        - isSegmented : Whether this SDU is segmented into multiple PDUs
84 */
85 typedef struct rlcSdu                        
86 {
87    CmLList   lstEnt;     /*!< List entry for SDU */
88    Buffer    *mBuf;      /*!< SDU buffer */ 
89    MsgLen    sduSz;      /*!< Buffer Size */
90    MsgLen    actSz;      /*!< Actual buffer Size */
91 /* kw005.201 added support for L2 Measurement */
92 #ifdef LTE_L2_MEAS
93    RlcSduSnMap  *snMap;   /*!< Sdu and the list of SN it maps to */
94 #endif /* LTE_L2_MEAS */
95
96    union
97    {
98       struct   _t 
99       {
100          uint16_t    sfn;        /*!< Sub frame number for BCCH/PCCH */
101          uint16_t    slot;   /*!< Subframe number */
102          CmLteRnti   rnti;       /*!< RNTI for CCCH */
103 #ifdef EMTC_ENABLE
104          uint8_t          emtcDiReason; /*!< DI reason */
105          uint8_t          pnb;       /*!<narrow band on which Ue performs Paging*/
106 #endif
107       }tm;   /*!< SDU for TM mode */
108
109       struct   _u
110       {
111          uint32_t  sduId;         /*!< SDU Identifier */
112          Bool      isSegmented;   /*!< Flag to indicate if the SDU is segmented */
113       }um;   /*!< SDU for UM mode */
114
115       struct   _a
116       {
117          uint32_t   sduId;                    /*!< SDU Identifier */
118          MsgLen     rcvdSz;                   /*!< Recvd SDU Size from peer */
119          Bool       isSegmented;              /*!< Is SDU segmented */
120          RlcSn        sn;                       /*!< SN assigned to this SDU*/
121       }am;   /*!< SDU for AM mode */
122    }mode;   /*!< RLC mode specific SDUs */
123    /* Discard new changes starts */
124    Ticks               arrTime;     /*!< Arrival time of the PDCP PDU at RLC */
125    /* Discard new changes ends */
126
127 }RlcSdu;
128
129 /** @addtogroup tmmode */
130 /*@{*/
131
132 /** 
133  * @brief  Structure to hold Transparent Mode information for a RB
134  *
135  * @details
136  *    - sduQ : Queue of SDUs
137 */
138 typedef struct rlcTm
139 {
140    CmLListCp sduQ; /*!< SDU queue for TM */
141 }RlcTm;
142 /*@}*/
143
144 /** 
145  * @brief  Structure to hold buffer occupancy report sent to MAC
146  *
147  * @details
148  *    - bo         : Size of the buffers at RLC
149  *    - estHdrSz   : Size for all the headers as estimated by RLC
150  *    - staPduPrst : Whether RLC wants to send a STATUS PDU or not
151 */
152 typedef struct rlcBoRep
153 {
154    S32      bo;            /*!< Buffer occupancy */
155    uint16_t estHdrSz;      /*!< Estimated header size for the bo */
156    Bool     staPduPrsnt;   /*!< Indicate control bo present or not */
157    uint32_t staPduBo;     /*!< Indicate bo for control PDU */
158    uint32_t oldestSduArrTime;
159 } RlcBoRep;
160
161 /** 
162  * @brief  Structure to hold information sent to MAC in a Data Request
163  *
164  * @details
165  *    - pduSz   : Sum total of sizes of all the PDUs being sent
166  *    - pduInfo : Information about each PDU
167  *    - boRep   : Current buffer occupancy report
168 */
169 typedef struct rlcDatReq
170 {
171    MsgLen      pduSz;         /*!< PDU(s) size indicated by MAC */ 
172    KwPduInfo   pduInfo;       /*!< PDU Information for lChs within UE */
173    RlcBoRep     boRep;         /*!< BO report */ 
174 /* kw005.201 added support for L2 Measurement */
175 #ifdef LTE_L2_MEAS
176    KwLchMapInfo lchMapInfo;   /*!< Logical channel mapping info */
177    uint32_t          totMacGrant;
178 #endif /* LTE_L2_MEAS */
179 }RlcDatReq;
180
181 /** @defgroup ummode UM Module Info 
182 */
183
184 /** @addtogroup ummode */
185 /*@{*/
186 /** 
187  * @brief  Structure to hold Unacknowledged mode downlink information for a RB
188  *
189  * @details
190  *    - sduQ        : Control point for the queue of SDUs
191  *    - snLen       : length of the squence number. Here it is stored 
192  *                    as 1 for 5 bit sequence numbers and 
193  *                    2 for 10 bit sequence numbers
194  *    - bo          : Current buffer occupancy for this RB
195  *    - estHdrSz    : Estimated size of headers required to send 
196  *                    all the SDUs in the queue
197  *    - vtUs        : VT(US)
198  *    - modBitMask  : Bitmask used to do modulus operations to wrap around 
199  *                    state variables, value is 0x1f or 
200  *                    0x3ff for 5-bit and 10-bit sequence numbers respectively
201  *    - numLi       : Number of length indicators to be sent in the next pdu
202  *    - li          : Values of the lenght indicators
203 */
204 typedef struct rlcUmDl
205 {
206    CmLListCp   sduQ;            /*!< SDU queue for UM */
207    uint8_t     snLen;           /*!< Sequence number length */
208    S32         bo;              /*!< Buffer occupancy */
209    S32         estHdrSz;        /*!< Estimated header size for BO */
210    RlcSn       vtUs;            /*!< VT(US) */
211    uint16_t    modBitMask;      /*!< Bitmask for modulus to wrap around vars*/   
212    uint16_t    numLi;           /*!< Number of LIs */
213    uint16_t    li[RLC_MAX_LI];   /*!< Length Indicator array */
214 }RlcUmDl;
215
216 /** 
217  * @brief  Structure to hold information about which SDUs a PDU/segment carries
218  *
219  * @details
220  *    - sduSz  : Size of the SDU or part of it
221  *    - sdu    : Pointer to the SDU
222 */
223 typedef struct rlcSduMap
224 {
225    /*MsgLen   actSz;*/         /*!< SDU Size */
226    MsgLen   sduSz;         /*!< SDU Size */
227    /*Bool     isSegmented;*/   /*!< Flag to indicate if the SDU is segmented */
228    RlcSdu*   sdu;           /*!< Pointer to the associated SDU */
229 }RlcSduMap;
230
231 /** 
232  * @brief  Structure to hold info about a PDU/segment to be re-transmitted
233  *
234  * @details
235  *    - lstEnt           : Control point to link the re-transmit (the 
236  *                         re-transmit PDUs  ,segments are stored as a 
237  *                         link list) nodes
238  *    - seg              : Pointer to the data
239  *    - segSz            : Size of the PDU/segment including the header
240  *    - hdrSz            : Size of the AM header for this in bytes
241  *    - amHdr            : The header for this PDU/segment
242  *    - soEnd            : SO End
243  *    - retxCnt          : Number of times this has been re-transmitted
244  *    - yetToConst       : Whether the PDU/segment has been constructed (headers
245  *                         appended) or not
246  *    - pendingReTrans   : TRUE if this node is to be re-transmitted else FALSE
247  *    - numSdu           : Number of SDUs this PDU/segment carries
248  *    - sduMap           : Infomation about the SDUs this node carries
249 */
250 typedef struct rlcRetx
251 {
252    CmLList    lstEnt;              /*!< List entry for Retransmission PDU */
253    Buffer     *seg;                /*!< Buffer of PDU or Segment */
254    MsgLen     segSz;               /*!< Segment Size */
255    MsgLen     hdrSz;               /*!< Header size for the segment */
256    RlcAmHdr   amHdr;               /*!< AM header Info */
257    uint16_t   soEnd;               /*!< Segment Offset End */
258    RlcSn      retxCnt;             /*!< Retransmission count */
259    Bool       yetToConst;          /*!< Yet to construct seg flag */
260    Bool       pendingReTrans;      /*!< Is node waiting for re-transmission */
261    RlcSduMap  sduMap;              /*!< SDU mapped with PDU */
262 }RlcRetx;
263
264 /** 
265  * @brief  Structure to hold a RLC AM PDU Information
266  *
267  * @details
268  *    - lstEnt : This is required for the linked list in which pdu is stored
269  *    - pdu    : Holds the pdu
270  *    - pduSz  : The length of the segment in bytes
271  *    - hdrSz  : Header size of this PDU
272  *    - amHdr  : The AM Header for the PDU segment
273  *    - RlcSduMap :SDU map info for this PDU 
274  *
275 */
276 typedef struct rlcDlPduInfo
277 {
278    CmLList   lstEnt;               /*!< List entry for PDU list */
279    Buffer     *pdu;                /*!< Buffer of PDU */
280    MsgLen     pduSz;               /*!< PDU Size */
281    MsgLen     hdrSz;               /*!< Header size for the segment */
282    RlcAmHdr    amHdr;               /*!< AM header Info */
283    RlcSduMap   sduMap;              /*!< SDU info for this PDU */
284
285 }RlcDlPduInfo;
286
287 /** 
288  * @brief  Structure to hold info about a PDU that has been transmitted
289  *
290  * @details
291  *    - lnk    : Link to the TX buffer list
292  *    - sn     : SN of this RLC SDU
293  *    - rlsLnk : Link to store on release list, used for
294  *    - pduLst : It contains all PDUs of a particular SN
295 */
296 typedef struct rlcTx
297 {
298    CmLList     lnk;                /**< Link to the TX buffer list*/
299    RlcSn        sn;                /*!< SN of this RLC SDU */
300    CmLList    rlsLnk;             /*!< Lnk to store on release lst */
301    CmLListCp  pduLst;             /*!< It contains all PDUs of a particular SN*/
302 }RlcTx;
303
304 /** @addtogroup ammode */
305 /*@{*/
306
307 /** 
308  * @brief  Structure to hold Acknowledged Mode Downlink information for a RB
309  *
310  * @details
311  *    - sduQ           : SDU queue
312  *    - nxtTx          : Pointer to the next SDU to be transmitted
313  *    - pollRetxTmr    : Poll re-transmission timer
314  *    - pollRetxTmrInt : Timer interval (?? secs) of poll re-transmission timer
315  *    - pollPdu        : Number of PDUs to send before sending a poll bit
316  *    - pollByte       : Number of bytes to send before sending a poll bit
317  *    - maxRetx        : Maximum number of re-transmissions to be done for a 
318  *                       PDU/segment
319  *    - cntrlBo        : Size of the STATUS PDU if it is to be sent, else 0
320  *    - retxBo         : Bo of the PDUs/segments to be re-transmitted
321  *    - estHdrSz       : Extimated header size of all the SDUs in the queue
322  *    - bo             : Bo of the PDUs in the transmission buffer
323  *    - txBufLst       : Transmission buffer lists. It's contiguous index by sequence
324  *                       number
325  *    - rextLst        : Re-transmission buffer. It is a doubly linked list
326  *    - nxtRetx        : Next node to be re-transmitted
327  *    - txNext         : 5GNR - TX_Next - Send state variable,( in LTE VT(S)) 
328  *    - txNextAck      : 5GNR - TX_Next_Ack- Acknowledgement state variable
329                        : (in LTE VT(A))     
330  *    - pduWoPoll      : Number of PDUs sent without sending a poll bit
331  *    - byteWoPoll     : Number of bytes sent without sending a poll bit
332  *    - pollSn         : The sequence number on which the last poll bit was sent
333  *    - mBuf           : The encoded STATUS pdu to be sent
334  *    - maxReTxReached : Whether maximum number of re-transmissions has been
335  *                       reached or not
336  *    - pStaPdu        : Stores the control pdu (information required to
337  *                       create the STATUS PDU) passed from AM uplink
338 */
339 typedef struct rlcAmDl
340 {
341    CmLListCp        sduQ;             /*!< SDU queue */
342    RlcSdu           *nxtTx;           /*!< Next SDU to be transmitted */
343    CmTimer          pollRetxTmr;      /*!< T_poll_retransmit Timer */
344    uint16_t         pollRetxTmrInt;   /*!< Timer Interval */
345    S16              pollPdu;          /*!< Poll_PDU */
346    S32              pollByte;         /*!< Poll_Byte */
347    uint8_t          maxRetx;          /*!< Max_Retx_Threshold */
348    S32              cntrlBo;          /*!< BO of control pdu */ 
349    S32              retxBo;           /*!< BO of Retransmission PDUs */ 
350    uint32_t         estHdrSz;         /*!< Estimated header size for the BO */
351    S32              bo;               /*!< BO of new PDUs */
352 #ifndef LTE_TDD 
353    CmLListCp        *txBufLst;       /*!< Transmission buffer list of type RlcTx */
354 #else
355 //   RlcTx             *txBuf[1024];          /*!< Transmission buffer */
356 #endif
357    CmLListCp        retxLst;          /*!< Retransmission PDU list */
358    RlcRetx          *nxtRetx;         /*!< Next node to be retransmitted */
359    RlcSn            txNext;           /*!< 5GNR: TX_Next, in LTE  VT(S) */
360    RlcSn            txNextAck;        /*!< 5GNR: TX_Next_Ack, in LTE VT(A)*/ 
361    S16              pduWoPoll;        /*!< PDU without poll bit counter */
362    S32              byteWoPoll;       /*!< Byte without poll bit counter */
363    RlcSn            pollSn;           /*!< Poll SN */
364    Buffer           *mBuf;            /*!< this can be removed later 
365                                            Stores the Control Pdu */
366    Bool             maxReTxReached;   /*!< Set when the DL MAX Retx exceeded */
367    RlcUdxDlStaPdu*  pStaPdu;          /*!< The Control Pdu passed from UL*/
368    uint8_t          snLen;           /*!< Sequence number length:12 bit or 18 bit : 5GNR RLC */
369    uint32_t         snModMask;       /*!< (2 Pwr SnLen - 1): 5GNR RLC */
370 }RlcAmDl;
371
372 /*@}*/
373
374 /** 
375  * @brief  Structure to hold information about a Radio Bearer as required by RLC
376  *
377  * @details
378  *    - rlcId          : RLC identifier, uniquely identifies a Radio Bearer
379  *    - lch            : Information (type and id) of the logical channel 
380  *                       associated with this Radio  Bearer.
381  *    - mode           : The mode of the Radio Bearer TM or UM or AM
382  *    - dir            : The direction of the Radio Bearer, downlink or 
383  *                       uplink or both
384  *    - inst           : Id of RLC instance where this Radio Bearer is present. 
385  *                       Used to find the instance from the Radio Bearer for 
386  *                       memory needs as different instances might have 
387  *                       different memory.
388  *    - k1wuSapId       : KWU SAP identifier
389  *    - udxSapId       : UDX SAP idenrifier
390  *    - transId        : Stores the transaction identifier used to communicate 
391  *                       with MAC, the same value as sent by MAC is passed back 
392  *                       for it to be able to corelate
393  *    - reestInProgress: Whether re-establishment is going on for this RB
394  *    - m              : Mode of the RB (TM/UM/AM)
395  *      - tm           : Transparent Mode information
396  *      - umDl         : Unacknowledged Mode downlink information
397  *      - amDl         : Acknowledged Mode downlink information
398  *    - rlsLnk         : Link list used to free the RbCb
399  *    - cleanupStarted : Whether cleanup of RB is in progress or not
400 */
401 typedef struct _rlcDlRbCb
402 {
403    uint8_t              qci;                /*!< qci of the RB */
404 #ifdef LTE_L2_MEAS
405    RlcDlUeCb        *ueCb;              /*!< Pointer to UeCb  */
406    RlcL2MeasRbCb    rbL2Cb;             /*!< RB measurement L2 Cb */
407    CmLListCp       sduSnMapQ;          /*!< SDU SN map queue for UM */
408
409    RlcL2MeasIpThruput l2MeasIpThruput;  /*!< Holds related parameter for
410                                                  DL/UL ip throughput>*/
411 #endif                                                 
412
413    /* Discard new changes starts */
414    S16             discTmrInt;        /*!< The discard time in milli 
415                                            seconds for an PDCP SDU for this RB */
416    /* Discard new changes ends */
417    CmLteRlcId     rlcId;           /*!< RLC Identifier */
418    RlcLchInfo     lch;             /*!< Logical Channel Info  */
419    CmLteRlcMode   mode;            /*!< Entity Mode */
420    uint8_t        dir;             /*!< Direction for UL/DL */
421    Inst           inst;            /*!< Tapa Instance where rb created */
422    SpId           k1wuSapId;        /*!< KWU sap Id, to get the KwuSapCb */
423    SpId           udxSapId;        /*!< UDX sap Id, to get the UdxSapCb */
424    uint32_t       transId;         /*!< Transaction Id for RLC */
425    Bool           reestInProgress; /*!< Is reestablishment in progress */
426    SpId           rguSapId;        /*!< RGU Instance SAP corresponding to this RB */
427    union          
428    {
429       RlcTm     tm;     /*!< TM mode specific elements */
430       RlcUmDl   umDl;   /*!< UM downlink elements */
431       RlcAmDl   amDl;   /*!< AM downlink elements */
432    }m;   /*!< RLC mode specific Info */
433    CmLList   rlsLnk;   /*!< Link to add to release list */
434    Bool      cleanupStarted; /*!< Whether cleanup of RB is in progress or not */
435    uint32_t  lastRprtdBoToMac; /*!< Last Reported BO to MAC Layer */
436    uint32_t  boUnRprtdCnt; /*!< Count to keep track of periodic BO Update */
437 }RlcDlRbCb;
438
439 /** 
440  * @brief  Structure to hold mapping between logical channel and Radio Bearer
441  *
442  * @details
443  *    - dlRbCb   : Pointer to the downlink Radio Bearer
444 */
445 typedef struct rlcDlLch
446 {
447    RlcDlRbCb *dlRbCb;   /*!< Pointer to Downlink RbCb */
448 }RlcDlLch;                                  
449
450 /** 
451  * @brief  Structure to hold information about the Cells
452  *
453  * @details
454  *    - cellHlEnt : Information about cells are stored in a hash table. This is
455  *                  required for that.
456  *    - cellId    : Identity of the cell
457  *    - rbCb      : Radio Bearers in the cell
458  *    - lCh       : Logical Channels in the cell
459 */
460 typedef struct rlcDlCellCb
461 {
462    CmHashListEnt   cellHlEnt;                 /*!< Hash list entry for CellCb */
463    CmLteCellId     cellId;                    /*!< Cell Id */
464    RlcDlRbCb        *rbCb[RLC_MAX_RB_PER_CELL]; /*!< RbCbs within a Cell */
465    RlcDlLch         lCh[RLC_MAX_LCH_PER_CELL];  /*!< Array of Logical channels */
466 }RlcDlCellCb;
467
468 #ifdef LTE_L2_MEAS
469 /** @struct RlcContSduLst
470  * Structure contains list of rbId and index to KwOutStngSduLst
471  */
472 typedef struct rlcContSduLst
473 {
474    CmLteLcId   lcId;    /*!< Holds the lcId of rbCb */
475    uint8_t     numSdus; /*!< Number sdus in sduIdx array */
476    uint8_t     sduIdx[RLC_L2MEAS_MAX_OUTSTNGSDU];  /*!< Hold the index to KwOutStngSduLst */
477 }RlcContSduLst;
478 typedef struct rlcSduInfo
479 {
480    Bool  isRetxPdu;
481    Ticks arvlTime; /* stores the the arrival time of each PDCP PDU */
482 }RlcSduInfo;
483
484 typedef struct rlclchInfo
485 {
486    CmLteLcId   lcId;    /*!< Holds the lcId of rbCb */
487    uint8_t     numSdus; /*!< Number sdus belonged to the this LC */
488    RlcSduInfo  sduInfo[RLC_L2MEAS_SDUIDX];
489 }RlclchInfo;
490
491 /** @struct RlcL2MeasTb
492  * Structure containes list of rbId and  index to KwOutStngSduLst
493  */
494 typedef struct rlcL2MeasTb
495 {
496    uint8_t          numLcId;       /* number of logical channels in this TbCb */
497    RlcContSduLst    sduInfo[RLC_MAX_ACTV_DRB]; /*!< Contained sduLst for 
498                                                outstanding sdu */
499    uint8_t          numLchInfo;
500    RlclchInfo       lchInfo[RLC_MAX_ACTV_DRB]; /* Holds the LC info details 
501                                                   used for DL delay L2 Meas*/
502    uint32_t         txSegSduCnt; /*!< This holds the no.of partially 
503                                      transmitted SDU per TB which can be used for UU loss Meas*/
504 }RlcL2MeasTb;
505 #endif
506
507 /** 
508  * @brief  Structure to hold information about the UEs
509  *
510  * @details
511  *    - ueHlEnt : Information about cells are stored in a hash table. This is
512  *                required for that.
513  *    - key     : Key to store/find the UE in the hashtable
514  *    - srbCb   : Signaling Radio Bearers configured for the UE
515  *    - drbCb   : Data Radio Bearers configured for the UE
516  *    - lCh     : Logical Channels in the UE
517 */
518 struct rlcDlUeCb
519 {
520    CmHashListEnt     ueHlEnt;                   /*!< Hash list entry for UeCb */
521    CmLteRnti         ueId;     /*!< UE Id */
522    CmLteCellId       cellId;   /*!< Cell Id */
523    RlcDlRbCb         *srbCb[RLC_MAX_SRB_PER_UE]; /*!< SRB RbCbs within a UE */ 
524    RlcDlRbCb         *drbCb[RLC_MAX_DRB_PER_UE]; /*!< DRB RbCbs within a UE */ 
525    RlcDlLch          lCh[RLC_MAX_LCH_PER_UE];    /*!< Array of Logical channels */
526 /* kw005.201 added support for L2 Measurement */
527 #ifdef LTE_L2_MEAS
528    uint16_t           numActRb[LKW_MAX_QCI];     /*!< number of RBs Active */
529    uint8_t            tbIdx;                /*!< TBIDx for  measTbCb */
530    RlcL2MeasTb        *l2MeasTbCb[RLC_MAX_TB_PER_UE]; /*!< Array of Measurement tbCb */
531 #endif /* LTE_L2_MEAS */
532 #ifdef TENB_STATS
533    TSL2UeStatsCb   *tenbStats; /*!< UE Stats Holder */
534 #endif
535 };
536
537 /****************************************************************************
538  *                      Declarations
539  ***************************************************************************/
540 /****************************************************************************
541  *                    Configuration Functions 
542  ***************************************************************************/ 
543 S16 rlcCfgAddDlRb ARGS ((RlcCb *gCb, 
544                               CmLteRnti ueId, 
545                               CmLteCellId cellId, 
546                               RlcEntCfgInfo *entCfg, 
547                               RlcEntCfgCfmInfo *entCfm));
548
549 S16 rlcCfgReCfgDlRb ARGS ((RlcCb *gCb, 
550                                  CmLteRnti ueId, 
551                                  CmLteCellId cellId, 
552                                  RlcEntCfgInfo *entCfg, 
553                                  RlcEntCfgCfmInfo *entCfm));
554
555 S16 rlcCfgDelDlRb ARGS ((RlcCb *gCb, 
556                                CmLteRnti ueId, 
557                                CmLteCellId cellId, 
558                                RlcEntCfgInfo *entCfg, 
559                                RlcEntCfgCfmInfo *entCfm));
560
561 S16 rlcCfgDelDlUe ARGS ((RlcCb *gCb, 
562                                CmLteRnti ueId, 
563                                CmLteCellId cellId, 
564                                RlcEntCfgInfo *entCfg, 
565                                RlcEntCfgCfmInfo *entCfm));
566
567 S16 rlcCfgReEstDlRb ARGS ((RlcCb *gCb, 
568                                  CmLteRnti ueId, 
569                                  CmLteCellId cellId, 
570                                  Bool sndReEst,
571                                  RlcEntCfgInfo *entCfg, 
572                                  RlcEntCfgCfmInfo *entCfm));
573
574 S16 rlcCfgDelDlCell ARGS ((RlcCb *gCb, 
575                                  CmLteCellId cellId, 
576                                  RlcEntCfgInfo *entCfg,
577                                  RlcEntCfgCfmInfo *entCfm));
578
579 S16 rlcCfgDlUeIdChng ARGS ((RlcCb *gCb, 
580                                   CkwUeInfo *ueInfo, 
581                                   CkwUeInfo *newUeInfo, 
582                                   CmStatus  *status));
583
584 /****************************************************************************
585  *                    DBM module Functions 
586  ***************************************************************************/
587 S16 rlcDbmDlInit ARGS ((RlcCb *gCb));
588
589 Void rlcDbmDlDeInit ARGS ((RlcCb *gCb));
590
591 S16 rlcDbmCreateDlUeCb ARGS ((RlcCb *gCb,     
592                                     CmLteRnti ueId,   
593                                     CmLteCellId cellId,
594                                     RlcDlUeCb **ueCb));
595
596 uint8_t rlcDbmFetchDlUeCb ARGS ((RlcCb *gCb,        
597                                    CmLteRnti ueId,      
598                                    CmLteCellId cellId,     
599                                    RlcDlUeCb **ueCb));
600
601 Void rlcDbmDelDlUeCb ARGS ((RlcCb *gCb,       
602                                   RlcDlUeCb *ueCb, 
603                                   Bool abortFlag));
604
605 Void rlcDbmDelAllDlUe ARGS ((RlcCb *gCb));
606
607 S16 rlcDbmCreateDlCellCb ARGS ((RlcCb *gCb,      
608                                     CmLteCellId cellId,   
609                                     RlcDlCellCb **cellCb));
610
611 uint8_t rlcDbmFetchDlCellCb ARGS ((RlcCb *gCb, 
612                                      CmLteCellId cellId, 
613                                      RlcDlCellCb **cellCb));
614
615 Void rlcDbmDelDlCellCb ARGS ((RlcCb *gCb, RlcDlCellCb *cellCb));
616
617 Void rlcDbmDelAllDlCell ARGS ((RlcCb *gCb));
618
619 Void rlcDbmFetchDlRbCbByRbId ARGS ((RlcCb *gCb, 
620                                           CmLteRlcId *rlcId, 
621                                           RlcDlRbCb **rbCb));
622
623 Void rlcDbmFetchDlRbCbFromLchId ARGS ((RlcCb *gCb,       
624                                              CmLteRnti ueId,     
625                                              CmLteCellId cellId,    
626                                              CmLteLcId lcId,      
627                                              RlcDlRbCb **rbCb));
628
629 Void rlcDbmDelAllDlRb ARGS ((RlcCb *gCb, RlcDlRbCb **rbCbLst, uint8_t numRbCb));
630
631 S16 rlcDbmDlShutdown ARGS ((RlcCb *gCb));
632
633 Void rlcUtlGetCurrTime ARGS((uint32_t *time));
634 Void rlcUtlTrigPdbFlowCntrl ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t pktAdmitCnt ));
635 #ifdef LTE_L2_MEAS
636 Void rlcDbmDelAllDlL2MeasTbFrmUe ARGS ((RlcCb *gCb, RlcDlUeCb *ueCb));
637
638 #endif
639
640 /****************************************************************************
641  *                    Transparent Mode Functions 
642  ***************************************************************************/
643 Void rlcTmmQSdu ARGS ((RlcCb *gCb,
644                             RlcDlRbCb *rbCb,
645                             KwuDatReqInfo *datReqInfo,
646                             Buffer *mBuf));
647 Void rlcTmmSendToMac ARGS ((RlcCb     *gCb,
648                                 SuId     suId,
649                                 RlcDlRbCb *rbCb, 
650                                 RguCStaIndInfo *staInd));
651
652 Void rlcDlTmmReEstablish ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
653
654 /****************************************************************************
655  *                    Unacknowledged Mode Functions 
656  ***************************************************************************/
657 Void rlcUmmQSdu ARGS ((RlcCb *gCb, 
658                              RlcDlRbCb *rbCb,
659                              KwuDatReqInfo *datReq, 
660                              Buffer *mBuf));
661
662 Void rlcUmmDiscSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t sduId));
663
664 Void rlcDlUmmReEstablish ARGS ((RlcCb *gCb, 
665                                       CmLteRlcId rlcId, 
666                                       Bool sndReEst,
667                                       RlcDlRbCb *rbCb));
668
669 Void rlcUmmProcessSdus ARGS ((RlcCb *gCb,RlcDlRbCb *rbCb,RlcDatReq *datReq));
670
671 Void rlcUmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
672
673 /****************************************************************************
674  *                    Acknowledged Mode Functions 
675  ***************************************************************************/
676
677 S32 rlcAmmCalculateBo ARGS ((RlcAmDl *amDl));
678
679 Void rlcAmmSendDedLcBoStatus ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl));
680
681 Void rlcAmmQSdu ARGS((RlcCb *gCb,
682                             RlcDlRbCb *rbCb,
683                             Buffer *mBuf, 
684                             KwuDatReqInfo *datReq));
685
686 void rlcAmmProcessSdus ARGS((RlcCb *gCb, 
687                                    RlcDlRbCb *rbCb, 
688                                    RlcDatReq *rlcDatReq,
689                                    bool staPduPres));
690
691 Void rlcAmmDlReEstablish ARGS((RlcCb *gCb, 
692                                      CmLteRlcId rlcId, 
693                                      RlcDlRbCb *rbCb));
694
695 Void rlcAmmDlHndlStatusPdu ARGS ((RlcCb  *gCb,
696                                         RlcDlRbCb  *rbCb,
697                                         RlcUdxStaPdu *pStaPdu));
698
699 S16 rlcAmmDiscSdu ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t sduId));
700
701 Void rlcAmmPollRetxTmrExp ARGS((RlcCb *gCB, RlcDlRbCb *rbCb));
702
703 Void rlcAmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
704
705 /****************************************************************************
706  *                    Utility Functions 
707  ***************************************************************************/
708
709 Void rlcUtlStoreTxBuf ARGS ((CmLListCp        *txBufLst,
710                                     RlcTx       *txBuf,
711                                     RlcSn              sn
712                                    ));
713 RlcTx* rlcUtlGetTxBuf ARGS ((CmLListCp        *txBufLst,
714                                   RlcSn              sn
715                                   ));
716 Void rlcUtlDelTxBuf ARGS ((CmLListCp        *txBufLst,
717                                   RlcTx            *txBuf,
718                                   RlcCb              *gCb
719                                   ));
720 Void rlcUtlRemovTxBuf ARGS ((CmLListCp      *txBufLst,
721                                   RlcTx            *txBuf,
722                                   RlcCb              *gCb
723                                   ));
724
725 uint8_t rlcUtlSendDedLcBoStatus ARGS ((RlcCb *gCb,
726                                   RlcDlRbCb *rbCb,
727                                   int32_t bo,
728                                   int32_t estHdrSz,
729                                   bool staPduPrsnt,
730                                   uint32_t staPduBo));
731
732 #ifdef LTE_L2_MEAS_RLC
733 Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, CmLListCp *sduQ));
734 #else /* LTE_L2_MEAS */
735 Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb,CmLListCp *sduQ));
736 #endif /* LTE_L2_MEAS */
737
738 Void rlcUtlCalcLiForSdu ARGS ((RlcCb *gCb,
739                                      uint16_t numLi, 
740                                      MsgLen msgLen,
741                                      S16 *pduSz));
742
743 uint8_t rlcUtlSendToMac ARGS ((RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo));
744
745 Void rlcUtlIncrementKwuStsSduTx ARGS((RlcKwuSapCb *rlckwuSap));
746
747 Void rlcUtlIncrementGenStsBytesAndPdusSent ARGS((RlcGenSts *genSts, 
748                                                        Buffer *pdu));
749
750 Void rlcUtlFreeDlMemory ARGS ((RlcCb *gCb));
751
752 Void rlcUtlInitToBeFreed ARGS ((RlcCb *gCb, RlcDlDataToBeFreed *toBeFreed));
753
754 Void rlcUtlInitializeSelfPst ARGS((RlcCb *gCb));
755
756 Void rlcUtlRaiseDlCleanupEvent ARGS((RlcCb *gCb));
757
758 Void rlcUtlAddSduToBeFreedQueue ARGS((RlcCb *gCb, RlcSdu *sdu));
759
760 Void rlcUtlAddReTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcRetx *retx));
761
762 Void rlcUtlAddTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcTx *pdu));
763
764 #ifdef LTE_L2_MEAS
765 S16 rlcUtlL2MeasDlInit ARGS((RlcCb *gCb));
766 #endif
767
768 /****************************************************************************
769  *                    Debug Functions 
770  ***************************************************************************/
771 Void ResetRLCStats ARGS((Void));
772
773 Void PrintRLCStats ARGS((Void));
774
775 Void DumpRLCDlDebugInformation ARGS((Void));
776
777 /****************************************************************************
778  *                    Activation Functions 
779  ***************************************************************************/
780 S16 rlcDlActvInit ARGS ((Ent ent,Inst inst,Region region,Reason reason)); 
781
782 S16 rlcDlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
783
784 bool rlcDlUtlIsReestInProgress ARGS ((RlcDlRbCb *rbCb));
785
786 Void rlcDlUtlResetReestInProgress ARGS ((RlcDlRbCb *rbCb));
787
788 Void rlcDlUtlResetReestInProgress ARGS (( RlcDlRbCb *rbCb));
789
790 Void rlcDlUtlSetReestInProgressForAllRBs ARGS ((RlcCb *gCb, RlcDlUeCb
791          *ueCb));
792 Void rlcDlUtlSetReestInProgressForRB ARGS (( RlcCb *gCb, RlcDlRbCb *rbCb));
793
794 #ifdef LTE_L2_MEAS
795 Void rlcUtlUpdateContainedSduLst ARGS ((
796 uint8_t  sduIdx, 
797 RlcContSduLst  *contSduLst
798 ));
799 Void rlcUtlUpdateOutStandingSduLst ARGS ((
800 RlcL2MeasDlIpTh   *dlIpThPut, 
801 uint8_t           sduIdx, 
802 MsgLen            sduLen, 
803 uint32_t          sduId,
804 Bool              newIdx
805 ));
806 Void rlcUtlUpdateBurstSdus ARGS((
807 RlcCb            *gCb,         
808 RlcDlRbCb        *rbCb,
809 RlcContSduLst    *contSduLst,
810 S32              dataVol,
811 uint32_t         schPduSz
812 ));
813
814 RlcL2MeasTb * rlcUtlGetCurMeasTb ARGS((
815 RlcCb     *gCb,
816 RlcDlRbCb *rbCb
817 ));
818
819 S16 rlcUtlSndDlL2MeasNCfm ARGS((RlcCb *gCb,
820                                       RlcL2MeasReqEvt *measReqEvt,
821                                       RlcL2MeasCfmEvt *measCfmEvt));
822
823 S16 rlcUtlSndDlL2MeasCfm  ARGS ((RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
824
825 S16 rlcUtlProcHarqInd  ARGS (( RlcCb *gCb, RguHarqStatusInd *staInd, RlcDlUeCb *ueCb, 
826                                      uint8_t tbIdx));
827 Void rlcUtlResetDlL2MeasInRlcRb ARGS ((RlcCb *gCb,
828                                             RlcL2MeasCb *measCb,
829                                             uint8_t measType));
830
831 S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, uint8_t  measType,uint8_t  status));
832
833 S16 rlcUtlValidateIpThL2Meas ARGS((RlcL2MeasReqEvt *measReqEvt, 
834                                      RlcL2MeasCfmEvt *measCfmEvt)); 
835                                     
836 S16 rlcFetchLchInfo ARGS ((RlcL2MeasReqEvt *measReqEvt,
837                                  RlcL2MeasCfmEvt *measCfmEvt,
838                                  uint16_t             ueId,
839                                  CmLteLcId *lChId,
840                                  uint8_t *numLch));
841
842 S16 rlcUtlNotifyMacUlIp ARGS ((RlcL2MeasCb *measCb,uint16_t ueIdx, Bool enable,
843                                     CmLteLcId  *lChId, uint8_t *numLCh));
844 #endif
845
846 uint8_t rlcProcDlData(Pst *pst, KwuDatReqInfo* datReq, Buffer *buf);
847 uint8_t rlcProcCommLcSchedRpt(Pst *pst, SuId suId, RguCStaIndInfo  *staInd);
848 uint8_t rlcProcDedLcSchedRpt(Pst *pst, SuId suId, RguDStaIndInfo  *staInd);
849
850 Void rlcUtlFreeDlMem ARGS(( Void));
851 #ifdef __cplusplus
852 }
853 #endif /* __cplusplus */
854
855 #endif /* __KW_DLX__ */
856
857 \f  
858 /********************************************************************30**
859   
860          End of file
861 **********************************************************************/