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_UL_UE_CREATE_REQ 210
25 #define EVENT_RLC_UL_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
33 #define RB_TYPE_SRB 0 /* Signalling Radio Bearer */
34 #define RB_TYPE_DRB 1 /* Data Radio Bearer */
36 /* RLC Direction Config */
37 #define RLC_CFG_DIR_UL 1 /*!< Uplink direction */
38 #define RLC_CFG_DIR_DL 2 /*!< Downlink direction */
39 #define RLC_CFG_DIR_BOTH 3 /*!< Both Downlink and Uplink Direction*/
42 /* Logical Channel Type */
43 #define LCH_BCCH 1 /*!< BCCH Logical Channel */
44 #define LCH_PCCH 2 /*!< PCCH Logical Channel */
45 #define LCH_CCCH 3 /*!< CCCH Logical Channel */
46 #define LCH_DTCH 4 /*!< DTCH Logical Channel */
47 #define LCH_DCCH 5 /*!< DCCH Logical Channel */
52 RLC_CFG_REAS_NONE , /*!< No Failure */
53 RLC_CFG_REAS_RB_CREAT_FAIL , /*!< RB CB creation Failure */
54 RLC_CFG_REAS_UE_CREAT_FAIL , /*!< UE CB creation Failure */
55 RLC_CFG_REAS_CELL_CREAT_FAIL , /*!< CELL CB creation Failure */
56 RLC_CFG_REAS_RB_PRSNT , /*!< RB CB already present */
57 RLC_CFG_REAS_LCHTYPE_MIS , /*!< Logical channel type mismatch */
58 RLC_CFG_REAS_RB_UNKWN , /*!< RB Cb unknown */
59 RLC_CFG_REAS_UE_UNKWN , /*!< UE Cb unknown */
60 RLC_CFG_REAS_CELL_UNKWN , /*!< Cell Cb unknown */
61 RLC_CFG_REAS_RB_DEL_FAIL , /*!< RB Cb Deletion Failure */
62 RLC_CFG_REAS_UE_DEL_FAIL , /*!< UE Cb Deletion Failure */
63 RLC_CFG_REAS_RB_REEST_FAIL , /*!< RB Cb Re establish Failure */
64 RLC_CFG_REAS_RB_MODE_MIS , /*!< RB Cb Mode mismatch */
65 RLC_CFG_REAS_REEST_FAIL , /*!< RB Cb Re-establishment Failed */
66 RLC_CFG_REAS_RECFG_FAIL , /*!< RB Cb Re-configuration Failed */
67 RLC_CFG_REAS_INVALID_CFG , /*!< Invalid Configuration Type */
68 RLC_CFG_REAS_SAME_UEID , /*!< UE Ids match in ChngUeId Request */
69 RLC_CFG_REAS_CELL_DEL_FAIL , /*!< Cell Cb Deletion Failure */
70 RLC_CFG_REAS_INVALID_LCHID , /*!< Invalid LChId */
71 RLC_CFG_REAS_INVALID_DIR , /*!< Invalid Direction */
72 RLC_CFG_REAS_UE_EXISTS , /*!< UE ID already exists */
73 RLC_CFG_REAS_INVALID_SNLEN , /*!< Invalid SN Length */
74 RLC_CFG_REAS_SNLEN_MIS , /*!< SN Length mismatch */
75 RLC_CFG_REAS_INVALID_RGUSAP /*!< Invalid RGU SAP ID */
80 RLC_AM, //Acknowledged Mode
81 RLC_UM_BI_DIRECTIONAL, //UnAcknowledged Mode
82 RLC_UM_UNI_DIRECTIONAL_UL,
83 RLC_UM_UNI_DIRECTIONAL_DL
156 POLL_RETX_TMR_1000MS,
157 POLL_RETX_TMR_2000MS,
158 POLL_RETX_TMR_4000MS,
159 POLL_RETX_TMR_SPARE5,
160 POLL_RETX_TMR_SPARE4,
161 POLL_RETX_TMR_SPARE3,
162 POLL_RETX_TMR_SPARE2,
182 POLL_PDU_TMR_12288MS,
183 POLL_PDU_TMR_16384MS,
184 POLL_PDU_TMR_20480MS,
185 POLL_PDU_TMR_24576MS,
186 POLL_PDU_TMR_28672MS,
187 POLL_PDU_TMR_32768MS,
188 POLL_PDU_TMR_40960MS,
189 POLL_PDU_TMR_49152MS,
190 POLL_PDU_TMR_57344MS,
191 POLL_PDU_TMR_65536MS,
192 POLL_PDU_TMR_INFINITY,
193 POLL_PDU_TMR_SPARE_8,
194 POLL_PDU_TMR_SPARE_7,
195 POLL_PDU_TMR_SPARE_6,
196 POLL_PDU_TMR_SPARE_5,
197 POLL_PDU_TMR_SPARE_4,
198 POLL_PDU_TMR_SPARE_3,
199 POLL_PDU_TMR_SPARE_2,
408 typedef struct ulAmCfg
410 SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
411 TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/
412 TStatProhTmr statProhTmr; /* T_status_prohibit Timer in msec*/
416 typedef struct dlAmCfg
418 SnLenAm snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
419 TpollReTxTmr pollRetxTmr; /* T_poll_retransmit Timer in msec */
420 PollPdu pollPdu; /* Used to trigger a poll for every pollPdu.*/
421 PollBytes pollByte; /* Poll_Byte in bytes. */
422 MaxRetxTh maxRetxTh; /* Max_Retx_Threshold */
426 typedef struct dlUmCfg
428 SnLenUm snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
432 typedef struct ulUmCfg
434 SnLenUm snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
435 TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/
439 typedef struct amBearerCfg
445 typedef struct umBiDirBearerCfg
451 typedef struct umUniDirUlBearerCfg
454 }UmUniDirUlBearerCfg;
456 typedef struct umUniDirDlBearerCfg
459 }UmUniDirDlBearerCfg;
461 /* Spec Ref: 38.331, 6.3.2 RLC-BearerConfig */
462 typedef struct rlcBearerCfg
472 UmBiDirBearerCfg umBiDirCfg;
473 UmUniDirUlBearerCfg umUniDirUlCfg;
474 UmUniDirDlBearerCfg umUniDirDlCfg;
478 typedef struct rlcUeCfg
483 RlcBearerCfg rlcBearerCfg[MAX_NUM_LC];
486 typedef struct rlcUeCfgRsp
491 FailureReason reason;
494 /* UL RRC Message from RLC to DU APP */
495 typedef struct ulRrcMsgInfo
497 uint16_t cellId; /* Cell Id */
498 uint16_t ueIdx; /* UE Index */
499 uint8_t lcId; /* Logical channel Id */
500 uint16_t msgLen; /* RRC message length (in bytes) */
501 uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */
504 /* DL RRC Message from DU APP to RLC */
505 typedef struct dlRrcMsgInfo
507 uint16_t cellId; /* Cell Id */
508 uint16_t ueIdx; /* UE index */
509 uint8_t rbType; /* Radio Bearer Type */
510 uint8_t rbId; /* Radio Bearer Id */
511 uint8_t lcType; /* Logical channel type */
512 uint8_t lcId; /* Logical channel Id */
513 bool execDup; /* Execution duplication enabled */
514 bool deliveryStaRpt; /* Reporting of delivery status by RLC to DU-APP enabled */
515 uint16_t msgLen; /* RRC Message length */
516 uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */
519 /* RRC delivery message from RLC to DU APP */
520 typedef struct rrcDeliveryStatus
522 uint16_t deliveryStatus;
523 uint16_t triggeringMessage;
526 typedef struct rrcDeliveryReportInfo
531 RrcDeliveryStatus rrcDeliveryStatus;
534 /* Function Pointers */
535 /* UE create Request from DU APP to RLC*/
536 typedef uint8_t (*DuRlcUlUeCreateReq) ARGS((
540 /* UE create Response from RLC to DU APP*/
541 typedef uint8_t (*RlcUlDuUeCreateRsp) ARGS((
543 RlcUeCfgRsp *ueCfgRsp));
545 /* UL RRC Message from RLC to DU APP */
546 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
548 RlcUlRrcMsgInfo *ulRrcMsgInfo));
550 /* DL RRC Message from DU APP to RLC */
551 typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
553 RlcDlRrcMsgInfo *dlRrcMsgInfo));
555 /* RRC delivery message from RLC to DU APP */
556 typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
558 RrcDeliveryReport *rrcDeliveryReport));
560 /* Pack/Unpack function declarations */
561 uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
562 uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf);
563 uint8_t packRlcUlDuUeCreateRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
564 uint8_t unpackRlcUlUeCreateRsp(RlcUlDuUeCreateRsp func, Pst *pst, Buffer *mBuf);
565 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
566 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
567 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
568 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
569 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
570 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
572 /* Event Handler function declarations */
573 uint8_t RlcUlProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
574 uint8_t DuProcRlcUlUeCreateRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
575 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
576 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
577 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
578 #endif /* RLC_INF_H */
580 /**********************************************************************
582 **********************************************************************/