[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-480] WG8 Alignment | Third Phase | RLC-MAC...
[o-du/l2.git] / src / cm / rlc_mac_inf.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 */
19
20 /* RLC instances */
21 #define RLC_UL_INST  0
22 #define RLC_DL_INST  1
23
24 /* Event */
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
29
30 /* MACRO defines */
31 #define MAX_NUM_PDU     16
32
33 /* Buffer occupancy status information */
34 typedef struct rlcBoStatus
35 {
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 */
40 }RlcBoStatus;
41
42 /* Scheduled logical channel info */
43 typedef struct rlcLcSchInfo
44 {
45    uint8_t   lcId;        /*!< Logical channel ID */
46    uint32_t  bufSize;  /*!< Total buffer size in bytes scheduled by MAC */
47 }RlcLcSchInfo;
48
49 /* Schedule result report */
50 typedef struct rlcSchedResultRpt
51 {
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 */
57 }RlcSchedResultRpt;
58
59 /* DL/UL data transfer */
60 typedef struct rlcPduInfo
61 {
62    uint8_t    lcId;     /*!< Logical channel ID */
63    uint16_t   pduLen;   /*!< PDU Length */
64    uint8_t    *pduBuf;  /*!< RLC PDU buffer */
65 }RlcPduInfo;
66  
67 typedef struct rlcDlData
68 {
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];
74    uint8_t        numLc;
75    RlcBoStatus    boStatus[MAX_NUM_LC];     /*!< Buffer occupancy */
76 }RlcDlData;
77
78 typedef struct rlcUlData
79 {
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];
85 }RlcUlData;
86
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);
92
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);
106
107 /**********************************************************************
108           End of file
109 **********************************************************************/
110