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 PDCP.
30 *********************************************************************21*/
32 @brief PDCP Product Structures, prototypes
36 #include "pj_tenb_stats.x"
45 * The structures and variables declared in this file
46 * correspond to structures and variables used by
47 * the following TRILLIUM software:
49 * part no. description
50 * -------- ----------------------------------------------
58 #endif /* __cplusplus */
60 typedef struct pjDlUeCb PjDlUeCb;
61 typedef struct pjDlRbCb PjDlRbCb; /* PDCP RB control block */
65 /** @addtogroup dldata */
70 * PDCP SDU Status Information for a DRB mapped to RLC AM.
73 typedef struct pjDlHoCfmInfo
75 U8 rbId; /*!< RB ID */
76 Bool pres; /*!< Is handover info present for this RB */
77 U8 dir; /*!< Direction of the RB */
79 U32 count; /*!< Count of the next SN to be assigned */
84 * Handover information maintainned during processing of SduStaReq
86 typedef struct pjDlHoInfo
88 U32 transId; /*!< Transaction ID */
89 PjDlHoCfmInfo *hoCfmInfo; /*!< SDU Status Confirm */
93 PDCP Tx Entry - SDU received from Relay */
94 typedef struct pjTxEnt
96 CmLList lstEnt; /*!< List entry for SDU */
97 CmLList datCfmEnt; /*!< List entry for SDU */
98 CmLList sduSubmitEnt; /*!< List entry for SDU */
99 CmLList reEstPktEnt; /*!< List entry for SDU */
100 U8 state; /*!< SDU state */
101 U8 res; /*!< reserved */
102 PjSn sn; /*!< PDCP SN associated with this SDU */
103 U32 count; /*!< COUNT associated with this SDU */
104 Data *ciphDBuf; /*Pointer to flat buffer created for ciphering */
105 Buffer *pdu; /*!< Pdu Buffer */
106 Buffer *sdu; /*!< Sdu Buffer */
107 #ifdef FLAT_BUFFER_OPT
110 U32 sduId; /*!< SDU ID */
114 EpcTime epcTime; /*!< Arrival Time of the SDU for dl delay */
119 PDCP downlink control block */
120 typedef struct pjDlCb
122 S16 discTmrInt; /*!< Discard timer Interval */
123 U32 txNext; /*!<indicates the COUNT value of the next PDCP SDU to be transmitted */
124 Bool cfmReqd; /*!< Flag to indicate if
125 confirmation is required for the
126 SDUs delivered to the peer PDCP */
127 U8 res[3]; /*!< reserved */
128 PjBuf txBuf; /*!< Transmission buffer */
129 U32 count; /*!< DL COUNT associated with the
131 PjSn sn; /*<Sn for PDCP SDU */
132 U32 nxtToSub; /*!< COUNT of the next PDU to be
134 U32 cfmExp; /*!< COUNT of the next PDU for which
135 confirmation is expected */
136 CmTimer discTmr; /*!< Discard timer */
137 #if (defined(PJ_SEC_ASYNC) || defined (PJ_CMP_ASYNC))
138 CmTimer obdTmr; /*!< Offboard timer */
139 U32 obdCount; /*!< OBD Count */
140 #endif /* (defined(PJ_SEC_ASYNC) || defined (PJ_CMP_ASYNC)) */
141 CmLListCp dlPktQ; /*!< Queues the message during
142 Re-establishment/Handover */
149 PDCP RB control block */
152 CmLteRbId rbId; /*!< RB Id for PDCP Cb */
153 U8 rbType; /*!< RB Type : 0 - PJ_SRB, 1 - PJ_DRB */
154 CmLteRlcMode mode; /*!< Mapped RLC entity's mode */
155 U8 dir; /*!< Direction for UL/DL/biderctional */
156 U8 snLen; /*!< Sequence number length */
157 U8 state; /*!< RB state - Used only for DRBs*/
158 PjSn firstSn; /*!< SN of the first message sent
159 for Integrity Protection */
160 PjRohc rohc; /*!< ROHC Information */
161 PjCmpCxt cmpCxt; /*!< Context for ROHC */
162 PTR cmpCxtId; /*!< Context Id for ROHC */
163 Bool firstDlMsg; /*!< Flag for firstDlMsg
164 Set to FALSE at start */
165 Bool dropOnlyOne; /*!< Indicates whether too many packets
166 are waiting on this RB */
167 U32 pktAdmitCnt; /*!< Indicates how many packets
169 U32 pktCnt; /*!< counts number of packets
171 /* pj005.201 added support for L2 Measurement */
173 U8 qci; /*!< QCI value associated with rb */
174 PjL2MeasRbCb rbL2Cb; /*!< L2 Meas Cb for RB */
175 #endif /* LTE_L2_MEAS */
176 /** @defgroup dldata DL Module Info
178 PjDlCb dlCb; /*!< Downlink PDCP RbCb */
179 PjDlUeCb *ueCb; /*!< Pointer to the UE in which RB is present */
180 U32 maxTxSn; /*!< Sequence number length */
181 PjUeKey key; /*!< Hash list key for UeCb */
182 CmLListCp dlPktLst; /*!< List of DL packets */
183 U32 rbOverloadCnt; /*!< Count to track consecutive PDB breach report on an RB*/
186 /** @brief SDU Confirmation Structure from RLC */
187 typedef struct pjDatCfm
189 CmLteRlcId rlcId; /*!< RLC identifier */
190 U32 numSdu; /*!< Number of SDUs */
191 U32 sduId[PJ_MAX_DAT_CFM]; /*!< SDU Id Array */
199 CmHashListEnt ueHlEnt; /*!< Hash list entry for UeCb */
201 PjUeKey key; /*!< Hash list key for UeCb */
204 PjDlRbCb *srbCb[PJ_MAX_SRB_PER_UE]; /*!< SRB RbCbs within a UE */
205 PjDlRbCb *drbCb[PJ_MAX_DRB_PER_UE]; /*!< DRB RbCbs within a UE */
206 PjSec secInfo; /*!< Security Info */
207 PjDlHoInfo *hoInfo; /*!< SDU Status Confirm */
208 PjLibInfo libInfo; /*!< Hook Info - to wait for
210 U32 waitForReEstTrig;
212 /* pj005.201 added support for L2 Measurement */
214 U16 numActRb[LPJ_MAX_QCI]; /* number of RBs Active */
215 #endif /* LTE_L2_MEAS */
217 TSL2UeStatsCb *tenbStats; /*!< UE Stats Holder */
221 typedef struct pjDlPkt
228 #ifdef FLAT_BUFFER_OPT
234 EXTERN S16 pjCfgAddDlRb ARGS ((PjCb *gCb,CmLteRnti ueId,CmLteCellId cellId,
235 U8 isHo, UdxCfgEnt *entCfg, PjDlUeCb **ueCb,UdxCfmEnt *entCfm ));
237 EXTERN S16 pjCfgReCfgDlRb ARGS ((PjCb *gCb,PjDlUeCb *ueCb,
238 UdxCfgEnt *entCfg, UdxCfmEnt *entCfm));
240 EXTERN S16 pjCfgDelDlRb ARGS ((PjCb *gCb,PjDlUeCb *ueCb,
241 UdxCfgEnt *entCfg,UdxCfmEnt *entCfm));
243 EXTERN S16 pjCfgReEstDlRb ARGS ((
250 EXTERN S16 pjCfgDelDlUe ARGS ((
257 EXTERN S16 pjCfgPrcSecDlCfg ARGS ((
259 UdxSecCfgReqInfo *secCfg,
260 UdxSecCfgCfmInfo *cfgCfm
263 EXTERN S16 pjCfgDlUeIdChng ARGS((
266 UdxUeInfo *newUeInfo,
270 EXTERN S16 pjCfgPrcDlCount ARGS ((
272 UdxCountReqInfo *countReq,
273 UdxCountCfmInfo *countCfm
276 EXTERN S16 pjCfgDelPjDlRbCb ARGS ((
283 EXTERN S16 pjCfgDlReEstReq ARGS ((
285 UdxReEstReqInfo *reEstReq,
286 UdxReEstCfmInfo *reEstCfm
289 EXTERN S16 pjDbmInsTxEnt ARGS ((
294 EXTERN S16 pjDbmDlBufInit ARGS ((
296 PjBuf *buf, /* !< Rx/Tx Buffer */
297 U8 numBins /* !< number of Bins */
300 EXTERN PjTxEnt* pjDbmGetTxEnt ARGS ((
305 EXTERN PjTxEnt* pjDbmGetTxEntSn ARGS ((
310 EXTERN S16 pjDbmDelTxEnt ARGS ((
315 EXTERN S16 pjDbmTxDelAll ARGS((
319 EXTERN S16 pjDbmTxDeInit ARGS ((
324 EXTERN S16 pjDbmFetchDlUeCb ARGS ((
326 CmLteRnti ueId, /* UE Identifier */
327 CmLteCellId cellId, /* Cell Identifier */
328 PjDlUeCb **ueCb /* UE Control Block */
331 EXTERN S16 pjDbmCreateDlUeCb ARGS ((
333 CmLteRnti ueId, /* UE Identifier */
334 CmLteCellId cellId, /* Cell Identifier */
335 PjDlUeCb **ueCb /* UE Control Block */
337 EXTERN PjDlRbCb* pjDbmCreateDlRbCb ARGS ((
344 EXTERN S16 pjDbmDelDlRbCb ARGS ((
353 EXTERN S16 pjDbmDelDlUeCb ARGS((
355 PjDlUeCb *ueCb, /* UE Identifier */
356 Bool abortFlag /* Abort Flag */
359 EXTERN S16 pjDbmFetchDlRbCb ARGS((
361 CmLteRlcId rlcId, /* RLC Identifier */
362 PjDlRbCb **rbCb /* RB Cb */
365 EXTERN S16 PjDbmDelAllDlUe ARGS((PjCb *gCb));
366 EXTERN S16 pjDbmDelAllDlRb ARGS((
368 PjDlRbCb **rbCbLst, /* RB Cb list */
369 U8 numRbCb /* Number of rbCbs */
372 EXTERN S16 pjDbmDlInit ARGS (( PjCb *gCb));
373 EXTERN S16 pjDbmDlDeInit ARGS (( PjCb *gCb));
374 EXTERN S16 pjDbmDlShutdown ARGS((PjCb *gCb));
376 EXTERN S16 pjDlUtlCmpReset ARGS((
378 PjDlRbCb *pjRbCb /* Context to be reset for compression */
382 EXTERN S16 pjUtlDlCmpInit ARGS((
384 PjDlRbCb *pjRbCb /* PDCP RbCb */
386 EXTERN S16 pjUtlDlIntInit ARGS((
388 PjDlUeCb *ueCb /* UE CB Ptr */
390 EXTERN S16 pjUtlDlCpInit ARGS((
392 PjDlUeCb *ueCb /* UE CB Ptr */
394 EXTERN S16 pjUtlDlUpInit ARGS((
396 PjDlUeCb *ueCb /* UE CB Ptr */
398 EXTERN S16 pjUtlDlCmpReset ARGS((
400 PjDlRbCb *pjRbCb /* Context to be reset for compression */
402 EXTERN S16 pjUtlCmpReq ARGS((
404 PjDlRbCb *pjRbCb, /* PDCP RbCb */
405 Buffer *mBuf, /* SDU to be compressed */
406 Buffer **opSdu, /* Compressed SDU */
407 U32 count /* COUNT - transaction Id */
409 EXTERN S16 pjUtlIntProtReq ARGS((
411 PjDlRbCb *pjRbCb, /* PDCP RbCb */
412 PjSecInp secInp , /* Input parameters for integrity */
413 Buffer **mBuf /* SDU to be compressed */
415 EXTERN S16 pjUtlCipherReq ARGS((
417 PjDlRbCb *pjRbCb, /* PDCP RbCb */
418 U32 count, /* COUNT associated with SDU/PDU */
419 Buffer *mBuf, /* Data to be ciphered */
420 Buffer **opSdu /* ciphered SDU */
423 #ifdef FLAT_BUFFER_OPT
424 EXTERN S16 pjUtlCipherReqFB ARGS((
426 PjDlRbCb *pjRbCb, /* PDCP RbCb */
427 U32 count, /* COUNT associated with SDU/PDU */
428 FlatBuffer *mBuf, /* Data to be deciphered */
429 Buffer **opSdu /* Deciphered SDU */
433 EXTERN S16 pjUtlDlCmpClose ARGS((
434 PTR cmpCxtId /* ROHC Context to be closed */
436 EXTERN S16 pjUtlDlIntClose ARGS((
438 Void *intCxtId /* Handle to be closed */
441 EXTERN S16 pjUtlDlCipherClose ARGS((
443 Void *cpCxtId /* Context Id for Ciphering to be closed */
445 EXTERN S16 pjUtlDlReEstSrb1 ARGS((
447 PjDlRbCb *pjRbCb /* PDCP Control Block Pointer */
449 EXTERN S16 pjUtlDlReEstStart ARGS((
451 PjDlUeCb *ueCb, /* UE Control Block Pointer */
452 UdxCfgReqInfo *cfgReq /* CfgReq for Reestablishment */
454 EXTERN S16 pjUtlDlReEstHOStart ARGS((
456 PjDlUeCb *ueCb, /* Number of RBs undergoing reestablishment*/
457 U32 transId, /* Transaction id of Sdu Status cfm */
460 EXTERN S16 pjUtlDlReEstReconfig ARGS((
462 PjDlUeCb *ueCb /* UE Control Block */
464 EXTERN S16 pjUtlDlReEstDl ARGS((
466 PjDlUeCb *ueCb /* UE Control Block */
468 EXTERN S16 pjUtlDlSndReEstCfgCfm ARGS((
470 PjDlUeCb *ueCb /* UE Control Block */
472 EXTERN S16 pjUtlDlSndSduStaCfm ARGS((
474 PjDlUeCb *ueCb /* UE Control Block */
476 EXTERN S16 pjUtlDlShutdown ARGS((
479 EXTERN Void pjUtlDlFreeRb ARGS((
483 /* kw005.201 added function to send data forward indication mesage */
484 EXTERN S16 pjUtlDlSndDatFwdInd ARGS((
487 PjuDatFwdIndInfo *datFwdInd
490 EXTERN S16 pjUtlDlHdlObdInitCfm ARGS((
492 PjDlUeCb *ueCb, /* Pointer to UeCb */
493 U16 txIdx, /* Transaction Index for UeCb */
494 U8 cfmType, /* Confirm type */
495 U8 maskVal /* mask value */
497 EXTERN S16 pjUtlDlHdlInitObdTmrExp ARGS((
502 EXTERN S16 pjCfgPrcDlSduSta ARGS((
504 UdxSduStaReqInfo *staReq
507 EXTERN S16 pjUtlDlSaveCfmInfo ARGS((
509 PjDlUeCb *ueCb, /* Pointer to UeCb */
510 U8 cfmType, /* Confirm type */
511 Bool startTmr, /* Whether to start timer */
512 U8 entity, /* Confirm type */
513 PTR cfmPtr, /* Pointer to the structure for confirm */
514 PTR cfgPtr /* Pointer to the structure for request */
518 EXTERN S16 pjDlmProcessSdus ARGS ((
526 EXTERN S16 pjDlmProcDrb ARGS ((
532 #ifdef FLAT_BUFFER_OPT
533 EXTERN S16 pjDlmProcDrbFB ARGS ((
540 EXTERN S16 pjDlmProcSrb ARGS ((
545 EXTERN Void pjDlmReEstSrb ARGS ((
550 EXTERN S16 pjDlmReEstDrbUm ARGS ((
555 EXTERN S16 pjDlmReEstDrbAm ARGS ((
559 EXTERN S16 pjDlmProcessCfm ARGS ((
565 EXTERN S16 pjDlmHndlStaRep ARGS ((
571 EXTERN S16 pjDlmReEstHoDrbAm ARGS ((
575 EXTERN S16 pjDlmHdlDatFwdReq ARGS ((
578 PjuDatFwdReqInfo *datFwdReq
580 EXTERN S16 pjDlmDeliverPdu ARGS ((
585 EXTERN S16 pjDlmObdTmrExp ARGS ((
589 EXTERN S16 pjDlmHdlIntProt ARGS ((
594 EXTERN S16 pjDlmHdlCmp ARGS ((
600 #ifdef FLAT_BUFFER_OPT
601 EXTERN S16 pjDlmHdlCmpFB ARGS ((
608 EXTERN S16 pjDlmHdlCiph ARGS ((
614 #ifdef FLAT_BUFFER_OPT
615 EXTERN S16 pjDlmHdlCiphFB ARGS ((
622 EXTERN S16 pjDlmDiscTmrExp ARGS ((
627 EXTERN S16 pjDlmSendDatReq ARGS(( PjCb *gCb, PjDlRbCb *pjRbCb, U32 sduId,
629 EXTERN S16 pjDlmSendDiscSdu ARGS(( PjCb *gCb, PjDlRbCb *pjRbCb, U32 sduId));
631 EXTERN Void pjLimDatCfm ARGS((
636 EXTERN S16 pjUtlReEstDl ARGS ((
638 PjDlUeCb *ueCb /* UE Control Block */
641 EXTERN Void pjLimStaInd ARGS((
647 EXTERN S16 pjDbmFetchPjDlRbCb ARGS((
654 EXTERN Void pjDlmProcessDlPktQ ARGS((
656 PjDlRbCb *pjRbCb /* !< PDCP Control Block */
659 EXTERN Void pjDlmEnqueueDlPkt ARGS((
661 PjDlRbCb *pjRbCb, /* !< PDCP Control Block */
663 PjuDatFwdReqInfo *datFwd, /* !< SN value of PDU */
665 Buffer *pdu /* !< PDU message buffer */
668 #ifdef FLAT_BUFFER_OPT
669 EXTERN Void pjDlmEnqueueDlPktFB ARGS((
671 PjDlRbCb *pjRbCb, /* !< PDCP Control Block */
673 PjuDatFwdReqInfo *datFwd, /* !< SN value of PDU */
675 FlatBuffer *pdu /* !< Flat Buffer PDU */
678 EXTERN Void pjDlmRbDataResumeFB ARGS((
683 EXTERN Void pjDlmProcessDlPktQFB ARGS((
685 PjDlRbCb *pjRbCb /* !< PDCP Control Block */
688 EXTERN S16 pjDlmStartDataFrwdPerRbFB ARGS((
695 EXTERN S16 pjDlmStartDataFrwdPerRb ARGS((
700 EXTERN S16 pjDlmHndlDatFwdReq ARGS((
703 PjuDatFwdReqInfo *datFwdReq
706 EXTERN S16 pjUtlDlUpdUpSecKeys ARGS((
708 PjDlUeCb *ueCb /* UE Control Block */
711 EXTERN S16 pjUtlDlUpdCpSecKeys ARGS((
713 PjDlUeCb *ueCb /* UE Control Block */
716 EXTERN S16 pjUtlDlReEstHO ARGS((
718 PjDlUeCb *ueCb /* Number of RBs undergoing reestablishment*/
721 EXTERN Void pjUtlEmptyDlPktList ARGS((
725 EXTERN Void pjDlmRbDataResume ARGS((
730 EXTERN PUBLIC S16 pjDlmHdlNullCiph ARGS((
736 #ifdef FLAT_BUFFER_OPT
737 EXTERN PUBLIC S16 pjDlmProcessSdusFB ARGS((
745 EXTERN PUBLIC S16 pjUtlConvFbToBuf ARGS((
751 EXTERN PUBLIC S16 pjUtlCopyFbToBuf ARGS((
759 S16 pjUtlL2MeasDlInit(PjCb *gCb);
761 EXTERN Void pjUtlResetDlL2MeasCntr ARGS((
767 EXTERN Void pjUtlPlcMeasDatInDlL2Sts ARGS((
769 PjL2MeasRbCb *rbL2Cb,
772 S16 pjUtlSndDlL2MeasCfm ARGS ((PjCb *gCb, PjL2MeasEvtCb *measEvtCb));
777 void DumpPDCPDlDebugInformation(void);
778 void dumpPDCPDlRbInformation(PjDlRbCb* dlRbCb, U16 ueId);
779 void ResetPDCPStats(void);
780 void PrintPDCPStats(void);
781 EXTERN Void pjDeInitCiphQ(Void);
784 #endif /* __cplusplus */
789 /********************************************************************30**
792 **********************************************************************/