Changes for SR, BSR and MSG5 Handling
[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 "rgu.h"
23 #include "rgu.x"
24 #include "du_app_mac_inf.h"
25 #include "mac_upr_inf_api.h"
26
27 /* Funtion pointer options for slot indication */
28 DuMacSlotInd packMacSlotIndOpts[] =
29 {
30    packMacSlotInd,
31    duHandleSlotInd,
32    packMacSlotInd
33 };
34 /* Funtion pointer options for stop indication */
35 DuMacStopInd packMacStopIndOpts[] =
36 {
37    packMacStopInd,
38    duHandleStopInd,
39    packMacStopInd
40 };
41
42 /* Funtion pointer options for UL CCCH indication */
43 DuMacUlCcchInd packMacUlCcchIndOpts[] =
44 {
45    packMacUlCcchInd,
46    duHandleUlCcchInd,
47    packMacUlCcchInd
48 };
49
50 /* Function pointer options for UL Data to RLC */
51 RlcMacUlDataFunc rlcMacSendUlDataOpts[] =
52 {
53    packRlcUlData,
54    RlcProcUlData,
55    packRlcUlData
56 };
57
58 /*******************************************************************
59  *
60  * @brief Send slot indication to MAC
61  *
62  * @details
63  *
64  *    Function : MacDuAppSlotInd
65  *
66  *    Functionality:
67  *       Select appropriate function using selector value and
68  *       send to MAC
69  *
70  * @params[in]  Post structure pointer
71  *              Slot info pointer 
72  * @return ROK     - success
73  *         RFAILED - failure
74  *
75  * ****************************************************************/
76 uint8_t MacDuAppSlotInd(Pst *pst, SlotIndInfo *slotInfo)
77 {
78    return (*packMacSlotIndOpts[pst->selector])(pst, slotInfo);
79 }
80
81 /*******************************************************************
82  *
83  * @brief Send stop indication to MAC
84  *
85  * @details
86  *
87  *    Function : MacDuAppStopInd
88  *
89  *    Functionality:
90  *       Sends Stop Indication to MAC
91  *
92  * @params[in]  Post structure pointer
93  * @return ROK     - success
94  *         RFAILED - failure
95  *
96  * ****************************************************************/
97 uint8_t MacDuAppStopInd(Pst *pst, MacCellStopInfo *cellStopId)
98 {
99    return (*packMacStopIndOpts[pst->selector])(pst, cellStopId);
100 }
101
102 /*******************************************************************
103  *
104  * @brief Send UL CCCH Ind to DU APP
105  *
106  * @details
107  *
108  *    Function :MacDuAppUlCcchInd 
109  *
110  *    Functionality:
111  *       Select appropriate function using selector value and
112  *       send to DU APP
113  *
114  * @params[in]  Post structure pointer
115  *              UlCcchInd pointer 
116  * @return ROK     - success
117  *         RFAILED - failure
118  *
119  * ****************************************************************/
120 uint8_t MacDuAppUlCcchInd(Pst *pst, UlCcchIndInfo *ulCcchIndInfo)
121 {
122    return (*packMacUlCcchIndOpts[pst->selector])(pst, ulCcchIndInfo);
123 }
124
125 /*******************************************************************
126  *
127  * @brief Send UL data to RLC
128  *
129  * @details
130  *
131  *    Function : MacRlcSendUlData
132  *
133  *    Functionality: Send UL data to RLC
134  *
135  * @params[in] 
136  * @return ROK     - success
137  *         RFAILED - failure
138  *
139  * ****************************************************************/
140 uint8_t MacSendUlDataToRlc(Pst *pst, RlcMacData *ulData)
141 {
142    return (*rlcMacSendUlDataOpts[pst->selector])(pst, ulData);
143 }
144
145
146 /**********************************************************************
147   End of file
148  **********************************************************************/
149