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 rlcUeCreate
225 RlcBearerCfg rlcLcCfgAdd[MAX_NUM_LC];
228 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.2 UE Create Response */
229 typedef struct rlcUeCreateRsp
234 FailureReason reason;
237 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.4 UE Reconfig Response */
238 typedef struct rlcUeCreateRsp RlcUeReconfigRsp;
240 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.5 UE Delete Response */
241 typedef struct rlcUeDelete
247 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.6 UE Delete Response */
248 typedef struct rlcUeDeleteRsp
252 CauseOfResult status;
255 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.8 UL RRC Message Transfer*/
256 typedef struct ulRrcMsgInfo
258 uint16_t cellId; /* Cell Id */
259 uint16_t ueId; /* UE Id */
260 uint8_t lcId; /* Logical channel Id */
261 uint16_t msgLen; /* RRC message length (in bytes) */
262 uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */
265 /* Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.7 DL RRC Message Transfer */
266 typedef struct dlRrcMsgInfo
268 uint16_t cellId; /* Cell Id */
269 uint16_t ueId; /* UE Id */
270 uint8_t lcId; /* Logical channel Id {1...3} */
271 bool execDup; /* Execution duplication enabled */
272 bool deliveryStaRpt; /* Reporting of delivery status by RLC to DU-APP enabled */
273 uint16_t msgLen; /* RRC Message length */
274 uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */
277 /* UL User Data from RLC to DU APP */
278 typedef struct ulUserDatInfo
280 uint16_t cellId; /* Cell Id */
281 uint16_t ueId; /* UE Id */
283 uint16_t msgLen; /* User data length (in bytes) */
284 uint8_t *userData; /* User data (UL-DTCH Message) */
287 /* DL RRC Message Rsp From RLC to DU APP */
288 typedef struct dlRrcMsgRsp
290 uint16_t cellId; /* Cell Id */
291 uint16_t crnti; /* UE index */
292 DlMsgState state; /* Dl RRC Msg State */
301 /*Pm Metric for NW Slicing from RLC to DUAPP*/
302 typedef struct slicePm
304 SliceIdentifier networkSliceIdentifier;
309 typedef struct slicePmList
312 SlicePm *sliceRecord;
315 /* DL Data Message from DU APP to RLC */
316 typedef struct dlDataMsgInfo
318 uint16_t cellId; /* Cell Id */
319 uint16_t ueId; /* UE Id */
320 uint8_t rbId; /* Radio Bearer Id {4 .. MAC
\7fX_NUM_DRB} */
321 uint16_t msgLen; /* Message length */
322 Buffer *dlMsg; /* DL Data */
325 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.9 UL RRC Message Delivery Report */
326 typedef struct rrcDeliveryStatus
328 uint16_t deliveryStatus;
329 uint16_t triggeringMessage;
332 typedef struct rrcDeliveryReportInfo
337 RrcDeliveryStatus rrcDeliveryStatus;
340 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.11 UE RLC Re-establishment Req */
342 typedef struct rlcUeReestablishReq
346 uint8_t numLcsToReestablish;
347 uint8_t lcToReestablish[MAX_NUM_LC];
348 }RlcUeReestablishReq;
350 /*Ref: ORAN_WG8.V7.0.0 Sec 11.2.5.12 UE RLC Re-establishment Rsp */
351 typedef struct rlcUeReestablishRsp
355 CauseOfResult status;
356 }RlcUeReestablishRsp;
358 /* Function Pointers */
360 /* Max Retransmission from RLC to DU APP*/
361 typedef uint8_t (*RlcDuMaxRetransInd) ARGS((
363 RlcMaxRetransInfo *maxRetransInfo));
365 /* UE create Request from DU APP to RLC*/
366 typedef uint8_t (*DuRlcUeCreateReq) ARGS((
368 RlcUeCreate *ueCfg ));
370 /* UE Create Response from RLC to DU APP*/
371 typedef uint8_t (*RlcDuUeCreateRsp) ARGS((
373 RlcUeCreateRsp *ueCreateRsp));
375 /* UE Delete Response from RLC to DU APP*/
376 typedef uint8_t (*RlcDuUeDeleteRsp) ARGS((
378 RlcUeDeleteRsp *ueDelRsp));
380 /* UL RRC Message from RLC to DU APP */
381 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
383 RlcUlRrcMsgInfo *ulRrcMsgInfo));
385 /* DL RRC Message from DU APP to RLC */
386 typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
388 RlcDlRrcMsgInfo *dlRrcMsgInfo));
390 /* RRC delivery message from RLC to DU APP */
391 typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
393 RrcDeliveryReport *rrcDeliveryReport));
395 /* UE Reconfig Request from DU APP to RLC */
396 typedef uint8_t (*DuRlcUeReconfigReq) ARGS((
398 RlcUeRecfg *ueRecfg ));
400 /* UE Reconfig Response from RLC to DU APP*/
401 typedef uint8_t (*RlcDuUeReconfigRsp) ARGS((
403 RlcUeReconfigRsp *ueReconfigRsp));
405 /* UE Delete Request from DU APP to RLC */
406 typedef uint8_t (*DuRlcUeDeleteReq) ARGS((
408 RlcUeDelete *ueDelete));
410 /* DL RRC Message from RLC to DU APP */
411 typedef uint8_t (*RlcDlRrcMsgRspToDuFunc) ARGS((
413 RlcDlRrcMsgRsp *dlRrcMsgRsp));
415 /* UL User data from RLC to DU APP */
416 typedef uint8_t (*RlcUlUserDataToDuFunc) ARGS((
418 RlcUlUserDatInfo *ulUserData));
420 /* DL User Data from DU APP to RLC */
421 typedef uint8_t (*DuRlcDlUserDataToRlcFunc) ARGS((
423 RlcDlUserDataInfo *dlDataMsg));
425 /* Slice Metrics from RLC to DU APP */
426 typedef uint8_t (*RlcSlicePmToDuFunc) ARGS((
428 SlicePmList *sliceStats));
430 /* UE Re-establishment Request from DU APP to RLC */
431 typedef uint8_t (*DuRlcUeReestablishReq) ARGS((
433 RlcUeReestablishReq *ueReestablishReq));
435 /* UE Re-establishment Response from RLC to DU APP*/
436 typedef uint8_t (*RlcDuUeReestablishRsp) ARGS((
438 RlcUeReestablishRsp *ueDelRsp));
440 /* Pack/Unpack function declarations */
441 uint8_t packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
442 uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd func, Pst *pst, Buffer *mBuf);
443 uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCreate *ueCfg);
444 uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
445 uint8_t packRlcDuUeCreateRsp(Pst *pst, RlcUeCreateRsp *ueCfgRsp);
446 uint8_t unpackRlcUeCreateRsp(RlcDuUeCreateRsp func, Pst *pst, Buffer *mBuf);
447 uint8_t packRlcDuUeReconfigRsp(Pst *pst, RlcUeReconfigRsp *ueCfgRsp);
448 uint8_t unpackRlcUeReconfigRsp(RlcDuUeReconfigRsp func, Pst *pst, Buffer *mBuf);
449 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
450 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
451 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
452 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
453 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
454 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
455 uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeRecfg *ueCfg);
456 uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf);
457 uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
458 uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf);
459 uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData);
460 uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf);
461 uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlDataMsg);
462 uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf);
463 uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
464 uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf);
465 uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDeleteRsp);
466 uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf);
467 uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats);
468 uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf);
469 uint8_t packDuRlcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish);
470 uint8_t unpackRlcUeReestablishReq(DuRlcUeReestablishReq func, Pst *pst, Buffer *mBuf);
471 uint8_t packRlcDuUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablishRsp);
472 uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf);
474 /* Event Handler function declarations */
475 uint8_t DuProcRlcMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInd);
476 uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCreate *ueCfg);
477 uint8_t DuProcRlcUeCreateRsp(Pst *pst, RlcUeCreateRsp *cfgRsp);
478 uint8_t DuProcRlcUeReconfigRsp(Pst *pst, RlcUeReconfigRsp *recfgRsp);
479 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
480 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
481 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
482 uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeRecfg *ueCfg);
483 uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg);
484 uint8_t DuProcRlcUlUserDataTrans(Pst *pst, RlcUlUserDatInfo *ulUserData);
485 uint8_t RlcProcDlUserDataTransfer(Pst *pst, RlcDlUserDataInfo *dlDataMsgInfo);
486 uint8_t RlcProcUeDeleteReq(Pst *pst, RlcUeDelete *ueDelete);
487 uint8_t DuProcRlcUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *delRsp);
488 uint8_t DuProcRlcSliceMetrics(Pst *pst, SlicePmList *sliceStats);
489 uint8_t RlcProcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueReestablish);
490 uint8_t DuProcRlcUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *delRsp);
491 #endif /* RLC_INF_H */
493 /**********************************************************************
495 **********************************************************************/