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 /* As per the spec 38.472, the registered port number for F1AP is 38472 */
32 #define NUM_F1_ASSOC 1
33 #define REMOTE_IP_DU (char*[]){"192.168.130.81", "192.168.130.83"}
35 #define XN_SCTP_PORT 38422 /* As per 3GPP TS 38.422, The SCTP Destination Port number value assigned by IANA to be used for XnAP is 38422 */
36 #define NUM_XN_ASSOC 0
37 #define REMOTE_IP_CU (char*[]){"192.168.130.84"}
38 #define LOCAL_NODE_TYPE SERVER
41 #define F1_EGTP_PORT 2152 /* As per the spec 29.281, the registered port number for GTP-U is 2152 */
52 #define CU_DU_NAME_LEN_MAX 30 /* Max length of CU/DU name string */
54 #define CU_APP_MEM_REG 1
57 #define MAX_NUM_OF_SLICE 1024 /* As per the spec 38.473, maxnoofSliceItems = 1024*/
58 #define MAX_QOS_FLOWS 64 /* As per the spec 38.331, maxNrofQFIs = 64 */
60 /* allocate and zero out a static buffer */
62 #define CU_ALLOC(_datPtr, _size) \
65 _ret = SGetSBuf(CU_APP_MEM_REG, CU_POOL, \
66 (Data **)&_datPtr, _size); \
68 memset(_datPtr, 0, _size); \
73 /* free a static buffer */
74 #define CU_FREE(_datPtr, _size) \
76 SPutSBuf(CU_APP_MEM_REG, CU_POOL, \
77 (Data *)_datPtr, _size);
79 #define SEARCH_DU_DB(_duIdx, _duId, _duDb){\
81 for(_duIdx=0; _duIdx < cuCb.numDu; _duIdx++)\
83 if(cuCb.duInfo[_duIdx].duId == _duId)\
85 _duDb = (&cuCb.duInfo[_duIdx]);\
91 #define SEARCH_CELL_DB(_cellIdx, _duDb, _nrCellId, _cellCb){\
93 for(_cellIdx=0; _cellIdx < _duDb->numCells; _cellIdx++)\
95 if(_duDb->cellCb[_cellIdx].nrCellId == _nrCellId)\
97 _cellCb = (&(_duDb->cellCb[_cellIdx]));\
104 /* Set this parameter true of false as per the need to enable or disable drx of
106 #define DRX_TO_BE_RELEASE true
111 Xn_Based_Inter_CU_HO = 1,
119 CELL_DELETION_IN_PROGRESS
125 UE_ATTACH_IN_PROGRESS,
127 UE_HANDOVER_IN_PROGRESS
130 typedef struct RrcVersion
132 uint8_t rrcVer; /* Latest RRC Version */
133 uint32_t extRrcVer; /* Latest RRC version extended */
136 typedef struct cuCfgParams
139 char cuName[CU_DU_NAME_LEN_MAX];
140 CuSctpParams sctpParams;
142 CuEgtpParams egtpParams;
143 RrcVersion rrcVersion;
146 typedef struct handoverInfo
152 typedef struct dlAmCfg
154 uint8_t snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
155 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
156 int16_t statProhTmr; /* T_status_prohibit Timer in msec*/
159 typedef struct ulAmCfg
161 uint8_t snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
162 uint16_t pollRetxTmr; /* T_poll_retransmit Timer in msec */
163 int16_t pollPdu; /* Used to trigger a poll for every pollPdu.*/
164 int32_t pollByte; /* Poll_Byte in bytes. */
165 uint8_t maxRetxTh; /* Max_Retx_Threshold */
168 typedef struct amBearerCfg
174 typedef struct ulUmCfg
176 uint8_t snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
179 typedef struct dlUmCfg
181 uint8_t snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
182 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
185 typedef struct umBiDirBearerCfg
191 typedef struct umUniDirUlBearerCfg
194 }UmUniDirUlBearerCfg;
196 typedef struct umUniDirDlBearerCfg
199 }UmUniDirDlBearerCfg;
201 typedef struct rlcLcCfg
207 UmBiDirBearerCfg umBiDirCfg;
208 UmUniDirUlBearerCfg umUniDirUlCfg;
209 UmUniDirDlBearerCfg umUniDirDlCfg;
213 typedef struct macLcCfg
218 uint8_t pbr; // prioritisedBitRate
219 uint8_t bsd; // bucketSizeDuration
222 typedef struct srbInfo
231 typedef struct qosInfo
233 uint8_t nonDynFiveQI;
235 uint16_t maxBurstDataVol;
236 uint8_t priorityLevel;
237 uint8_t preemptionCapability;
238 uint8_t preemptionVulnerability;
239 uint8_t pduSessionId;
242 typedef struct flowsMapped
248 typedef struct TnlInfo
254 typedef struct drbInfo
261 FlowsMapped flowMapList[MAX_QOS_FLOWS];
270 typedef struct cuCellCb CuCellCb;
273 /* The following list of structures is taken from the DRX-Config section of specification 33.331. */
274 typedef struct drxOnDurationTimer
276 bool onDurationTimerValInMs;
279 uint8_t subMilliSeconds;
280 uint16_t milliSeconds;
281 }onDurationtimerValue;
284 typedef struct drxLongCycleStartOffset
286 uint16_t drxLongCycleStartOffsetChoice;
287 uint16_t drxLongCycleStartOffsetVal;
288 }DrxLongCycleStartOffset;
290 typedef struct shortDrx
292 uint16_t drxShortCycle;
293 uint8_t drxShortCycleTimer;
296 typedef struct drxCfg
298 DrxOnDurationTimer drxOnDurationTimer;
299 uint16_t drxInactivityTimer;
300 uint8_t drxHarqRttTimerDl;
301 uint8_t drxHarqRttTimerUl;
302 uint16_t drxRetransmissionTimerDl;
303 uint16_t drxRetransmissionTimerUl;
304 DrxLongCycleStartOffset drxLongCycleStartOffset;
307 uint8_t drxSlotOffset;
311 typedef struct cuUeCb
315 uint8_t gnbDuUeF1apId;
316 uint8_t gnbCuUeF1apId;
319 SrbInfo srbList[MAX_NUM_SRB];
321 DrbInfo drbList[MAX_NUM_DRB];
335 CuUeCb *ueCb[MAX_NUM_UE];
336 CellStatusInfo cellStatus;
342 char duName[CU_DU_NAME_LEN_MAX];
344 CuCellCb cellCb[MAX_NUM_CELL];
346 CuUeCb ueCb[MAX_NUM_CELL * MAX_NUM_UE];
349 typedef struct cuGlobalCb
351 CuCfgParams cuCfgParams;
352 uint8_t numSnssaiSupported;
353 Snssai *snssaiList[MAX_NUM_OF_SLICE];
355 DuDb duInfo[MAX_DU_SUPPORTED];
356 uint32_t gnbCuUeF1apIdGenerator; /* Generating CU UE F1AP ID */
362 void cuAppInmsgHdlr(Buffer *mBuf);
363 void sctpNtfyInd(CmInetSctpNotification *ntfy);
364 uint8_t egtpInitReq();
365 void *cuConsoleHandler(void *);
369 /**********************************************************************
371 **********************************************************************/