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 bool commCh; /*!< Common or Dedicated Channel */
39 uint8_t lcId; /*!< Logical channel ID */
40 uint32_t bo; /*!< Buffer occupancy reported by RLC */
43 /* Scheduled logical channel info */
44 typedef struct rlcLcSchInfo
46 bool commCh; /* Common or dedicated channel */
47 uint8_t lcId; /*!< Logical channel ID */
48 uint32_t bufSize; /*!< Total buffer size in bytes scheduled by MAC */
51 /* Schedule result report */
52 typedef struct rlcSchedResultRpt
55 uint16_t cellId; /*!< CELL ID */
56 uint16_t rnti; /*!< Temporary CRNTI */
57 uint8_t numLc; /*!< Number of logical channels scheduled */
58 SlotTimingInfo slotInfo; /*!< Timing info */
59 RlcLcSchInfo lcSch[MAX_NUM_LC]; /*!< Scheduled info of logical channels */
62 /* DL/UL data transfer */
63 typedef struct rlcPduInfo
65 bool commCh; /*!<Common or Dedicated Channel */
66 uint8_t lcId; /*!< Logical channel ID */
67 uint16_t pduLen; /*!< PDU Length */
68 uint8_t *pduBuf; /*!< RLC PDU buffer */
71 typedef struct rlcData
73 uint16_t cellId; /*!< CELL ID */
74 uint16_t rnti; /*!< Temporary CRNTI */
75 SlotTimingInfo slotInfo; /*!< Timing info */
76 uint8_t numPdu; /*!< Number of RLC PDUs */
77 RlcPduInfo pduInfo[MAX_NUM_PDU];
79 RlcBoStatus boStatus[MAX_NUM_LC]; /*!< Buffer occupancy */
82 /* Function pointers */
83 typedef uint8_t (*RlcMacBoStatusFunc)(Pst* pst, RlcBoStatus *boStatus);
84 typedef uint8_t (*RlcMacSchedResultRptFunc)(Pst *pst, RlcSchedResultRpt *schRpt);
85 typedef uint8_t (*RlcMacDlDataFunc)(Pst* pst, RlcData *dlData);
86 typedef uint8_t (*RlcMacUlDataFunc)(Pst* pst, RlcData *ulData);
88 /* Function declarations */
89 uint8_t packRlcBoStatus(Pst* pst, RlcBoStatus* boStatus);
90 uint8_t unpackRlcBoStatus(RlcMacBoStatusFunc func, Pst* pst, Buffer *mBuf);
91 uint8_t MacProcRlcBoStatus(Pst* pst, RlcBoStatus* boStatus);
92 uint8_t packRlcSchedResultRpt(Pst* pst, RlcSchedResultRpt *schRpt);
93 uint8_t unpackSchedResultRpt(RlcMacSchedResultRptFunc func, Pst *pst, Buffer *mBuf);
94 uint8_t RlcProcSchedResultRpt(Pst *pst, RlcSchedResultRpt *schRpt);
95 uint8_t packRlcDlData(Pst* pst, RlcData *datReq);
96 uint8_t unpackRlcDlData(RlcMacDlDataFunc func, Pst *pst, Buffer *mBuf);
97 uint8_t MacProcRlcDlData(Pst* pst, RlcData *dlData);
98 uint8_t packRlcUlData(Pst* pst, RlcData *ulData);
99 uint8_t unpackRlcUlData(RlcMacUlDataFunc func, Pst *pst, Buffer *mBuf);
100 uint8_t RlcProcUlData(Pst* pst, RlcData *ulData);
102 /**********************************************************************
104 **********************************************************************/