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 U32 KwSn; /*!< 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
54 U32 numDLNacksInStaPdu;
56 U32 numDLPollTimerExpiresSrb;
57 U32 numDLPollTimerExpiresDrb;
60 U32 numULPdusDiscarded;
61 U32 numULReOrdTimerExpires;
63 U32 numULNackInStaPduRcvd;
64 U32 numRlcAmCellSduTx; /* Count of SDUs transmitted in DL for all UEs */
65 U32 numRlcAmCellSduBytesTx; /*Total number of bytes transmitted in DL for all Ues */
66 U32 numRlcAmCellRetxPdu; /*Count of PDUs retransmitted for all Ues */
67 U32 numRlcAmMaxRetx; /*Total number of Max-RLC retransmissions hit for all the Ues */
68 U32 numRlcAmCellDupPduRx; /*Count of Duplicate PDUs detected for a UE in UL for all Ues */
69 U32 numRlcAmCellDropOutWinRx; /*Count of PDUs dropped due to Out of Window reception for all Ues */
70 U32 numRlcAmCellSduRx; /* Count of SDUs received in UL for all UEs*/
71 U32 numRlcAmCellSduBytesRx;/*Total number of bytes received in UL for all Ues*/
72 U32 numRlcAmCellNackRx; /*Total number of UL PDUs nacked for all the Ues*/
73 U32 numRlcAmCellWinStall; /*Number of window stalls detected for all the Ues */
76 typedef struct _umRlcStats
80 U32 numULPdusDiscarded;
81 U32 numULReOrdTimerExpires;
82 U32 numULPdusOutsideWindow;
85 typedef struct _rlcStats
87 AMRLCStats amRlcStats;
88 UMRLCStats umRlcStats;
91 EXTERN RLCStats gRlcStats;
93 /* kw005.201 added support for L2 Measurement */
95 typedef struct kwSduSnMap KwSduSnMap;
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 kwUmHdr
113 U8 fi; /*!< Framing Info */
114 KwSn sn; /*!< Sequence number */
115 U16 numLi; /*!< Number of LIs */
116 U16 li[KW_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 kwAmHdr
136 U8 dc; /*!< Data/Control PDU */
137 U8 p; /*!< Poll bit */
138 U8 si; /*!< Segmentation Info: 5GNR */
139 KwSn sn; /*!< Sequence number */
140 U32 so; /*!< Segment offset */
143 /* structures used for encoding/decoding the headers */
144 typedef struct kwCntrlInfo
155 typedef struct kwHdrInfo
166 typedef struct kwExtHdr
175 * @brief Structure to hold information about a Logical channel
178 * - lChId : Logical channel Id
179 * - lChType : Logical channel type
181 typedef struct kwLchInfo
183 CmLteLcId lChId; /*!< Logical channel Id */
184 CmLteLcType lChType; /*!< Logical channel type */
187 /* kw005.201 added support for L2 Measurement */
192 typedef struct kwL2Cntr
196 U32 numActvUe; /*!< number of active Ue */
197 U32 sampOc; /*!< Total number of sampling occasion */
201 U32 dLoss; /*!< Total number of lost packets */
202 U32 posPkts; /*!< Total number of positively acknowlegded
205 struct /*!< For DL IP throughput */
207 U32 volSummation; /*!< Sum of data in bytes */
208 U32 timeSummation; /*!< Sum of time difference in milli sec*/
210 struct /*!< For UL IP throughput */
212 U32 volSummation; /*!< Sum of data in bytes */
213 U32 timeSummation; /*!< Sum of time difference in milli sec*/
215 /* Discard new changes starts */
216 struct /*!< For UL IP throughput */
218 U32 discSdus; /*!< Total RLC SDUs discarded */
219 U32 totSdus; /*!< Total RLC SDUs received */
221 struct /*!< For UL IP throughput */
223 U64 sduDelay; /*!< Total SDUs delay */
226 U32 totDrbsPerQci; /*!< Total Count of DRB's for this QCI */
236 U16 snList[KW_MAX_PDU_MAP];
242 typedef struct kwSnSduMap
245 CmLteLcId lChId; /*!< Logical channel Id */
248 Bool isBurstSplitted; /*!< true: burst for this LCH is splitted */
249 #endif /* LTE_RLC_R9 */
250 KwSduSnMap *sduList[KW_MAX_DL_LI];
253 typedef struct kwTbSnMap
255 CmHashListEnt hlTbEnt;
259 KwSnSduMap snSduMap[RGU_MAX_PDU * RGU_MAX_LC];
262 typedef struct kwL2MeasCbUeMeasInfo
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 U8 numLcId; /*!< Holds the number of LCh for which Ul Ip
271 U8 lcId[KW_MAX_LCH_PER_UE]; /*!< Holds the list of LCh for which Ul ip
273 KwL2Cntr measData[LKW_MAX_QCI];
274 U16 numQci; /*!< number of valid qcI */
275 U8 qci[LKW_MAX_QCI]; /*!< list of valid qcI */
276 }KwL2MeasCbUeMeasInfo;
278 typedef struct kwL2MeasCbIpThMeas
282 U8 totQci[LKW_MAX_QCI];
283 KwL2MeasCbUeMeasInfo ueInfoLst[LKW_MAX_UE]; /*Added for handling meas for multiple ues*/
286 typedef struct kwL2MeasCbNonIpThMeas
288 U16 numSamples; /*!< Number of samples to take on numActUe */
289 U16 numQci; /*!< number of valid qcI */
290 U8 qci[LKW_MAX_QCI]; /*!< list of valid qcI */
291 KwL2Cntr measData[LKW_MAX_QCI]; /*!< Measurement CB */
292 }KwL2MeasCbNonIpThMeas;
294 typedef union kwL2MeasCbIpNonIpThMeasVal
296 KwL2MeasCbIpThMeas ipThMeas;
297 KwL2MeasCbNonIpThMeas nonIpThMeas;
298 }KwL2MeasCbIpNonIpThMeasVal;
300 /** @struct KwL2MeasCb
301 * RLC L2 Measurement CB */
302 typedef struct kwL2MeasCb
304 U8 measType; /*!< Bit-wise set measurement types */
305 KwL2MeasCbIpNonIpThMeasVal val; /* Union of IP tpt or non-ip tpt */
308 /** @struct KwL2MeasEvtCb
309 * RLC L2 Measurement Evt CB */
310 typedef struct kwL2MeasEvtCb
312 U32 transId; /*!< TransId of Measurement Req */
313 U32 cbIdx; /*!< TransId of Measurement Req */
314 CmTimer l2Tmr; /* NOT USED */ /*!< L2 Timer per request */
315 TmrCfg l2TmrCfg; /* NOT USED */ /*!< Time period of measurement */
316 KwL2MeasCb measCb; /*!< Measurement CB */
317 EpcTime startTime; /* NOT USED */ /*!< start time when meas starts*/
320 /** @struct KwL2MeasRbCb
321 * RLC L2 Measurement Rb CB */
322 typedef struct kwL2MeasRbCb
324 U8 measOn; /*!< Measurements that are running */
325 KwL2Cntr *l2Sts[KW_MAX_L2MEAS_EVT]; /*!< L2 Mesurement statistics */
330 typedef struct kwL2Cb
332 U16 kwNumMeas; /*!< Number of measurements going on */
333 KwL2MeasEvtCb kwL2EvtCb[LKW_MAX_L2MEAS]; /*!< Pointers to Measurement Cb */
334 U8 measOn[LKW_MAX_QCI]; /*!< Measurement on */
335 U32 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 kwL2MeasSduLst
349 * Structure to hold parameters of
350 * burst sdus in DL for a RB */
351 typedef struct kwOutStngSduInfo
353 U32 sduId; /*!< SDU Id of sdu */
354 MsgLen sduLen; /*!< Size of sdu */
355 U32 numTb; /*!< Hold the number of TBs for this sdu in DL */
359 * @struct kwL2MeasDlIpTh
360 * Structure to hold parameters for DL ip
361 * throughput for a RB */
362 typedef struct kwL2MeasDlIpTh
364 Bool isBurstAct; /*!< Set to TRUE when burst is active in DL */
365 U64 burstStartTime; /*!< Holds the starting time of the burst */
366 U32 burstEndSduId; /*!< Sdu ID when burst ends */
367 U8 lastSduIdx; /*!< Holds the index of last outStanding sdu */
368 KwOutStngSduInfo outStngSduArr[KW_L2MEAS_MAX_OUTSTNGSDU];/*!< Hold the burst sdu information */
372 * @struct kwL2MeasIpThruput
373 * Structure to hold parameters for UL/DL ip
374 * throughput for a RB */
375 typedef struct kwL2MeasIpThruput
377 U32 dataVol; /*!< Holds volume of new data in bytes
378 for UL IP throughput */
379 U32 ttiCnt; /*!< Holds ttiCnt received from MAC in UL */
380 U32 prevTtiCnt; /*!< Holds previous ttiCnt received from MAC in UL */
381 KwL2MeasDlIpTh dlIpTh;
384 #endif /* LTE_L2_MEAS */
387 * @brief Structure to hold an UE key for the UE hast lists
393 typedef struct kwUeKey
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 kwCkwSapCb
411 Pst pst; /*!< Service user post structure */
412 SpId spId; /*!< Service provider Id */
413 SuId suId; /*!< Service user Id */
414 U8 state; /*!< Sap Status */
415 KwCkwCntSts 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 kwKwuSapCb
430 Pst pst; /*!< Service user post structure */
431 SpId spId; /*!< Service provider Id */
432 SuId suId; /*!< Service user Id */
433 U8 state; /*!< Sap Status */
434 KwKwuSapSts 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 kwRguSapCb
451 Pst pst; /*!< Service user post structure */
452 SpId spId; /*!< Service provider Id */
453 SuId suId; /*!< Service user Id */
454 U8 state; /*!< Sap Status */
455 CmTimer bndTmr; /*!< Bind Timer */
456 U16 bndTmrInt; /*!< Timer Interval */
457 U8 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 kwUdxUlSapCb
474 Pst pst; /*!< Service user post structure */
475 SpId spId; /*!< Service provider Id */
476 SuId suId; /*!< Service user Id */
477 U8 state; /*!< Sap Status */
478 CmTimer bndTmr; /*!< Bind Timer */
479 U16 bndTmrInt; /*!< Timer Interval */
480 U8 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 kwUdxDlSapCb
494 Pst pst; /*!< Service user post structure */
495 SpId spId; /*!< Service provider Id */
496 SuId suId; /*!< Service user Id */
497 U8 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 kwDlDataToBeFreed
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 * - kwuDlSap : 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 _kwDlCb
535 U8 numKwuSaps; /*!< Number of RLC Data Saps */
536 U8 numUdxSaps; /*!< Number of RLC Data Saps */
537 KwKwuSapCb *kwuDlSap; /*!< KWU Sap Control Block */
538 KwUdxDlSapCb *udxDlSap; /*!< UDX DL Sap Control Block */
539 KwRguSapCb *rguDlSap; /*!< RGU Sap Control Block */
540 CmHashListCp cellLstCp; /*!< Hashlist of CellCb */
541 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
542 KwDlDataToBeFreed 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 KwL2Cb kwL2Cb; /*!< 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 * - kwuUlSap : 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 _kwUlCb
568 KwCkwSapCb ckwSap; /*!< CKW Sap Conrol Block */
569 U8 numKwuSaps; /*!< Number of RLC Data Saps */
570 U8 numUdxSaps; /*!< Number of RLC Data Saps */
571 KwUdxUlSapCb *udxUlSap; /*!< UDX DL Sap Control Block */
572 KwKwuSapCb *kwuUlSap; /*!< KWU Sap Control Block */
573 KwRguSapCb *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 /* kw005.201 added support for L2 Measurement */
579 KwL2Cb kwL2Cb; /*!< Control Block for L2 Measurements in RLC */
580 #endif /* LTE_L2_MEAS */
585 * @brief Structure to hold an information about a RLC instance
588 * - init : Task Initialization Info
589 * - genCfg : General Configuration
590 * - genSts : General Statistics
591 * - trcLen : Trace Length
592 * - trcMask : Trace Mask
593 * - kwTq : Timer queue
594 * - kwTqCp : Timer queue control point
595 * - u : Union depending on whether the instance is UL or DL
596 * - ulCb : UL instance Control Block
597 * - dlCb : DL instance Control Block
601 TskInit init; /*!< Task Initialization Info */
602 KwGenCfg genCfg; /*!< General Configuration Structure */
603 KwGenSts genSts; /*!< General Statistics */
604 S16 trcLen; /*!< Trace Length */
605 U8 trcMask; /*!< Trace Mask */
606 CmTqType kwTq[KW_TMR_LEN]; /*!< Timer queue */
607 CmTqCp kwTqCp; /*!< Timer queue control point */
610 KwUlCb *ulCb; /*!< Ul Control Block */
611 KwDlCb *dlCb; /*!< Dl Control Block */
615 EXTERN KwCb *kwCb[KW_MAX_RLC_INSTANCES]; /*!< RLC global control block */
617 /****************************************************************************
618 * EXTERN Declarations
619 ***************************************************************************/
620 EXTERN S16 kwGetSId ARGS((SystemId *s));
622 EXTERN Void kwTmrExpiry ARGS((PTR cb, S16 tmrEvnt));
624 EXTERN S16 kwLmmSendTrc ARGS ((KwCb *gCb, Event event, Buffer *mBuf));
626 EXTERN Void kwStartTmr ARGS((KwCb *gCb, PTR cb, S16 tmrEvnt));
628 EXTERN Void kwStopTmr ARGS((KwCb *gCb, PTR cb, U8 tmrType));
630 EXTERN Bool kwChkTmr ARGS((KwCb *gCb,PTR cb, S16 tmrEvnt));
633 EXTERN Void kwLmmSendAlarm ARGS (( KwCb *gCb,
641 EXTERN S16 KwMiLkwDlL2MeasReq ARGS (( Pst *pst, KwL2MeasReqEvt *measReqEvt ));
642 EXTERN S16 KwMiLkwDlL2MeasSendReq ARGS((Pst *pst,U8 measType));
643 EXTERN S16 KwMiLkwDlL2MeasStopReq ARGS((Pst *pst,U8 measType));
644 EXTERN S16 KwMiLkwUlL2MeasReq ARGS (( Pst *pst, KwL2MeasReqEvt *measReqEvt ));
645 EXTERN S16 KwMiLkwUlL2MeasSendReq ARGS((Pst *pst,U8 measType));
646 EXTERN S16 KwMiLkwUlL2MeasStopReq ARGS((Pst *pst,U8 measType));
647 EXTERN Void kwUtlPlcMeasDatInL2Sts ARGS((KwL2Cntr *measData,
648 KwL2MeasRbCb *rbL2Cb,
650 #else /* LTE_L2_MEAS */
651 EXTERN Void kwLmmSendAlarm ARGS ((KwCb *gCb,
657 #endif /* LTE_L2_MEAS */
661 #endif /* __cplusplus */
666 /********************************************************************30**
669 **********************************************************************/