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: LTE RLC file for uplink and non real time tasks
25 Desc: This file contains all the data structures and
26 prototypes for LTE RLC in the uplink.
30 *********************************************************************21*/
33 * @brief RLC uplink structures, prototypes
41 #endif /* __cplusplus */
43 typedef struct kwUlUeCb KwUlUeCb;
45 /** @defgroup um_uplink UM Uplink Module
49 * @brief Structure to hold a UM PDU
52 * - pdu : Buffer holding the UM PDU data
53 * - umHdr : UM PDU Header Information
54 * - pduSz : Length of the PDU excluding the header
56 typedef struct kwUmRecBuf
58 Buffer *pdu; /**< Buffer holding the UM PDU */
59 KwUmHdr umHdr; /**< UM PDU Header Information */
60 MsgLen pduSz; /**< PDU Size */
64 * @brief Structure to hold uplink information in UM mode for a particular RB
67 * - snLen : The sequence number length can be 5 bits or 10 bits.
68 * Here it is stored as 1 or 2 (as the number of bytes)
69 * - recBuf : Holds all the received PDUs. PDU's are removed from this
70 * after a SDU is formed or during restablishment
71 * - umWinSz : The window size is 512 for 10 bits sequence number and 16
72 * for 5 bits sequence number
73 * - partialSdu : This is used to store the partially completed SDU.
74 * It remains till complete SDU is received
78 U8 snLen; /**< Sequence number length */
79 U8 reOrdTmrInt; /**< Timer Interval */
80 KwUmRecBuf **recBuf; /**< Reception buffer */
81 KwSn umWinSz; /**< UM window size */
82 U16 modBitMask; /**< Bitmask for modulus to wrap around variables */
83 KwSn sn; /**< Sequence number */
84 KwSn vrUr; /**< VR(UR) - Receive state variable */
85 KwSn vrUh; /**< VR(UH) - Highest received state variable */
86 KwSn vrUx; /**< VR(UX) - Reordering state variable */
87 CmTimer reOrdTmr; /**< Reordering Timer */
88 Buffer *partialSdu; /**< Partial SDU - Remains till the complete SDU
94 * @brief Structure to hold a RLC AM PDU segment
97 * - lstEnt : This is required for the linked list in which the segments
99 * - seg : Holds the segment data
100 * - segSz : The length of the segment in bytes
102 * - amHdr : The AM Header for the PDU segment
107 CmLList lstEnt; /**< List entry for PDU segment */
108 Buffer *seg; /**< PDU segment */
109 MsgLen segSz; /**< Buffer Size */
110 U16 soEnd; /**< Segment Offset End */
111 KwAmHdr amHdr; /**< AM header */
117 * @brief Structure to hold a received AM PDU or segments of a PDU
120 * - pdu : Holds the PDU data
121 * - pduSz : Length of the PDU in bytes
122 * - amHdr : The AM Header for the PDU
123 * - segLst : The length of the segment in bytes
124 * - expByteSeg : The next expected segment for re-ordering
125 * - expSo : The next expected SO so to be in sequence
126 * - allRcvd : Whether all the segments for this PDU has been recevied
129 typedef struct kwAmRecBuf
131 CmLList lnk; /**< Link to the receive buffer list */
132 Buffer *pdu; /**< PDU buffer */
133 MsgLen pduSz; /**< Buffer Size */
134 KwAmHdr amHdr; /**< AM header Info */
135 CmLListCp segLst; /**< PDU Segments list */
136 KwSeg *expByteSeg; /**< Next expected byte segment */
137 U16 expSo; /**< Next expected seg offset */
138 Bool allRcvd; /**< All bytes received or not */
139 Bool isDelvUpperLayer; /**< Is it sent to upper layer */
142 /** @addtogroup ammode */
146 * @brief Structure to hold information about an uplink AM Radio Bearer
149 * - recBuf : Reception buffer
150 * - rxNext : RX_Next - Receive state variable
151 * - rxNextHighestRcvd : RX_Next_Highest_Rcvd - Highest received state variable
152 * - rxNextStatusTrig : RX_Next_Status_Trigger - reorderig state variable
153 * - vrMr : VR(MR) - Maximum acceptable receive state variable
154 * - rxHighestStatus : RX_Highest_Status - Maximum STATUS transmit state variable
155 * - staTrg : Flag to indicate if status trigger occured
156 * - partialSdu : Partial SDU - Remains till the complete SDU
158 * - expSn : The expected sequence number for reassembly
159 * - expSo : The expected SO for reassembly
160 * - staProhTmr : The Status Probihit Timer
161 * - staProhTmrInt : Status Prohibit Timer interval (in ??)
162 * - reOrdTmr : The Reordering Timer
163 * - reOrdTmrInt : Re-ordering timer interval
164 * - gatherStaPduInfo : Whether to gather information required to create
168 typedef struct kwAmUl
171 CmLListCp *recBufLst;
173 // KwAmRecBuf *recBuf[1024]; /**< Reception buffer */
175 KwSn rxNext; /**< RX_Next:Equvalent to VR(R) in 4G */
176 KwSn rxNextHighestRcvd; /**< RX_Next_Highest_Rcvd: Equvalent to VR(H) in 4G */
177 KwSn rxNextStatusTrig; /**< rxNextStatusTrig: Equvalent to VR(X) in 4G*/
178 KwSn vrMr; /**< VR(MR) */
179 KwSn rxHighestStatus; /**< rxHighestStatus: Eqvalent to VR(MS) in 4G*/
180 Bool staTrg; /**< Whether status trigger occured */
181 Buffer *partialSdu; /**< Partially received SDU */
182 KwSn expSn; /**< Expected SN for reassembly */
183 U16 expSo; /**< Expected SO for reassembly */
184 CmTimer staProhTmr; /**< T_status_prohibit Timer */
185 U16 staProhTmrInt; /**< Timer Interval */
186 CmTimer reOrdTmr; /**< T_reordering Timer */
187 U8 reOrdTmrInt; /**< Timer Interval */
188 Bool gatherStaPduInfo; /**< Gather STATUS PDU creation info*/
189 Bool isOutOfSeq; /**< To identify whether packets are Out-Of-Seq or not */
190 U8 snLen; /*!< Sequence number length:12 bit or 18 bit : 5GNR RLC */
191 U32 snModMask; /*!< (2 Pwr SnLen - 1): 5GNR RLC */
197 * @brief Structure to hold uplink information about a Radio Bearer
200 * - rlcId : RLC identifier, uniquely identifies a Radio Bearer
201 * - lch : Information (type and id) of the logical channel associated
202 * with this Radio Bearer.
203 * - mode : The mode of the Radio Bearer; UM or AM
204 * - dir : The direction of the Radio Bearer, downlink or uplink or both
205 * - inst : Id of RLC instance where this Radio Bearer is present. Used
206 * to find the instance from the Radio Bearer for memory needs
207 * as different instances might have different memory.
208 * - kwuSapId : KWU SAP identifier
209 * - udxSapId : UDX SAP idenrifier
210 * - transId : Stores the transaction identifier used to communicate
211 * with MAC, the same value as sent by MAC is passed back
212 * for it to be able to corelate
213 * - m : Mode of the RB (TM/UM/AM)
214 * - umDl : Unacknowledged Mode downlink information
215 * - amDl : Acknowledged Mode downlink information
217 typedef struct _kwUlRbCb
219 /* kw005.201 added support for L2 Measurement */
221 KwL2MeasRbCb rbL2Cb; /**< RB measurement L2 Cb */
222 KwUlUeCb *ueCb; /*!< Pointer to UeCb */
223 U8 qci; /**< qci of the RB */
224 KwL2MeasIpThruput l2MeasIpThruput; /**< Holds related parameter for
225 DL/Ul ip throughput>*/
226 #endif /* LTE_L2_MEAS */
227 CmLteRlcId rlcId; /**< RLC Identifier */
228 KwLchInfo lch; /**< Logical Channel Info */
229 CmLteRlcMode mode; /**< Entity Mode */
230 U8 dir; /**< Direction for UL/DL */
231 Inst inst; /**< Tapa where Rb created Instance id */
232 SpId kwuSapId; /**< KWU sap Id, to get the KwuSapCb */
233 SpId udxSapId; /**< KWU sap Id, to get the KwuSapCb */
234 U32 transId; /**< Transaction Id for RLC */
237 KwUmUl umUl; /**< UM mode Ul elements */
238 KwAmUl amUl; /**< AM mode uplink elements */
239 }m; /**< RLC mode specific Info */
243 * @brief Structure to hold mapping between logical channel and Radio Bearer
246 * - ulRbCb : Pointer to the uplink Radio Bearer
248 typedef struct kwUlLch
250 KwUlRbCb *ulRbCb; /**< Pointer to Uplink RbCb */
254 * @brief Structure to hold uplink information about the Cells
257 * - cellHlEnt : Information about cells are stored in a hash table. This is
259 * - cellId : Identity of the cell
260 * - rbCb : Radio Bearers in the cell
261 * - lCh : Logical Channels in the cell
262 * - selfPstUl : Pst structure for sending messages to self
264 typedef struct kwUlCellCb
266 CmHashListEnt cellHlEnt; /**< Hash list entry for CellCb */
267 CmLteCellId cellId; /**< Cell Id */
268 KwUlRbCb *rbCb[KW_MAX_RB_PER_CELL]; /**< RbCbs within a Cell */
269 KwUlLch lCh[KW_MAX_LCH_PER_CELL]; /**< Logical channels in a cell */
274 * @brief Structure to hold uplink information about the UEs
277 * - ueHlEnt : Information about cells are stored in a hash table. This is
279 * - key : Key to store/find the UE in the hashtable
280 * - srbCb : Signaling Radio Bearers configured for the UE
281 * - drbCb : Data Radio Bearers configured for the UE
282 * - lCh : Logical Channels in the UE
286 CmHashListEnt ueHlEnt; /**< Hash list entry for UeCb */
287 CmLteRnti ueId; /*!< UE Id */
288 CmLteCellId cellId; /*!< Cell Id */
289 KwUlRbCb *srbCb[KW_MAX_SRB_PER_UE]; /**< SRB RbCbs within an UE */
290 KwUlRbCb *drbCb[KW_MAX_DRB_PER_UE]; /**< DRB RbCbs within an UE */
291 KwUlLch lCh[KW_MAX_LCH_PER_UE]; /**< Logical channels of an UE*/
292 /* kw005.201 added support for L2 Measurement */
294 U32 firstPacketTTI; /*!< is first packet of the burst */
295 U16 numActRb[LKW_MAX_QCI]; /**< number of RBs Active */
296 Bool isUlBurstActive; /*!<Has the Burst started for UL IP Thrpt meas */
297 #endif /* LTE_L2_MEAS */
301 * @brief Structure to hold temporary data of configuration
304 * - entUlCfgCfm : Holds the UL configuration status
307 typedef struct kwUlEntTmpData
309 CkwEntCfgCfmInfo entUlCfgCfm; /**< Ul Configuration status*/
310 KwUlRbCb *rbCb; /**< Rb Block */
314 * @brief Structure to hold transaction information in configuration request
317 * - transHlEnt : List entry for transaction block.
318 * - transId : Transaction Id
322 * - cellCb : Cell Block
323 * - cfgInfo : Configuration Information
324 * - ueInfo : UE Information
325 * - newUeInfo : New Ue Information
326 * - cfgTmpData : Temporary data per Configuration entity
328 typedef struct kwUlCfgTmpData
330 CmHashListEnt transHlEnt; /**< List Entry of
332 U32 transId; /**< Locally generated Transaction Id */
333 U32 uprLyrTransId; /**< Transaction Id generated by upper layer.
334 This is used while sending confirm to the User Layer */
335 CmLteCellId cellId; /**< Cell Id */
336 CmLteRnti ueId; /**< Ue Id */
337 KwUlUeCb *ueCb; /**< Ue Block */
338 KwUlCellCb *cellCb; /**< Cell Block */
339 CkwCfgInfo *cfgInfo; /**< Config Information*/
340 CkwUeInfo *ueInfo; /**< Ue Information */
341 CkwUeInfo *newUeInfo; /**< New Ue Information */
342 KwUlEntTmpData cfgEntData[CKW_MAX_ENT_CFG]; /**< Entity Data */
344 /****************************************************************************
345 * EXTERN Declarations
346 ***************************************************************************/
347 /****************************************************************************
348 * Configuration Functions
349 ***************************************************************************/
351 EXTERN S16 kwValidateRbCfgParams ARGS ((KwCb *gCb,
354 CkwEntCfgInfo *cfgToValidate,
356 EXTERN S16 kwCfgValidateUlRb ARGS (( KwCb *gCb,
357 CkwEntCfgInfo *cfgToValidate,
358 KwUlEntTmpData *cfgInfo,
359 KwUlCfgTmpData *cfg));
361 EXTERN S16 kwCfgRollBackUlRb ARGS ((KwCb *gCb,
363 CkwEntCfgInfo *cfgToValidate,
364 KwUlEntTmpData *cfgTempData));
366 EXTERN Void kwCfgApplyUlRb ARGS ((KwCb *gCb,
367 CkwEntCfgInfo *cfgToAply,
368 KwUlEntTmpData *cfgTmpData,
369 KwUlCfgTmpData *cfgTmpInfo));
371 EXTERN S16 kwCfgValidateReEstRb ARGS ((KwCb *gCb,
374 CkwEntCfgInfo *cfgToValidate,
375 KwUlEntTmpData *cfgTmpData));
377 EXTERN Void kwCfgApplyReEstUlRb ARGS ((KwCb *gCb,
381 KwUlEntTmpData *cfgTmpData));
383 EXTERN Void kwCfgApplyDelUlCell ARGS ((KwCb *gCb,
384 KwUlCfgTmpData *cfgTmpData));
386 EXTERN S16 kwCfgValidateDelUlCell ARGS ((KwCb *gCb,
388 CkwEntCfgInfo *cfgToValidate,
389 KwUlEntTmpData *cfgTmpData,
390 KwUlCfgTmpData *cfgInfo));
392 EXTERN S16 kwCfgValidateDelUlUe ARGS ((KwCb *gCb,
393 CkwEntCfgInfo *cfgToValidate,
394 KwUlEntTmpData *cfgTmpData,
395 KwUlCfgTmpData *cfgInfo));
397 EXTERN Void kwCfgApplyDelUlUe ARGS ((KwCb *gCb,
398 KwUlCfgTmpData *cfgTmpData));
400 EXTERN Void kwHdlUiCkwUlCfgReq ARGS ((KwCb *gCb,
401 KwUlCfgTmpData *cfgInfo,
404 EXTERN Void kwCfgApplyUlUeIdChng ARGS ((KwCb *gCb,
406 CkwUeInfo *newUeInfo,
407 KwUlCfgTmpData *cfgTmpInfo));
409 EXTERN S16 kwCfgValidateUeIdChng ARGS ((KwCb *gCb,
411 CkwUeInfo *newUeInfo,
412 KwUlCfgTmpData *cfgTmpInfo));
414 /****************************************************************************
415 * DBM module Functions
416 ***************************************************************************/
417 EXTERN S16 kwDbmUlInit ARGS ((KwCb *gCb));
419 EXTERN Void kwDbmUlDeInit ARGS ((KwCb *gCb));
421 EXTERN S16 kwDbmAddUlUeCb ARGS ((KwCb *gCb,
426 EXTERN S16 kwDbmFetchUlUeCb ARGS ((KwCb *gCb,
431 EXTERN Void kwDbmDelUlUeCb ARGS ((KwCb *gCb,
435 EXTERN Void kwDbmDelAllUlUe ARGS ((KwCb *gCb));
437 EXTERN S16 kwDbmAddUlCellCb ARGS ((KwCb *gCb,
439 KwUlCellCb *cellCb));
441 EXTERN Void kwDbmFetchUlCellCb ARGS ((KwCb *gCb,
443 KwUlCellCb **cellCb));
445 EXTERN Void kwDbmDelUlCellCb ARGS ((KwCb *gCb,
446 KwUlCellCb *cellCb));
448 EXTERN Void kwDbmDelAllUlCell ARGS ((KwCb *gCb));
450 EXTERN Void kwDbmFetchUlRbCbByRbId ARGS ((KwCb *gCb,
454 EXTERN Void kwDbmFetchUlRbCbFromLchId ARGS ((KwCb *gCb,
460 EXTERN Void kwDbmDelAllUlRb ARGS ((KwCb *gCb,
464 EXTERN S16 kwDbmAddUlTransaction ARGS((KwCb *gCb, KwUlCfgTmpData *cfg));
466 EXTERN S16 kwDbmFindUlTransaction ARGS((KwCb *gCb,
468 KwUlCfgTmpData **cfg));
470 EXTERN S16 kwDbmDelUlTransaction ARGS((KwCb *gCb, KwUlCfgTmpData *cfg));
472 EXTERN S16 kwDbmDelAllUlTransactions ARGS((KwCb *gCb));
474 EXTERN Void kwDbmUlShutdown ARGS ((KwCb *gCb));
476 /****************************************************************************
477 * Transparent Mode Functions
478 ***************************************************************************/
480 EXTERN PUBLIC Void kwTmmRcvFrmLi ARGS ((KwCb *gCb,
485 EXTERN PUBLIC Void kwTmmRcvFrmLi ARGS ((KwCb *gCb,
488 #endif /* CCPU_OPT */
490 EXTERN Void kwTmmUlReEstablish ARGS ((KwCb *gCb, KwUlRbCb *rbCb));
492 /****************************************************************************
493 * Unacknowledged Mode Functions
494 ***************************************************************************/
496 EXTERN Void kwUmmProcessPdus ARGS((KwCb *gCb,
501 EXTERN Void kwUmmProcessPdus ARGS ((KwCb *gCb,
503 KwPduInfo *pduInfo));
505 EXTERN Void kwUmmUlReEstablish ARGS ((KwCb *gCb,
509 EXTERN Void kwUmmReOrdTmrExp ARGS((KwCb *gCb, KwUlRbCb *rbCb));
512 EXTERN Void kwUmmFreeUlRbCb ARGS ((KwCb *gCb, KwUlRbCb *rbCb));
514 /****************************************************************************
515 * Acknowledged Mode Functions
516 ***************************************************************************/
517 EXTERN Void kwAmmUlReEstablish ARGS((KwCb *gCb,
522 EXTERN Void kwAmmProcessPdus ARGS((KwCb *gCb,
527 EXTERN Void kwAmmProcessPdus ARGS((KwCb *gCb,
529 KwPduInfo *pduInfo));
532 EXTERN Void kwAmmReOrdTmrExp ARGS((KwCb *gCb, KwUlRbCb *rbCb));
534 EXTERN Void kwAmmStaProTmrExp ARGS((KwCb *gCb, KwUlRbCb *rbCb));
536 EXTERN Void kwAmmFreeUlRbCb ARGS ((KwCb *gCb, KwUlRbCb *rbCb));
538 /****************************************************************************
540 ***************************************************************************/
541 EXTERN Void kwUtlStoreRecBuf ARGS ((CmLListCp *recBufLst,
545 EXTERN KwAmRecBuf* kwUtlGetRecBuf ARGS ((CmLListCp *recBufLst,
548 EXTERN Void kwUtlDelRecBuf ARGS ((CmLListCp *recBufLst,
553 EXTERN S16 kwUtlRcvFrmLi ARGS ((KwCb *gCb, KwDatIndInfo *datIndInfo));
555 EXTERN S16 kwUtlSndDatInd ARGS ((KwCb *gCb,KwUlRbCb *rbCb, Buffer *sdu));
558 EXTERN S16 kwUtlHdlL2TmrExp ARGS (( KwCb *gCb, KwL2MeasEvtCb *measEvtCb));
560 EXTERN Void kwUtlCalUlIpThrPutIncTTI ARGS ((KwCb *gCb,
564 EXTERN Void kwUtlCalUlIpThrPut ARGS((KwCb *gCb,
569 EXTERN S16 kwUtlSndUlL2MeasCfm ARGS ((KwCb *gCb, KwL2MeasEvtCb *measEvtCb));
571 EXTERN S16 kwUtlSndUlL2MeasNCfm ARGS ((KwCb *gCb,
572 KwL2MeasReqEvt *measReqEvt,
573 KwL2MeasCfmEvt *measCfmEvt));
575 EXTERN S16 kwUtlL2MeasUlInit ARGS((KwCb *gCb));
577 EXTERN Void kwUtlResetUlL2MeasInKwRb ARGS((KwCb *gCb,
581 EXTERN S16 kwUtlValidateIpThL2Meas ARGS ((KwL2MeasReqEvt *measReqEvt,
582 KwL2MeasCfmEvt *measCfmEvt));
584 #endif /* LTE_L2_MEAS */
585 /****************************************************************************
586 * Activation Functions
587 ***************************************************************************/
588 EXTERN S16 kwUlActvInit ARGS ((Ent ent,
593 EXTERN S16 kwUlActvTsk ARGS ((Pst *pst, Buffer *mBuf));
595 /****************************************************************************
597 ***************************************************************************/
598 EXTERN Void DumpRLCUlDebugInformation ARGS((Void));
602 #endif /* __cplusplus */
604 #endif /* __KW_ULX__ */
607 /********************************************************************30**
610 **********************************************************************/