Added missing triggers and state params for cell up
[o-du/l2.git] / src / 5gnrmac / mac_msg_hdl.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 /* header include files -- defines (.h)  */
20 #include "envopt.h"        /* environment options */
21 #include "envdep.h"        /* environment dependent */
22 #include "envind.h"        /* environment independent */
23 #include "gen.h"           /* general layer */
24 #include "ssi.h"           /* system services */
25 #include "cm5.h"           /* common timers defines */
26 #include "cm_hash.h"       /* common hash list defines */
27 #include "cm_llist.h"      /* common linked list defines */
28 #include "cm_mblk.h"       /* memory management */
29 #include "cm_tkns.h"       /* common tokens */
30 #include "cm_lte.h"        /* common tokens */
31 #include "rgu.h"
32 #include "tfu.h"
33 #include "rg_sch_inf.h"
34 #include "rg_env.h"
35 #include "lrg.h"
36 #include "crg.h"
37 #include "rg.h"
38 #include "du_log.h"
39 #include "lwr_mac.h"
40
41 /* header/extern include files (.x) */
42 #include "gen.x"           /* general layer typedefs */
43 #include "ssi.x"           /* system services typedefs */
44 #include "cm5.x"           /* common timers */
45 #include "cm_hash.x"       /* common hash list */
46 #include "cm_lib.x"        /* common library */
47 #include "cm_llist.x"      /* common linked list */
48 #include "cm_mblk.x"       /* memory management */
49 #include "cm_tkns.x"       /* common tokens */
50 #include "cm_lte.x"        /* common tokens */
51 #include "rgu.x"
52 #include "tfu.x"
53 #include "rg_sch_inf.x"
54 #include "lrg.x"
55 #include "crg.x"
56 #include "rg_prg.x"
57 #include "du_app_mac_inf.h"
58 #include "rg.x"
59
60 /* This file contains message handling functionality for MAC */
61
62 /*******************************************************************
63  *
64  * @brief Handles cell start reuqest from DU APP
65  *
66  * @details
67  *
68  *    Function : MacHdlCellStartReq
69  *
70  *    Functionality:
71  *      Handles cell start reuqest from DU APP
72  *
73  * @params[in] Post structure pointer
74  *             Cell Start Request info pointer 
75  * @return ROK     - success
76  *         RFAILED - failure
77  *
78  * ****************************************************************/
79 uint16_t MacHdlCellStartReq(Pst *pst, MacCellStartInfo  *cellStartInfo)
80 {
81    DU_LOG("\nMAC : Handling cell start request");
82    sendToLowerMac(START_REQUEST, 0, cellStartInfo);
83
84    MAC_FREE_MEM(pst->region, pst->pool, cellStartInfo, \
85            sizeof(MacCellStartInfo));
86
87    return ROK;
88 }
89
90 /*******************************************************************
91  *
92  * @brief Handles cell stop request from DU APP
93  *
94  * @details
95  *
96  *    Function : MacHdlCellStartReq
97  *
98  *    Functionality:
99  *        Handles cell stop request from DU APP
100  *
101  * @params[in] Post structure pointer
102  *             Mac Cell stop information
103  * @return ROK     - success
104  *         RFAILED - failure
105  *
106  * ****************************************************************/
107 uint16_t MacHdlCellStopReq(Pst *pst, MacCellStopInfo  *cellStopInfo)
108 {
109    DU_LOG("\nMAC : Handling cell stop request");
110    sendToLowerMac(STOP_REQUEST, 0, cellStopInfo);
111
112    MAC_FREE_MEM(pst->region, pst->pool, cellStopInfo, \
113            sizeof(MacCellStopInfo));
114  
115    return ROK;
116 }
117
118 /**********************************************************************
119          End of file
120 **********************************************************************/
121