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 /* Defines APIs exchanged between du_app and cl module of RLC */
24 #define EVENT_RLC_UE_CREATE_REQ 210
25 #define EVENT_RLC_UE_CREATE_RSP 211 /*!< Config Confirm */
26 #define EVENT_UL_RRC_MSG_TRANS_TO_DU 212
27 #define EVENT_DL_RRC_MSG_TRANS_TO_RLC 213
28 #define EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU 214
29 #define EVENT_RLC_UE_RECONFIG_REQ 215
30 #define EVENT_RLC_UE_RECONFIG_RSP 216
31 #define EVENT_DL_RRC_MSG_RSP_TO_DU 217
32 #define EVENT_DL_USER_DATA_TRANS_TO_RLC 218
33 #define EVENT_UL_USER_DATA_TRANS_TO_DU 219
34 #define EVENT_RLC_UE_DELETE_REQ 220
35 #define EVENT_RLC_UE_DELETE_RSP 221
36 #define EVENT_RLC_SLICE_PM_TO_DU 222
41 #define RB_TYPE_SRB 0 /* Signalling Radio Bearer */
42 #define RB_TYPE_DRB 1 /* Data Radio Bearer */
44 /* RLC Direction Config */
45 #define RLC_CFG_DIR_UL 1 /*!< Uplink direction */
46 #define RLC_CFG_DIR_DL 2 /*!< Downlink direction */
47 #define RLC_CFG_DIR_BOTH 3 /*!< Both Downlink and Uplink Direction*/
50 /* Logical Channel Type */
51 #define LCH_BCCH 1 /*!< BCCH Logical Channel */
52 #define LCH_PCCH 2 /*!< PCCH Logical Channel */
53 #define LCH_CCCH 3 /*!< CCCH Logical Channel */
54 #define LCH_DTCH 4 /*!< DTCH Logical Channel */
55 #define LCH_DCCH 5 /*!< DCCH Logical Channel */
59 TRANSMISSION_IN_PROGRESS,
60 TRANSMISSION_COMPLETE,
66 RLC_CFG_REAS_NONE , /*!< No Failure */
67 RLC_CFG_REAS_RB_CREAT_FAIL , /*!< RB CB creation Failure */
68 RLC_CFG_REAS_UE_CREAT_FAIL , /*!< UE CB creation Failure */
69 RLC_CFG_REAS_CELL_CREAT_FAIL , /*!< CELL CB creation Failure */
70 RLC_CFG_REAS_RB_PRSNT , /*!< RB CB already present */
71 RLC_CFG_REAS_LCHTYPE_MIS , /*!< Logical channel type mismatch */
72 RLC_CFG_REAS_RB_UNKWN , /*!< RB Cb unknown */
73 RLC_CFG_REAS_UE_UNKWN , /*!< UE Cb unknown */
74 RLC_CFG_REAS_CELL_UNKWN , /*!< Cell Cb unknown */
75 RLC_CFG_REAS_RB_DEL_FAIL , /*!< RB Cb Deletion Failure */
76 RLC_CFG_REAS_UE_DEL_FAIL , /*!< UE Cb Deletion Failure */
77 RLC_CFG_REAS_RB_REEST_FAIL , /*!< RB Cb Re establish Failure */
78 RLC_CFG_REAS_RB_MODE_MIS , /*!< RB Cb Mode mismatch */
79 RLC_CFG_REAS_REEST_FAIL , /*!< RB Cb Re-establishment Failed */
80 RLC_CFG_REAS_RECFG_FAIL , /*!< RB Cb Re-configuration Failed */
81 RLC_CFG_REAS_INVALID_CFG , /*!< Invalid Configuration Type */
82 RLC_CFG_REAS_SAME_UEID , /*!< UE Ids match in ChngUeId Request */
83 RLC_CFG_REAS_CELL_DEL_FAIL , /*!< Cell Cb Deletion Failure */
84 RLC_CFG_REAS_INVALID_LCHID , /*!< Invalid LChId */
85 RLC_CFG_REAS_INVALID_DIR , /*!< Invalid Direction */
86 RLC_CFG_REAS_UE_EXISTS , /*!< UE ID already exists */
87 RLC_CFG_REAS_INVALID_SNLEN , /*!< Invalid SN Length */
88 RLC_CFG_REAS_SNLEN_MIS , /*!< SN Length mismatch */
89 RLC_CFG_REAS_INVALID_RGUSAP /*!< Invalid RGU SAP ID */
94 SUCCESSFUL , /*!< No Failure */
95 INVALID_CELLID , /*!< CellId not present */
96 INVALID_UEID , /*!< UEId not present */
101 RLC_AM, //Acknowledged Mode
102 RLC_UM_BI_DIRECTIONAL, //UnAcknowledged Mode
103 RLC_UM_UNI_DIRECTIONAL_UL,
104 RLC_UM_UNI_DIRECTIONAL_DL
121 RLC_DU_APP_RSP_OK = 1,
125 typedef struct ulAmCfg
127 SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
128 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
129 int16_t statProhTmr; /* T_status_prohibit Timer in msec*/
133 typedef struct dlAmCfg
135 SnLenAm snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
136 uint16_t pollRetxTmr; /* T_poll_retransmit Timer in msec */
137 int16_t pollPdu; /* Used to trigger a poll for every pollPdu.*/
138 int32_t pollByte; /* Poll_Byte in bytes. */
139 uint8_t maxRetxTh; /* Max_Retx_Threshold */
143 typedef struct dlUmCfg
145 SnLenUm snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
149 typedef struct ulUmCfg
151 SnLenUm snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
152 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
156 typedef struct amBearerCfg
162 typedef struct umBiDirBearerCfg
168 typedef struct umUniDirUlBearerCfg
171 }UmUniDirUlBearerCfg;
173 typedef struct umUniDirDlBearerCfg
176 }UmUniDirDlBearerCfg;
178 /* Spec Ref: 38.331, 6.3.2 RLC-BearerConfig */
179 typedef struct rlcBearerCfg
181 ConfigType configType;
191 UmBiDirBearerCfg *umBiDirCfg;
192 UmUniDirUlBearerCfg *umUniDirUlCfg;
193 UmUniDirDlBearerCfg *umUniDirDlCfg;
197 typedef struct rlcUeCfg
202 RlcBearerCfg rlcLcCfg[MAX_NUM_LC];
203 UeCfgState rlcUeCfgState; /* InActive / Completed */
206 typedef struct rlcUeCfgRsp
211 FailureReason reason;
214 typedef struct rlcUeDelete
220 typedef struct rlcUeDeleteRsp
224 UeDeleteResult result;
227 /* UL RRC Message from RLC to DU APP */
228 typedef struct ulRrcMsgInfo
230 uint16_t cellId; /* Cell Id */
231 uint16_t ueIdx; /* UE Index */
232 uint8_t lcId; /* Logical channel Id */
233 uint16_t msgLen; /* RRC message length (in bytes) */
234 uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */
237 /* UL User Data from RLC to DU APP */
238 typedef struct ulUserDatInfo
240 uint16_t cellId; /* Cell Id */
241 uint16_t ueIdx; /* UE Index */
243 uint16_t msgLen; /* User data length (in bytes) */
244 uint8_t *userData; /* User data (UL-DTCH Message) */
247 /* DL RRC Message from DU APP to RLC */
248 typedef struct dlRrcMsgInfo
250 uint16_t cellId; /* Cell Id */
251 uint16_t ueIdx; /* UE index */
252 uint8_t rbType; /* Radio Bearer Type */
253 uint8_t rbId; /* Radio Bearer Id */
254 uint8_t lcType; /* Logical channel type */
255 uint8_t lcId; /* Logical channel Id */
256 bool execDup; /* Execution duplication enabled */
257 bool deliveryStaRpt; /* Reporting of delivery status by RLC to DU-APP enabled */
258 uint16_t msgLen; /* RRC Message length */
259 uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */
262 /* DL RRC Message Rsp From RLC to DU APP */
263 typedef struct dlRrcMsgRsp
265 uint16_t cellId; /* Cell Id */
266 uint16_t crnti; /* UE index */
267 DlMsgState state; /* Dl RRC Msg State */
270 /* RRC delivery message from RLC to DU APP */
271 typedef struct rrcDeliveryStatus
273 uint16_t deliveryStatus;
274 uint16_t triggeringMessage;
283 /*Pm Metric for NW Slicing from RLC to DUAPP*/
284 typedef struct slicePm
286 SliceIdentifier networkSliceIdentifier;
291 typedef struct slicePmList
294 SlicePm *sliceRecord;
297 typedef struct rrcDeliveryReportInfo
302 RrcDeliveryStatus rrcDeliveryStatus;
305 /* DL Data Message from DU APP to RLC */
306 typedef struct dlDataMsgInfo
308 uint16_t cellId; /* Cell Id */
309 uint16_t ueIdx; /* UE index */
310 uint8_t rbId; /* Radio Bearer Id */
311 uint16_t msgLen; /* Message length */
312 Buffer *dlMsg; /* DL Data */
315 /* Function Pointers */
316 /* UE create Request from DU APP to RLC*/
317 typedef uint8_t (*DuRlcUeCreateReq) ARGS((
321 /* UE Cfg Response from RLC to DU APP*/
322 typedef uint8_t (*RlcDuUeCfgRsp) ARGS((
324 RlcUeCfgRsp *ueCfgRsp));
326 /* UE Delete Response from RLC to DU APP*/
327 typedef uint8_t (*RlcDuUeDeleteRsp) ARGS((
329 RlcUeDeleteRsp *ueDelRsp));
331 /* UL RRC Message from RLC to DU APP */
332 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
334 RlcUlRrcMsgInfo *ulRrcMsgInfo));
336 /* DL RRC Message from DU APP to RLC */
337 typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
339 RlcDlRrcMsgInfo *dlRrcMsgInfo));
341 /* RRC delivery message from RLC to DU APP */
342 typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
344 RrcDeliveryReport *rrcDeliveryReport));
346 /* UE Reconfig Request from DU APP to RLC */
347 typedef uint8_t (*DuRlcUeReconfigReq) ARGS((
351 /* UE Delete Request from DU APP to RLC */
352 typedef uint8_t (*DuRlcUeDeleteReq) ARGS((
354 RlcUeDelete *ueDelete));
356 /* DL RRC Message from RLC to DU APP */
357 typedef uint8_t (*RlcDlRrcMsgRspToDuFunc) ARGS((
359 RlcDlRrcMsgRsp *dlRrcMsgRsp));
361 /* UL User data from RLC to DU APP */
362 typedef uint8_t (*RlcUlUserDataToDuFunc) ARGS((
364 RlcUlUserDatInfo *ulUserData));
366 /* DL User Data from DU APP to RLC */
367 typedef uint8_t (*DuRlcDlUserDataToRlcFunc) ARGS((
369 RlcDlUserDataInfo *dlDataMsg));
371 /* Slice Metrics from RLC to DU APP */
372 typedef uint8_t (*RlcSlicePmToDuFunc) ARGS((
374 SlicePmList *sliceStats));
376 /* Pack/Unpack function declarations */
377 uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
378 uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
379 uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
380 uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf);
381 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
382 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
383 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
384 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
385 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
386 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
387 uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg);
388 uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf);
389 uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
390 uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf);
391 uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData);
392 uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf);
393 uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlDataMsg);
394 uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf);
395 uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
396 uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf);
397 uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
398 uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf);
399 uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats);
400 uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf);
402 /* Event Handler function declarations */
403 uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
404 uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
405 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
406 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
407 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
408 uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg);
409 uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg);
410 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData);
411 uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo);
412 uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
413 uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp);
414 uint8_t DuProcRlcSliceMetrics(Pst *pst, SlicePmList *sliceStats);
415 #endif /* RLC_INF_H */
417 /**********************************************************************
419 **********************************************************************/