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 *******************************************************************************/
18 /* This file containes define for RLC-MAC interface */
25 #define EVENT_BO_STATUS_TO_MAC 15
26 #define EVENT_SCHED_RESULT_TO_RLC 16
27 #define EVENT_DL_DATA_TO_MAC 17
28 #define EVENT_UL_DATA_TO_RLC 18
31 #define MAX_NUM_PDU 16
33 /* Buffer occupancy status information */
34 typedef struct rlcBoStatus
36 uint16_t cellId; /*!< CELL ID */
37 uint16_t ueId; /*!< UE ID */
38 uint8_t lcId; /*!< Logical channel ID */
39 uint32_t bo; /*!< Buffer occupancy reported by RLC */
42 /* Scheduled logical channel info */
43 typedef struct rlcLcSchInfo
45 uint8_t lcId; /*!< Logical channel ID */
46 uint32_t bufSize; /*!< Total buffer size in bytes scheduled by MAC */
49 /* Schedule result report */
50 typedef struct rlcSchedResultRpt
52 SlotTimingInfo slotInfo; /*!< Timing info */
53 uint16_t cellId; /*!< CELL ID */
54 uint16_t rnti; /*!< Temporary CRNTI */
55 uint8_t numLc; /*!< Number of logical channels scheduled */
56 RlcLcSchInfo lcSch[MAX_NUM_LC]; /*!< Scheduled info of logical channels */
59 /* DL/UL data transfer */
60 typedef struct rlcPduInfo
62 uint8_t lcId; /*!< Logical channel ID */
63 uint16_t pduLen; /*!< PDU Length */
64 uint8_t *pduBuf; /*!< RLC PDU buffer */
67 typedef struct rlcDlData
69 SlotTimingInfo slotInfo; /*!< Timing info */
70 uint16_t cellId; /*!< CELL ID */
71 uint16_t rnti; /*!< Temporary CRNTI */
72 uint8_t numPdu; /*!< Number of RLC PDUs */
73 RlcPduInfo pduInfo[MAX_NUM_PDU];
75 RlcBoStatus boStatus[MAX_NUM_LC]; /*!< Buffer occupancy */
78 typedef struct rlcUlData
80 SlotTimingInfo slotInfo; /*!< Timing info */
81 uint16_t cellId; /*!< CELL ID */
82 uint16_t rnti; /*!< Temporary CRNTI */
83 uint8_t numPdu; /*!< Number of RLC PDUs */
84 RlcPduInfo pduInfo[MAX_NUM_PDU];
87 /* Function pointers */
88 typedef uint8_t (*RlcMacBoStatusFunc)(Pst* pst, RlcBoStatus *boStatus);
89 typedef uint8_t (*RlcMacSchedResultRptFunc)(Pst *pst, RlcSchedResultRpt *schRpt);
90 typedef uint8_t (*RlcMacDlDataFunc)(Pst* pst, RlcDlData *dlData);
91 typedef uint8_t (*RlcMacUlDataFunc)(Pst* pst, RlcUlData *ulData);
93 /* Function declarations */
94 uint8_t packRlcBoStatus(Pst* pst, RlcBoStatus* boStatus);
95 uint8_t unpackRlcBoStatus(RlcMacBoStatusFunc func, Pst* pst, Buffer *mBuf);
96 uint8_t MacProcRlcBoStatus(Pst* pst, RlcBoStatus* boStatus);
97 uint8_t packRlcSchedResultRpt(Pst* pst, RlcSchedResultRpt *schRpt);
98 uint8_t unpackSchedResultRpt(RlcMacSchedResultRptFunc func, Pst *pst, Buffer *mBuf);
99 uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRpt);
100 uint8_t packRlcDlData(Pst* pst, RlcDlData *datReq);
101 uint8_t unpackRlcDlData(RlcMacDlDataFunc func, Pst *pst, Buffer *mBuf);
102 uint8_t MacProcRlcDlData(Pst* pst, RlcDlData *dlData);
103 uint8_t packRlcUlData(Pst* pst, RlcUlData *ulData);
104 uint8_t unpackRlcUlData(RlcMacUlDataFunc func, Pst *pst, Buffer *mBuf);
105 uint8_t RlcProcUlData(Pst* pst, RlcUlData *ulData);
107 /**********************************************************************
109 **********************************************************************/