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**
25 Desc: This file contains all the data structures and
26 prototypes for LTE RLC.
30 *********************************************************************21*/
32 @brief RLC Product Structures, prototypes
40 #endif /* __cplusplus */
42 /** @brief Local typedefs */
43 typedef uint32_t RlcSn; /*!< Sequence Number length */
45 typedef RguDDatIndInfo KwDatIndInfo;
47 typedef RguDStaIndInfo KwDStaIndInfo;
49 typedef RguPduInfo KwPduInfo; /* kw002.201 : Aligning the structure with RGU */
51 typedef struct _amRlcStats
53 uint32_t numDLStaPduSent;
54 uint32_t numDLNacksInStaPdu;
55 uint32_t numDLBytesUnused;
56 uint32_t numDLPollTimerExpiresSrb;
57 uint32_t numDLPollTimerExpiresDrb;
58 uint32_t numDLMaxRetx;
59 uint32_t numDLRetransPdus;
60 uint32_t numULPdusDiscarded;
61 uint32_t numULReOrdTimerExpires;
62 uint32_t numULStaPduRcvd;
63 uint32_t numULNackInStaPduRcvd;
64 uint32_t numRlcAmCellSduTx; /* Count of SDUs transmitted in DL for all UEs */
65 uint32_t numRlcAmCellSduBytesTx; /*Total number of bytes transmitted in DL for all Ues */
66 uint32_t numRlcAmCellRetxPdu; /*Count of PDUs retransmitted for all Ues */
67 uint32_t numRlcAmMaxRetx; /*Total number of Max-RLC retransmissions hit for all the Ues */
68 uint32_t numRlcAmCellDupPduRx; /*Count of Duplicate PDUs detected for a UE in UL for all Ues */
69 uint32_t numRlcAmCellDropOutWinRx; /*Count of PDUs dropped due to Out of Window reception for all Ues */
70 uint32_t numRlcAmCellSduRx; /* Count of SDUs received in UL for all UEs*/
71 uint32_t numRlcAmCellSduBytesRx;/*Total number of bytes received in UL for all Ues*/
72 uint32_t numRlcAmCellNackRx; /*Total number of UL PDUs nacked for all the Ues*/
73 uint32_t numRlcAmCellWinStall; /*Number of window stalls detected for all the Ues */
76 typedef struct _umRlcStats
78 uint32_t numDLBytesUnused;
79 uint32_t numDLMaxRetx;
80 uint32_t numULPdusDiscarded;
81 uint32_t numULReOrdTimerExpires;
82 uint32_t numULPdusOutsideWindow;
85 typedef struct _rlcStats
87 AMRLCStats amRlcStats;
88 UMRLCStats umRlcStats;
93 /* kw005.201 added support for L2 Measurement */
95 typedef struct rlcSduSnMap RlcSduSnMap;
96 typedef RguLchMapInfo KwLchMapInfo;
97 #endif /* LTE_L2_MEAS */
100 /** @defgroup ummode UM Module Info
103 * @brief Structure to hold an Unacknowledged Mode header
106 * - fi : Framing Info
107 * - sn : Sequence number
108 * - numLi : Number of length indicators in the following array (li)
109 * - li : Length indicators
111 typedef struct rlcUmHdr
114 uint8_t si; /*!< Segmentation Info */
115 uint16_t so; /*!< Segment offset 5G NR */
117 uint8_t fi; /*!< Framing Info */
118 RlcSn sn; /*!< Sequence number */
119 uint16_t numLi; /*!< Number of LIs */
120 uint16_t li[RLC_MAX_UL_LI]; /*!< Array of LIs */
125 * @brief Structure to hold an Acknowledged Mode header
128 * - dc : Data/Control PDU
129 * - rf : Resegmentation flag
131 * - fi : Framing Info
132 * - e : Extension bit
133 * - lsf : Last segment flat
134 * - sn : Sequence number
135 * - so : Segment offset
136 * - numLi : Number of length indicators in the following array (li)
137 * - li : Length indicators
139 typedef struct rlcAmHdr
141 uint8_t dc; /*!< Data/Control PDU */
142 uint8_t p; /*!< Poll bit */
143 uint8_t si; /*!< Segmentation Info: 5GNR */
144 RlcSn sn; /*!< Sequence number */
145 uint32_t so; /*!< Segment offset */
148 /* structures used for encoding/decoding the headers */
149 typedef struct rlcCntrlInfo
160 typedef struct rlcHdrInfo
171 typedef struct rlcExtHdr
180 * @brief Structure to hold information about a Logical channel
183 * - lChId : Logical channel Id
184 * - lChType : Logical channel type
186 typedef struct rlcLchInfo
188 CmLteLcId lChId; /*!< Logical channel Id */
189 CmLteLcType lChType; /*!< Logical channel type */
192 /* kw005.201 added support for L2 Measurement */
195 /** @struct RlcL2Cntr
197 typedef struct rlcL2Cntr
201 uint32_t numActvUe; /*!< number of active Ue */
202 uint32_t sampOc; /*!< Total number of sampling occasion */
206 uint32_t dLoss; /*!< Total number of lost packets */
207 uint32_t posPkts; /*!< Total number of positively acknowlegded
210 struct /*!< For DL IP throughput */
212 uint32_t volSummation; /*!< Sum of data in bytes */
213 uint32_t timeSummation; /*!< Sum of time difference in milli sec*/
215 struct /*!< For UL IP throughput */
217 uint32_t volSummation; /*!< Sum of data in bytes */
218 uint32_t timeSummation; /*!< Sum of time difference in milli sec*/
220 /* Discard new changes starts */
221 struct /*!< For UL IP throughput */
223 uint32_t discSdus; /*!< Total RLC SDUs discarded */
224 uint32_t totSdus; /*!< Total RLC SDUs received */
226 struct /*!< For UL IP throughput */
228 uint64_t sduDelay; /*!< Total SDUs delay */
231 uint32_t totDrbsPerQci; /*!< Total Count of DRB's for this QCI */
241 uint16_t snList[RLC_MAX_PDU_MAP];
247 typedef struct rlcSnSduMap
250 CmLteLcId lChId; /*!< Logical channel Id */
253 Bool isBurstSplitted; /*!< true: burst for this LCH is splitted */
254 #endif /* LTE_RLC_R9 */
255 RlcSduSnMap *sduList[RLC_MAX_DL_LI];
258 typedef struct rlcTbSnMap
260 CmHashListEnt hlTbEnt;
264 RlcSnSduMap snSduMap[RGU_MAX_PDU * RGU_MAX_LC];
267 typedef struct rlcL2MeasCbUeMeasInfo
269 CmLteRnti ueId; /*!< UE ID (Used only for IP Throughput
271 CmLteCellId cellId; /*!< UE ID (Used only for IP Throughput
273 Bool isValid; /*! < is this UE entry valid */
274 uint8_t numLcId; /*!< Holds the number of LCh for which Ul Ip
276 uint8_t lcId[RLC_MAX_LCH_PER_UE]; /*!< Holds the list of LCh for which Ul ip
278 RlcL2Cntr measData[LKW_MAX_QCI];
279 uint16_t numQci; /*!< number of valid qcI */
280 uint8_t qci[LKW_MAX_QCI]; /*!< list of valid qcI */
281 }RlcL2MeasCbUeMeasInfo;
283 typedef struct rlcL2MeasCbIpThMeas
287 uint8_t totQci[LKW_MAX_QCI];
288 RlcL2MeasCbUeMeasInfo ueInfoLst[LKW_MAX_UE]; /*Added for handling meas for multiple ues*/
289 }RlcL2MeasCbIpThMeas;
291 typedef struct rlcL2MeasCbNonIpThMeas
293 uint16_t numSamples; /*!< Number of samples to take on numActUe */
294 uint16_t numQci; /*!< number of valid qcI */
295 uint8_t qci[LKW_MAX_QCI]; /*!< list of valid qcI */
296 RlcL2Cntr measData[LKW_MAX_QCI]; /*!< Measurement CB */
297 }RlcL2MeasCbNonIpThMeas;
299 typedef union rlcL2MeasCbIpNonIpThMeasVal
301 RlcL2MeasCbIpThMeas ipThMeas;
302 RlcL2MeasCbNonIpThMeas nonIpThMeas;
303 }RlcL2MeasCbIpNonIpThMeasVal;
305 /** @struct RlcL2MeasCb
306 * RLC L2 Measurement CB */
307 typedef struct rlcL2MeasCb
309 uint8_t measType; /*!< Bit-wise set measurement types */
310 RlcL2MeasCbIpNonIpThMeasVal val; /* Union of IP tpt or non-ip tpt */
313 /** @struct RlcL2MeasEvtCb
314 * RLC L2 Measurement Evt CB */
315 typedef struct rlcL2MeasEvtCb
317 uint32_t transId; /*!< TransId of Measurement Req */
318 uint32_t cbIdx; /*!< TransId of Measurement Req */
319 CmTimer l2Tmr; /* NOT USED */ /*!< L2 Timer per request */
320 TmrCfg l2TmrCfg; /* NOT USED */ /*!< Time period of measurement */
321 RlcL2MeasCb measCb; /*!< Measurement CB */
322 EpcTime startTime; /* NOT USED */ /*!< start time when meas starts*/
325 /** @struct RlcL2MeasRbCb
326 * RLC L2 Measurement Rb CB */
327 typedef struct rlcL2MeasRbCb
329 uint8_t measOn; /*!< Measurements that are running */
330 RlcL2Cntr *l2Sts[RLC_MAX_L2MEAS_EVT]; /*!< L2 Mesurement statistics */
335 typedef struct rlcL2Cb
337 uint16_t rlcNumMeas; /*!< Number of measurements going on */
338 RlcL2MeasEvtCb rlcL2EvtCb[LKW_MAX_L2MEAS]; /*!< Pointers to Measurement Cb */
339 uint8_t measOn[LKW_MAX_QCI]; /*!< Measurement on */
340 uint32_t numActUe[LKW_MAX_QCI]; /*!< Measurement on */
344 typedef enum _dlIpThrputState
346 KW_DL_IPTHRU_RESET = 0,
347 KW_DL_IPTHRU_BURST_STARTED,
348 KW_DL_IPTHRU_BURST_CONTINUE,
349 KW_DL_IPTHRU_BURST_COMPLETED
353 * @struct rlcL2MeasSduLst
354 * Structure to hold parameters of
355 * burst sdus in DL for a RB */
356 typedef struct rlcOutStngSduInfo
358 uint32_t sduId; /*!< SDU Id of sdu */
359 MsgLen sduLen; /*!< Size of sdu */
360 uint32_t numTb; /*!< Hold the number of TBs for this sdu in DL */
364 * @struct rlcL2MeasDlIpTh
365 * Structure to hold parameters for DL ip
366 * throughput for a RB */
367 typedef struct rlcL2MeasDlIpTh
369 Bool isBurstAct; /*!< Set to TRUE when burst is active in DL */
370 uint64_t burstStartTime; /*!< Holds the starting time of the burst */
371 uint32_t burstEndSduId; /*!< Sdu ID when burst ends */
372 uint8_t lastSduIdx; /*!< Holds the index of last outStanding sdu */
373 RlcOutStngSduInfo outStngSduArr[RLC_L2MEAS_MAX_OUTSTNGSDU];/*!< Hold the burst sdu information */
377 * @struct rlcL2MeasIpThruput
378 * Structure to hold parameters for UL/DL ip
379 * throughput for a RB */
380 typedef struct rlcL2MeasIpThruput
382 uint32_t dataVol; /*!< Holds volume of new data in bytes
383 for UL IP throughput */
384 uint32_t ttiCnt; /*!< Holds ttiCnt received from MAC in UL */
385 uint32_t prevTtiCnt; /*!< Holds previous ttiCnt received from MAC in UL */
386 RlcL2MeasDlIpTh dlIpTh;
389 #endif /* LTE_L2_MEAS */
392 * @brief Structure to hold an UE key for the UE hast lists
398 typedef struct rlcUeKey
400 CmLteRnti ueId; /*!< UE Id */
401 CmLteCellId cellId; /*!< Cell Id */
405 * @brief Structure to hold an information about the CKW SAP
408 * - pst : Service user post structure
409 * - spId : Service provider Id
410 * - suId : Service user Id
411 * - state : State of the SAP
412 * - sts : SAP specific statistics
414 typedef struct rlcCkwSapCb
416 Pst pst; /*!< Service user post structure */
417 SpId spId; /*!< Service provider Id */
418 SuId suId; /*!< Service user Id */
419 uint8_t state; /*!< Sap Status */
420 RlcCkwCntSts sts; /*!< Statistics */
424 * @brief Structure to hold an information about the KWU SAP
427 * - pst : Service user post structure
428 * - spId : Service provider Id
429 * - suId : Service user Id
430 * - state : State of the SAP
431 * - sts : SAP specific statistics
433 typedef struct rlcKwuSapCb
435 Pst pst; /*!< Service user post structure */
436 SpId spId; /*!< Service provider Id */
437 SuId suId; /*!< Service user Id */
438 uint8_t state; /*!< Sap Status */
439 RlcKwuSapSts sts; /*!< Statistics */
443 * @brief Structure to hold an information about the RGU SAP
446 * - pst : Service user post structure
447 * - spId : Service provider Id
448 * - suId : Service user Id
449 * - state : State of the SAP
450 * - bndTmr : Bind Timer
451 * - bndTmrInt : Timer Interval
452 * - retryCnt : Bind Retry Count
454 typedef struct rlcRguSapCb
456 Pst pst; /*!< Service user post structure */
457 SpId spId; /*!< Service provider Id */
458 SuId suId; /*!< Service user Id */
459 uint8_t state; /*!< Sap Status */
460 CmTimer bndTmr; /*!< Bind Timer */
461 uint16_t bndTmrInt; /*!< Timer Interval */
462 uint8_t retryCnt; /*!< Bind Retry Count */
466 * @brief Structure to hold an information about the UDX UL SAP
469 * - pst : Service user post structure
470 * - spId : Service provider Id
471 * - suId : Service user Id
472 * - state : State of the SAP
473 * - bndTmr : Bind Timer
474 * - bndTmrInt : Timer Interval
475 * - retryCnt : Bind Retry Count
477 typedef struct rlcUdxUlSapCb
479 Pst pst; /*!< Service user post structure */
480 SpId spId; /*!< Service provider Id */
481 SuId suId; /*!< Service user Id */
482 uint8_t state; /*!< Sap Status */
483 CmTimer bndTmr; /*!< Bind Timer */
484 uint16_t bndTmrInt; /*!< Timer Interval */
485 uint8_t retryCnt; /*!< Bind Retry Count */
489 * @brief Structure to hold an information about the UDX DL SAP
492 * - pst : Service user post structure
493 * - spId : Service provider Id
494 * - suId : Service user Id
495 * - state : State of the SAP
497 typedef struct rlcUdxDlSapCb
499 Pst pst; /*!< Service user post structure */
500 SpId spId; /*!< Service provider Id */
501 SuId suId; /*!< Service user Id */
502 uint8_t state; /*!< Sap Status */
506 * @brief Structure to hold info about memory to be freed
509 * - sduLst : The SDU queues are appended to this queue, used
510 * for the UM SDU queues
511 * - txLst : Stores to be released AM Mode TX PDUs
512 * - reTxLst : Stores to be released AM Re TX PDU's
513 * - rbLst : List of AM DL RBs to be freed
515 typedef struct rlcDlDataToBeFreed
517 CmLListCp sduLst; /*!< Queue of SDU's to be freed */
518 CmLListCp txLst; /*!< Stores to be released TX PDUs */
519 CmLListCp reTxLst; /*!< Stores to be released ReTX PDUs */
520 CmLListCp rbLst; /*!< List of AM DL RBs to be freed */
524 * @brief Structure to hold an information about DL RLC instance
527 * - numKwuSaps : Number of RLC KWU Saps
528 * - numUdxSaps : Number of RLC UDX Saps
529 * - rlcKwuDlSap : Pointer to the array of KWU SAPS
530 * - udxDlSap : Pointer to the array of UDX SAPS
531 * - rguDlSap : RGU Sap Control Block
532 * - cellLstCp : Hashlist of CellCb
533 * - ueLstCp : Hashlist of UeCb
534 * - toBeFreed : Pointer to data to be freed
535 * - shutdownReveived : Request for shutdown recevied or not
536 * - eventInQueue : Event for cleanup exists in queue or not
538 typedef struct rlcDlCb
540 uint8_t numKwuSaps; /*!< Number of RLC Data Saps */
541 uint8_t numUdxSaps; /*!< Number of RLC Data Saps */
542 RlcKwuSapCb *rlcKwuDlSap; /*!< KWU Sap Control Block */
543 RlcUdxDlSapCb *udxDlSap; /*!< UDX DL Sap Control Block */
544 RlcRguSapCb *rguDlSap; /*!< RGU Sap Control Block */
545 CmHashListCp cellLstCp; /*!< Hashlist of CellCb */
546 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
547 RlcDlDataToBeFreed toBeFreed; /*!< Pointer to data to be freed */
548 Pst selfPst; /*!< Pst to post events to self */
549 Buffer *selfPstMBuf; /*!< Buffer used for self post */
550 Bool shutdownReceived; /*!< Request for shutdown recevied */
551 Bool eventInQueue; /*!< Event exists in queue or not */
553 RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
554 #endif /* LTE_L2_MEAS */
558 * @brief Structure to hold an information about UL RLC instance
561 * - ckwSap : CKW Sap Conrol Block
562 * - numKwuSaps : Number of RLC KWU Saps
563 * - numUdxSaps : Number of RLC UDX Saps
564 * - udxUlSap : Pointer to the array of UDX SAPS
565 * - rlcKwuUlSap : Pointer to the array of KWU SAPS
566 * - rguUlSap : RGU Sap Control Block
567 * - cellLstCp : Hashlist of CellCb
568 * - ueLstCp : Hashlist of UeCb
569 * - transIdLstCp : Hashlist of cfg trans
571 typedef struct rlcUlCb
573 RlcCkwSapCb ckwSap; /*!< CKW Sap Conrol Block */
574 uint8_t numKwuSaps; /*!< Number of RLC Data Saps */
575 uint8_t numUdxSaps; /*!< Number of RLC Data Saps */
576 RlcUdxUlSapCb *udxUlSap; /*!< UDX DL Sap Control Block */
577 RlcKwuSapCb *rlcKwuUlSap; /*!< KWU Sap Control Block */
578 RlcRguSapCb *rguUlSap; /*!< RGU Sap Control Block */
579 CmHashListCp cellLstCp; /*!< Hashlist of CellCb */
580 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
581 CmHashListCp transIdLstCp; /*!< Hashlist of cfg trans */
582 uint8_t rlcUlUdxEventType; /*!<Ue Create/ReConfig> */
583 /* kw005.201 added support for L2 Measurement */
585 RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
586 #endif /* LTE_L2_MEAS */
591 * @brief Structure to hold an information about a RLC instance
594 * - init : Task Initialization Info
595 * - genCfg : General Configuration
596 * - genSts : General Statistics
597 * - trcLen : Trace Length
598 * - trcMask : Trace Mask
599 * - rlcTq : Timer queue
600 * - rlcTqCp : Timer queue control point
601 * - u : Union depending on whether the instance is UL or DL
602 * - ulCb : UL instance Control Block
603 * - dlCb : DL instance Control Block
607 TskInit init; /*!< Task Initialization Info */
608 RlcGenCfg genCfg; /*!< General Configuration Structure */
609 RlcGenSts genSts; /*!< General Statistics */
610 S16 trcLen; /*!< Trace Length */
611 uint8_t trcMask; /*!< Trace Mask */
612 CmTqType rlcTq[RLC_TMR_LEN]; /*!< Timer queue */
613 CmTqCp rlcTqCp; /*!< Timer queue control point */
616 RlcUlCb *ulCb; /*!< Ul Control Block */
617 RlcDlCb *dlCb; /*!< Dl Control Block */
619 uint8_t dlSduId; /*!< Downlink SDU ID */
622 RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */
624 /****************************************************************************
626 ***************************************************************************/
627 S16 rlcGetSId ARGS((SystemId *s));
629 Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
631 S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf));
633 void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt));
635 void rlcStopTmr ARGS((RlcCb *gCb, PTR cb, uint8_t tmrType));
637 bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
640 Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
648 S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
649 S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
650 S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
651 S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
652 S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
653 S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
654 Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData,
655 RlcL2MeasRbCb *rbL2Cb,
657 #else /* LTE_L2_MEAS */
658 Void rlcLmmSendAlarm ARGS ((RlcCb *gCb,
664 #endif /* LTE_L2_MEAS */
668 #endif /* __cplusplus */
673 /********************************************************************30**
676 **********************************************************************/