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
39 #define EVENT_RLC_MAX_RETRANSMISSION 225
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 RB_TYPE_SRB, /* Signalling Radio Bearer */
60 RB_TYPE_DRB /* Data Radio Bearer */
65 TRANSMISSION_IN_PROGRESS,
66 TRANSMISSION_COMPLETE,
72 RLC_CFG_REAS_NONE , /*!< No Failure */
73 RLC_CFG_REAS_RB_CREAT_FAIL , /*!< RB CB creation Failure */
74 RLC_CFG_REAS_UE_CREAT_FAIL , /*!< UE CB creation Failure */
75 RLC_CFG_REAS_CELL_CREAT_FAIL , /*!< CELL CB creation Failure */
76 RLC_CFG_REAS_RB_PRSNT , /*!< RB CB already present */
77 RLC_CFG_REAS_LCHTYPE_MIS , /*!< Logical channel type mismatch */
78 RLC_CFG_REAS_RB_UNKWN , /*!< RB Cb unknown */
79 RLC_CFG_REAS_UE_UNKWN , /*!< UE Cb unknown */
80 RLC_CFG_REAS_CELL_UNKWN , /*!< Cell Cb unknown */
81 RLC_CFG_REAS_RB_DEL_FAIL , /*!< RB Cb Deletion Failure */
82 RLC_CFG_REAS_UE_DEL_FAIL , /*!< UE Cb Deletion Failure */
83 RLC_CFG_REAS_RB_REEST_FAIL , /*!< RB Cb Re establish Failure */
84 RLC_CFG_REAS_RB_MODE_MIS , /*!< RB Cb Mode mismatch */
85 RLC_CFG_REAS_REEST_FAIL , /*!< RB Cb Re-establishment Failed */
86 RLC_CFG_REAS_RECFG_FAIL , /*!< RB Cb Re-configuration Failed */
87 RLC_CFG_REAS_INVALID_CFG , /*!< Invalid Configuration Type */
88 RLC_CFG_REAS_SAME_UEID , /*!< UE Ids match in ChngUeId Request */
89 RLC_CFG_REAS_CELL_DEL_FAIL , /*!< Cell Cb Deletion Failure */
90 RLC_CFG_REAS_INVALID_LCHID , /*!< Invalid LChId */
91 RLC_CFG_REAS_INVALID_DIR , /*!< Invalid Direction */
92 RLC_CFG_REAS_UE_EXISTS , /*!< UE ID already exists */
93 RLC_CFG_REAS_INVALID_SNLEN , /*!< Invalid SN Length */
94 RLC_CFG_REAS_SNLEN_MIS , /*!< SN Length mismatch */
95 RLC_CFG_REAS_INVALID_RGUSAP /*!< Invalid RGU SAP ID */
100 RLC_AM, //Acknowledged Mode
101 RLC_UM_BI_DIRECTIONAL, //UnAcknowledged Mode
102 RLC_UM_UNI_DIRECTIONAL_UL,
103 RLC_UM_UNI_DIRECTIONAL_DL
120 RLC_DU_APP_RSP_OK = 1,
124 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.10 RLC Max Retransmission Reached */
126 typedef struct rlcMaxRetransInd
134 typedef struct ulAmCfg
136 SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
137 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
138 int16_t statProhTmr; /* T_status_prohibit Timer in msec*/
142 typedef struct dlAmCfg
144 SnLenAm snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
145 uint16_t pollRetxTmr; /* T_poll_retransmit Timer in msec */
146 int16_t pollPdu; /* Used to trigger a poll for every pollPdu.*/
147 int32_t pollByte; /* Poll_Byte in bytes. */
148 uint8_t maxRetxTh; /* Max_Retx_Threshold */
152 typedef struct dlUmCfg
154 SnLenUm snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
158 typedef struct ulUmCfg
160 SnLenUm snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
161 int8_t reAssemTmr; /* T_reassembling Timer in msec*/
165 typedef struct amBearerCfg
171 typedef struct umBiDirBearerCfg
177 typedef struct umUniDirUlBearerCfg
180 }UmUniDirUlBearerCfg;
182 typedef struct umUniDirDlBearerCfg
185 }UmUniDirDlBearerCfg;
187 /* Spec Ref: 38.331, 6.3.2 RLC-BearerConfig */
188 typedef struct rlcBearerCfg
199 UmBiDirBearerCfg *umBiDirCfg;
200 UmUniDirUlBearerCfg *umUniDirUlCfg;
201 UmUniDirDlBearerCfg *umUniDirDlCfg;
203 bool isLcAddModRspSent;
206 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.3 UE Reconfiguration */
207 typedef struct rlcUeRecfg
212 RlcBearerCfg rlcLcCfgAdd[MAX_NUM_LC];
214 RlcBearerCfg rlcLcCfgMod[MAX_NUM_LC];
216 RlcBearerCfg rlcLcCfgRel[MAX_NUM_LC];
219 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.1 UE Create */
220 typedef struct rlcUeCfg
225 RlcBearerCfg rlcLcCfgAdd[MAX_NUM_LC];
228 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.2 UE Create Response */
229 typedef struct rlcUeCfgRsp
234 FailureReason reason;
237 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.5 UE Delete Response */
238 typedef struct rlcUeDelete
244 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.6 UE Delete Response */
245 typedef struct rlcUeDeleteRsp
249 CauseOfResult status;
252 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.8 UL RRC Message Transfer*/
253 typedef struct ulRrcMsgInfo
255 uint16_t cellId; /* Cell Id */
256 uint16_t ueId; /* UE Id */
257 uint8_t lcId; /* Logical channel Id */
258 uint16_t msgLen; /* RRC message length (in bytes) */
259 uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */
262 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.7 DL RRC Message Transfer */
263 typedef struct dlRrcMsgInfo
265 uint16_t cellId; /* Cell Id */
266 uint16_t ueId; /* UE Id */
267 uint8_t lcId; /* Logical channel Id {1...3} */
268 bool execDup; /* Execution duplication enabled */
269 bool deliveryStaRpt; /* Reporting of delivery status by RLC to DU-APP enabled */
270 uint16_t msgLen; /* RRC Message length */
271 uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */
274 /* UL User Data from RLC to DU APP */
275 typedef struct ulUserDatInfo
277 uint16_t cellId; /* Cell Id */
278 uint16_t ueId; /* UE Id */
280 uint16_t msgLen; /* User data length (in bytes) */
281 uint8_t *userData; /* User data (UL-DTCH Message) */
284 /* DL RRC Message Rsp From RLC to DU APP */
285 typedef struct dlRrcMsgRsp
287 uint16_t cellId; /* Cell Id */
288 uint16_t crnti; /* UE index */
289 DlMsgState state; /* Dl RRC Msg State */
298 /*Pm Metric for NW Slicing from RLC to DUAPP*/
299 typedef struct slicePm
301 SliceIdentifier networkSliceIdentifier;
306 typedef struct slicePmList
309 SlicePm *sliceRecord;
312 /* DL Data Message from DU APP to RLC */
313 typedef struct dlDataMsgInfo
315 uint16_t cellId; /* Cell Id */
316 uint16_t ueId; /* UE Id */
317 uint8_t rbId; /* Radio Bearer Id {4 .. MAC
\7fX_NUM_DRB} */
318 uint16_t msgLen; /* Message length */
319 Buffer *dlMsg; /* DL Data */
322 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.9 UL RRC Message Delivery Report */
323 typedef struct rrcDeliveryStatus
325 uint16_t deliveryStatus;
326 uint16_t triggeringMessage;
329 typedef struct rrcDeliveryReportInfo
334 RrcDeliveryStatus rrcDeliveryStatus;
337 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.11 UE RLC Re-establishment Req */
339 typedef struct rlcUeReestablishReq
343 uint8_t numLcsToReestablish;
344 uint8_t lcToReestablish[MAX_NUM_LC];
345 }RlcUeReestablishReq;
347 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.12 UE RLC Re-establishment Rsp */
348 typedef struct rlcUeReestablishRsp
352 CauseOfResult status;
353 }RlcUeReestablishRsp;
355 /* Function Pointers */
357 /* Max Retransmission from RLC to DU APP*/
358 typedef uint8_t (*RlcDuMaxRetransInd) ARGS((
360 RlcMaxRetransInfo *maxRetransInfo));
362 /* UE create Request from DU APP to RLC*/
363 typedef uint8_t (*DuRlcUeCreateReq) ARGS((
367 /* UE Cfg Response from RLC to DU APP*/
368 typedef uint8_t (*RlcDuUeCfgRsp) ARGS((
370 RlcUeCfgRsp *ueCfgRsp));
372 /* UE Delete Response from RLC to DU APP*/
373 typedef uint8_t (*RlcDuUeDeleteRsp) ARGS((
375 RlcUeDeleteRsp *ueDelRsp));
377 /* UL RRC Message from RLC to DU APP */
378 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
380 RlcUlRrcMsgInfo *ulRrcMsgInfo));
382 /* DL RRC Message from DU APP to RLC */
383 typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
385 RlcDlRrcMsgInfo *dlRrcMsgInfo));
387 /* RRC delivery message from RLC to DU APP */
388 typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
390 RrcDeliveryReport *rrcDeliveryReport));
392 /* UE Reconfig Request from DU APP to RLC */
393 typedef uint8_t (*DuRlcUeReconfigReq) ARGS((
395 RlcUeRecfg *ueRecfg ));
397 /* UE Delete Request from DU APP to RLC */
398 typedef uint8_t (*DuRlcUeDeleteReq) ARGS((
400 RlcUeDelete *ueDelete));
402 /* DL RRC Message from RLC to DU APP */
403 typedef uint8_t (*RlcDlRrcMsgRspToDuFunc) ARGS((
405 RlcDlRrcMsgRsp *dlRrcMsgRsp));
407 /* UL User data from RLC to DU APP */
408 typedef uint8_t (*RlcUlUserDataToDuFunc) ARGS((
410 RlcUlUserDatInfo *ulUserData));
412 /* DL User Data from DU APP to RLC */
413 typedef uint8_t (*DuRlcDlUserDataToRlcFunc) ARGS((
415 RlcDlUserDataInfo *dlDataMsg));
417 /* Slice Metrics from RLC to DU APP */
418 typedef uint8_t (*RlcSlicePmToDuFunc) ARGS((
420 SlicePmList *sliceStats));
422 /* UE Re-establishment Request from DU APP to RLC */
423 typedef uint8_t (*DuRlcUeReestablishReq) ARGS((
425 RlcUeReestablishReq *ueReestablishReq));
427 /* UE Re-establishment Response from RLC to DU APP*/
428 typedef uint8_t (*RlcDuUeReestablishRsp) ARGS((
430 RlcUeReestablishRsp *ueDelRsp));
432 /* Pack/Unpack function declarations */
433 uint8_t packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
434 uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd func, Pst *pst, Buffer *mBuf);
435 uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
436 uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
437 uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
438 uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf);
439 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
440 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
441 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
442 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
443 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
444 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
445 uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeRecfg *ueCfg);
446 uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf);
447 uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
448 uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf);
449 uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData);
450 uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf);
451 uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlDataMsg);
452 uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf);
453 uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
454 uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf);
455 uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
456 uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf);
457 uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats);
458 uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf);
459 uint8_t packDuRlcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish);
460 uint8_t unpackRlcUeReestablishReq(DuRlcUeReestablishReq func, Pst *pst, Buffer *mBuf);
461 uint8_t packRlcDuUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablishRsp);
462 uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf);
464 /* Event Handler function declarations */
465 uint8_t DuProcRlcMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
466 uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
467 uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
468 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
469 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
470 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
471 uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeRecfg *ueCfg);
472 uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg);
473 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData);
474 uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo);
475 uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
476 uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp);
477 uint8_t DuProcRlcSliceMetrics(Pst *pst, SlicePmList *sliceStats);
478 uint8_t RlcProcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish);
479 uint8_t DuProcRlcUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *delRsp);
480 #endif /* RLC_INF_H */
482 /**********************************************************************
484 **********************************************************************/