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
36 #define RB_TYPE_SRB 0 /* Signalling Radio Bearer */
37 #define RB_TYPE_DRB 1 /* Data Radio Bearer */
39 /* RLC Direction Config */
40 #define RLC_CFG_DIR_UL 1 /*!< Uplink direction */
41 #define RLC_CFG_DIR_DL 2 /*!< Downlink direction */
42 #define RLC_CFG_DIR_BOTH 3 /*!< Both Downlink and Uplink Direction*/
45 /* Logical Channel Type */
46 #define LCH_BCCH 1 /*!< BCCH Logical Channel */
47 #define LCH_PCCH 2 /*!< PCCH Logical Channel */
48 #define LCH_CCCH 3 /*!< CCCH Logical Channel */
49 #define LCH_DTCH 4 /*!< DTCH Logical Channel */
50 #define LCH_DCCH 5 /*!< DCCH Logical Channel */
54 TRANSMISSION_IN_PROGRESS,
55 TRANSMISSION_COMPLETE,
61 RLC_CFG_REAS_NONE , /*!< No Failure */
62 RLC_CFG_REAS_RB_CREAT_FAIL , /*!< RB CB creation Failure */
63 RLC_CFG_REAS_UE_CREAT_FAIL , /*!< UE CB creation Failure */
64 RLC_CFG_REAS_CELL_CREAT_FAIL , /*!< CELL CB creation Failure */
65 RLC_CFG_REAS_RB_PRSNT , /*!< RB CB already present */
66 RLC_CFG_REAS_LCHTYPE_MIS , /*!< Logical channel type mismatch */
67 RLC_CFG_REAS_RB_UNKWN , /*!< RB Cb unknown */
68 RLC_CFG_REAS_UE_UNKWN , /*!< UE Cb unknown */
69 RLC_CFG_REAS_CELL_UNKWN , /*!< Cell Cb unknown */
70 RLC_CFG_REAS_RB_DEL_FAIL , /*!< RB Cb Deletion Failure */
71 RLC_CFG_REAS_UE_DEL_FAIL , /*!< UE Cb Deletion Failure */
72 RLC_CFG_REAS_RB_REEST_FAIL , /*!< RB Cb Re establish Failure */
73 RLC_CFG_REAS_RB_MODE_MIS , /*!< RB Cb Mode mismatch */
74 RLC_CFG_REAS_REEST_FAIL , /*!< RB Cb Re-establishment Failed */
75 RLC_CFG_REAS_RECFG_FAIL , /*!< RB Cb Re-configuration Failed */
76 RLC_CFG_REAS_INVALID_CFG , /*!< Invalid Configuration Type */
77 RLC_CFG_REAS_SAME_UEID , /*!< UE Ids match in ChngUeId Request */
78 RLC_CFG_REAS_CELL_DEL_FAIL , /*!< Cell Cb Deletion Failure */
79 RLC_CFG_REAS_INVALID_LCHID , /*!< Invalid LChId */
80 RLC_CFG_REAS_INVALID_DIR , /*!< Invalid Direction */
81 RLC_CFG_REAS_UE_EXISTS , /*!< UE ID already exists */
82 RLC_CFG_REAS_INVALID_SNLEN , /*!< Invalid SN Length */
83 RLC_CFG_REAS_SNLEN_MIS , /*!< SN Length mismatch */
84 RLC_CFG_REAS_INVALID_RGUSAP /*!< Invalid RGU SAP ID */
89 RLC_AM, //Acknowledged Mode
90 RLC_UM_BI_DIRECTIONAL, //UnAcknowledged Mode
91 RLC_UM_UNI_DIRECTIONAL_UL,
92 RLC_UM_UNI_DIRECTIONAL_DL
165 POLL_RETX_TMR_1000MS,
166 POLL_RETX_TMR_2000MS,
167 POLL_RETX_TMR_4000MS,
168 POLL_RETX_TMR_SPARE5,
169 POLL_RETX_TMR_SPARE4,
170 POLL_RETX_TMR_SPARE3,
171 POLL_RETX_TMR_SPARE2,
191 POLL_PDU_TMR_12288MS,
192 POLL_PDU_TMR_16384MS,
193 POLL_PDU_TMR_20480MS,
194 POLL_PDU_TMR_24576MS,
195 POLL_PDU_TMR_28672MS,
196 POLL_PDU_TMR_32768MS,
197 POLL_PDU_TMR_40960MS,
198 POLL_PDU_TMR_49152MS,
199 POLL_PDU_TMR_57344MS,
200 POLL_PDU_TMR_65536MS,
201 POLL_PDU_TMR_INFINITY,
202 POLL_PDU_TMR_SPARE_8,
203 POLL_PDU_TMR_SPARE_7,
204 POLL_PDU_TMR_SPARE_6,
205 POLL_PDU_TMR_SPARE_5,
206 POLL_PDU_TMR_SPARE_4,
207 POLL_PDU_TMR_SPARE_3,
208 POLL_PDU_TMR_SPARE_2,
417 typedef struct ulAmCfg
419 SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
420 TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/
421 TStatProhTmr statProhTmr; /* T_status_prohibit Timer in msec*/
425 typedef struct dlAmCfg
427 SnLenAm snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
428 TpollReTxTmr pollRetxTmr; /* T_poll_retransmit Timer in msec */
429 PollPdu pollPdu; /* Used to trigger a poll for every pollPdu.*/
430 PollBytes pollByte; /* Poll_Byte in bytes. */
431 MaxRetxTh maxRetxTh; /* Max_Retx_Threshold */
435 typedef struct dlUmCfg
437 SnLenUm snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
441 typedef struct ulUmCfg
443 SnLenUm snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
444 TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/
448 typedef struct amBearerCfg
454 typedef struct umBiDirBearerCfg
460 typedef struct umUniDirUlBearerCfg
463 }UmUniDirUlBearerCfg;
465 typedef struct umUniDirDlBearerCfg
468 }UmUniDirDlBearerCfg;
470 /* Spec Ref: 38.331, 6.3.2 RLC-BearerConfig */
471 typedef struct rlcBearerCfg
473 ConfigType configType;
482 UmBiDirBearerCfg *umBiDirCfg;
483 UmUniDirUlBearerCfg *umUniDirUlCfg;
484 UmUniDirDlBearerCfg *umUniDirDlCfg;
488 typedef struct rlcUeCfg
493 RlcBearerCfg rlcLcCfg[MAX_NUM_LC];
494 UeCfgState rlcUeCfgState; /* InActive / Completed */
497 typedef struct rlcUeCfgRsp
502 FailureReason reason;
505 /* UL RRC Message from RLC to DU APP */
506 typedef struct ulRrcMsgInfo
508 uint16_t cellId; /* Cell Id */
509 uint16_t ueIdx; /* UE Index */
510 uint8_t lcId; /* Logical channel Id */
511 uint16_t msgLen; /* RRC message length (in bytes) */
512 uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */
515 /* DL RRC Message from DU APP to RLC */
516 typedef struct dlRrcMsgInfo
518 uint16_t cellId; /* Cell Id */
519 uint16_t ueIdx; /* UE index */
520 uint8_t rbType; /* Radio Bearer Type */
521 uint8_t rbId; /* Radio Bearer Id */
522 uint8_t lcType; /* Logical channel type */
523 uint8_t lcId; /* Logical channel Id */
524 bool execDup; /* Execution duplication enabled */
525 bool deliveryStaRpt; /* Reporting of delivery status by RLC to DU-APP enabled */
526 uint16_t msgLen; /* RRC Message length */
527 uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */
530 /* DL RRC Message Rsp From RLC to DU APP */
531 typedef struct dlRrcMsgRsp
533 uint16_t cellId; /* Cell Id */
534 uint16_t crnti; /* UE index */
535 DlMsgState state; /* Dl RRC Msg State */
538 /* RRC delivery message from RLC to DU APP */
539 typedef struct rrcDeliveryStatus
541 uint16_t deliveryStatus;
542 uint16_t triggeringMessage;
545 typedef struct rrcDeliveryReportInfo
550 RrcDeliveryStatus rrcDeliveryStatus;
553 /* Function Pointers */
554 /* UE create Request from DU APP to RLC*/
555 typedef uint8_t (*DuRlcUeCreateReq) ARGS((
559 /* UE Cfg Response from RLC to DU APP*/
560 typedef uint8_t (*RlcDuUeCfgRsp) ARGS((
562 RlcUeCfgRsp *ueCfgRsp));
564 /* UL RRC Message from RLC to DU APP */
565 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
567 RlcUlRrcMsgInfo *ulRrcMsgInfo));
569 /* DL RRC Message from DU APP to RLC */
570 typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
572 RlcDlRrcMsgInfo *dlRrcMsgInfo));
574 /* RRC delivery message from RLC to DU APP */
575 typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
577 RrcDeliveryReport *rrcDeliveryReport));
579 typedef uint8_t (*DuRlcUeReconfigReq) ARGS((
583 /* DL RRC Message from RLC to DU APP */
584 typedef uint8_t (*RlcDlRrcMsgRspToDuFunc) ARGS((
586 RlcDlRrcMsgRsp *dlRrcMsgRsp));
588 /* Pack/Unpack function declarations */
589 uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
590 uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf);
591 uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
592 uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf);
593 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
594 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
595 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
596 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
597 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
598 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
599 uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg);
600 uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf);
601 uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp);
602 uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf);
605 /* Event Handler function declarations */
606 uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
607 uint8_t DuProcRlcUeCfgRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
608 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
609 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
610 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
611 uint8_t RlcProcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg);
612 uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg);
614 #endif /* RLC_INF_H */
616 /**********************************************************************
618 **********************************************************************/