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 #ifndef __CU_MGR_MAIN_H__
20 #define __CU_MGR_MAIN_H__
23 #define CU_NAME "ORAN OAM CU"
25 #define DU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0001"
26 #define CU_IP_V6_ADDR "0000:0000:0000:0000:0000:0000:0000:0011"
29 #define LOCAL_IP_CU "192.168.130.82"
31 #define F1_SCTP_PORT 38472
32 #define NUM_F1_ASSOC 1
33 #define REMOTE_IP_DU (char*[]){"192.168.130.81", "192.168.130.83"}
36 #define DU_EGTP_PORT (int[]){39001, 39002}
37 #define CU_EGTP_PORT (int[]){39003, 39004}
48 #define CU_DU_NAME_LEN_MAX 30 /* Max length of CU/DU name string */
50 #define CU_APP_MEM_REG 1
53 #define MAX_NUM_OF_SLICE 1024 /* As per the spec 38.473, maxnoofSliceItems = 1024*/
54 #define MAX_QOS_FLOWS 64 /* As per the spec 38.331, maxNrofQFIs = 64 */
56 /* allocate and zero out a static buffer */
58 #define CU_ALLOC(_datPtr, _size) \
61 _ret = SGetSBuf(CU_APP_MEM_REG, CU_POOL, \
62 (Data **)&_datPtr, _size); \
64 memset(_datPtr, 0, _size); \
69 /* free a static buffer */
70 #define CU_FREE(_datPtr, _size) \
72 SPutSBuf(CU_APP_MEM_REG, CU_POOL, \
73 (Data *)_datPtr, _size);
75 #define SEARCH_DU_DB(_duIdx, _duId, _duDb){\
77 for(_duIdx=0; _duIdx < cuCb.numDu; _duIdx++)\
79 if(cuCb.duInfo[_duIdx].duId == _duId)\
81 _duDb = (&cuCb.duInfo[_duIdx]);\
87 #define SEARCH_CELL_DB(_cellIdx, _duDb, _nrCellId, _cellCb){\
89 for(_cellIdx=0; _cellIdx < _duDb->numCells; _cellIdx++)\
91 if(_duDb->cellCb[_cellIdx].nrCellId == _nrCellId)\
93 _cellCb = (&(_duDb->cellCb[_cellIdx]));\
100 /* Set this parameter true of false as per the need to enable or disable drx of
102 #define DRX_TO_BE_RELEASE true
109 CELL_DELETION_IN_PROGRESS
115 UE_ATTACH_IN_PROGRESS,
117 UE_HANDOVER_IN_PROGRESS
120 typedef struct RrcVersion
122 uint8_t rrcVer; /* Latest RRC Version */
123 uint32_t extRrcVer; /* Latest RRC version extended */
126 typedef struct cuCfgParams
129 char cuName[CU_DU_NAME_LEN_MAX];
130 CuSctpParams sctpParams;
132 CuEgtpParams egtpParams;
133 RrcVersion rrcVersion;
136 typedef struct handoverInfo
142 typedef struct dlAmCfg
144 uint8_t snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
145 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
146 int16_t statProhTmr; /* T_status_prohibit Timer in msec*/
149 typedef struct ulAmCfg
151 uint8_t snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
152 uint16_t pollRetxTmr; /* T_poll_retransmit Timer in msec */
153 int16_t pollPdu; /* Used to trigger a poll for every pollPdu.*/
154 int32_t pollByte; /* Poll_Byte in bytes. */
155 uint8_t maxRetxTh; /* Max_Retx_Threshold */
158 typedef struct amBearerCfg
164 typedef struct ulUmCfg
166 uint8_t snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
169 typedef struct dlUmCfg
171 uint8_t snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
172 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
175 typedef struct umBiDirBearerCfg
181 typedef struct umUniDirUlBearerCfg
184 }UmUniDirUlBearerCfg;
186 typedef struct umUniDirDlBearerCfg
189 }UmUniDirDlBearerCfg;
191 typedef struct rlcLcCfg
197 UmBiDirBearerCfg umBiDirCfg;
198 UmUniDirUlBearerCfg umUniDirUlCfg;
199 UmUniDirDlBearerCfg umUniDirDlCfg;
203 typedef struct macLcCfg
208 uint8_t pbr; // prioritisedBitRate
209 uint8_t bsd; // bucketSizeDuration
212 typedef struct srbInfo
221 typedef struct qosInfo
223 uint8_t nonDynFiveQI;
225 uint16_t maxBurstDataVol;
226 uint8_t priorityLevel;
227 uint8_t preemptionCapability;
228 uint8_t preemptionVulnerability;
229 uint8_t pduSessionId;
232 typedef struct flowsMapped
238 typedef struct TnlInfo
244 typedef struct drbInfo
251 FlowsMapped flowMapList[MAX_QOS_FLOWS];
260 typedef struct cuCellCb CuCellCb;
263 /* The following list of structures is taken from the DRX-Config section of specification 33.331. */
264 typedef struct drxOnDurationTimer
266 bool onDurationTimerValInMs;
269 uint8_t subMilliSeconds;
270 uint16_t milliSeconds;
271 }onDurationtimerValue;
274 typedef struct drxLongCycleStartOffset
276 uint16_t drxLongCycleStartOffsetChoice;
277 uint16_t drxLongCycleStartOffsetVal;
278 }DrxLongCycleStartOffset;
280 typedef struct shortDrx
282 uint16_t drxShortCycle;
283 uint8_t drxShortCycleTimer;
286 typedef struct drxCfg
288 DrxOnDurationTimer drxOnDurationTimer;
289 uint16_t drxInactivityTimer;
290 uint8_t drxHarqRttTimerDl;
291 uint8_t drxHarqRttTimerUl;
292 uint16_t drxRetransmissionTimerDl;
293 uint16_t drxRetransmissionTimerUl;
294 DrxLongCycleStartOffset drxLongCycleStartOffset;
297 uint8_t drxSlotOffset;
301 typedef struct cuUeCb
305 uint8_t gnbDuUeF1apId;
306 uint8_t gnbCuUeF1apId;
309 SrbInfo srbList[MAX_NUM_SRB];
311 DrbInfo drbList[MAX_NUM_DRB];
325 CuUeCb *ueCb[MAX_NUM_UE];
326 CellStatusInfo cellStatus;
332 char duName[CU_DU_NAME_LEN_MAX];
334 CuCellCb cellCb[MAX_NUM_CELL];
336 CuUeCb ueCb[MAX_NUM_CELL * MAX_NUM_UE];
339 typedef struct cuGlobalCb
341 CuCfgParams cuCfgParams;
342 uint8_t numSnssaiSupported;
343 Snssai *snssaiList[MAX_NUM_OF_SLICE];
345 DuDb duInfo[MAX_DU_SUPPORTED];
346 uint32_t gnbCuUeF1apIdGenerator; /* Generating CU UE F1AP ID */
352 void cuAppInmsgHdlr(Buffer *mBuf);
353 void sctpNtfyInd(CmInetSctpNotification *ntfy);
354 uint8_t egtpInitReq();
355 void *cuConsoleHandler(void *);
359 /**********************************************************************
361 **********************************************************************/