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
113 uint8_t fi; /*!< Framing Info */
114 RlcSn sn; /*!< Sequence number */
115 uint16_t numLi; /*!< Number of LIs */
116 uint16_t li[RLC_MAX_UL_LI]; /*!< Array of LIs */
120 * @brief Structure to hold an Acknowledged Mode header
123 * - dc : Data/Control PDU
124 * - rf : Resegmentation flag
126 * - fi : Framing Info
127 * - e : Extension bit
128 * - lsf : Last segment flat
129 * - sn : Sequence number
130 * - so : Segment offset
131 * - numLi : Number of length indicators in the following array (li)
132 * - li : Length indicators
134 typedef struct rlcAmHdr
136 uint8_t dc; /*!< Data/Control PDU */
137 uint8_t p; /*!< Poll bit */
138 uint8_t si; /*!< Segmentation Info: 5GNR */
139 RlcSn sn; /*!< Sequence number */
140 uint32_t so; /*!< Segment offset */
143 /* structures used for encoding/decoding the headers */
144 typedef struct rlcCntrlInfo
155 typedef struct rlcHdrInfo
166 typedef struct rlcExtHdr
175 * @brief Structure to hold information about a Logical channel
178 * - lChId : Logical channel Id
179 * - lChType : Logical channel type
181 typedef struct rlcLchInfo
183 CmLteLcId lChId; /*!< Logical channel Id */
184 CmLteLcType lChType; /*!< Logical channel type */
187 /* kw005.201 added support for L2 Measurement */
190 /** @struct RlcL2Cntr
192 typedef struct rlcL2Cntr
196 uint32_t numActvUe; /*!< number of active Ue */
197 uint32_t sampOc; /*!< Total number of sampling occasion */
201 uint32_t dLoss; /*!< Total number of lost packets */
202 uint32_t posPkts; /*!< Total number of positively acknowlegded
205 struct /*!< For DL IP throughput */
207 uint32_t volSummation; /*!< Sum of data in bytes */
208 uint32_t timeSummation; /*!< Sum of time difference in milli sec*/
210 struct /*!< For UL IP throughput */
212 uint32_t volSummation; /*!< Sum of data in bytes */
213 uint32_t timeSummation; /*!< Sum of time difference in milli sec*/
215 /* Discard new changes starts */
216 struct /*!< For UL IP throughput */
218 uint32_t discSdus; /*!< Total RLC SDUs discarded */
219 uint32_t totSdus; /*!< Total RLC SDUs received */
221 struct /*!< For UL IP throughput */
223 uint64_t sduDelay; /*!< Total SDUs delay */
226 uint32_t totDrbsPerQci; /*!< Total Count of DRB's for this QCI */
236 uint16_t snList[RLC_MAX_PDU_MAP];
242 typedef struct rlcSnSduMap
245 CmLteLcId lChId; /*!< Logical channel Id */
248 Bool isBurstSplitted; /*!< true: burst for this LCH is splitted */
249 #endif /* LTE_RLC_R9 */
250 RlcSduSnMap *sduList[RLC_MAX_DL_LI];
253 typedef struct rlcTbSnMap
255 CmHashListEnt hlTbEnt;
259 RlcSnSduMap snSduMap[RGU_MAX_PDU * RGU_MAX_LC];
262 typedef struct rlcL2MeasCbUeMeasInfo
264 CmLteRnti ueId; /*!< UE ID (Used only for IP Throughput
266 CmLteCellId cellId; /*!< UE ID (Used only for IP Throughput
268 Bool isValid; /*! < is this UE entry valid */
269 uint8_t numLcId; /*!< Holds the number of LCh for which Ul Ip
271 uint8_t lcId[RLC_MAX_LCH_PER_UE]; /*!< Holds the list of LCh for which Ul ip
273 RlcL2Cntr measData[LKW_MAX_QCI];
274 uint16_t numQci; /*!< number of valid qcI */
275 uint8_t qci[LKW_MAX_QCI]; /*!< list of valid qcI */
276 }RlcL2MeasCbUeMeasInfo;
278 typedef struct rlcL2MeasCbIpThMeas
282 uint8_t totQci[LKW_MAX_QCI];
283 RlcL2MeasCbUeMeasInfo ueInfoLst[LKW_MAX_UE]; /*Added for handling meas for multiple ues*/
284 }RlcL2MeasCbIpThMeas;
286 typedef struct rlcL2MeasCbNonIpThMeas
288 uint16_t numSamples; /*!< Number of samples to take on numActUe */
289 uint16_t numQci; /*!< number of valid qcI */
290 uint8_t qci[LKW_MAX_QCI]; /*!< list of valid qcI */
291 RlcL2Cntr measData[LKW_MAX_QCI]; /*!< Measurement CB */
292 }RlcL2MeasCbNonIpThMeas;
294 typedef union rlcL2MeasCbIpNonIpThMeasVal
296 RlcL2MeasCbIpThMeas ipThMeas;
297 RlcL2MeasCbNonIpThMeas nonIpThMeas;
298 }RlcL2MeasCbIpNonIpThMeasVal;
300 /** @struct RlcL2MeasCb
301 * RLC L2 Measurement CB */
302 typedef struct rlcL2MeasCb
304 uint8_t measType; /*!< Bit-wise set measurement types */
305 RlcL2MeasCbIpNonIpThMeasVal val; /* Union of IP tpt or non-ip tpt */
308 /** @struct RlcL2MeasEvtCb
309 * RLC L2 Measurement Evt CB */
310 typedef struct rlcL2MeasEvtCb
312 uint32_t transId; /*!< TransId of Measurement Req */
313 uint32_t cbIdx; /*!< TransId of Measurement Req */
314 CmTimer l2Tmr; /* NOT USED */ /*!< L2 Timer per request */
315 TmrCfg l2TmrCfg; /* NOT USED */ /*!< Time period of measurement */
316 RlcL2MeasCb measCb; /*!< Measurement CB */
317 EpcTime startTime; /* NOT USED */ /*!< start time when meas starts*/
320 /** @struct RlcL2MeasRbCb
321 * RLC L2 Measurement Rb CB */
322 typedef struct rlcL2MeasRbCb
324 uint8_t measOn; /*!< Measurements that are running */
325 RlcL2Cntr *l2Sts[RLC_MAX_L2MEAS_EVT]; /*!< L2 Mesurement statistics */
330 typedef struct rlcL2Cb
332 uint16_t rlcNumMeas; /*!< Number of measurements going on */
333 RlcL2MeasEvtCb rlcL2EvtCb[LKW_MAX_L2MEAS]; /*!< Pointers to Measurement Cb */
334 uint8_t measOn[LKW_MAX_QCI]; /*!< Measurement on */
335 uint32_t numActUe[LKW_MAX_QCI]; /*!< Measurement on */
339 typedef enum _dlIpThrputState
341 KW_DL_IPTHRU_RESET = 0,
342 KW_DL_IPTHRU_BURST_STARTED,
343 KW_DL_IPTHRU_BURST_CONTINUE,
344 KW_DL_IPTHRU_BURST_COMPLETED
348 * @struct rlcL2MeasSduLst
349 * Structure to hold parameters of
350 * burst sdus in DL for a RB */
351 typedef struct rlcOutStngSduInfo
353 uint32_t sduId; /*!< SDU Id of sdu */
354 MsgLen sduLen; /*!< Size of sdu */
355 uint32_t numTb; /*!< Hold the number of TBs for this sdu in DL */
359 * @struct rlcL2MeasDlIpTh
360 * Structure to hold parameters for DL ip
361 * throughput for a RB */
362 typedef struct rlcL2MeasDlIpTh
364 Bool isBurstAct; /*!< Set to TRUE when burst is active in DL */
365 uint64_t burstStartTime; /*!< Holds the starting time of the burst */
366 uint32_t burstEndSduId; /*!< Sdu ID when burst ends */
367 uint8_t lastSduIdx; /*!< Holds the index of last outStanding sdu */
368 RlcOutStngSduInfo outStngSduArr[RLC_L2MEAS_MAX_OUTSTNGSDU];/*!< Hold the burst sdu information */
372 * @struct rlcL2MeasIpThruput
373 * Structure to hold parameters for UL/DL ip
374 * throughput for a RB */
375 typedef struct rlcL2MeasIpThruput
377 uint32_t dataVol; /*!< Holds volume of new data in bytes
378 for UL IP throughput */
379 uint32_t ttiCnt; /*!< Holds ttiCnt received from MAC in UL */
380 uint32_t prevTtiCnt; /*!< Holds previous ttiCnt received from MAC in UL */
381 RlcL2MeasDlIpTh dlIpTh;
384 #endif /* LTE_L2_MEAS */
387 * @brief Structure to hold an UE key for the UE hast lists
393 typedef struct rlcUeKey
395 CmLteRnti ueId; /*!< UE Id */
396 CmLteCellId cellId; /*!< Cell Id */
400 * @brief Structure to hold an information about the CKW SAP
403 * - pst : Service user post structure
404 * - spId : Service provider Id
405 * - suId : Service user Id
406 * - state : State of the SAP
407 * - sts : SAP specific statistics
409 typedef struct rlcCkwSapCb
411 Pst pst; /*!< Service user post structure */
412 SpId spId; /*!< Service provider Id */
413 SuId suId; /*!< Service user Id */
414 uint8_t state; /*!< Sap Status */
415 RlcCkwCntSts sts; /*!< Statistics */
419 * @brief Structure to hold an information about the KWU SAP
422 * - pst : Service user post structure
423 * - spId : Service provider Id
424 * - suId : Service user Id
425 * - state : State of the SAP
426 * - sts : SAP specific statistics
428 typedef struct rlcKwuSapCb
430 Pst pst; /*!< Service user post structure */
431 SpId spId; /*!< Service provider Id */
432 SuId suId; /*!< Service user Id */
433 uint8_t state; /*!< Sap Status */
434 RlcKwuSapSts sts; /*!< Statistics */
438 * @brief Structure to hold an information about the RGU SAP
441 * - pst : Service user post structure
442 * - spId : Service provider Id
443 * - suId : Service user Id
444 * - state : State of the SAP
445 * - bndTmr : Bind Timer
446 * - bndTmrInt : Timer Interval
447 * - retryCnt : Bind Retry Count
449 typedef struct rlcRguSapCb
451 Pst pst; /*!< Service user post structure */
452 SpId spId; /*!< Service provider Id */
453 SuId suId; /*!< Service user Id */
454 uint8_t state; /*!< Sap Status */
455 CmTimer bndTmr; /*!< Bind Timer */
456 uint16_t bndTmrInt; /*!< Timer Interval */
457 uint8_t retryCnt; /*!< Bind Retry Count */
461 * @brief Structure to hold an information about the UDX UL SAP
464 * - pst : Service user post structure
465 * - spId : Service provider Id
466 * - suId : Service user Id
467 * - state : State of the SAP
468 * - bndTmr : Bind Timer
469 * - bndTmrInt : Timer Interval
470 * - retryCnt : Bind Retry Count
472 typedef struct rlcUdxUlSapCb
474 Pst pst; /*!< Service user post structure */
475 SpId spId; /*!< Service provider Id */
476 SuId suId; /*!< Service user Id */
477 uint8_t state; /*!< Sap Status */
478 CmTimer bndTmr; /*!< Bind Timer */
479 uint16_t bndTmrInt; /*!< Timer Interval */
480 uint8_t retryCnt; /*!< Bind Retry Count */
484 * @brief Structure to hold an information about the UDX DL SAP
487 * - pst : Service user post structure
488 * - spId : Service provider Id
489 * - suId : Service user Id
490 * - state : State of the SAP
492 typedef struct rlcUdxDlSapCb
494 Pst pst; /*!< Service user post structure */
495 SpId spId; /*!< Service provider Id */
496 SuId suId; /*!< Service user Id */
497 uint8_t state; /*!< Sap Status */
501 * @brief Structure to hold info about memory to be freed
504 * - sduLst : The SDU queues are appended to this queue, used
505 * for the UM SDU queues
506 * - txLst : Stores to be released AM Mode TX PDUs
507 * - reTxLst : Stores to be released AM Re TX PDU's
508 * - rbLst : List of AM DL RBs to be freed
510 typedef struct rlcDlDataToBeFreed
512 CmLListCp sduLst; /*!< Queue of SDU's to be freed */
513 CmLListCp txLst; /*!< Stores to be released TX PDUs */
514 CmLListCp reTxLst; /*!< Stores to be released ReTX PDUs */
515 CmLListCp rbLst; /*!< List of AM DL RBs to be freed */
519 * @brief Structure to hold an information about DL RLC instance
522 * - numKwuSaps : Number of RLC KWU Saps
523 * - numUdxSaps : Number of RLC UDX Saps
524 * - rlcKwuDlSap : Pointer to the array of KWU SAPS
525 * - udxDlSap : Pointer to the array of UDX SAPS
526 * - rguDlSap : RGU Sap Control Block
527 * - cellLstCp : Hashlist of CellCb
528 * - ueLstCp : Hashlist of UeCb
529 * - toBeFreed : Pointer to data to be freed
530 * - shutdownReveived : Request for shutdown recevied or not
531 * - eventInQueue : Event for cleanup exists in queue or not
533 typedef struct rlcDlCb
535 uint8_t numKwuSaps; /*!< Number of RLC Data Saps */
536 uint8_t numUdxSaps; /*!< Number of RLC Data Saps */
537 RlcKwuSapCb *rlcKwuDlSap; /*!< KWU Sap Control Block */
538 RlcUdxDlSapCb *udxDlSap; /*!< UDX DL Sap Control Block */
539 RlcRguSapCb *rguDlSap; /*!< RGU Sap Control Block */
540 CmHashListCp cellLstCp; /*!< Hashlist of CellCb */
541 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
542 RlcDlDataToBeFreed toBeFreed; /*!< Pointer to data to be freed */
543 Pst selfPst; /*!< Pst to post events to self */
544 Buffer *selfPstMBuf; /*!< Buffer used for self post */
545 Bool shutdownReceived; /*!< Request for shutdown recevied */
546 Bool eventInQueue; /*!< Event exists in queue or not */
548 RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
549 #endif /* LTE_L2_MEAS */
553 * @brief Structure to hold an information about UL RLC instance
556 * - ckwSap : CKW Sap Conrol Block
557 * - numKwuSaps : Number of RLC KWU Saps
558 * - numUdxSaps : Number of RLC UDX Saps
559 * - udxUlSap : Pointer to the array of UDX SAPS
560 * - rlcKwuUlSap : Pointer to the array of KWU SAPS
561 * - rguUlSap : RGU Sap Control Block
562 * - cellLstCp : Hashlist of CellCb
563 * - ueLstCp : Hashlist of UeCb
564 * - transIdLstCp : Hashlist of cfg trans
566 typedef struct rlcUlCb
568 RlcCkwSapCb ckwSap; /*!< CKW Sap Conrol Block */
569 uint8_t numKwuSaps; /*!< Number of RLC Data Saps */
570 uint8_t numUdxSaps; /*!< Number of RLC Data Saps */
571 RlcUdxUlSapCb *udxUlSap; /*!< UDX DL Sap Control Block */
572 RlcKwuSapCb *rlcKwuUlSap; /*!< KWU Sap Control Block */
573 RlcRguSapCb *rguUlSap; /*!< RGU Sap Control Block */
574 CmHashListCp cellLstCp; /*!< Hashlist of CellCb */
575 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
576 CmHashListCp transIdLstCp; /*!< Hashlist of cfg trans */
577 uint8_t rlcUlUdxEventType; /*!<Ue Create/ReConfig> */
578 /* kw005.201 added support for L2 Measurement */
580 RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
581 #endif /* LTE_L2_MEAS */
586 * @brief Structure to hold an information about a RLC instance
589 * - init : Task Initialization Info
590 * - genCfg : General Configuration
591 * - genSts : General Statistics
592 * - trcLen : Trace Length
593 * - trcMask : Trace Mask
594 * - rlcTq : Timer queue
595 * - rlcTqCp : Timer queue control point
596 * - u : Union depending on whether the instance is UL or DL
597 * - ulCb : UL instance Control Block
598 * - dlCb : DL instance Control Block
602 TskInit init; /*!< Task Initialization Info */
603 RlcGenCfg genCfg; /*!< General Configuration Structure */
604 RlcGenSts genSts; /*!< General Statistics */
605 S16 trcLen; /*!< Trace Length */
606 uint8_t trcMask; /*!< Trace Mask */
607 CmTqType rlcTq[RLC_TMR_LEN]; /*!< Timer queue */
608 CmTqCp rlcTqCp; /*!< Timer queue control point */
611 RlcUlCb *ulCb; /*!< Ul Control Block */
612 RlcDlCb *dlCb; /*!< Dl Control Block */
614 uint8_t dlSduId; /*!< Downlink SDU ID */
617 RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */
619 /****************************************************************************
621 ***************************************************************************/
622 S16 rlcGetSId ARGS((SystemId *s));
624 Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
626 S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf));
628 void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt));
630 void rlcStopTmr ARGS((RlcCb *gCb, PTR cb, uint8_t tmrType));
632 bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
635 Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
643 S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
644 S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
645 S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
646 S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
647 S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
648 S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
649 Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData,
650 RlcL2MeasRbCb *rbL2Cb,
652 #else /* LTE_L2_MEAS */
653 Void rlcLmmSendAlarm ARGS ((RlcCb *gCb,
659 #endif /* LTE_L2_MEAS */
663 #endif /* __cplusplus */
668 /********************************************************************30**
671 **********************************************************************/