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: LKW RLC Layer Manager Interface
25 Desc: This file Contains the Data structures and prototypes
30 *********************************************************************21*/
37 #endif /* __cplusplus */
41 General Configuration Structure. */
42 typedef struct rlcGenCfg
44 Pst lmPst; /*!< Post structure for communicating
46 uint32_t maxUe; /*!< Maximum number of UEs supported
48 uint16_t maxKwuSaps; /*!< Maximum KWU SAPs. */
49 /* Supported by SPLIT Architecture */
50 uint16_t maxUdxSaps; /*!< Maximum Udx SAPs. */
51 /* Supported by SPLIT Architecture ends */
52 Ticks timeRes; /*!< Time resolution. */
53 /* Supported by SPLIT Architecture */
54 uint8_t rlcMode; /*!< RLC_DL or RLC_UL */
55 /* Supported by SPLIT Architecture ends */
56 uint16_t maxRguSaps; /*!< Maximum RGU SAPs. */
60 SAP Configuration Structure */
61 typedef struct rlcSapCfg
63 Selector selector; /*!< Selector for LC/TC. */
64 MemoryId mem; /*!< Region and pool. */
65 ProcId procId; /*!< Processor ID. */
66 Ent ent; /*!< Entity ID. */
67 Inst inst; /*!< Instance ID. */
68 SpId sapId; /*!< SAP ID. */
69 uint16_t bndTmrIntvl; /*!< Bind timer interval. */
70 Priority priority; /*!< Priority. */
71 Route route; /*!< Route. */
75 * Configuration Structure
81 RlcGenCfg gen; /*!< General configuraton. */
82 RlcSapCfg sap; /*!< SAP configuration. */
87 General Statistics Structure */
88 typedef struct rlcGenSts
90 CntrSts numUe; /*!< Total number of UEs. */
91 CntrSts pdusRecv; /*!< Number of PDUs received. */
92 CntrSts pdusSent; /*!< Number of PDUs sent. */
93 CntrSts pdusRetx; /*!< Number of PDUs retransmitted. */
94 CntrSts bytesRecv; /*!< Number of bytes received. */
95 CntrSts bytesSent; /*!< Number of bytes sent. */
96 CntrSts unexpPdusRecv; /*!< Unexpected PDU received. */
97 CntrSts errorPdusRecv; /*!< Format error pdus received. */
98 CntrSts protTimeOut; /*!< Number of protocol time outs leading
100 CntrSts numOfRb; /*!< Total number of RBs in RLC. */
101 CntrSts numSduDisc; /*!< Number of SDUs discarded. */
105 RLC Upper SAP statistics */
106 typedef struct rlcKwuSapSts
108 /* lkw_x_001.main_2, changed from suId to spId */
109 SpId spId; /*!< Service Provider ID. */
110 CntrSts sduRx; /*!< Number of SDUs received. */
111 CntrSts sduTx; /*!< Number of tranxmitted SDUs. */
115 RRC Control SAP Statistics */
116 typedef struct rlcCkwCntSts
118 CntrSts statMsgs; /*!< Number of Status Messages send. */
122 Statistics Structure */
123 typedef struct rlcSts
125 DateTime dt; /*!< Date and Time structure. */
128 RlcGenSts gen; /*!< General Statistics. */
129 RlcKwuSapSts rlckwuSap; /*!< RLC upper SAP statistics. */
130 RlcCkwCntSts ckwSap; /*!< RRC control SAP. */
135 MAC Upper SAP Status Structure */
136 typedef struct rlcRguSapSta
138 SuId suId; /*!< Service user ID. */
139 State state; /*!< State of the SAP. */
143 RLC Upper SAP Status Structure */
144 typedef struct rlcKwuSapSta
146 SpId spId; /*!< Service provider ID. */
147 State state; /*!< State of the SAP. */
151 RRC Control SAP Status Structure */
152 typedef struct rlcCkwCntSapSta
154 SpId spId; /*!< Service provider ID. */
155 State state; /*!< State of the SAP. */
160 typedef struct rlcSSta
162 DateTime dt; /*!< Date and Time structure. */
165 SystemId sysId; /*!< System ID. */
166 RlcRguSapSta rguSap; /*!< RLC lower SAP (MAC) status. */
167 RlcKwuSapSta rlckwuSap; /*!< RLC Upper SAP status. */
168 RlcCkwCntSapSta ckwSap; /*!< RRC Control SAP Status. */
173 Trace Control Structure */
174 typedef struct rlcTrcCntrl
176 uint8_t trcMask; /*!< Trace mask. */
177 S16 trcLen; /*!< Trace length. */
181 Debug Control Structure */
182 typedef struct rlcDbgCntrl
184 uint32_t dbgMask; /*!< Debug mask. Assign non zero value to enable
185 and zero to disable debug */
189 SAP Control Structure */
190 typedef struct rlcSapCntrl
192 SuId suId; /*!< Service user ID. */
193 SpId spId; /*!< Service provider ID. */
198 typedef struct rlcCntrl
200 DateTime dt; /*!< Date and Time structure. */
201 uint8_t action; /*!< Action. */
202 uint8_t subAction; /*!< Sub action. */
205 RlcTrcCntrl trcCntrl; /*!< Trace Control Structure. */
206 RlcDbgCntrl dbgCntrl; /*!< Debug Control Structure. */
207 RlcSapCntrl sapCntrl; /*!< SAP Control Structure. */
209 uint32_t logMask; /*!< Logging Control Structure. */
215 Unsolicited Status Structure */
216 typedef struct rlcUSta
218 DateTime dt; /*!< Date and Time structure. */
219 CmAlarm alarm; /*!< Alarm. */
220 SuId suId; /*!< Service user ID. */
221 uint32_t ueId; /*!< Urnti UE ID. */
222 /* lkw_x_001.main_2, added support for L2 measurement */
224 uint8_t qci; /*!< Qci value */
230 typedef struct rlcTrc
232 DateTime dt; /*!< Date and Time structure. */
233 uint16_t event; /*!< Event. Events defined in the differenct RLC
234 interfaces are pssible values here.*/
238 Layer Management Structure */
239 typedef struct rlcMngmt
241 Header hdr; /*!< Common header. */
242 CmStatus cfm; /*!< Status of confirmation. */
245 RlcCfg cfg; /*!< General Configuration. */
246 RlcCntrl cntrl; /*!< Control Structure. */
247 RlcSts sts; /*!< Statistics. */
248 RlcSSta ssta; /*!< Status. */
249 RlcUSta usta; /*!< Unsolicited Status. */
250 RlcTrc trc; /*!< Trace Structre. */
254 /* lkw_x_001.main_2, added support for L2 measurement */
257 /** @brief Measurement Request Params Structure. */
258 typedef struct rlcL2MeasReqInfo
260 uint8_t measType; /*!< Measurement type, bit 1 to 4 (LSB nibble)
261 will be used for non IP Throughput and
262 bit 5 and 6 will be used for DL and UL
263 Ipthroughput respectively */
268 uint16_t numSamples; /*!<Sampling period: */
269 uint8_t numQci; /*!<number of qCI to take measurement for */
270 uint8_t qci[LKW_MAX_QCI]; /*!<QCI for the measurement */
278 uint8_t numQci; /*!<number of qCI to take measurement for */
279 uint8_t qci[LKW_MAX_QCI]; /*!<QCI for the measurement */
280 CmLteRnti ueId; /*!< UE ID (Used only for IP Throughput in UL/DL */
281 CmLteCellId cellId; /*!< Cell ID (Used only for IP Throughput in UL/DL */
282 }ueInfoLst[LKW_MAX_UE];
288 /** @brief Measurement Request Exvent Structure. */
289 typedef struct rlcL2MeasReqEvt
291 uint32_t transId; /*!< Transaction Identifier */
292 uint16_t measPeriod; /*!< Measurement Period */
293 RlcL2MeasReqInfo measReq; /*!< Measurement request structure */
296 /** @brief Measurement Confirm Params Structure. */
297 typedef struct rlcL2MeasCfmInfo
299 uint8_t qci; /*!< QCI value */
304 uint32_t numActUe; /*!< num of Active UEs*/
305 uint32_t uuLoss; /*!< Uu Loss Rate */
306 /* Discard new changes starts */
307 uint32_t dlDiscRate; /*!< DL Discard rate to be reported */
308 /* Discard new changes ends */
312 struct /*!< Structure for IP throughput*/
314 F32 dlIpThPut; /*!< Scheduled DL IP throughput */
315 F32 ulIpThPut; /*!< Scheduled UL IP throughput */
321 typedef struct rlcL2MeasCfmUeInfoLst
323 CmLteRnti ueId; /*!< UE Id used for DL/UL Ipthroughput*/
324 CmLteCellId cellId; /*!< Cell Id used for DL/UL Ipthroughput*/
325 RlcL2MeasCfmInfo measCfm[LKW_MAX_QCI]; /*!< Measurement confirm structure*/
326 uint16_t numCfm; /*!< Number of Measurement confirm*/
327 }RlcL2MeasCfmUeInfoLst;
329 typedef struct rlcL2MeasCfmIpThMeas
331 uint16_t numUes; /*!< Number of Ue Info*/
332 RlcL2MeasCfmUeInfoLst ueInfoLst[LKW_MAX_UE]; /*!< UE info list*/
333 }RlcL2MeasCfmIpThMeas;
335 typedef struct rlcL2MeasCfmNonIpThMeas
337 uint16_t numCfm; /*!< Number of confirm */
338 RlcL2MeasCfmInfo measCfm[LKW_MAX_QCI]; /*!< Confirmation info */
339 }RlcL2MeasCfmNonIpThMeas;
341 typedef union kwL2MeasCfmIpNonIp
343 RlcL2MeasCfmIpThMeas ipThMeas; /*!< Ip thrupt measurements*/
344 RlcL2MeasCfmNonIpThMeas nonIpThMeas; /*!< Non-Ip thrupt measurements*/
345 }RlcL2MeasCfmIpNonIp;
347 /** @brief Measurement Confirm Event Structure. */
348 typedef struct rlcL2MeasCfmEvt
350 uint32_t transId; /*!< Transaction id */
351 CmStatus status; /*!< Status is for all QCIs */
352 uint8_t measType; /*!< Measurement type, bit 1 to 4 (LSB nibble)
353 will be used for non IP Throughput and
354 bit 5 and 6 will be used for DL and UL
355 Ipthroughput respectively. It is same for
356 all qci in this Cfm event. */
357 RlcL2MeasCfmIpNonIp val;
360 #endif /* LTE_L2_MEAS */
362 /* Control primitives towards NR RLC */
363 /* Pointer functions to pack/unpack primitives */
364 typedef uint8_t (*RlcConfigReq) ARGS((Pst *pst, RlcMngmt *cfg));
365 typedef uint8_t (*RlcConfigCfm) ARGS((Pst *pst, RlcMngmt *cfgCfm));
367 typedef uint8_t (*LkwCntrlReq) ARGS((Pst *pst, RlcMngmt *cntl));
368 typedef uint8_t (*LkwCntrlCfm) ARGS((Pst *pst, RlcMngmt *cntlCfm));
370 typedef S16 (*LkwStaInd) ARGS((Pst *pst, RlcMngmt *staInd));
371 typedef S16 (*LkwStaReq) ARGS((Pst *pst, RlcMngmt *staReq));
372 typedef S16 (*LkwStaCfm) ARGS((Pst *pst, RlcMngmt *staCfm));
374 typedef S16 (*LkwStsReq) ARGS((Pst *pst, Action, RlcMngmt *sts));
375 typedef S16 (*LkwStsCfm) ARGS((Pst *pst, Action, RlcMngmt *stsCfm));
377 typedef S16 (*LkwTrcInd) ARGS((Pst *pst, RlcMngmt *trc, Buffer *mBuf));
379 /* lkw_x_001.main_2, added support for L2 measurement */
381 typedef S16 (*LkwL2MeasReq) ARGS((Pst *pst, RlcL2MeasReqEvt *measEvt));
382 typedef S16 (*LkwL2MeasCfm) ARGS((Pst *pst, RlcL2MeasCfmEvt *measEvt));
383 typedef S16 (*LkwL2MeasSendReq) ARGS((Pst *pst, uint8_t measType));
384 typedef S16 (*LkwL2MeasStopReq) ARGS((Pst *pst, uint8_t measType));
385 typedef S16 (*LkwL2MeasStopCfm) ARGS((Pst *pst, uint8_t measType,uint8_t status));
386 #endif /* LTE_L2_MEAS */
388 /* Layer primitives */
389 /** @details This function processes configuration requests received from the layer manager.The configuration requests are general configuration, or configuration of RGU, KWU, and CKW SAPs. The type of the configuration request is determined from the elmId field in the header of the layer manager message.This function is called by the layer manager to configure RLC.
391 @param[in] pst - Pointer to post structure
392 @param[in] cfg - Configuration management structure
393 @return ROK if success , RFAILED if failure
396 uint8_t RlcMiRlcConfigReq ARGS((Pst *pst, RlcMngmt *cfg));
399 @details This function is called by the RlcMiRlcConfigReq function for responding to configuration requests.The cfm field in the RlcMngmt structure contains the response value.
401 @param[in] pst - Pointer to post structure
402 @param[in] cfm - Configuration management structure
403 @return ROK if success , RFAILED if failure
405 S16 RlcMiRlcConfigCfm ARGS((Pst *pst, RlcMngmt *cfgCfm));
409 The layer manager initiates and uses the management-control procedure to control
410 RLC elements.The RLC control request primitive (RlcMiLkwCntrlReq) is called
411 more than once and at any time after the management-configuration procedure.The
412 control request primitive is confirmed by a RlcMiLkwCntrlCfm primitive.
414 @param[in] pst - Pointer to post structure
415 @param[in] cntl - Configuration management structure
416 @return ROK if success , RFAILED if failure
418 uint8_t RlcMiLkwCntrlReq ARGS((Pst *pst, RlcMngmt *cntl));
422 This function is called by the RlcMiLkwCntrlReq function to send a control confirm to the layer management module.
424 @param[in] pst - Pointer to post structure
425 @param[in] cfm - Configuration management structure
426 @return ROK if success , RFAILED if failure
428 S16 RlcMiLkwCntrlCfm ARGS((Pst *pst, RlcMngmt *cntlCfm));
432 This function processes solicited status requests received from the layer manager.The layer manager can request status information regarding the system ID, RGSA
435 @param[in] pst - Pointer to post structure
436 @param[in] cfg - Configuration management structure
437 @return ROK if success , RFAILED if failure
439 S16 RlcMiLkwStaReq ARGS((Pst *pst, RlcMngmt *staInd));
443 This function is called by the RlcMiLkwStaReq function to send the requested stat
444 us information to the layer manager.
446 @param[in] pst - Pointer to post structure
447 @param[in] stacfm - Configuration management structure
448 @return ROK if success , RFAILED if failure
450 S16 RlcMiLkwStaCfm ARGS((Pst *pst, RlcMngmt *staCfm));
454 This function processes statistics requests received from the layer manager. After collecting the statistics, this function calls the statistics confirm function to send the statistics to the layer manager.
456 @param[in] pst - Pointer to post structure
457 @param[in] acton - action
458 @param[in] sts - Configuration management structure
459 @return ROK if success , RFAILED if failure
461 S16 RlcMiLkwStsReq ARGS((Pst *pst, Action, RlcMngmt *sts));
464 This function is called by the RlcMiLkwStsReq function for responding to statisti
467 @param[in] pst - Pointer to post structure
468 @param[in] action - action
469 @param[in] cfg - Configuration management structure
470 @return ROK if success , RFAILED if failure
472 S16 RlcMiLkwStsCfm ARGS((Pst *pst, Action action, RlcMngmt *stsCfm));
475 This function is used by RLC module to send unsolicited trace indications to
476 the layer manager, when tracing is enabled by the layer manager through a previous control request.
478 @param[in] pst - Pointer to post structure
479 @param[in] cfg - Configuration management structure
480 @param[in] buf - buffer
481 @return ROK if success , RFAILED if failure
483 S16 RlcMiLkwTrcInd ARGS ((Pst *pst, RlcMngmt *trc, Buffer *mBuf));
486 @details This function is used by RLC to send unsolicited status information to the layer manager, when the unsolicited status flag is enabled by the layer manager through a previous control request.
488 @param[in] pst - Pointer to post structure
489 @param[in] staReq - Configuration management structure
490 @return ROK if success , RFAILED if failure
492 /* lkw_x_001.main_2, added support for L2 measurement */
495 @details This function is called by the Layer Manger function to request
496 for Measurement responding to statisti cs requests.
498 @param[in] pst - Pointer to post structure
499 @param[in] measEvt - Measurement Request structure
500 @return ROK if success , RFAILED if failure
502 S16 RlcMiLkwL2MeasReq ARGS((Pst *pst, RlcL2MeasReqEvt *measEvt));
503 S16 RlcMiLkwL2MeasStopReq ARGS((Pst *pst,uint8_t measType));
504 S16 RlcMiLkwL2MeasSendReq ARGS((Pst *pst,uint8_t measType));
506 @details This function can be used by PDCP to send the measurement values
507 after doing L2 measurement that was requested by the layer manager.
509 @param[in] pst - Pointer to post structure
510 @param[in] measEvt - Measurement confirmation structure
511 @return ROK if success , RFAILED if failure
513 S16 RlcMiLkwL2MeasCfm ARGS((Pst *pst, RlcL2MeasCfmEvt *measCfm));
514 S16 RlcMiLkwL2MeasStopCfm ARGS((Pst *pst, uint8_t measType, uint8_t status));
515 #endif /* LTE_L2_MEAS */
517 S16 RlcMiLkwStaInd ARGS((Pst *pst, RlcMngmt *staReq));
519 Void rlcSendLmAlarm ARGS ((
527 S16 SmMiRlcConfigCfm ARGS((
532 S16 SmMiLkwCntrlCfm ARGS((
537 S16 SmMiLkwStaInd ARGS((
542 S16 SmMiLkwStaCfm ARGS((
547 S16 SmMiLkwStsCfm ARGS((
553 S16 SmMiLkwTrcInd ARGS((
559 S16 SmMiLkwStsReq ARGS((
565 S16 SmMiLkwStaReq ARGS((
570 S16 SmMiLkwCntrlReq ARGS((
575 S16 SmMiRlcConfigReq ARGS((
580 /* lkw_x_001.main_2, added support for L2 measurement */
582 S16 SmMiLkwL2MeasReq ARGS((
586 S16 SmMiLkwL2MeasStopReq ARGS((
591 S16 SmMiLkwL2MeasSendReq ARGS((
595 S16 SmMiLkwL2MeasCfm ARGS((
599 S16 SmMiLkwL2MeasStopCfm ARGS((
604 #endif /* LTE_L2_MEAS */
607 S16 smKwActvInit ARGS((Ent ent, Inst inst, Region region, Reason reason));
608 S16 smKwActvTsk ARGS((Pst *pst, Buffer *mBuf));
610 /* pack/unpack functions */
612 S16 packRlcConfigReq ARGS((
617 uint8_t packRlcConfigCfm ARGS((
623 S16 cmPkLkwCntrlReq ARGS((
628 uint8_t cmPkLkwCntrlCfm ARGS((
633 S16 cmPkLkwStaInd ARGS((
638 S16 cmPkLkwStaReq ARGS((
643 S16 cmPkLkwStaCfm ARGS((
648 S16 cmPkLkwStsReq ARGS((
654 S16 cmPkLkwStsCfm ARGS((
660 S16 cmPkLkwTrcInd ARGS((
666 uint8_t unpackRlcConfigReq ARGS((
672 uint8_t unpackRlcConfigCfm ARGS((
678 S16 cmUnpkLkwCntrlReq ARGS((
684 S16 cmUnpkLkwCntrlCfm ARGS((
690 S16 cmUnpkLkwStaInd ARGS((
696 S16 cmUnpkLkwStaReq ARGS((
702 S16 cmUnpkLkwStaCfm ARGS((
708 S16 cmUnpkLkwStsReq ARGS((
714 S16 cmUnpkLkwStsCfm ARGS((
720 S16 cmUnpkLkwTrcInd ARGS((
725 /* lkw_x_001.main_2, added support for L2 measurement */
727 S16 cmPkLkwL2MeasReq ARGS((
729 RlcL2MeasReqEvt * measReqEvt
731 S16 cmUnpkLkwL2MeasReq ARGS((
736 S16 cmPkLkwL2MeasCfm ARGS((
738 RlcL2MeasCfmEvt *measCfmEvt
740 S16 cmUnpkLkwL2MeasCfm ARGS((
745 S16 cmPkRlcL2MeasReqInfo ARGS((
746 RlcL2MeasReqInfo * measReqInfo,
749 S16 cmUnpkRlcL2MeasReqInfo ARGS((
750 RlcL2MeasReqInfo * measReqInfo,
753 S16 cmPkRlcL2MeasCfmInfo ARGS((
754 RlcL2MeasCfmInfo * measCfmInfo,
758 S16 cmUnpkRlcL2MeasCfmInfo ARGS((
759 RlcL2MeasCfmInfo * measCfmInfo,
763 S16 cmPkLkwL2MeasStopReq ARGS((
767 S16 cmUnpkLkwL2MeasStopReq ARGS((
768 LkwL2MeasStopReq func,
772 S16 cmPkLkwL2MeasSendReq ARGS((
776 S16 cmUnpkLkwL2MeasSendReq ARGS((
777 LkwL2MeasSendReq func,
781 S16 cmPkLkwL2MeasStopCfm ARGS((
786 S16 cmUnpkLkwL2MeasStopCfm ARGS((
787 LkwL2MeasStopCfm func,
791 #endif /* LTE_L2_MEAS */
797 #endif /* __cplusplus */
798 #endif /* __LKW_X__ */
801 /********************************************************************30**
803 **********************************************************************/