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