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
37 #define EVENT_RLC_UE_REESTABLISH_REQ 223
38 #define EVENT_RLC_UE_REESTABLISH_RSP 224
43 /* RLC Direction Config */
44 #define RLC_CFG_DIR_UL 1 /*!< Uplink direction */
45 #define RLC_CFG_DIR_DL 2 /*!< Downlink direction */
46 #define RLC_CFG_DIR_BOTH 3 /*!< Both Downlink and Uplink Direction*/
49 /* Logical Channel Type */
50 #define LCH_BCCH 1 /*!< BCCH Logical Channel */
51 #define LCH_PCCH 2 /*!< PCCH Logical Channel */
52 #define LCH_CCCH 3 /*!< CCCH Logical Channel */
53 #define LCH_DTCH 4 /*!< DTCH Logical Channel */
54 #define LCH_DCCH 5 /*!< DCCH Logical Channel */
58 RB_TYPE_SRB, /* Signalling Radio Bearer */
59 RB_TYPE_DRB /* Data Radio Bearer */
64 TRANSMISSION_IN_PROGRESS,
65 TRANSMISSION_COMPLETE,
71 RLC_CFG_REAS_NONE , /*!< No Failure */
72 RLC_CFG_REAS_RB_CREAT_FAIL , /*!< RB CB creation Failure */
73 RLC_CFG_REAS_UE_CREAT_FAIL , /*!< UE CB creation Failure */
74 RLC_CFG_REAS_CELL_CREAT_FAIL , /*!< CELL CB creation Failure */
75 RLC_CFG_REAS_RB_PRSNT , /*!< RB CB already present */
76 RLC_CFG_REAS_LCHTYPE_MIS , /*!< Logical channel type mismatch */
77 RLC_CFG_REAS_RB_UNKWN , /*!< RB Cb unknown */
78 RLC_CFG_REAS_UE_UNKWN , /*!< UE Cb unknown */
79 RLC_CFG_REAS_CELL_UNKWN , /*!< Cell Cb unknown */
80 RLC_CFG_REAS_RB_DEL_FAIL , /*!< RB Cb Deletion Failure */
81 RLC_CFG_REAS_UE_DEL_FAIL , /*!< UE Cb Deletion Failure */
82 RLC_CFG_REAS_RB_REEST_FAIL , /*!< RB Cb Re establish Failure */
83 RLC_CFG_REAS_RB_MODE_MIS , /*!< RB Cb Mode mismatch */
84 RLC_CFG_REAS_REEST_FAIL , /*!< RB Cb Re-establishment Failed */
85 RLC_CFG_REAS_RECFG_FAIL , /*!< RB Cb Re-configuration Failed */
86 RLC_CFG_REAS_INVALID_CFG , /*!< Invalid Configuration Type */
87 RLC_CFG_REAS_SAME_UEID , /*!< UE Ids match in ChngUeId Request */
88 RLC_CFG_REAS_CELL_DEL_FAIL , /*!< Cell Cb Deletion Failure */
89 RLC_CFG_REAS_INVALID_LCHID , /*!< Invalid LChId */
90 RLC_CFG_REAS_INVALID_DIR , /*!< Invalid Direction */
91 RLC_CFG_REAS_UE_EXISTS , /*!< UE ID already exists */
92 RLC_CFG_REAS_INVALID_SNLEN , /*!< Invalid SN Length */
93 RLC_CFG_REAS_SNLEN_MIS , /*!< SN Length mismatch */
94 RLC_CFG_REAS_INVALID_RGUSAP /*!< Invalid RGU SAP ID */
99 RLC_AM, //Acknowledged Mode
100 RLC_UM_BI_DIRECTIONAL, //UnAcknowledged Mode
101 RLC_UM_UNI_DIRECTIONAL_UL,
102 RLC_UM_UNI_DIRECTIONAL_DL
119 RLC_DU_APP_RSP_OK = 1,
123 typedef struct ulAmCfg
125 SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
126 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
127 int16_t statProhTmr; /* T_status_prohibit Timer in msec*/
131 typedef struct dlAmCfg
133 SnLenAm snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
134 uint16_t pollRetxTmr; /* T_poll_retransmit Timer in msec */
135 int16_t pollPdu; /* Used to trigger a poll for every pollPdu.*/
136 int32_t pollByte; /* Poll_Byte in bytes. */
137 uint8_t maxRetxTh; /* Max_Retx_Threshold */
141 typedef struct dlUmCfg
143 SnLenUm snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
147 typedef struct ulUmCfg
149 SnLenUm snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
150 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
154 typedef struct amBearerCfg
160 typedef struct umBiDirBearerCfg
166 typedef struct umUniDirUlBearerCfg
169 }UmUniDirUlBearerCfg;
171 typedef struct umUniDirDlBearerCfg
174 }UmUniDirDlBearerCfg;
176 /* Spec Ref: 38.331, 6.3.2 RLC-BearerConfig */
177 typedef struct rlcBearerCfg
188 UmBiDirBearerCfg *umBiDirCfg;
189 UmUniDirUlBearerCfg *umUniDirUlCfg;
190 UmUniDirDlBearerCfg *umUniDirDlCfg;
192 bool isLcAddModRspSent;
195 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.3 UE Reconfiguration */
196 typedef struct rlcUeRecfg
201 RlcBearerCfg rlcLcCfgAdd[MAX_NUM_LC];
203 RlcBearerCfg rlcLcCfgMod[MAX_NUM_LC];
205 RlcBearerCfg rlcLcCfgRel[MAX_NUM_LC];
208 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.1 UE Create */
209 typedef struct rlcUeCfg
214 RlcBearerCfg rlcLcCfgAdd[MAX_NUM_LC];
217 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.2 UE Create Response */
218 typedef struct rlcUeCfgRsp
223 FailureReason reason;
226 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.5 UE Delete Response */
227 typedef struct rlcUeDelete
233 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.6 UE Delete Response */
234 typedef struct rlcUeDeleteRsp
238 CauseOfResult status;
241 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.8 UL RRC Message Transfer*/
242 typedef struct ulRrcMsgInfo
244 uint16_t cellId; /* Cell Id */
245 uint16_t ueId; /* UE Id */
246 uint8_t lcId; /* Logical channel Id */
247 uint16_t msgLen; /* RRC message length (in bytes) */
248 uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */
251 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.7 DL RRC Message Transfer */
252 typedef struct dlRrcMsgInfo
254 uint16_t cellId; /* Cell Id */
255 uint16_t ueId; /* UE Id */
256 uint8_t lcId; /* Logical channel Id {1...3} */
257 bool execDup; /* Execution duplication enabled */
258 bool deliveryStaRpt; /* Reporting of delivery status by RLC to DU-APP enabled */
259 uint16_t msgLen; /* RRC Message length */
260 uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */
263 /* UL User Data from RLC to DU APP */
264 typedef struct ulUserDatInfo
266 uint16_t cellId; /* Cell Id */
267 uint16_t ueId; /* UE Id */
269 uint16_t msgLen; /* User data length (in bytes) */
270 uint8_t *userData; /* User data (UL-DTCH Message) */
273 /* DL RRC Message Rsp From RLC to DU APP */
274 typedef struct dlRrcMsgRsp
276 uint16_t cellId; /* Cell Id */
277 uint16_t crnti; /* UE index */
278 DlMsgState state; /* Dl RRC Msg State */
287 /*Pm Metric for NW Slicing from RLC to DUAPP*/
288 typedef struct slicePm
290 SliceIdentifier networkSliceIdentifier;
295 typedef struct slicePmList
298 SlicePm *sliceRecord;
301 /* DL Data Message from DU APP to RLC */
302 typedef struct dlDataMsgInfo
304 uint16_t cellId; /* Cell Id */
305 uint16_t ueId; /* UE Id */
306 uint8_t rbId; /* Radio Bearer Id {4 .. MAC
\7fX_NUM_DRB} */
307 uint16_t msgLen; /* Message length */
308 Buffer *dlMsg; /* DL Data */
311 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.9 UL RRC Message Delivery Report */
312 typedef struct rrcDeliveryStatus
314 uint16_t deliveryStatus;
315 uint16_t triggeringMessage;
318 typedef struct rrcDeliveryReportInfo
323 RrcDeliveryStatus rrcDeliveryStatus;
326 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.11 UE RLC Re-establishment Req */
328 typedef struct rlcUeReestablishReq
332 uint8_t numLcsToReestablish;
333 uint8_t lcToReestablish[MAX_NUM_LC];
334 }RlcUeReestablishReq;
336 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.12 UE RLC Re-establishment Rsp */
337 typedef struct rlcUeReestablishRsp
341 CauseOfResult status;
342 }RlcUeReestablishRsp;
344 /* Function Pointers */
345 /* UE create Request from DU APP to RLC*/
346 typedef uint8_t (*DuRlcUeCreateReq) ARGS((
350 /* UE Cfg Response from RLC to DU APP*/
351 typedef uint8_t (*RlcDuUeCfgRsp) ARGS((
353 RlcUeCfgRsp *ueCfgRsp));
355 /* UE Delete Response from RLC to DU APP*/
356 typedef uint8_t (*RlcDuUeDeleteRsp) ARGS((
358 RlcUeDeleteRsp *ueDelRsp));
360 /* UL RRC Message from RLC to DU APP */
361 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
363 RlcUlRrcMsgInfo *ulRrcMsgInfo));
365 /* DL RRC Message from DU APP to RLC */
366 typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
368 RlcDlRrcMsgInfo *dlRrcMsgInfo));
370 /* RRC delivery message from RLC to DU APP */
371 typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
373 RrcDeliveryReport *rrcDeliveryReport));
375 /* UE Reconfig Request from DU APP to RLC */
376 typedef uint8_t (*DuRlcUeReconfigReq) ARGS((
378 RlcUeRecfg *ueRecfg ));
380 /* UE Delete Request from DU APP to RLC */
381 typedef uint8_t (*DuRlcUeDeleteReq) ARGS((
383 RlcUeDelete *ueDelete));
385 /* DL RRC Message from RLC to DU APP */
386 typedef uint8_t (*RlcDlRrcMsgRspToDuFunc) ARGS((
388 RlcDlRrcMsgRsp *dlRrcMsgRsp));
390 /* UL User data from RLC to DU APP */
391 typedef uint8_t (*RlcUlUserDataToDuFunc) ARGS((
393 RlcUlUserDatInfo *ulUserData));
395 /* DL User Data from DU APP to RLC */
396 typedef uint8_t (*DuRlcDlUserDataToRlcFunc) ARGS((
398 RlcDlUserDataInfo *dlDataMsg));
400 /* Slice Metrics from RLC to DU APP */
401 typedef uint8_t (*RlcSlicePmToDuFunc) ARGS((
403 SlicePmList *sliceStats));
405 /* UE Re-establishment Request from DU APP to RLC */
406 typedef uint8_t (*DuRlcUeReestablishReq) ARGS((
408 RlcUeReestablishReq *ueReestablishReq));
410 /* UE Re-establishment Response from RLC to DU APP*/
411 typedef uint8_t (*RlcDuUeReestablishRsp) ARGS((
413 RlcUeReestablishRsp *ueDelRsp));
415 /* Pack/Unpack function declarations */
416 uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
417 uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
418 uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
419 uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf);
420 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
421 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
422 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
423 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
424 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
425 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
426 uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeRecfg *ueCfg);
427 uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf);
428 uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
429 uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf);
430 uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData);
431 uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf);
432 uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlDataMsg);
433 uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf);
434 uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
435 uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf);
436 uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
437 uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf);
438 uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats);
439 uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf);
440 uint8_t packDuRlcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish);
441 uint8_t unpackRlcUeReestablishReq(DuRlcUeReestablishReq func, Pst *pst, Buffer *mBuf);
442 uint8_t packRlcDuUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablishRsp);
443 uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf);
445 /* Event Handler function declarations */
446 uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
447 uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
448 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
449 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
450 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
451 uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeRecfg *ueCfg);
452 uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg);
453 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData);
454 uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo);
455 uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
456 uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp);
457 uint8_t DuProcRlcSliceMetrics(Pst *pst, SlicePmList *sliceStats);
458 uint8_t RlcProcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish);
459 uint8_t DuProcRlcUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *delRsp);
460 #endif /* RLC_INF_H */
462 /**********************************************************************
464 **********************************************************************/