1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 /********************************************************************20**
21 Name: NR RLC file for downlink and non real time tasks
25 Desc: This file contains helper macros for RLC downlink
26 and non real time task
30 *********************************************************************21*/
32 @brief RLC Downlink helper macros
40 #endif /* __cplusplus */
43 #include "pj_tenb_stats.x"
45 #include "l2_tenb_stats.x"
50 #define RLC_MAX_RNG_DEQ_INDX 8
52 /* Below are the status used within RLC */
53 #define RLC_SDU_OPAT_NOUPDATE 0
54 #define RLC_SDU_OPAT_UPD_TX 1
55 #define RLC_SDU_OPAT_UPD_RETX 2
57 /* Below are the status which needs to be updated to MAC */
58 #define RLC_RGU_SDU_OPAT_NOUPDATE 0
59 #define RLC_RGU_SDU_OPAT_UPDATE 1
60 #define RLC_RGU_SDU_OPAT_BREACH 2
62 /* PDB Values for various QCI bearers : This value is considered
63 after taking into account a 20ms delay at the network */
64 #define RLC_PDB_VALUE_FOR_QCI1 80
65 #define RLC_PDB_VALUE_FOR_QCI2 130
66 #define RLC_PDB_VALUE_FOR_QCI3 30
67 #define RLC_PDB_VALUE_FOR_QCI4 280
68 #define RLC_PDB_VALUE_FOR_QCI5 80
69 #define RLC_PDB_VALUE_FOR_QCI6 280
70 #define RLC_PDB_VALUE_FOR_QCI7 80
71 #define RLC_PDB_VALUE_FOR_QCI8 280
72 #define RLC_PDB_VALUE_FOR_QCI9 280
74 #define RLC_DATA_BITMASK 0x80 /* Data bitmask is used to fill D/C bit for data*/
76 * @def RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB
78 * This macro is used to check if DL IP throughput measurement is ON
79 * or off for the passed rb
81 * Returns TRUE (non-zero) if measurement is ON else FALSE (zero)
83 * @param[in] _gCb RLC DL Cb
84 * @param[in] _rbCb RLC downlink control block
88 #define RLC_MEAS_IS_DL_ANY_MEAS_ON_FOR_RB(_gCb, _rbCb) \
89 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
90 (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci]))
92 #define RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb) \
93 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
94 (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_IP) && \
95 (_rbCb->rbL2Cb.measOn & LKW_L2MEAS_DL_IP))
97 #define RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb) \
98 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
99 (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_DL_DELAY))
101 #define RLC_MEAS_IS_DL_UU_LOSS_MEAS_ON_FOR_RB(_gCb, _rbCb) \
102 ((_rbCb->rlcId.rbType == CM_LTE_DRB) && \
103 (_gCb->u.dlCb->rlcL2Cb.measOn[_rbCb->qci] & LKW_L2MEAS_UU_LOSS))
104 #define RLC_UPD_PDCP_L2_DLDELAY_STS(_rlcCb, _rlcRbCb, _delay) \
106 if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \
107 ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DELAY)) \
109 (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DELAY]->dlPjSduDelay.sduDelay += _delay; \
110 (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DELAY]->dlPjSduDelay.numSdus++; \
114 #define RLC_UPD_L2_UU_LOSS_PKTS(_rlcCb, _rlcRbCb, _val) \
116 if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \
117 ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \
119 (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_UU_LOSS]->uuLoss.dLoss += _val; \
122 #define RLC_UPD_L2_UU_LOSS_POS_PKTS(_rlcCb,_rlcRbCb,_val) \
124 if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \
125 ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_UU_LOSS)) \
127 (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_UU_LOSS]->uuLoss.posPkts += _val; \
130 /* Discard new changes starts */
131 #define RLC_UPD_L2_DL_DISC_SDU_STS(_rlcCb,_rlcRbCb) \
133 if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \
134 ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \
136 (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DISC]->dlDisc.discSdus++; \
140 #define RLC_UPD_L2_DL_TOT_SDU_STS(_rlcCb,_rlcRbCb) \
142 if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \
143 ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \
145 (_rlcRbCb)->rbL2Cb.l2Sts[RLC_L2MEAS_DL_DISC]->dlDisc.totSdus++; \
149 #define RLC_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_rlcCb, _rlcRbCb) \
151 if(((_rlcRbCb)->rlcId.rbType == CM_LTE_DRB) && \
152 ((_rlcCb)->u.dlCb->rlcL2Cb.measOn[_rlcRbCb->qci] & LKW_L2MEAS_DL_DISC)) \
155 for (idx1 = 0; idx1 < LKW_MAX_L2MEAS; idx1++) \
157 if(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.measType & LKW_L2MEAS_DL_DISC) \
159 if(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci > 0) \
161 _rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci--; \
162 if (_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci].totDrbsPerQci == 0) \
164 _rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.qci[(_rlcRbCb)->qci] = 0; \
165 memset(&_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci], 0, \
166 sizeof(_rlcCb->u.dlCb->rlcL2Cb.rlcL2EvtCb[idx1].measCb.val.nonIpThMeas.measData[(_rlcRbCb)->qci])); \
174 #define RLC_UPD_PDCP_L2_DLDELAY_STS(_rlcCb, _rlcRbCb, _delay)
175 #define RLC_MEAS_IS_DL_IP_MEAS_ON_FOR_RB(_gCb, _rbCb)
176 #define RLC_MEAS_IS_DL_DELAY_MEAS_ON_FOR_RB(_gCb, _rbCb)
177 #define RLC_UPD_L2_DL_DISC_SDU_STS(_rlcCb,_rlcRbCb)
178 #define RLC_UPD_L2_DL_TOT_SDU_STS(_rlcCb, _rlcRbCb)
179 #define RLC_UPD_L2_DECR_NONIP_PER_QCI_RB_COUNT(_rlcCb, _rlcRbCb)
183 typedef struct rlcDlUeCb RlcDlUeCb;
186 * @brief Structure to hold the SN of the PDU onto which a SDU is mapped
189 * - sn : Sequence number of the AM pdu
191 typedef struct rlcPduMap
193 RlcSn sn; /*!< Mapped PDU's SN */
197 * @brief Structure to hold information regarding a SDU received from PDCP
200 * - lstEnt : Used for linking ( we have linked list of SDUs) which forms
202 * - mBuf : Pointer to the SDU data
203 * - sduSz : Size of the mBuf above
204 * - actSz : Length of the SDU when received from PDCP, this might be
205 * different from sduSz, in case when the SDU is split
206 * - mode : Depending on the type, holds AM, UM or TM mode information
208 * - sfn : System Frame number for BCCH/PCCH
209 * - subframe : Subframe number
210 * - rnti : RNTI for CCCH
212 * - sduId : Unique identity for the SDU
213 * - isSegmented : Whether this SDU is segmented into multiple PDUs
215 * - sduId : Unique identity for the SDU
216 * - rcvdSz : Length of this SDU which is received by the peer
217 * - isSegmented : Whether this SDU is segmented into multiple PDUs
219 typedef struct rlcSdu
221 CmLList lstEnt; /*!< List entry for SDU */
222 Buffer *mBuf; /*!< SDU buffer */
223 MsgLen sduSz; /*!< Buffer Size */
224 MsgLen actSz; /*!< Actual buffer Size */
225 /* kw005.201 added support for L2 Measurement */
227 RlcSduSnMap *snMap; /*!< Sdu and the list of SN it maps to */
228 #endif /* LTE_L2_MEAS */
234 uint16_t sfn; /*!< Sub frame number for BCCH/PCCH */
235 uint16_t slot; /*!< Subframe number */
236 CmLteRnti rnti; /*!< RNTI for CCCH */
238 uint8_t emtcDiReason; /*!< DI reason */
239 uint8_t pnb; /*!<narrow band on which Ue performs Paging*/
241 }tm; /*!< SDU for TM mode */
245 uint32_t sduId; /*!< SDU Identifier */
246 Bool isSegmented; /*!< Flag to indicate if the SDU is segmented */
247 }um; /*!< SDU for UM mode */
251 uint32_t sduId; /*!< SDU Identifier */
252 MsgLen rcvdSz; /*!< Recvd SDU Size from peer */
253 Bool isSegmented; /*!< Is SDU segmented */
254 RlcSn sn; /*!< SN assigned to this SDU*/
255 }am; /*!< SDU for AM mode */
256 }mode; /*!< RLC mode specific SDUs */
257 /* Discard new changes starts */
258 Ticks arrTime; /*!< Arrival time of the PDCP PDU at RLC */
259 /* Discard new changes ends */
263 /** @addtogroup tmmode */
267 * @brief Structure to hold Transparent Mode information for a RB
270 * - sduQ : Queue of SDUs
274 CmLListCp sduQ; /*!< SDU queue for TM */
279 * @brief Structure to hold buffer occupancy report sent to MAC
282 * - bo : Size of the buffers at RLC
283 * - estHdrSz : Size for all the headers as estimated by RLC
284 * - staPduPrst : Whether RLC wants to send a STATUS PDU or not
286 typedef struct rlcBoRep
288 int32_t bo; /*!< Buffer occupancy */
289 uint16_t estHdrSz; /*!< Estimated header size for the bo */
290 bool staPduPrsnt; /*!< Indicate control bo present or not */
291 uint32_t staPduBo; /*!< Indicate bo for control PDU */
292 uint32_t oldestSduArrTime;
296 * @brief Structure to hold information sent to MAC in a Data Request
299 * - pduSz : Sum total of sizes of all the PDUs being sent
300 * - pduInfo : Information about each PDU
301 * - boRep : Current buffer occupancy report
303 typedef struct rlcDatReq
305 MsgLen pduSz; /*!< PDU(s) size indicated by MAC */
306 KwPduInfo pduInfo; /*!< PDU Information for lChs within UE */
307 RlcBoRep boRep; /*!< BO report */
308 /* kw005.201 added support for L2 Measurement */
310 KwLchMapInfo lchMapInfo; /*!< Logical channel mapping info */
311 uint32_t totMacGrant;
312 #endif /* LTE_L2_MEAS */
315 /** @defgroup ummode UM Module Info
318 /** @addtogroup ummode */
321 * @brief Structure to hold Unacknowledged mode downlink information for a RB
324 * - sduQ : Control point for the queue of SDUs
325 * - snLen : length of the squence number. Here it is stored
326 * as 1 for 5 bit sequence numbers and
327 * 2 for 10 bit sequence numbers
328 * - bo : Current buffer occupancy for this RB
329 * - TX_Next : SN to be allocated to next SDU
330 * - modBitMask : Bitmask used to do modulus operations to wrap around
331 * state variables, value is 0x3f or
332 * 0xfff for 6-bit and 12-bit sequence numbers respectively
334 typedef struct rlcUmDl
336 CmLListCp sduQ; /*!< SDU queue for UM */
337 uint8_t snLen; /*!< Sequence number length */
338 int32_t bo; /*!< Buffer occupancy */
339 RlcSn txNext; /*!< TX_Next */
340 uint16_t modBitMask; /*!< Bitmask for modulus to wrap around vars*/
344 * @brief Structure to hold information about which SDUs a PDU/segment carries
347 * - sduSz : Size of the SDU or part of it
348 * - sdu : Pointer to the SDU
350 typedef struct rlcSduMap
352 /*MsgLen actSz;*/ /*!< SDU Size */
353 MsgLen sduSz; /*!< SDU Size */
354 /*Bool isSegmented;*/ /*!< Flag to indicate if the SDU is segmented */
355 RlcSdu* sdu; /*!< Pointer to the associated SDU */
359 * @brief Structure to hold info about a PDU/segment to be re-transmitted
362 * - lstEnt : Control point to link the re-transmit (the
363 * re-transmit PDUs ,segments are stored as a
365 * - seg : Pointer to the data
366 * - segSz : Size of the PDU/segment including the header
367 * - hdrSz : Size of the AM header for this in bytes
368 * - amHdr : The header for this PDU/segment
370 * - retxCnt : Number of times this has been re-transmitted
371 * - yetToConst : Whether the PDU/segment has been constructed (headers
373 * - pendingReTrans : TRUE if this node is to be re-transmitted else FALSE
374 * - numSdu : Number of SDUs this PDU/segment carries
375 * - sduMap : Infomation about the SDUs this node carries
377 typedef struct rlcRetx
379 CmLList lstEnt; /*!< List entry for Retransmission PDU */
380 Buffer *seg; /*!< Buffer of PDU or Segment */
381 MsgLen segSz; /*!< Segment Size */
382 MsgLen hdrSz; /*!< Header size for the segment */
383 RlcAmHdr amHdr; /*!< AM header Info */
384 uint16_t soEnd; /*!< Segment Offset End */
385 RlcSn retxCnt; /*!< Retransmission count */
386 Bool yetToConst; /*!< Yet to construct seg flag */
387 Bool pendingReTrans; /*!< Is node waiting for re-transmission */
388 RlcSduMap sduMap; /*!< SDU mapped with PDU */
392 * @brief Structure to hold a RLC AM PDU Information
395 * - lstEnt : This is required for the linked list in which pdu is stored
396 * - pdu : Holds the pdu
397 * - pduSz : The length of the segment in bytes
398 * - hdrSz : Header size of this PDU
399 * - amHdr : The AM Header for the PDU segment
400 * - RlcSduMap :SDU map info for this PDU
403 typedef struct rlcDlPduInfo
405 CmLList lstEnt; /*!< List entry for PDU list */
406 Buffer *pdu; /*!< Buffer of PDU */
407 MsgLen pduSz; /*!< PDU Size */
408 MsgLen hdrSz; /*!< Header size for the segment */
409 RlcAmHdr amHdr; /*!< AM header Info */
410 RlcSduMap sduMap; /*!< SDU info for this PDU */
415 * @brief Structure to hold info about a PDU that has been transmitted
418 * - lnk : Link to the TX buffer list
419 * - sn : SN of this RLC SDU
420 * - rlsLnk : Link to store on release list, used for
421 * - pduLst : It contains all PDUs of a particular SN
425 CmLList lnk; /**< Link to the TX buffer list*/
426 RlcSn sn; /*!< SN of this RLC SDU */
427 CmLList rlsLnk; /*!< Lnk to store on release lst */
428 CmLListCp pduLst; /*!< It contains all PDUs of a particular SN*/
431 /** @addtogroup ammode */
435 * @brief Structure to hold Acknowledged Mode Downlink information for a RB
439 * - nxtTx : Pointer to the next SDU to be transmitted
440 * - pollRetxTmr : Poll re-transmission timer
441 * - pollRetxTmrInt : Timer interval (?? secs) of poll re-transmission timer
442 * - pollPdu : Number of PDUs to send before sending a poll bit
443 * - pollByte : Number of bytes to send before sending a poll bit
444 * - maxRetx : Maximum number of re-transmissions to be done for a
446 * - cntrlBo : Size of the STATUS PDU if it is to be sent, else 0
447 * - retxBo : Bo of the PDUs/segments to be re-transmitted
448 * - estHdrSz : Extimated header size of all the SDUs in the queue
449 * - bo : Bo of the PDUs in the transmission buffer
450 * - txBufLst : Transmission buffer lists. It's contiguous index by sequence
452 * - rextLst : Re-transmission buffer. It is a doubly linked list
453 * - nxtRetx : Next node to be re-transmitted
454 * - txNext : 5GNR - TX_Next - Send state variable,( in LTE VT(S))
455 * - txNextAck : 5GNR - TX_Next_Ack- Acknowledgement state variable
457 * - pduWoPoll : Number of PDUs sent without sending a poll bit
458 * - byteWoPoll : Number of bytes sent without sending a poll bit
459 * - pollSn : The sequence number on which the last poll bit was sent
460 * - mBuf : The encoded STATUS pdu to be sent
461 * - maxReTxReached : Whether maximum number of re-transmissions has been
463 * - pStaPdu : Stores the control pdu (information required to
464 * create the STATUS PDU) passed from AM uplink
466 typedef struct rlcAmDl
468 CmLListCp sduQ; /*!< SDU queue */
469 RlcSdu *nxtTx; /*!< Next SDU to be transmitted */
470 CmTimer pollRetxTmr; /*!< T_poll_retransmit Timer */
471 uint16_t pollRetxTmrInt; /*!< Timer Interval */
472 int16_t pollPdu; /*!< Poll_PDU */
473 int32_t pollByte; /*!< Poll_Byte */
474 uint8_t maxRetx; /*!< Max_Retx_Threshold */
475 int32_t cntrlBo; /*!< BO of control pdu */
476 int32_t retxBo; /*!< BO of Retransmission PDUs */
477 uint32_t estHdrSz; /*!< Estimated header size for the BO */
478 int32_t bo; /*!< BO of new PDUs */
480 CmLListCp *txBufLst; /*!< Transmission buffer list of type RlcTx */
482 // RlcTx *txBuf[1024]; /*!< Transmission buffer */
484 CmLListCp retxLst; /*!< Retransmission PDU list */
485 RlcRetx *nxtRetx; /*!< Next node to be retransmitted */
486 RlcSn txNext; /*!< 5GNR: TX_Next, in LTE VT(S) */
487 RlcSn txNextAck; /*!< 5GNR: TX_Next_Ack, in LTE VT(A)*/
488 int16_t pduWoPoll; /*!< PDU without poll bit counter */
489 int32_t byteWoPoll; /*!< Byte without poll bit counter */
490 RlcSn pollSn; /*!< Poll SN */
491 Buffer *mBuf; /*!< this can be removed later
492 Stores the Control Pdu */
493 Bool maxReTxReached; /*!< Set when the DL MAX Retx exceeded */
494 RlcUdxDlStaPdu* pStaPdu; /*!< The Control Pdu passed from UL*/
495 uint8_t snLen; /*!< Sequence number length:12 bit or 18 bit : 5GNR RLC */
496 uint32_t snModMask; /*!< (2 Pwr SnLen - 1): 5GNR RLC */
502 * @brief Structure to hold information about a Radio Bearer as required by RLC
505 * - rlcId : RLC identifier, uniquely identifies a Radio Bearer
506 * - lch : Information (type and id) of the logical channel
507 * associated with this Radio Bearer.
508 * - mode : The mode of the Radio Bearer TM or UM or AM
509 * - dir : The direction of the Radio Bearer, downlink or
511 * - inst : Id of RLC instance where this Radio Bearer is present.
512 * Used to find the instance from the Radio Bearer for
513 * memory needs as different instances might have
515 * - k1wuSapId : KWU SAP identifier
516 * - udxSapId : UDX SAP idenrifier
517 * - transId : Stores the transaction identifier used to communicate
518 * with MAC, the same value as sent by MAC is passed back
519 * for it to be able to corelate
520 * - reestInProgress: Whether re-establishment is going on for this RB
521 * - m : Mode of the RB (TM/UM/AM)
522 * - tm : Transparent Mode information
523 * - umDl : Unacknowledged Mode downlink information
524 * - amDl : Acknowledged Mode downlink information
525 * - rlsLnk : Link list used to free the RbCb
526 * - cleanupStarted : Whether cleanup of RB is in progress or not
528 typedef struct _rlcDlRbCb
530 uint8_t qci; /*!< qci of the RB */
532 RlcDlUeCb *ueCb; /*!< Pointer to UeCb */
533 RlcL2MeasRbCb rbL2Cb; /*!< RB measurement L2 Cb */
534 CmLListCp sduSnMapQ; /*!< SDU SN map queue for UM */
536 RlcL2MeasIpThruput l2MeasIpThruput; /*!< Holds related parameter for
537 DL/UL ip throughput>*/
540 /* Discard new changes starts */
541 S16 discTmrInt; /*!< The discard time in milli
542 seconds for an PDCP SDU for this RB */
543 /* Discard new changes ends */
544 CmLteRlcId rlcId; /*!< RLC Identifier */
545 RlcLchInfo lch; /*!< Logical Channel Info */
546 CmLteRlcMode mode; /*!< Entity Mode */
547 uint8_t dir; /*!< Direction for UL/DL */
548 Inst inst; /*!< Tapa Instance where rb created */
549 SpId k1wuSapId; /*!< KWU sap Id, to get the KwuSapCb */
550 SpId udxSapId; /*!< UDX sap Id, to get the UdxSapCb */
551 uint32_t transId; /*!< Transaction Id for RLC */
552 Bool reestInProgress; /*!< Is reestablishment in progress */
553 SpId rguSapId; /*!< RGU Instance SAP corresponding to this RB */
556 RlcTm tm; /*!< TM mode specific elements */
557 RlcUmDl umDl; /*!< UM downlink elements */
558 RlcAmDl amDl; /*!< AM downlink elements */
559 }m; /*!< RLC mode specific Info */
560 CmLList rlsLnk; /*!< Link to add to release list */
561 Bool cleanupStarted; /*!< Whether cleanup of RB is in progress or not */
562 uint32_t lastRprtdBoToMac; /*!< Last Reported BO to MAC Layer */
563 uint32_t boUnRprtdCnt; /*!< Count to keep track of periodic BO Update */
567 * @brief Structure to hold mapping between logical channel and Radio Bearer
570 * - dlRbCb : Pointer to the downlink Radio Bearer
572 typedef struct rlcDlLch
574 RlcDlRbCb *dlRbCb; /*!< Pointer to Downlink RbCb */
578 * @brief Structure to hold information about the Cells
581 * - cellHlEnt : Information about cells are stored in a hash table. This is
583 * - cellId : Identity of the cell
584 * - rbCb : Radio Bearers in the cell
585 * - lCh : Logical Channels in the cell
587 typedef struct rlcDlCellCb
589 CmHashListEnt cellHlEnt; /*!< Hash list entry for CellCb */
590 CmLteCellId cellId; /*!< Cell Id */
591 RlcDlRbCb *rbCb[RLC_MAX_RB_PER_CELL]; /*!< RbCbs within a Cell */
592 RlcDlLch lCh[RLC_MAX_LCH_PER_CELL]; /*!< Array of Logical channels */
596 /** @struct RlcContSduLst
597 * Structure contains list of rbId and index to KwOutStngSduLst
599 typedef struct rlcContSduLst
601 CmLteLcId lcId; /*!< Holds the lcId of rbCb */
602 uint8_t numSdus; /*!< Number sdus in sduIdx array */
603 uint8_t sduIdx[RLC_L2MEAS_MAX_OUTSTNGSDU]; /*!< Hold the index to KwOutStngSduLst */
605 typedef struct rlcSduInfo
608 Ticks arvlTime; /* stores the the arrival time of each PDCP PDU */
611 typedef struct rlclchInfo
613 CmLteLcId lcId; /*!< Holds the lcId of rbCb */
614 uint8_t numSdus; /*!< Number sdus belonged to the this LC */
615 RlcSduInfo sduInfo[RLC_L2MEAS_SDUIDX];
618 /** @struct RlcL2MeasTb
619 * Structure containes list of rbId and index to KwOutStngSduLst
621 typedef struct rlcL2MeasTb
623 uint8_t numLcId; /* number of logical channels in this TbCb */
624 RlcContSduLst sduInfo[RLC_MAX_ACTV_DRB]; /*!< Contained sduLst for
627 RlclchInfo lchInfo[RLC_MAX_ACTV_DRB]; /* Holds the LC info details
628 used for DL delay L2 Meas*/
629 uint32_t txSegSduCnt; /*!< This holds the no.of partially
630 transmitted SDU per TB which can be used for UU loss Meas*/
635 * @brief Structure to hold information about the UEs
638 * - ueHlEnt : Information about cells are stored in a hash table. This is
640 * - key : Key to store/find the UE in the hashtable
641 * - srbCb : Signaling Radio Bearers configured for the UE
642 * - drbCb : Data Radio Bearers configured for the UE
643 * - lCh : Logical Channels in the UE
647 CmHashListEnt ueHlEnt; /*!< Hash list entry for UeCb */
648 CmLteRnti ueId; /*!< UE Id */
649 CmLteCellId cellId; /*!< Cell Id */
650 RlcDlRbCb *srbCb[RLC_MAX_SRB_PER_UE]; /*!< SRB RbCbs within a UE */
651 RlcDlRbCb *drbCb[RLC_MAX_DRB_PER_UE]; /*!< DRB RbCbs within a UE */
652 RlcDlLch lCh[RLC_MAX_LCH_PER_UE]; /*!< Array of Logical channels */
653 /* kw005.201 added support for L2 Measurement */
655 uint16_t numActRb[LKW_MAX_QCI]; /*!< number of RBs Active */
656 uint8_t tbIdx; /*!< TBIDx for measTbCb */
657 RlcL2MeasTb *l2MeasTbCb[RLC_MAX_TB_PER_UE]; /*!< Array of Measurement tbCb */
658 #endif /* LTE_L2_MEAS */
660 TSL2UeStatsCb *tenbStats; /*!< UE Stats Holder */
664 /****************************************************************************
666 ***************************************************************************/
667 /****************************************************************************
668 * Configuration Functions
669 ***************************************************************************/
670 S16 rlcCfgAddDlRb ARGS ((RlcCb *gCb,
673 RlcEntCfgInfo *entCfg,
674 RlcEntCfgCfmInfo *entCfm));
676 S16 rlcCfgReCfgDlRb ARGS ((RlcCb *gCb,
679 RlcEntCfgInfo *entCfg,
680 RlcEntCfgCfmInfo *entCfm));
682 S16 rlcCfgDelDlRb ARGS ((RlcCb *gCb,
685 RlcEntCfgInfo *entCfg,
686 RlcEntCfgCfmInfo *entCfm));
688 S16 rlcCfgDelDlUe ARGS ((RlcCb *gCb,
691 RlcEntCfgInfo *entCfg,
692 RlcEntCfgCfmInfo *entCfm));
694 S16 rlcCfgReEstDlRb ARGS ((RlcCb *gCb,
698 RlcEntCfgInfo *entCfg,
699 RlcEntCfgCfmInfo *entCfm));
701 S16 rlcCfgDelDlCell ARGS ((RlcCb *gCb,
703 RlcEntCfgInfo *entCfg,
704 RlcEntCfgCfmInfo *entCfm));
706 S16 rlcCfgDlUeIdChng ARGS ((RlcCb *gCb,
708 CkwUeInfo *newUeInfo,
711 /****************************************************************************
712 * DBM module Functions
713 ***************************************************************************/
714 S16 rlcDbmDlInit ARGS ((RlcCb *gCb));
716 Void rlcDbmDlDeInit ARGS ((RlcCb *gCb));
718 S16 rlcDbmCreateDlUeCb ARGS ((RlcCb *gCb,
723 uint8_t rlcDbmFetchDlUeCb ARGS ((RlcCb *gCb,
728 Void rlcDbmDelDlUeCb ARGS ((RlcCb *gCb,
732 Void rlcDbmDelAllDlUe ARGS ((RlcCb *gCb));
734 S16 rlcDbmCreateDlCellCb ARGS ((RlcCb *gCb,
736 RlcDlCellCb **cellCb));
738 uint8_t rlcDbmFetchDlCellCb ARGS ((RlcCb *gCb,
740 RlcDlCellCb **cellCb));
742 Void rlcDbmDelDlCellCb ARGS ((RlcCb *gCb, RlcDlCellCb *cellCb));
744 Void rlcDbmDelAllDlCell ARGS ((RlcCb *gCb));
746 Void rlcDbmFetchDlRbCbByRbId ARGS ((RlcCb *gCb,
750 Void rlcDbmFetchDlRbCbFromLchId ARGS ((RlcCb *gCb,
756 Void rlcDbmDelAllDlRb ARGS ((RlcCb *gCb, RlcDlRbCb **rbCbLst, uint8_t numRbCb));
758 S16 rlcDbmDlShutdown ARGS ((RlcCb *gCb));
760 Void rlcUtlGetCurrTime ARGS((uint32_t *time));
761 Void rlcUtlTrigPdbFlowCntrl ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t pktAdmitCnt ));
763 Void rlcDbmDelAllDlL2MeasTbFrmUe ARGS ((RlcCb *gCb, RlcDlUeCb *ueCb));
767 /****************************************************************************
768 * Transparent Mode Functions
769 ***************************************************************************/
770 Void rlcTmmQSdu ARGS ((RlcCb *gCb,
772 RlcDatReqInfo *datReqInfo,
774 Void rlcTmmSendToMac ARGS ((RlcCb *gCb,
777 RguCStaIndInfo *staInd));
779 Void rlcDlTmmReEstablish ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
781 /****************************************************************************
782 * Unacknowledged Mode Functions
783 ***************************************************************************/
784 Void rlcUmmQSdu ARGS ((RlcCb *gCb,
786 RlcDatReqInfo *datReq,
789 Void rlcUmmDiscSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t sduId));
791 Void rlcDlUmmReEstablish ARGS ((RlcCb *gCb,
796 Void rlcUmmProcessSdus ARGS ((RlcCb *gCb,RlcDlRbCb *rbCb,RlcDatReq *datReq));
798 Void rlcUmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
800 /****************************************************************************
801 * Acknowledged Mode Functions
802 ***************************************************************************/
804 S32 rlcAmmCalculateBo ARGS ((RlcAmDl *amDl));
806 Void rlcAmmSendDedLcBoStatus ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl));
808 Void rlcAmmQSdu ARGS((RlcCb *gCb,
811 RlcDatReqInfo *datReq));
813 void rlcAmmProcessSdus ARGS((RlcCb *gCb,
815 RlcDatReq *rlcDatReq,
818 Void rlcAmmDlReEstablish ARGS((RlcCb *gCb,
822 Void rlcAmmDlHndlStatusPdu ARGS ((RlcCb *gCb,
824 RlcUdxStaPdu *pStaPdu));
826 S16 rlcAmmDiscSdu ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t sduId));
828 Void rlcAmmPollRetxTmrExp ARGS((RlcCb *gCB, RlcDlRbCb *rbCb));
830 Void rlcAmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
832 /****************************************************************************
834 ***************************************************************************/
836 Void rlcUtlStoreTxBuf ARGS ((CmLListCp *txBufLst,
840 RlcTx* rlcUtlGetTxBuf ARGS ((CmLListCp *txBufLst,
843 Void rlcUtlDelTxBuf ARGS ((CmLListCp *txBufLst,
847 Void rlcUtlRemovTxBuf ARGS ((CmLListCp *txBufLst,
852 uint8_t rlcUtlSendDedLcBoStatus ARGS ((RlcCb *gCb,
859 #ifdef LTE_L2_MEAS_RLC
860 Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, CmLListCp *sduQ));
861 #else /* LTE_L2_MEAS */
862 Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb,CmLListCp *sduQ));
863 #endif /* LTE_L2_MEAS */
865 uint8_t rlcUtlSendToMac ARGS ((RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo));
867 Void rlcUtlIncrementKwuStsSduTx ARGS((RlcKwuSapCb *rlckwuSap));
869 Void rlcUtlIncrementGenStsBytesAndPdusSent ARGS((RlcGenSts *genSts,
872 Void rlcUtlFreeDlMemory ARGS ((RlcCb *gCb));
874 Void rlcUtlInitToBeFreed ARGS ((RlcCb *gCb, RlcDlDataToBeFreed *toBeFreed));
876 Void rlcUtlInitializeSelfPst ARGS((RlcCb *gCb));
878 Void rlcUtlRaiseDlCleanupEvent ARGS((RlcCb *gCb));
880 Void rlcUtlAddSduToBeFreedQueue ARGS((RlcCb *gCb, RlcSdu *sdu));
882 Void rlcUtlAddReTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcRetx *retx));
884 Void rlcUtlAddTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcTx *pdu));
887 S16 rlcUtlL2MeasDlInit ARGS((RlcCb *gCb));
890 /****************************************************************************
892 ***************************************************************************/
893 Void ResetRLCStats ARGS((Void));
895 Void PrintRLCStats ARGS((Void));
897 Void DumpRLCDlDebugInformation ARGS((Void));
899 /****************************************************************************
900 * Activation Functions
901 ***************************************************************************/
902 S16 rlcDlActvInit ARGS ((Ent ent,Inst inst,Region region,Reason reason));
904 S16 rlcDlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
906 bool rlcDlUtlIsReestInProgress ARGS ((RlcDlRbCb *rbCb));
908 Void rlcDlUtlResetReestInProgress ARGS ((RlcDlRbCb *rbCb));
910 Void rlcDlUtlResetReestInProgress ARGS (( RlcDlRbCb *rbCb));
912 Void rlcDlUtlSetReestInProgressForAllRBs ARGS ((RlcCb *gCb, RlcDlUeCb
914 Void rlcDlUtlSetReestInProgressForRB ARGS (( RlcCb *gCb, RlcDlRbCb *rbCb));
917 Void rlcUtlUpdateContainedSduLst ARGS ((
919 RlcContSduLst *contSduLst
921 Void rlcUtlUpdateOutStandingSduLst ARGS ((
922 RlcL2MeasDlIpTh *dlIpThPut,
928 Void rlcUtlUpdateBurstSdus ARGS((
931 RlcContSduLst *contSduLst,
936 RlcL2MeasTb * rlcUtlGetCurMeasTb ARGS((
941 S16 rlcUtlSndDlL2MeasNCfm ARGS((RlcCb *gCb,
942 RlcL2MeasReqEvt *measReqEvt,
943 RlcL2MeasCfmEvt *measCfmEvt));
945 S16 rlcUtlSndDlL2MeasCfm ARGS ((RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
947 S16 rlcUtlProcHarqInd ARGS (( RlcCb *gCb, RguHarqStatusInd *staInd, RlcDlUeCb *ueCb,
949 Void rlcUtlResetDlL2MeasInRlcRb ARGS ((RlcCb *gCb,
953 S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, uint8_t measType,uint8_t status));
955 S16 rlcUtlValidateIpThL2Meas ARGS((RlcL2MeasReqEvt *measReqEvt,
956 RlcL2MeasCfmEvt *measCfmEvt));
958 S16 rlcFetchLchInfo ARGS ((RlcL2MeasReqEvt *measReqEvt,
959 RlcL2MeasCfmEvt *measCfmEvt,
964 S16 rlcUtlNotifyMacUlIp ARGS ((RlcL2MeasCb *measCb,uint16_t ueIdx, Bool enable,
965 CmLteLcId *lChId, uint8_t *numLCh));
968 uint8_t rlcProcDlData(Pst *pst, RlcDatReqInfo* datReq, Buffer *buf);
969 uint8_t rlcProcCommLcSchedRpt(Pst *pst, SuId suId, RguCStaIndInfo *staInd);
970 uint8_t rlcProcDedLcSchedRpt(Pst *pst, SuId suId, RguDStaIndInfo *staInd);
972 Void rlcUtlFreeDlMem ARGS(( Void));
975 #endif /* __cplusplus */
977 #endif /* __RLC_DLH__ */
979 /********************************************************************30**
982 **********************************************************************/