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
40 * The structures and variables declared in this file
41 * correspond to structures and variables used by
42 * the following TRILLIUM software:
44 * part no. description
45 * -------- ----------------------------------------------
52 #endif /* __cplusplus */
54 typedef U32 PjSn; /*!< Sequence Number length */
56 /* pj005.201 added support for L2 Measurement */
57 /** @defgroup l2meas L2Meas Module Info
59 /** @addtogroup l2meas */
65 typedef struct pjL2Cntr
69 U32 numPkts; /*!< Number of packet monitired in dlDelay */
70 EpcTime val; /*!< L2 Measurement value in dlDelay */
74 U32 numPkts; /*!< Number of packet monitired in ulLoss */
75 U32 val; /*!< L2 Measurement value in ulLoss */
79 U32 numPkts; /*!< Number of packet monitired in ulLoss */
80 U32 val; /*!< L2 Measurement value in dlDisc */
82 U32 totDrbsPerQci; /*!< Total Count of DRB's for this QCI */
85 /** @struct PjL2MeasCb
86 * PDCP L2 Measurement CB */
87 typedef struct pjL2MeasCb
89 U16 measType; /*!< Bit-wise set measurement types */
90 U16 numQci; /*!< number of valid qcI */
91 U8 qci[LPJ_MAX_QCI]; /*!< list of valid qcI */
92 PjL2Cntr measData[LPJ_MAX_QCI]; /*!< Measurement CB */
94 CmCpuStatsInfo cpuInfo;
97 /** @struct PjL2MeasEvtCb
98 * PDCP L2 Measurement Evt CB */
99 typedef struct pjL2MeasEvtCb
101 U32 transId; /*!< TransId of Measurement Req */
102 U32 cbIdx; /*!< TransId of Measurement Req */
103 CmTimer l2Tmr; /*!< L2 Timer per request */
104 TmrCfg l2TmrCfg; /*!< Time period of measurement */
105 PjL2MeasCb measCb; /*!< Measurement CB */
110 typedef struct pjL2Cb
112 U16 pjNumMeas; /*!< Number of measurements going on */
113 PjL2MeasEvtCb pjL2EvtCb[PJ_MAX_L2MEAS_EVT]; /*!< Pointers to Measurement Cb */
114 U8 measOn[LPJ_MAX_QCI]; /*!< Measurement on */
115 U16 memUtilizationMask; /*!< Memory mask */
116 U16 cpuUtilizationMask; /*!< CPU Mask */
117 CmTimer measTmr; /* !< measurement timer */
118 TmrCfg measTmrCfg; /*!< Time period of measurement */
121 /** @struct PjL2MeasRbCb
122 * PDCP L2 Measurement Rb CB */
123 typedef struct pjL2MeasRbCb
125 PjL2Cntr *l2Sts[PJ_MAX_L2MEAS_INRB + 1]; /*!< Dl Delay counter */
127 #endif /* LTE_L2_MEAS */
130 typedef struct pjCfmEnt
132 U8 rbId; /*!< RB ID */
133 U8 rbType; /*!< RB Type */
134 U8 cfgType; /*!< CfgType for the Cfm */
136 Status status; /*!< ROK or RFAILED */
137 Reason reason; /*!< Reason for failure */
142 * When the libraries are offboarded, the confirms are sent
143 * asynchronously. This is to store them.
145 typedef struct pjAsyncCfm
147 U8 cfmType; /*!< PJ_SEC_ASYNC_CFM, PJ_CFG_ASYNC_CFM,
148 PJ_REEST_ASYNC_CFM, PJ_CFG_REEST_ASYNC_CFM
149 PJ_CFG_UEDEL_ASYNC_CFM */
150 U8 startTmr; /*!< Whether to start the timer or not */
151 U8 entity; /*!< Entity */
152 U8 numEnt; /*!< Number of entities */
153 U32 libInitBitMask; /*!< Bitmask to maintain the cfm for Init req */
154 U32 cmpInitBitMask; /*!< Bitmask to track cfm for compression */
155 CmLteRnti ueId; /*!< UE ID */
156 CmLteCellId cellId; /*!< Cell ID */
157 U32 transId; /*!< Transcation ID */
158 PjCfmEnt cfmEnt[CPJ_MAX_CFM]; /*!< Confirm parameter for
163 * Hook information maintainned during processing
165 typedef struct pjLibInfo
167 U8 state; /*!< State of the UE- Normal or ReEst. */
169 U16 numReEstCmp; /*!< Number of RBs reestablishment received */
170 U16 numReEstDrb; /*!< Number of RBs under reestablishment*/
171 CmTimer obdTmr; /*!< Timer to wait for InitCfm and UE Delete */
172 U32 tLibInitBitMask; /*!< Bitmask to maintain the cfm for Init req */
173 U32 tCmpInitBitMask; /*!< Bitmask to track cfm for compression */
174 PjAsyncCfm *asyncCfm[PJ_MAX_ASYNC_CFM]; /*!< Confirm list to handle multiple simultaneous
175 config requests when cfm is sent asynchronously */
176 U16 nxtAvlbTxId; /*!< Next available transaction Id for entry
177 in the async Cfm list */
178 U16 crntTmrTxId; /*!< Transaction id for which the timer is started */
180 Bool waitForReEstTrig;
187 Input parameters for security algorithm */
188 typedef struct pjSecInp
190 U32 count; /*!< COUNT associated with SDU/PDU */
191 CmLteRbId rbId; /*!< RB Identifier */
192 U8 dir; /*!< Direction UL/DL/biderectional */
193 U8 res[2]; /*!< reserved */
198 typedef struct pjCmpCxt
200 CmLteCellId cellId; /*!< Cell Identifier */
201 CmLteRnti ueId; /*!< UE Identifier */
202 CmLteRbId rbId; /*!< RB Identifier */
203 U8 rbType; /*!< RB Type */
204 U16 cfgTxId; /*!< Tx Idx of config confirm */
208 Context for Security Algorithm */
209 typedef struct pjSecCxt
211 CmLteCellId cellId; /*!< Cell Identifier */
212 CmLteRnti ueId; /*!< UE Identifier */
213 U16 cfgTxId; /*!< Tx Idx of config confirm */
214 U16 res; /*!< reserved */
215 U8 dir; /*!< direction DL/UL */
218 /** @struct PjLibTrans
219 Transaction Id for Security Algorithm */
220 typedef struct pjLibTrans
222 /* New parameters added from PjMsSecInfo to avoid multiple copy of parameters */
223 CmLteCellId cellId; /*!< cell ID */
224 CmLteRnti ueId; /*!< UE ID */
225 U8 pdcpInstance; /*!< PDCP instance UL/DL */
226 U8 hash_key[PJ_MS_KENB_LEN]; /*!< Current eNodeB key at App */
227 U8 strS[PJ_MS_STR_S_LEN];
229 U8 intAlgoType; /*!< Integ algo type */
230 U8 fresh[PJ_NUM_BYTES_FRESH];
231 U8 ciphAlgoType; /*!< Ciph algo type */
232 U8 *key; /*!< Integrity key */
233 U32 count; /*!< COUNT associated with SDU/PDU */
234 CmLteRbId rbId; /*!< PDCP RbCb */
235 U8 rbType; /*!< RB Type : 0 - PJ_SRB, 1 - PJ_DRB */
236 U16 res; /*!< Reserved */
237 PTR ueCb; /*!< UE control block */
241 U8 dir; /*!< Direction */
242 U8 snLen; /*!< SN Length */
249 /** @struct PjIntInfo
250 PDCP Integrity Algo Information */
251 typedef struct pjIntInfo
253 U32 algoType; /*!< Type of the algorithm */
254 U8 intKey[PJ_INTG_KEY_LEN]; /*!< Integrity key */
257 /** @struct PjCipherInfo
258 PDCP Ciphering Algo Information */
259 typedef struct pjCipherInfo
261 U32 algoType; /*!< Type of the algorithm */
262 U8 cpKey[PJ_CIPHER_KEY_LEN]; /*!< Control plane ciphering key */
263 U8 upKey[PJ_CIPHER_KEY_LEN]; /*!< User plane ciphering key */
267 PDCP Security Info */
270 Bool secAct; /*!< Flag to indicate if security is
271 activated for this UE */
272 Bool selSecAct; /*!< Flag to indicate if selective
273 security activation is set */
274 Bool firstMsg; /*!< Flag to indicate the first DL
276 PjIntInfo intInfo; /*!< Integrity Algo Information */
277 Bool intProtEnbForDrb; /*1< 5G NR Integrity protection is enbaled or not for DRB*/
278 PjIntInfo intInfoForDrb; /*!< 5G NR Integrity Algo Information for DRB */
279 PjCipherInfo cipherInfo; /*!< Ciphering Algo Information */
280 PjSecCxt secCxt; /*!< Context for security algorithm */
282 Void *intCxtId; /*!< Context Id for Integrity
283 protection / verification */
284 Void *cpCxtId; /*!< Context Id for cntrl plane
285 ciphering / deciphering */
286 Void *upCxtId; /*!< Context Id for user plane
287 ciphering / deciphering */
290 Void *cpSessCxtId; /*!< Session Context Id for Integrity protection / verification for first packet
291 And it will get replaced with chained integrity and ciphering session later */
293 Void *cpIntSessCxtId; /*!< Session Context Id for Integrity protection / verification */
294 Void *cpCiphSessCxtId; /*!< Session Context Id for cntrl plane ciphering / deciphering */
296 Void *upCiphSessCxtId; /*!< Session Context Id for user plane ciphering / deciphering */
304 U8 numBins; /*!< Number of lists for datQ */
305 U8 res1[3]; /*!< Reserved */
306 U32 numEntries; /*!< Total number of entries in the datQ */
307 CmLListCp *datQ; /*!< Array of lists for Tx SDUs/Rx PDUs */
309 CmLListCp sduSubmitQ;
313 U32 pduState[8]; /*!< Added for debugging purpose */
317 typedef struct pjUeKey
319 CmLteRnti ueId; /*!< UE Id */
320 CmLteCellId cellId; /*!< Cell Id */
323 /** @struct PjCpjSapCb
324 * CPJ Sap Control Block */
325 typedef struct pjCpjSapCb
327 Pst pst; /*!< Service user post structure */
328 SpId spId; /*!< Service provider Id */
329 SuId suId; /*!< Service user Id */
330 U8 state; /*!< Sap Status */
331 U8 res[3]; /*!< reserved */
334 /** @struct PjPjuSapCb
335 * PJU Sap Control Block */
336 typedef struct pjPjuSapCb
338 SpId spId; /*!< Service provider Id */
339 SuId suId; /*!< Service user Id */
340 U8 state; /*!< Sap Status */
341 U8 res[3]; /*!< Reserved */
342 PjPjuSts sts; /*!< Statistics */
343 Pst pst; /*!< Service user post structure */
346 typedef struct pjUdxDlSapCb
348 SpId spId; /*!< Service provider Id */
349 SuId suId; /*!< Service user Id */
350 U8 state; /*!< Sap Status */
351 U8 res[3]; /*!< Reserved */
352 PjPjuSts sts; /*!< Statistics */
353 Pst pst; /*!< Service user post structure */
357 typedef struct pjUdxUlSapCb
359 Pst pst; /*!< Service user post structure */
360 SpId spId; /*!< Service provider Id */
361 SuId suId; /*!< Service user Id */
362 U8 state; /*!< Sap Status */
363 U8 retryCnt; /*!< Bind Retry Count */
364 U16 bndTmrInt; /*!< Timer Interval */
365 CmTimer bndTmr; /*!< Bind Timer */
369 typedef struct pjKwuSapCb
371 Pst pst; /*!< Service user post structure */
372 SpId spId; /*!< Service provider Id */
373 SuId suId; /*!< Service user Id */
374 U8 state; /*!< Sap Status */
375 U8 retryCnt; /*!< Bind Retry Count */
376 U16 bndTmrInt; /*!< Timer Interval */
377 CmTimer bndTmr; /*!< Bind Timer */
381 Robust header compression Information */
382 typedef struct pjRohc
384 Bool hdrCmpUsed; /*!< Header Compression Used/Not */
385 U8 res[3]; /*!< reserved */
386 U16 maxCid; /*!< Max CID */
387 U16 profId; /*!< ROHC Profile Id */
389 typedef struct pjCfgInfo
391 CmHashListEnt transHlEnt;
395 CpjCfgReqInfo *cfgInfo;
397 CpjUeInfo *newUeInfo;
398 CpjSecCfgReqInfo *secCfgInfo;
399 CpjReEstReqInfo *reEstReq;
400 CpjCountReqInfo *cntReq;
401 CpjSduStaReqInfo *staReq;
402 CpjDatResumeReqInfo *datResReq;
405 /** @struct PjPerfStats
406 PDCP performance stats */
407 typedef struct _pjPerfSts
409 U32 pjSduRcvCnt; /*!< Number of SDUs received at PDCP */
414 RLC global control block */
415 typedef struct _pjUlCb
417 U32 transId; /*!< next available TransId */
418 PjCpjSapCb cpjSap; /*!< CPJ Sap Conrol Block */
419 PjUdxUlSapCb udxUlSap[PJ_MAX_UDXSAPS]; /*!< UDX Sap Control Block */
420 PjPjuSapCb pjuSap[PJ_MAX_PJUSAPS]; /*!< PJU Sap Conrol Block */
421 PjKwuSapCb kwuSap[PJ_MAX_KWUSAPS]; /*!< kwu Sap Control Block */
422 CmHashListCp transIdLstCp; /*!< Hashlist of cfg trans */
423 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
425 PjL2Cb pjL2Cb; /*!< Control block of L2 Measurements in PDCP */
426 #endif /* LTE_L2_MEAS */
428 #ifdef QAT_TWO_INSTANCE
437 RLC global control block */
438 typedef struct _pjDlCb
440 PjUdxDlSapCb udxDlSap[PJ_MAX_UDXSAPS]; /*!< Udx Sap Control Block */
441 PjPjuSapCb pjuSap[PJ_MAX_PJUSAPS]; /*!< PJU Sap Conrol Block */
442 PjKwuSapCb kwuSap[PJ_MAX_KWUSAPS]; /*!< kwu Sap Control Block */
443 PjGenSts pjGenSts; /*!< PDCP General Statistics */
444 CmHashListCp ueLstCp; /*!< Hashlist of UeCb */
446 PjL2Cb pjL2Cb; /*!< Control block of L2 Measurements in PDCP */
447 #endif /* LTE_L2_MEAS */
449 #ifdef QAT_TWO_INSTANCE
456 typedef U64 (*funcVirtToPhys)(void * virtAddr);
461 RLC global control block */
464 CmTqType pjTq[PJ_TMR_LEN]; /*!< Timer queue */
465 CmTqCp pjTqCp; /*!< Timer queue control point */
466 S16 trcLen; /*!< Trace Length */
467 U8 trcMask; /*!< Trace Mask */
468 TskInit init; /*!< Task Initialization Info */
469 PjGenCfg pjGenCfg; /*!< PDCP General Configuration Structure */
470 PjGenSts pjGenSts; /*!< PDCP General Statistics */
471 PjPerfSts pjPerfSts; /*!< PDCP Performance Statistics */
474 PjUlgCb *ulCb; /*!< Ul Control Block */
475 PjDlgCb *dlCb; /*!< Dl Control Block */
479 funcVirtToPhys va2pa;
483 typedef struct _pdcpStats
485 U32 numPdcpSdusDiscarded;
486 U32 numPdcpSdusDiscMem;
487 U32 numPdcpCellReorderTmrExp;
490 EXTERN PDCPStats gPdcpStats;
492 /* Extern variable declaration */
493 EXTERN PjCb *pjCb[PJ_MAX_PDCP_INSTANCES]; /*!< PDCP global control block */
496 EXTERN S16 pjStartTmr ARGS ((
502 EXTERN S16 pjStopTmr ARGS ((
508 EXTERN Bool pjChkTmr ARGS ((
514 EXTERN S16 pjTmrExpiry ARGS ((
518 EXTERN S16 pjDbmBufInit ARGS ((
524 EXTERN S16 pjLmmSendTrc ARGS ((PjCb *gCb, Event event, Buffer *mBuf));
526 EXTERN Void pjLmmSendAlarm ARGS ((PjCb *gCb, U16 category, U16 event,
527 U16 cause, SuId suId, U32 ueId, U8 qci));
528 #else /* LTE_L2_MEAS */
529 EXTERN Void pjLmmSendAlarm ARGS ((PjCb *gCb, U16 category,
530 U16 event, U16 cause,
531 SuId suId, U32 ueId));
532 #endif /* LTE_L2_MEAS */
533 EXTERN S16 pjUtlCmpClose ARGS((
535 PTR cmpCxtId /* ROHC Context to be closed */
539 /* Activation functions */
540 EXTERN S16 pjDlActvInit ARGS ((
541 Ent ent, /* entity */
542 Inst inst, /* instance */
543 Region region, /* region */
544 Reason reason /* reason */
547 EXTERN S16 pjDlActvTsk ARGS ((
548 Pst *pst, /* pst structure */
549 Buffer *mBuf /* message buffer */
552 /* Activation functions */
553 EXTERN S16 pjUlActvInit ARGS ((
554 Ent ent, /* entity */
555 Inst inst, /* instance */
556 Region region, /* region */
557 Reason reason /* reason */
560 EXTERN S16 pjUlActvTsk ARGS ((
561 Pst *pst, /* pst structure */
562 Buffer *mBuf /* message buffer */
565 #ifndef XEON_SPECIFIC_CHANGES
566 EXTERN U32 pjMsCheckSpaccQueue ARGS ((Bool isUl));
568 EXTERN U32 pjMsCheckSpaccQueue ARGS ((Void));
570 EXTERN Void pjProcessSpaccRdWr ARGS ((
575 EXTERN Void pjPollQatDat ARGS ((
581 EXTERN Void UpdateMemInfo ARGS ((
582 PjL2Cb *tPjL2Cb /* l2Cb structure */
584 EXTERN S16 UpdateCpuInfo ARGS ((
585 PjL2Cb *tPjL2Cb /* l2Cb structure */
588 EXTERN S16 pjUtlMemCpuHdlTmrExp ARGS((
589 PjCb *tPjCb,/*pjCb structure */
590 PjL2Cb *tPjL2Cb /*l2Cb structure */
596 #endif /* __cplusplus */
601 /********************************************************************30**
604 **********************************************************************/