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
30 /* Macro for Ue Context */
31 #define MAX_NUM_LOGICAL_CHANNELS 11
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 */
55 RLC_CFG_REAS_NONE , /*!< No Failure */
56 RLC_CFG_REAS_RB_CREAT_FAIL , /*!< RB CB creation Failure */
57 RLC_CFG_REAS_UE_CREAT_FAIL , /*!< UE CB creation Failure */
58 RLC_CFG_REAS_CELL_CREAT_FAIL , /*!< CELL CB creation Failure */
59 RLC_CFG_REAS_RB_PRSNT , /*!< RB CB already present */
60 RLC_CFG_REAS_LCHTYPE_MIS , /*!< Logical channel type mismatch */
61 RLC_CFG_REAS_RB_UNKWN , /*!< RB Cb unknown */
62 RLC_CFG_REAS_UE_UNKWN , /*!< UE Cb unknown */
63 RLC_CFG_REAS_CELL_UNKWN , /*!< Cell Cb unknown */
64 RLC_CFG_REAS_RB_DEL_FAIL , /*!< RB Cb Deletion Failure */
65 RLC_CFG_REAS_UE_DEL_FAIL , /*!< UE Cb Deletion Failure */
66 RLC_CFG_REAS_RB_REEST_FAIL , /*!< RB Cb Re establish Failure */
67 RLC_CFG_REAS_RB_MODE_MIS , /*!< RB Cb Mode mismatch */
68 RLC_CFG_REAS_REEST_FAIL , /*!< RB Cb Re-establishment Failed */
69 RLC_CFG_REAS_RECFG_FAIL , /*!< RB Cb Re-configuration Failed */
70 RLC_CFG_REAS_INVALID_CFG , /*!< Invalid Configuration Type */
71 RLC_CFG_REAS_SAME_UEID , /*!< UE Ids match in ChngUeId Request */
72 RLC_CFG_REAS_CELL_DEL_FAIL , /*!< Cell Cb Deletion Failure */
73 RLC_CFG_REAS_INVALID_LCHID , /*!< Invalid LChId */
74 RLC_CFG_REAS_INVALID_DIR , /*!< Invalid Direction */
75 RLC_CFG_REAS_UE_EXISTS , /*!< UE ID already exists */
76 RLC_CFG_REAS_INVALID_SNLEN , /*!< Invalid SN Length */
77 RLC_CFG_REAS_SNLEN_MIS , /*!< SN Length mismatch */
78 RLC_CFG_REAS_INVALID_RGUSAP /*!< Invalid RGU SAP ID */
83 RLC_AM, //Acknowledged Mode
84 RLC_UM_BI_DIRECTIONAL, //UnAcknowledged Mode
85 RLC_UM_UNI_DIRECTIONAL_UL,
86 RLC_UM_UNI_DIRECTIONAL_DL
159 POLL_RETX_TMR_1000MS,
160 POLL_RETX_TMR_2000MS,
161 POLL_RETX_TMR_4000MS,
162 POLL_RETX_TMR_SPARE5,
163 POLL_RETX_TMR_SPARE4,
164 POLL_RETX_TMR_SPARE3,
165 POLL_RETX_TMR_SPARE2,
185 POLL_PDU_TMR_12288MS,
186 POLL_PDU_TMR_16384MS,
187 POLL_PDU_TMR_20480MS,
188 POLL_PDU_TMR_24576MS,
189 POLL_PDU_TMR_28672MS,
190 POLL_PDU_TMR_32768MS,
191 POLL_PDU_TMR_40960MS,
192 POLL_PDU_TMR_49152MS,
193 POLL_PDU_TMR_57344MS,
194 POLL_PDU_TMR_65536MS,
195 POLL_PDU_TMR_INFINITY,
196 POLL_PDU_TMR_SPARE_8,
197 POLL_PDU_TMR_SPARE_7,
198 POLL_PDU_TMR_SPARE_6,
199 POLL_PDU_TMR_SPARE_5,
200 POLL_PDU_TMR_SPARE_4,
201 POLL_PDU_TMR_SPARE_3,
202 POLL_PDU_TMR_SPARE_2,
411 typedef struct ulAmCfg
413 SnLenAm snLenUl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
414 TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/
415 TStatProhTmr statProhTmr; /* T_status_prohibit Timer in msec*/
419 typedef struct dlAmCfg
421 SnLenAm snLenDl; /* Sequence Number length in bits. Allowed values are 12 and 18 */
422 TpollReTxTmr pollRetxTmr; /* T_poll_retransmit Timer in msec */
423 PollPdu pollPdu; /* Used to trigger a poll for every pollPdu.*/
424 PollBytes pollByte; /* Poll_Byte in bytes. */
425 MaxRetxTh maxRetxTh; /* Max_Retx_Threshold */
429 typedef struct dlUmCfg
431 SnLenUm snLenDlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
435 typedef struct ulUmCfg
437 SnLenUm snLenUlUm; /* Sequence Number length in bits. Allowed values are 6 and 12 */
438 TReAssembleTmr reAssemTmr; /* T_reassembling Timer in msec*/
442 typedef struct amBearerCfg
448 typedef struct umBiDirBearerCfg
454 typedef struct umUniDirUlBearerCfg
457 }UmUniDirUlBearerCfg;
459 typedef struct umUniDirDlBearerCfg
462 }UmUniDirDlBearerCfg;
464 /* Spec Ref: 38.331, 6.3.2 RLC-BearerConfig */
465 typedef struct rlcBearerCfg
475 UmBiDirBearerCfg umBiDirCfg;
476 UmUniDirUlBearerCfg umUniDirUlCfg;
477 UmUniDirDlBearerCfg umUniDirDlCfg;
481 typedef struct rlcUeCfg
486 RlcBearerCfg rlcBearerCfg[MAX_NUM_LOGICAL_CHANNELS];
489 typedef struct rlcUeCfgRsp
494 FailureReason reason;
497 /* UL RRC Message from RLC to DU APP */
498 typedef struct ulRrcMsgInfo
500 uint16_t cellId; /* Cell Id */
501 uint16_t ueIdx; /* UE Index */
502 uint8_t lcId; /* Logical channel Id */
503 uint16_t msgLen; /* RRC message length (in bytes) */
504 uint8_t *rrcMsg; /* RRC Message (UL-DCCH Message) */
507 /* DL RRC Message from DU APP to RLC */
508 typedef struct dlRrcMsgInfo
510 uint16_t cellId; /* Cell Id */
511 uint16_t ueIdx; /* UE index */
512 uint8_t rbType; /* Radio Bearer Type */
513 uint8_t rbId; /* Radio Bearer Id */
514 uint8_t lcType; /* Logical channel type */
515 uint8_t lcId; /* Logical channel Id */
516 bool execDup; /* Execution duplication enabled */
517 bool deliveryStaRpt; /* Reporting of delivery status by RLC to DU-APP enabled */
518 uint16_t msgLen; /* RRC Message length */
519 uint8_t *rrcMsg; /* RRC Message (DL-DCCH Message) */
522 /* RRC delivery message from RLC to DU APP */
523 typedef struct rrcDeliveryStatus
525 uint16_t deliveryStatus;
526 uint16_t triggeringMessage;
529 typedef struct rrcDeliveryReportInfo
534 RrcDeliveryStatus rrcDeliveryStatus;
537 /* Function Pointers */
538 /* UE create Request from DU APP to RLC*/
539 typedef uint8_t (*DuRlcUlUeCreateReq) ARGS((
543 /* UE create Response from RLC to DU APP*/
544 typedef uint8_t (*RlcUlDuUeCreateRsp) ARGS((
546 RlcUeCfgRsp *ueCfgRsp));
548 /* UL RRC Message from RLC to DU APP */
549 typedef uint8_t (*RlcUlRrcMsgToDuFunc) ARGS((
551 RlcUlRrcMsgInfo *ulRrcMsgInfo));
553 /* DL RRC Message from DU APP to RLC */
554 typedef uint8_t (*DuDlRrcMsgToRlcFunc) ARGS((
556 RlcDlRrcMsgInfo *dlRrcMsgInfo));
558 /* RRC delivery message from RLC to DU APP */
559 typedef uint8_t (*RlcRrcDeliveryReportToDuFunc) ARGS((
561 RrcDeliveryReport *rrcDeliveryReport));
563 /* Pack/Unpack function declarations */
564 uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
565 uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf);
566 uint8_t packRlcUlDuUeCreateRsp(Pst *pst, RlcUeCfgRsp *ueCfgRsp);
567 uint8_t unpackRlcUlUeCreateRsp(RlcUlDuUeCreateRsp func, Pst *pst, Buffer *mBuf);
568 uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
569 uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf);
570 uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
571 uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf);
572 uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
573 uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func,Pst *pst, Buffer *mBuf);
575 /* Event Handler function declarations */
576 uint8_t RlcUlProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg);
577 uint8_t DuProcRlcUlUeCreateRsp(Pst *pst, RlcUeCfgRsp *cfgRsp);
578 uint8_t DuProcRlcUlRrcMsgTrans(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo);
579 uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo);
580 uint8_t DuProcRlcRrcDeliveryReport(Pst *pst, RrcDeliveryReport *rrcDeliveryReport);
581 #endif /* RLC_INF_H */
583 /**********************************************************************
585 **********************************************************************/