[Epic-ID: ODUHIGH-406][Task-ID: ODUHIGH-428]Slot Indication at DUAPP
[o-du/l2.git] / src / 5gnrmac / mac_upr_inf_api.c
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
19 /* This file contains the definitions for Upper Interface APIs that are
20  * invoked from MAC */
21 #include "common_def.h"
22 #include "du_app_mac_inf.h"
23 #include "rlc_mac_inf.h"
24 #include "mac_upr_inf_api.h"
25
26 /* Funtion pointer options for cell up indication */
27 DuMacCellUpInd packMacCellUpIndOpts[] =
28 {
29    packMacCellUpInd,
30    duHandleCellUpInd,
31    packMacCellUpInd
32 };
33
34 DuMacSlotInd packMacSlotIndOpts[] = 
35 {
36    packMacSlotInd,
37    duHandleSlotInd,
38    packMacSlotInd
39 };
40
41 /* Funtion pointer options for stop indication */
42 DuMacStopInd packMacStopIndOpts[] =
43 {
44    packMacStopInd,
45    duHandleStopInd,
46    packMacStopInd
47 };
48
49 /* Funtion pointer options for UL CCCH indication */
50 DuMacUlCcchInd packMacUlCcchIndOpts[] =
51 {
52    packMacUlCcchInd,
53    duHandleUlCcchInd,
54    packMacUlCcchInd
55 };
56
57 /* Function pointer options for UL Data to RLC */
58 RlcMacUlDataFunc rlcMacSendUlDataOpts[] =
59 {
60    packRlcUlData,
61    RlcProcUlData,
62    packRlcUlData
63 };
64
65 /* Funtion pointer options for schedule result reporting */
66 RlcMacSchedResultRptFunc rlcMacSchedResultRptOpts[] =
67 {
68    packRlcSchedResultRpt,
69    RlcProcSchedResultRpt,
70    packRlcSchedResultRpt
71 };
72          
73
74 /*******************************************************************
75  *
76  * @brief Send cell up indication to DU APP
77  *
78  * @details
79  *
80  *    Function : MacDuAppCellUpInd
81  *
82  *    Functionality:
83  *       Select appropriate function using selector value and
84  *       send cell up indication to DU APP
85  *
86  * @params[in]  Post structure pointer
87  *              Cell UP info
88  * @return ROK     - success
89  *         RFAILED - failure
90  *
91  * ****************************************************************/
92 uint8_t MacDuAppCellUpInd(Pst *pst, OduCellId *cellId)
93 {
94    return (*packMacCellUpIndOpts[pst->selector])(pst, cellId);
95 }
96
97 /*******************************************************************
98  *
99  * @brief Send slot indication to DU APP
100  *
101  * @details
102  *
103  *    Function : MacDuAppSlotInd
104  *
105  *    Functionality:
106  *       send slot indication to DU APP
107  *
108  * @params[in]  Post structure pointer, SlotTimingInfo *slotIndInfo
109  * @return ROK     - success
110  *         RFAILED - failure
111  *
112  * ****************************************************************/
113 uint8_t MacDuAppSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo)
114 {
115    return (*packMacSlotIndOpts[pst->selector])(pst, slotIndInfo);
116 }
117 /*******************************************************************
118  *
119  * @brief Send stop indication to MAC
120  *
121  * @details
122  *
123  *    Function : MacDuAppStopInd
124  *
125  *    Functionality:
126  *       Sends Stop Indication to MAC
127  *
128  * @params[in]  Post structure pointer
129  * @return ROK     - success
130  *         RFAILED - failure
131  *
132  * ****************************************************************/
133 uint8_t MacDuAppStopInd(Pst *pst, OduCellId *cellId)
134 {
135    return (*packMacStopIndOpts[pst->selector])(pst, cellId);
136 }
137
138 /*******************************************************************
139  *
140  * @brief Send UL CCCH Ind to DU APP
141  *
142  * @details
143  *
144  *    Function :MacDuAppUlCcchInd 
145  *
146  *    Functionality:
147  *       Select appropriate function using selector value and
148  *       send to DU APP
149  *
150  * @params[in]  Post structure pointer
151  *              UlCcchInd pointer 
152  * @return ROK     - success
153  *         RFAILED - failure
154  *
155  * ****************************************************************/
156 uint8_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
157 {
158    return (*packMacUlCcchIndOpts[pst->selector])(pst, ulCcchIndInfo);
159 }
160
161 /*******************************************************************
162  *
163  * @brief Send UL data to RLC
164  *
165  * @details
166  *
167  *    Function : MacRlcSendUlData
168  *
169  *    Functionality: Send UL data to RLC
170  *
171  * @params[in] 
172  * @return ROK     - success
173  *         RFAILED - failure
174  *
175  * ****************************************************************/
176 uint8_t MacSendUlDataToRlc(Pst *pst, RlcData *ulData)
177 {
178    return (*rlcMacSendUlDataOpts[pst->selector])(pst, ulData);
179 }
180
181 /*******************************************************************
182  *
183  * @brief Send Schedule result report to RLC
184  *
185  * @details
186  *
187  *    Function : MacSendSchedResultRptToRlc
188  *
189  *    Functionality: Send Schedule result report to RLC
190  *
191  * @params[in] Post structure
192  *             Schedule result report
193  * @return ROK     - success
194  *         RFAILED - failure
195  *
196  * ****************************************************************/
197 uint8_t MacSendSchedResultRptToRlc(Pst *pst, RlcSchedResultRpt *schedRpt)
198 {
199    return (*rlcMacSchedResultRptOpts[pst->selector])(pst, schedRpt);
200 }
201
202 /**********************************************************************
203   End of file
204  **********************************************************************/
205