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 */
99 /** @defgroup ummode UM Module Info
102 * @brief Structure to hold an Unacknowledged Mode header
105 * - si : Segmentation Info
106 * - sn : Sequence number
107 * - so : Segmentation offset
109 typedef struct rlcUmHdr
111 uint8_t si; /*!< Segmentation Info */
112 RlcSn sn; /*!< Sequence number */
113 uint16_t so; /*!< Segmentation offset */
117 * @brief Structure to hold an Acknowledged Mode header
120 * - dc : Data/Control PDU
121 * - rf : Resegmentation flag
123 * - fi : Framing Info
124 * - e : Extension bit
125 * - lsf : Last segment flat
126 * - sn : Sequence number
127 * - so : Segment offset
128 * - numLi : Number of length indicators in the following array (li)
129 * - li : Length indicators
131 typedef struct rlcAmHdr
133 uint8_t dc; /*!< Data/Control PDU */
134 uint8_t p; /*!< Poll bit */
135 uint8_t si; /*!< Segmentation Info: 5GNR */
136 RlcSn sn; /*!< Sequence number */
137 uint32_t so; /*!< Segment offset */
140 /* structures used for encoding/decoding the headers */
141 typedef struct rlcCntrlInfo
152 typedef struct rlcHdrInfo
163 typedef struct rlcExtHdr
172 * @brief Structure to hold information about a Logical channel
175 * - lChId : Logical channel Id
176 * - lChType : Logical channel type
178 typedef struct rlcLchInfo
180 CmLteLcId lChId; /*!< Logical channel Id */
181 CmLteLcType lChType; /*!< Logical channel type */
184 /* kw005.201 added support for L2 Measurement */
187 /** @struct RlcL2Cntr
189 typedef struct rlcL2Cntr
193 uint32_t numActvUe; /*!< number of active Ue */
194 uint32_t sampOc; /*!< Total number of sampling occasion */
198 uint32_t dLoss; /*!< Total number of lost packets */
199 uint32_t posPkts; /*!< Total number of positively acknowlegded
202 struct /*!< For DL IP throughput */
204 uint32_t volSummation; /*!< Sum of data in bytes */
205 uint32_t timeSummation; /*!< Sum of time difference in milli sec*/
207 struct /*!< For UL IP throughput */
209 uint32_t volSummation; /*!< Sum of data in bytes */
210 uint32_t timeSummation; /*!< Sum of time difference in milli sec*/
212 /* Discard new changes starts */
213 struct /*!< For UL IP throughput */
215 uint32_t discSdus; /*!< Total RLC SDUs discarded */
216 uint32_t totSdus; /*!< Total RLC SDUs received */
218 struct /*!< For UL IP throughput */
220 uint64_t sduDelay; /*!< Total SDUs delay */
223 uint32_t totDrbsPerQci; /*!< Total Count of DRB's for this QCI */
233 uint16_t snList[RLC_MAX_PDU_MAP];
239 typedef struct rlcSnSduMap
242 CmLteLcId lChId; /*!< Logical channel Id */
245 Bool isBurstSplitted; /*!< true: burst for this LCH is splitted */
246 #endif /* LTE_RLC_R9 */
247 RlcSduSnMap *sduList[RLC_MAX_DL_LI];
250 typedef struct rlcTbSnMap
252 CmHashListEnt hlTbEnt;
256 RlcSnSduMap snSduMap[RGU_MAX_PDU * RGU_MAX_LC];
259 typedef struct rlcL2MeasCbUeMeasInfo
261 CmLteRnti ueId; /*!< UE ID (Used only for IP Throughput
263 CmLteCellId cellId; /*!< UE ID (Used only for IP Throughput
265 Bool isValid; /*! < is this UE entry valid */
266 uint8_t numLcId; /*!< Holds the number of LCh for which Ul Ip
268 uint8_t lcId[RLC_MAX_LCH_PER_UE]; /*!< Holds the list of LCh for which Ul ip
270 RlcL2Cntr measData[LKW_MAX_QCI];
271 uint16_t numQci; /*!< number of valid qcI */
272 uint8_t qci[LKW_MAX_QCI]; /*!< list of valid qcI */
273 }RlcL2MeasCbUeMeasInfo;
275 typedef struct rlcL2MeasCbIpThMeas
279 uint8_t totQci[LKW_MAX_QCI];
280 RlcL2MeasCbUeMeasInfo ueInfoLst[LKW_MAX_UE]; /*Added for handling meas for multiple ues*/
281 }RlcL2MeasCbIpThMeas;
283 typedef struct rlcL2MeasCbNonIpThMeas
285 uint16_t numSamples; /*!< Number of samples to take on numActUe */
286 uint16_t numQci; /*!< number of valid qcI */
287 uint8_t qci[LKW_MAX_QCI]; /*!< list of valid qcI */
288 RlcL2Cntr measData[LKW_MAX_QCI]; /*!< Measurement CB */
289 }RlcL2MeasCbNonIpThMeas;
291 typedef union rlcL2MeasCbIpNonIpThMeasVal
293 RlcL2MeasCbIpThMeas ipThMeas;
294 RlcL2MeasCbNonIpThMeas nonIpThMeas;
295 }RlcL2MeasCbIpNonIpThMeasVal;
297 /** @struct RlcL2MeasCb
298 * RLC L2 Measurement CB */
299 typedef struct rlcL2MeasCb
301 uint8_t measType; /*!< Bit-wise set measurement types */
302 RlcL2MeasCbIpNonIpThMeasVal val; /* Union of IP tpt or non-ip tpt */
305 /** @struct RlcL2MeasEvtCb
306 * RLC L2 Measurement Evt CB */
307 typedef struct rlcL2MeasEvtCb
309 uint32_t transId; /*!< TransId of Measurement Req */
310 uint32_t cbIdx; /*!< TransId of Measurement Req */
311 CmTimer l2Tmr; /* NOT USED */ /*!< L2 Timer per request */
312 TmrCfg l2TmrCfg; /* NOT USED */ /*!< Time period of measurement */
313 RlcL2MeasCb measCb; /*!< Measurement CB */
314 EpcTime startTime; /* NOT USED */ /*!< start time when meas starts*/
317 /** @struct RlcL2MeasRbCb
318 * RLC L2 Measurement Rb CB */
319 typedef struct rlcL2MeasRbCb
321 uint8_t measOn; /*!< Measurements that are running */
322 RlcL2Cntr *l2Sts[RLC_MAX_L2MEAS_EVT]; /*!< L2 Mesurement statistics */
327 typedef struct rlcL2Cb
329 uint16_t rlcNumMeas; /*!< Number of measurements going on */
330 RlcL2MeasEvtCb rlcL2EvtCb[LKW_MAX_L2MEAS]; /*!< Pointers to Measurement Cb */
331 uint8_t measOn[LKW_MAX_QCI]; /*!< Measurement on */
332 uint32_t numActUe[LKW_MAX_QCI]; /*!< Measurement on */
336 typedef enum _dlIpThrputState
338 KW_DL_IPTHRU_RESET = 0,
339 KW_DL_IPTHRU_BURST_STARTED,
340 KW_DL_IPTHRU_BURST_CONTINUE,
341 KW_DL_IPTHRU_BURST_COMPLETED
345 * @struct rlcL2MeasSduLst
346 * Structure to hold parameters of
347 * burst sdus in DL for a RB */
348 typedef struct rlcOutStngSduInfo
350 uint32_t sduId; /*!< SDU Id of sdu */
351 MsgLen sduLen; /*!< Size of sdu */
352 uint32_t numTb; /*!< Hold the number of TBs for this sdu in DL */
356 * @struct rlcL2MeasDlIpTh
357 * Structure to hold parameters for DL ip
358 * throughput for a RB */
359 typedef struct rlcL2MeasDlIpTh
361 Bool isBurstAct; /*!< Set to TRUE when burst is active in DL */
362 uint64_t burstStartTime; /*!< Holds the starting time of the burst */
363 uint32_t burstEndSduId; /*!< Sdu ID when burst ends */
364 uint8_t lastSduIdx; /*!< Holds the index of last outStanding sdu */
365 RlcOutStngSduInfo outStngSduArr[RLC_L2MEAS_MAX_OUTSTNGSDU];/*!< Hold the burst sdu information */
369 * @struct rlcL2MeasIpThruput
370 * Structure to hold parameters for UL/DL ip
371 * throughput for a RB */
372 typedef struct rlcL2MeasIpThruput
374 uint32_t dataVol; /*!< Holds volume of new data in bytes
375 for UL IP throughput */
376 uint32_t ttiCnt; /*!< Holds ttiCnt received from MAC in UL */
377 uint32_t prevTtiCnt; /*!< Holds previous ttiCnt received from MAC in UL */
378 RlcL2MeasDlIpTh dlIpTh;
381 #endif /* LTE_L2_MEAS */
384 * @brief Structure to hold an UE key for the UE hast lists
390 typedef struct rlcUeKey
392 CmLteRnti ueId; /*!< UE Id */
393 CmLteCellId cellId; /*!< Cell Id */
397 * @brief Structure to hold an information about the CKW SAP
400 * - pst : Service user post structure
401 * - spId : Service provider Id
402 * - suId : Service user Id
403 * - state : State of the SAP
404 * - sts : SAP specific statistics
406 typedef struct rlcCkwSapCb
408 Pst pst; /*!< Service user post structure */
409 SpId spId; /*!< Service provider Id */
410 SuId suId; /*!< Service user Id */
411 uint8_t state; /*!< Sap Status */
412 RlcCkwCntSts sts; /*!< Statistics */
416 * @brief Structure to hold an information about the KWU SAP
419 * - pst : Service user post structure
420 * - spId : Service provider Id
421 * - suId : Service user Id
422 * - state : State of the SAP
423 * - sts : SAP specific statistics
425 typedef struct rlcKwuSapCb
427 Pst pst; /*!< Service user post structure */
428 SpId spId; /*!< Service provider Id */
429 SuId suId; /*!< Service user Id */
430 uint8_t state; /*!< Sap Status */
431 RlcKwuSapSts sts; /*!< Statistics */
435 * @brief Structure to hold an information about the RGU SAP
438 * - pst : Service user post structure
439 * - spId : Service provider Id
440 * - suId : Service user Id
441 * - state : State of the SAP
442 * - bndTmr : Bind Timer
443 * - bndTmrInt : Timer Interval
444 * - retryCnt : Bind Retry Count
446 typedef struct rlcRguSapCb
448 Pst pst; /*!< Service user post structure */
449 SpId spId; /*!< Service provider Id */
450 SuId suId; /*!< Service user Id */
451 uint8_t state; /*!< Sap Status */
452 CmTimer bndTmr; /*!< Bind Timer */
453 uint16_t bndTmrInt; /*!< Timer Interval */
454 uint8_t retryCnt; /*!< Bind Retry Count */
458 * @brief Structure to hold an information about the UDX UL SAP
461 * - pst : Service user post structure
462 * - spId : Service provider Id
463 * - suId : Service user Id
464 * - state : State of the SAP
465 * - bndTmr : Bind Timer
466 * - bndTmrInt : Timer Interval
467 * - retryCnt : Bind Retry Count
469 typedef struct rlcUdxUlSapCb
471 Pst pst; /*!< Service user post structure */
472 SpId spId; /*!< Service provider Id */
473 SuId suId; /*!< Service user Id */
474 uint8_t state; /*!< Sap Status */
475 CmTimer bndTmr; /*!< Bind Timer */
476 uint16_t bndTmrInt; /*!< Timer Interval */
477 uint8_t retryCnt; /*!< Bind Retry Count */
481 * @brief Structure to hold an information about the UDX DL SAP
484 * - pst : Service user post structure
485 * - spId : Service provider Id
486 * - suId : Service user Id
487 * - state : State of the SAP
489 typedef struct rlcUdxDlSapCb
491 Pst pst; /*!< Service user post structure */
492 SpId spId; /*!< Service provider Id */
493 SuId suId; /*!< Service user Id */
494 uint8_t state; /*!< Sap Status */
498 * @brief Structure to hold info about memory to be freed
501 * - sduLst : The SDU queues are appended to this queue, used
502 * for the UM SDU queues
503 * - txLst : Stores to be released AM Mode TX PDUs
504 * - reTxLst : Stores to be released AM Re TX PDU's
505 * - rbLst : List of AM DL RBs to be freed
507 typedef struct rlcDlDataToBeFreed
509 CmLListCp sduLst; /*!< Queue of SDU's to be freed */
510 CmLListCp txLst; /*!< Stores to be released TX PDUs */
511 CmLListCp reTxLst; /*!< Stores to be released ReTX PDUs */
512 CmLListCp rbLst; /*!< List of AM DL RBs to be freed */
516 * @brief Structure to hold an information about DL RLC instance
519 * - numKwuSaps : Number of RLC KWU Saps
520 * - numUdxSaps : Number of RLC UDX Saps
521 * - rlcKwuDlSap : Pointer to the array of KWU SAPS
522 * - udxDlSap : Pointer to the array of UDX SAPS
523 * - rguDlSap : RGU Sap Control Block
524 * - cellLstCp : Hashlist of CellCb
525 * - ueLstCp : Hashlist of UeCb
526 * - toBeFreed : Pointer to data to be freed
527 * - shutdownReveived : Request for shutdown recevied or not
528 * - eventInQueue : Event for cleanup exists in queue or not
530 typedef struct rlcDlCb
532 uint8_t numKwuSaps; /*!< Number of RLC Data Saps */
533 uint8_t numUdxSaps; /*!< Number of RLC Data Saps */
534 RlcKwuSapCb *rlcKwuDlSap; /*!< KWU Sap Control Block */
535 RlcUdxDlSapCb *udxDlSap; /*!< UDX DL Sap Control Block */
536 RlcRguSapCb *rguDlSap; /*!< RGU Sap Control Block */
537 CmHashListCp cellLstCp; /*!< Hashlist of CellCb */
538 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
539 RlcDlDataToBeFreed toBeFreed; /*!< Pointer to data to be freed */
540 Pst selfPst; /*!< Pst to post events to self */
541 Buffer *selfPstMBuf; /*!< Buffer used for self post */
542 Bool shutdownReceived; /*!< Request for shutdown recevied */
543 Bool eventInQueue; /*!< Event exists in queue or not */
545 RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
546 #endif /* LTE_L2_MEAS */
550 * @brief Structure to hold an information about UL RLC instance
553 * - ckwSap : CKW Sap Conrol Block
554 * - numKwuSaps : Number of RLC KWU Saps
555 * - numUdxSaps : Number of RLC UDX Saps
556 * - udxUlSap : Pointer to the array of UDX SAPS
557 * - rlcKwuUlSap : Pointer to the array of KWU SAPS
558 * - rguUlSap : RGU Sap Control Block
559 * - cellLstCp : Hashlist of CellCb
560 * - ueLstCp : Hashlist of UeCb
561 * - transIdLstCp : Hashlist of cfg trans
563 typedef struct rlcUlCb
565 RlcCkwSapCb ckwSap; /*!< CKW Sap Conrol Block */
566 uint8_t numKwuSaps; /*!< Number of RLC Data Saps */
567 uint8_t numUdxSaps; /*!< Number of RLC Data Saps */
568 RlcUdxUlSapCb *udxUlSap; /*!< UDX DL Sap Control Block */
569 RlcKwuSapCb *rlcKwuUlSap; /*!< KWU Sap Control Block */
570 RlcRguSapCb *rguUlSap; /*!< RGU Sap Control Block */
571 CmHashListCp cellLstCp; /*!< Hashlist of CellCb */
572 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
573 CmHashListCp transIdLstCp; /*!< Hashlist of cfg trans */
574 uint8_t rlcUlUdxEventType; /*!<Ue Create/ReConfig> */
575 /* kw005.201 added support for L2 Measurement */
577 RlcL2Cb rlcL2Cb; /*!< Control Block for L2 Measurements in RLC */
578 #endif /* LTE_L2_MEAS */
583 * @brief Structure to hold an information about a RLC instance
586 * - init : Task Initialization Info
587 * - genCfg : General Configuration
588 * - genSts : General Statistics
589 * - trcLen : Trace Length
590 * - trcMask : Trace Mask
591 * - rlcTq : Timer queue
592 * - rlcTqCp : Timer queue control point
593 * - u : Union depending on whether the instance is UL or DL
594 * - ulCb : UL instance Control Block
595 * - dlCb : DL instance Control Block
599 TskInit init; /*!< Task Initialization Info */
600 RlcGenCfg genCfg; /*!< General Configuration Structure */
601 RlcGenSts genSts; /*!< General Statistics */
602 S16 trcLen; /*!< Trace Length */
603 uint8_t trcMask; /*!< Trace Mask */
604 CmTqType rlcTq[RLC_TMR_LEN]; /*!< Timer queue */
605 CmTqCp rlcTqCp; /*!< Timer queue control point */
608 RlcUlCb *ulCb; /*!< Ul Control Block */
609 RlcDlCb *dlCb; /*!< Dl Control Block */
611 uint8_t dlSduId; /*!< Downlink SDU ID */
614 RlcCb *rlcCb[MAX_RLC_INSTANCES]; /*!< RLC global control block */
616 /****************************************************************************
618 ***************************************************************************/
619 S16 rlcGetSId ARGS((SystemId *s));
621 Void rlcTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
623 S16 rlcLmmSendTrc ARGS ((RlcCb *gCb, Event event, Buffer *mBuf));
625 void rlcStartTmr ARGS((RlcCb *gCb, PTR cb, S16 tmrEvnt));
627 void rlcStopTmr ARGS((RlcCb *gCb, PTR cb, uint8_t tmrType));
629 bool rlcChkTmr ARGS((RlcCb *gCb,PTR cb, S16 tmrEvnt));
632 Void rlcLmmSendAlarm ARGS (( RlcCb *gCb,
640 S16 RlcMiRlcDlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
641 S16 RlcMiRlcDlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
642 S16 RlcMiRlcDlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
643 S16 RlcMiRlcUlL2MeasReq ARGS (( Pst *pst, RlcL2MeasReqEvt *measReqEvt ));
644 S16 RlcMiRlcUlL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
645 S16 RlcMiRlcUlL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
646 Void rlcUtlPlcMeasDatInL2Sts ARGS((RlcL2Cntr *measData,
647 RlcL2MeasRbCb *rbL2Cb,
649 #else /* LTE_L2_MEAS */
650 Void rlcLmmSendAlarm ARGS ((RlcCb *gCb,
656 #endif /* LTE_L2_MEAS */
660 #endif /* __cplusplus */
665 /********************************************************************30**
668 **********************************************************************/