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 /* This file contains message handling functionality for DU cell management */
33 #define DU_SAP_UNBOUND 1
34 #define DU_SAP_BINDING 2
35 #define DU_SAP_BOUND 3
44 #define RLC_MAC_SAP_CFG 2
45 #define RLC_UDX_SAP_CFG 4
51 #define DU_RLC_UL_CONFIGURED (RLC_GEN_CFG | \
52 RLC_MAC_SAP_CFG | RLC_UDX_SAP_CFG)
53 #define DU_RLC_DL_CONFIGURED DU_RLC_UL_CONFIGURED
55 #define MAC_CONFIGURED (MAC_GEN_CFG | MAC_SAP_CFG)
57 #define DU_SET_ZERO(_buf, _size) \
58 memset((_buf), 0, _size);
63 ACTIVATION_IN_PROGRESS,
82 typedef struct f1setupRsp
84 uint32_t transId; /* Uniquely identify transaction */
85 char cuName[CU_DU_NAME_LEN_MAX]; /* CU Name */
86 F1RrcVersion rrcVersion; /* RRC version */
89 typedef struct f1DlRrcMsg
91 uint32_t gnbDuUeF1apId;
92 uint32_t gnbCuUeF1apId;
100 typedef struct duUeCfg
103 void *ueNrCapability;
104 uint8_t numRlcLcs; /* Rlc Ue Cfg */
105 RlcBearerCfg rlcLcCfg[MAX_NUM_LC];
106 uint8_t numMacLcs; /* Mac Ue Cfg */
107 LcCfg macLcCfg[MAX_NUM_LC];
111 typedef struct f1UeContextSetup
113 UeCtxtActionType actionType;
116 F1DlRrcMsg *dlRrcMsg;
119 typedef struct cellCfgParams
121 NrEcgi nrEcgi; /* ECGI */
122 uint16_t nrPci; /* PCI */
123 uint16_t fiveGsTac; /* 5gSTac */
124 Plmn plmn[MAX_PLMN]; /* List of serving PLMN IDs */
125 uint32_t maxUe; /* max UE per slot */
128 typedef struct duUeCb
130 F1UeContextSetupDb *f1UeDb;
132 uint32_t gnbDuUeF1apId; /* GNB DU UE F1AP ID */
133 uint32_t gnbCuUeF1apId; /* GNB CU UE F1AP ID */
134 uint32_t drbBitMap; /* Drb Bit Map */
135 UeState ueState; /* UE Active/ Ue Inactive state */
136 MacUeCfg macUeCfg; /* Mac Ue Cfg */
137 RlcUeCfg rlcUeCfg; /* Rlc Ue Cfg */
140 typedef struct duCellCb
142 uint16_t cellId; /* Internal cell Id */
143 CellCfgParams cellInfo; /* Cell info */
144 /* pointer to store the address of macCellCfg params used to send du-app to MAC */
145 MacCellCfg *duMacCellCfg;
146 bool firstSlotIndRcvd;
147 CellStatus cellStatus; /* Cell status */
148 uint32_t numActvUes; /* Total Active UEs */
149 DuUeCb ueCb[MAX_NUM_UE]; /* UE CONTEXT */
152 typedef struct duLSapCb
165 typedef struct ueCcchCtxt
167 uint32_t gnbDuUeF1apId; /* GNB DU UE F1AP ID */
168 uint16_t crnti; /* CRNTI */
169 uint16_t cellId; /* Cell Id */
176 Mem mem; /* Memory configs */
177 TskInit init; /* DU Init */
178 //DuLSapCb **macSap; /* MAC SAP */
179 bool f1Status; /* Status of F1 connection */
180 bool e2Status; /* Status of E2 connection */
182 DuCellCb* cfgCellLst[MAX_NUM_CELL]; /* List of cells at DU APP of type DuCellCb */
183 uint8_t numActvCells;
184 DuCellCb* actvCellLst[MAX_NUM_CELL]; /* List of cells activated/to be activated of type DuCellCb */
185 uint32_t numUe; /* current number of UEs */
186 UeCcchCtxt ueCcchCtxt[MAX_NUM_UE]; /* mapping of gnbDuUeF1apId to CRNTI required for CCCH processing*/
190 typedef struct duLSapCfg
208 /* global variables */
210 //DuCfgParams duCfgParam;
212 /* DU Cell Functions */
213 uint8_t duActvInit(Ent entity, Inst inst, Region region, Reason reason);
214 uint8_t duActvTsk(Pst *pst, Buffer *mBuf);
215 uint8_t duSendRlcUlCfg();
216 uint8_t duSendRlcDlCfg();
217 uint8_t duBuildRlcCfg(Inst inst);
218 uint8_t duBuildRlcLsapCfg(Ent ent, Inst inst, uint8_t lsapInst);
219 uint8_t duBuildRlcUsapCfg(uint8_t elemId, Ent ent, Inst inst);
220 uint8_t DuHdlRlcCfgComplete(Pst *pst, RlcMngmt *cfm);
221 uint8_t duHdlRlcCntrlCfgComplete(Pst *pst, RlcMngmt *cfm);
222 uint8_t duProcRlcUlCfgComplete(Pst *pst, RlcMngmt *cfm);
223 uint8_t duProcRlcDlCfgComplete(Pst *pst, RlcMngmt *cfm);
224 uint8_t duSendMacCfg();
225 uint8_t duBuildMacGenCfg();
226 uint8_t duBuildMacUsapCfg(SpId sapId);
227 uint8_t duHdlMacCfgComplete(Pst *pst, RgMngmt *cfm);
228 uint8_t duBindUnbindRlcToMacSap(uint8_t inst, uint8_t action);
229 uint8_t duProcCfgComplete();
230 uint8_t duSendSchCfg();
231 uint8_t duSctpStartReq();
232 uint8_t duSctpNtfyHdl(Buffer *mBuf, CmInetSctpNotification *ntfy);
234 uint8_t duBuildEgtpCfgReq();
235 uint8_t duHdlEgtpCfgComplete(CmStatus cfm);
236 uint8_t duSendEgtpSrvOpenReq();
237 uint8_t duHdlEgtpSrvOpenComplete(CmStatus cfm);
238 uint8_t duSendEgtpTnlMgmtReq(uint8_t action, uint32_t lclTeid, uint32_t remTeid);
239 uint8_t duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm);
240 uint8_t duSendEgtpTestData();
241 uint8_t duSendEgtpDatInd(Buffer *mBuf);
242 uint8_t duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
243 uint8_t duBuildAndSendMacCellStartReq();
244 uint8_t duBuildAndSendMacCellStopReq();
247 /**********************************************************************
249 **********************************************************************/