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 */
547 CmLteRlcMode mode; /*!< Entity Mode */
548 uint8_t dir; /*!< Direction for UL/DL */
549 Inst inst; /*!< Tapa Instance where rb created */
550 SpId k1wuSapId; /*!< KWU sap Id, to get the KwuSapCb */
551 SpId udxSapId; /*!< UDX sap Id, to get the UdxSapCb */
552 uint32_t transId; /*!< Transaction Id for RLC */
553 Bool reestInProgress; /*!< Is reestablishment in progress */
554 SpId rguSapId; /*!< RGU Instance SAP corresponding to this RB */
557 RlcTm tm; /*!< TM mode specific elements */
558 RlcUmDl umDl; /*!< UM downlink elements */
559 RlcAmDl amDl; /*!< AM downlink elements */
560 }m; /*!< RLC mode specific Info */
561 CmLList rlsLnk; /*!< Link to add to release list */
562 Bool cleanupStarted; /*!< Whether cleanup of RB is in progress or not */
563 uint32_t lastRprtdBoToMac; /*!< Last Reported BO to MAC Layer */
564 uint32_t boUnRprtdCnt; /*!< Count to keep track of periodic BO Update */
568 * @brief Structure to hold mapping between logical channel and Radio Bearer
571 * - dlRbCb : Pointer to the downlink Radio Bearer
573 typedef struct rlcDlLch
575 RlcDlRbCb *dlRbCb; /*!< Pointer to Downlink RbCb */
579 * @brief Structure to hold information about the Cells
582 * - cellHlEnt : Information about cells are stored in a hash table. This is
584 * - cellId : Identity of the cell
585 * - rbCb : Radio Bearers in the cell
586 * - lCh : Logical Channels in the cell
588 typedef struct rlcDlCellCb
590 CmHashListEnt cellHlEnt; /*!< Hash list entry for CellCb */
591 CmLteCellId cellId; /*!< Cell Id */
592 RlcDlRbCb *rbCb[RLC_MAX_RB_PER_CELL]; /*!< RbCbs within a Cell */
593 RlcDlLch lCh[RLC_MAX_LCH_PER_CELL]; /*!< Array of Logical channels */
597 /** @struct RlcContSduLst
598 * Structure contains list of rbId and index to KwOutStngSduLst
600 typedef struct rlcContSduLst
602 CmLteLcId lcId; /*!< Holds the lcId of rbCb */
603 uint8_t numSdus; /*!< Number sdus in sduIdx array */
604 uint8_t sduIdx[RLC_L2MEAS_MAX_OUTSTNGSDU]; /*!< Hold the index to KwOutStngSduLst */
606 typedef struct rlcSduInfo
609 Ticks arvlTime; /* stores the the arrival time of each PDCP PDU */
612 typedef struct rlclchInfo
614 CmLteLcId lcId; /*!< Holds the lcId of rbCb */
615 uint8_t numSdus; /*!< Number sdus belonged to the this LC */
616 RlcSduInfo sduInfo[RLC_L2MEAS_SDUIDX];
619 /** @struct RlcL2MeasTb
620 * Structure containes list of rbId and index to KwOutStngSduLst
622 typedef struct rlcL2MeasTb
624 uint8_t numLcId; /* number of logical channels in this TbCb */
625 RlcContSduLst sduInfo[RLC_MAX_ACTV_DRB]; /*!< Contained sduLst for
628 RlclchInfo lchInfo[RLC_MAX_ACTV_DRB]; /* Holds the LC info details
629 used for DL delay L2 Meas*/
630 uint32_t txSegSduCnt; /*!< This holds the no.of partially
631 transmitted SDU per TB which can be used for UU loss Meas*/
636 * @brief Structure to hold information about the UEs
639 * - ueHlEnt : Information about cells are stored in a hash table. This is
641 * - key : Key to store/find the UE in the hashtable
642 * - srbCb : Signaling Radio Bearers configured for the UE
643 * - drbCb : Data Radio Bearers configured for the UE
644 * - lCh : Logical Channels in the UE
648 CmHashListEnt ueHlEnt; /*!< Hash list entry for UeCb */
649 CmLteRnti ueId; /*!< UE Id */
650 CmLteCellId cellId; /*!< Cell Id */
651 RlcDlRbCb *srbCb[RLC_MAX_SRB_PER_UE]; /*!< SRB RbCbs within a UE */
652 RlcDlRbCb *drbCb[RLC_MAX_DRB_PER_UE]; /*!< DRB RbCbs within a UE */
653 RlcDlLch lCh[RLC_MAX_LCH_PER_UE]; /*!< Array of Logical channels */
654 /* kw005.201 added support for L2 Measurement */
656 uint16_t numActRb[LKW_MAX_QCI]; /*!< number of RBs Active */
657 uint8_t tbIdx; /*!< TBIDx for measTbCb */
658 RlcL2MeasTb *l2MeasTbCb[RLC_MAX_TB_PER_UE]; /*!< Array of Measurement tbCb */
659 #endif /* LTE_L2_MEAS */
661 TSL2UeStatsCb *tenbStats; /*!< UE Stats Holder */
665 /****************************************************************************
667 ***************************************************************************/
668 /****************************************************************************
669 * Configuration Functions
670 ***************************************************************************/
671 S16 rlcCfgAddDlRb ARGS ((RlcCb *gCb,
674 RlcEntCfgInfo *entCfg,
675 RlcEntCfgCfmInfo *entCfm));
677 S16 rlcCfgReCfgDlRb ARGS ((RlcCb *gCb,
680 RlcEntCfgInfo *entCfg,
681 RlcEntCfgCfmInfo *entCfm));
683 S16 rlcCfgDelDlRb ARGS ((RlcCb *gCb,
686 RlcEntCfgInfo *entCfg,
687 RlcEntCfgCfmInfo *entCfm));
689 S16 rlcCfgDelDlUe ARGS ((RlcCb *gCb,
692 RlcEntCfgInfo *entCfg,
693 RlcEntCfgCfmInfo *entCfm));
695 S16 rlcCfgReEstDlRb ARGS ((RlcCb *gCb,
699 RlcEntCfgInfo *entCfg,
700 RlcEntCfgCfmInfo *entCfm));
702 S16 rlcCfgDelDlCell ARGS ((RlcCb *gCb,
704 RlcEntCfgInfo *entCfg,
705 RlcEntCfgCfmInfo *entCfm));
707 S16 rlcCfgDlUeIdChng ARGS ((RlcCb *gCb,
709 CkwUeInfo *newUeInfo,
712 /****************************************************************************
713 * DBM module Functions
714 ***************************************************************************/
715 S16 rlcDbmDlInit ARGS ((RlcCb *gCb));
717 Void rlcDbmDlDeInit ARGS ((RlcCb *gCb));
719 S16 rlcDbmCreateDlUeCb ARGS ((RlcCb *gCb,
724 uint8_t rlcDbmFetchDlUeCb ARGS ((RlcCb *gCb,
729 Void rlcDbmDelDlUeCb ARGS ((RlcCb *gCb,
733 Void rlcDbmDelAllDlUe ARGS ((RlcCb *gCb));
735 S16 rlcDbmCreateDlCellCb ARGS ((RlcCb *gCb,
737 RlcDlCellCb **cellCb));
739 uint8_t rlcDbmFetchDlCellCb ARGS ((RlcCb *gCb,
741 RlcDlCellCb **cellCb));
743 Void rlcDbmDelDlCellCb ARGS ((RlcCb *gCb, RlcDlCellCb *cellCb));
745 Void rlcDbmDelAllDlCell ARGS ((RlcCb *gCb));
747 Void rlcDbmFetchDlRbCbByRbId ARGS ((RlcCb *gCb,
751 Void rlcDbmFetchDlRbCbFromLchId ARGS ((RlcCb *gCb,
757 Void rlcDbmDelAllDlRb ARGS ((RlcCb *gCb, RlcDlRbCb **rbCbLst, uint8_t numRbCb));
759 S16 rlcDbmDlShutdown ARGS ((RlcCb *gCb));
761 Void rlcUtlGetCurrTime ARGS((uint32_t *time));
762 Void rlcUtlTrigPdbFlowCntrl ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t pktAdmitCnt ));
764 Void rlcDbmDelAllDlL2MeasTbFrmUe ARGS ((RlcCb *gCb, RlcDlUeCb *ueCb));
768 /****************************************************************************
769 * Transparent Mode Functions
770 ***************************************************************************/
771 Void rlcTmmQSdu ARGS ((RlcCb *gCb,
773 RlcDatReqInfo *datReqInfo,
775 Void rlcTmmSendToMac ARGS ((RlcCb *gCb,
778 RguCStaIndInfo *staInd));
780 Void rlcDlTmmReEstablish ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
782 /****************************************************************************
783 * Unacknowledged Mode Functions
784 ***************************************************************************/
785 Void rlcUmmQSdu ARGS ((RlcCb *gCb,
787 RlcDatReqInfo *datReq,
790 Void rlcUmmDiscSdu ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t sduId));
792 Void rlcDlUmmReEstablish ARGS ((RlcCb *gCb,
797 Void rlcUmmProcessSdus ARGS ((RlcCb *gCb,RlcDlRbCb *rbCb,RlcDatReq *datReq));
799 Void rlcUmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
801 /****************************************************************************
802 * Acknowledged Mode Functions
803 ***************************************************************************/
805 S32 rlcAmmCalculateBo ARGS ((RlcAmDl *amDl));
807 Void rlcAmmSendDedLcBoStatus ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, RlcAmDl *amDl));
809 Void rlcAmmQSdu ARGS((RlcCb *gCb,
812 RlcDatReqInfo *datReq));
814 void rlcAmmProcessSdus ARGS((RlcCb *gCb,
816 RlcDatReq *rlcDatReq,
819 Void rlcAmmDlReEstablish ARGS((RlcCb *gCb,
823 Void rlcAmmDlHndlStatusPdu ARGS ((RlcCb *gCb,
825 RlcUdxStaPdu *pStaPdu));
827 S16 rlcAmmDiscSdu ARGS((RlcCb *gCb, RlcDlRbCb *rbCb, uint32_t sduId));
829 Void rlcAmmPollRetxTmrExp ARGS((RlcCb *gCB, RlcDlRbCb *rbCb));
831 Void rlcAmmFreeDlRbCb ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb));
833 /****************************************************************************
835 ***************************************************************************/
837 Void rlcUtlStoreTxBuf ARGS ((CmLListCp *txBufLst,
841 RlcTx* rlcUtlGetTxBuf ARGS ((CmLListCp *txBufLst,
844 Void rlcUtlDelTxBuf ARGS ((CmLListCp *txBufLst,
848 Void rlcUtlRemovTxBuf ARGS ((CmLListCp *txBufLst,
853 uint8_t rlcUtlSendDedLcBoStatus ARGS ((RlcCb *gCb,
860 #ifdef LTE_L2_MEAS_RLC
861 Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb, RlcDlRbCb *rbCb, CmLListCp *sduQ));
862 #else /* LTE_L2_MEAS */
863 Void rlcUtlEmptySduQ ARGS ((RlcCb *gCb,CmLListCp *sduQ));
864 #endif /* LTE_L2_MEAS */
866 uint8_t rlcUtlSendToMac ARGS ((RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo));
868 Void rlcUtlIncrementKwuStsSduTx ARGS((RlcKwuSapCb *rlckwuSap));
870 Void rlcUtlIncrementGenStsBytesAndPdusSent ARGS((RlcGenSts *genSts,
873 Void rlcUtlFreeDlMemory ARGS ((RlcCb *gCb));
875 Void rlcUtlInitToBeFreed ARGS ((RlcCb *gCb, RlcDlDataToBeFreed *toBeFreed));
877 Void rlcUtlInitializeSelfPst ARGS((RlcCb *gCb));
879 Void rlcUtlRaiseDlCleanupEvent ARGS((RlcCb *gCb));
881 Void rlcUtlAddSduToBeFreedQueue ARGS((RlcCb *gCb, RlcSdu *sdu));
883 Void rlcUtlAddReTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcRetx *retx));
885 Void rlcUtlAddTxPduToBeFreedQueue ARGS((RlcCb *gCb, RlcTx *pdu));
888 S16 rlcUtlL2MeasDlInit ARGS((RlcCb *gCb));
891 /****************************************************************************
893 ***************************************************************************/
894 Void ResetRLCStats ARGS((Void));
896 Void PrintRLCStats ARGS((Void));
898 Void DumpRLCDlDebugInformation ARGS((Void));
900 /****************************************************************************
901 * Activation Functions
902 ***************************************************************************/
903 S16 rlcDlActvInit ARGS ((Ent ent,Inst inst,Region region,Reason reason));
905 S16 rlcDlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
907 bool rlcDlUtlIsReestInProgress ARGS ((RlcDlRbCb *rbCb));
909 Void rlcDlUtlResetReestInProgress ARGS ((RlcDlRbCb *rbCb));
911 Void rlcDlUtlResetReestInProgress ARGS (( RlcDlRbCb *rbCb));
913 Void rlcDlUtlSetReestInProgressForAllRBs ARGS ((RlcCb *gCb, RlcDlUeCb
915 Void rlcDlUtlSetReestInProgressForRB ARGS (( RlcCb *gCb, RlcDlRbCb *rbCb));
918 Void rlcUtlUpdateContainedSduLst ARGS ((
920 RlcContSduLst *contSduLst
922 Void rlcUtlUpdateOutStandingSduLst ARGS ((
923 RlcL2MeasDlIpTh *dlIpThPut,
929 Void rlcUtlUpdateBurstSdus ARGS((
932 RlcContSduLst *contSduLst,
937 RlcL2MeasTb * rlcUtlGetCurMeasTb ARGS((
942 S16 rlcUtlSndDlL2MeasNCfm ARGS((RlcCb *gCb,
943 RlcL2MeasReqEvt *measReqEvt,
944 RlcL2MeasCfmEvt *measCfmEvt));
946 S16 rlcUtlSndDlL2MeasCfm ARGS ((RlcCb *gCb, RlcL2MeasEvtCb *measEvtCb));
948 S16 rlcUtlProcHarqInd ARGS (( RlcCb *gCb, RguHarqStatusInd *staInd, RlcDlUeCb *ueCb,
950 Void rlcUtlResetDlL2MeasInRlcRb ARGS ((RlcCb *gCb,
954 S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, uint8_t measType,uint8_t status));
956 S16 rlcUtlValidateIpThL2Meas ARGS((RlcL2MeasReqEvt *measReqEvt,
957 RlcL2MeasCfmEvt *measCfmEvt));
959 S16 rlcFetchLchInfo ARGS ((RlcL2MeasReqEvt *measReqEvt,
960 RlcL2MeasCfmEvt *measCfmEvt,
965 S16 rlcUtlNotifyMacUlIp ARGS ((RlcL2MeasCb *measCb,uint16_t ueIdx, Bool enable,
966 CmLteLcId *lChId, uint8_t *numLCh));
969 uint8_t rlcProcDlData(Pst *pst, RlcDatReqInfo* datReq, Buffer *buf);
970 uint8_t rlcProcCommLcSchedRpt(Pst *pst, SuId suId, RguCStaIndInfo *staInd);
971 uint8_t rlcProcDedLcSchedRpt(Pst *pst, SuId suId, RguDStaIndInfo *staInd);
973 Void rlcUtlFreeDlMem ARGS(( Void));
976 #endif /* __cplusplus */
978 #endif /* __RLC_DLH__ */
980 /********************************************************************30**
983 **********************************************************************/