1 /******************************************************************************
3 * Copyright (c) 2020 ICT/CAS.
5 * Licensed under the O-RAN Software License, Version 1.0 (the "Software 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 * https://www.o-ran.org/software
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.
17 *******************************************************************************/
23 #include "vos_linklist.h"
24 #include "pdcpCommon.h"
26 #include "cuupCommon.h"
27 #include "cuModuleCommon.h"
28 #include "plat_syslog.h"
30 #define PROFILE0X0001_PRENSENT 0x0001
31 #define PROFILE0X0002_PRENSENT 0x0002
32 #define PROFILE0X0003_PRENSENT 0x0004
33 #define PROFILE0X0004_PRENSENT 0x0008
34 #define PROFILE0X0006_PRENSENT 0x0010
35 #define PROFILE0X0101_PRENSENT 0x0020
36 #define PROFILE0X0102_PRENSENT 0x0040
37 #define PROFILE0X0103_PRENSENT 0x0080
38 #define PROFILE0X0104_PRENSENT 0x0100
40 #define pdcpuLog(iLog_Level, content, arg...) \
41 VOS_SysLog(gPdcpuModuleId, iLog_Level, __FILE__, __LINE__, __func__, content, ##arg);
43 #define pdcpuNullCheck(p) \
47 pdcpuLog(LOG_ERR,"[PDCPU] NULL pointer\n");\
52 #define pdcpuNullCheckRp(p) \
56 pdcpuLog(LOG_ERR,"[PDCPU] NULL pointer\n");\
62 #define pdcpuCheckUeIdx(n) if(n<0 || n>MAX_UE_NUM) {pdcpuLog(LOG_ERR,#n" is wrong\r\n");return VOS_ERROR;}
63 #define pdcpuCheckDrbId(n) if(n<1 || n>MAX_DRB_ID) {pdcpuLog(LOG_ERR,#n":%d is wrong\r\n");return VOS_ERROR;}
64 #define pdcpuCheckPduSessionId(n) if(n<0 || n>255) {pdcpuLog(LOG_ERR,#n" is wrong\r\n");return VOS_ERROR;}
66 #define pdcpuGetEntity(ueIdx, drbId, p)\
68 if((NULL==gPdcpuUeInfo[ueIdx])\
69 ||(NULL==gPdcpuUeInfo[ueIdx]->pdcpDrbEntity[drbId]))\
74 p = gPdcpuUeInfo[ueIdx]->pdcpDrbEntity[drbId];\
78 #define pdcpuMsgbFree(p)\
90 UINT8 integrityEnableFlag;
91 UINT8 cipherEnableFlag;
92 UINT64 maxIPDataRate; /* Maximum Integrity Protected Data Rate */
93 }PdcpuSecEnableInfo_t;
104 PDCP_DISCARD_TIMER = 1,
112 UINT32 f1uSn; /* Not used in receiving buffer */
115 struct timeval startTime;
116 }PdcpuDataBuffNode_t;
122 RohcParaPR_e rohcType;
125 ROHCConfig_t rohcConfig;
126 UplinkOnlyRohc_t uplinkOnlyRohc;
128 }HeaderCompression_t;
137 PdcpRlcMode_e rlcMode;
140 PdcpSnSize_e pdcpSnSizeUl;
141 PdcpSnSize_e pdcpSnSizeDl;
142 HeaderCompression_t headerCompress;
144 UINT8 tDiscardActive; /* TRUE/FALSE */
145 UINT8 tDiscardRun; /* TRUE/FALSE */
146 UINT16 tDiscard; /* ms */
147 ModuleMsg_t *pDiscardMsg;
149 UINT8 tReorderActive; /* TRUE/FALSE */
150 UINT8 tReorderRun; /* TRUE/FALSE */
151 UINT16 tReorder; /* ms */
152 ModuleMsg_t *pReorderMsg;
155 MoreThanOneRLCContext moreThanOneRLCContext;
156 UINT8 integrityProtection; /* TRUR: used, FALSE: not used */
157 UINT8 outOfOrderDelivery;
158 UINT8 ciperingEnabled; /* TRUR: used, FALSE: not used */
159 PdcpStateVar_t stateVar;
161 plist pTxPduList; /* transmitting buffer */
162 ULONG txListLock; /* txListLock */
164 plist pRxSduList; /* receiving buffer */
165 ULONG rxListLock; /* rxListLock */
172 UINT32 kUpEnc[4]; /* 128 bit */
173 UINT32 kUpInt[4]; /* 128 bit */
174 UINT32 nh[8]; /* Next Hop parameter 256 bit */
175 UINT8 ncc; /* maximum: 3bit */
176 UINT8 encAlgorithm; /* Encryption Algorithm */
177 UINT8 intAlgorithm; /* Integrity Algorithm */
178 UINT8 encActiveFlag; /* define whether the encryption function has been activated */
179 UINT8 intActiveFlag; /* define whether the integrity protection function has been activated */
180 UINT8 nhInd; /* 1: nh existed 0: not existed */
186 CuupBearerStatus_e ueStatus;
187 PdcpuSecInfo_t *secInfo;
188 PdcpuSecEnableInfo_t *secEnableInfo[CUUP_MAX_SESSION_NUM];
189 PdcpDrbEntity_t *pdcpDrbEntity[MAX_DRB_NUM];
199 #endif /* PDCP_U_H */