Enabled timer at MAC and SCH [Issue-ID: ODUHIGH-283]
[o-du/l2.git] / src / 5gnrsch / sch_tmr.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 #include "common_def.h"
20 #include "lrg.h"
21 #include "lrg.x"
22 #include "mac_sch_interface.h"
23 #include "sch.h"
24
25 /**
26  * @brief Timer Expiry handler.
27  *
28  * @details
29  *
30  *     Function : schTmrExpiry
31  *
32  *     This is a callback function used as an input parameter to cmPrcTmr()
33  *     to check expiry of any timer. In this function, we are only concerned
34  *     about tmrEvnt=Bind timer.
35  *
36  *  @param[in]  PTR   cb,  Entry for which Timer expired
37  *  @param[in]  S16   tmrEvnt, the Timer Event
38  *  @return  uint8_t
39  *      -# ROK
40  **/
41 uint8_t schTmrExpiry(PTR cb, uint8_t tmrEvnt)
42 {
43    /* TODO : Handling of any timer event expiry */
44    return ROK;
45 }
46
47 /**
48  * @brief Scheduler instance timer call back function registered with system services.
49  *
50  * @details
51  *
52  *     Function :  schActvTmr
53  *
54  *     This function is invoked for every timer activation
55  *     period expiry. Note that SS_MT_TMR flag needs to be enabled for this
56  *     as isntId is needed.As part of SRegTmr call for scheduler instance
57  *     SS_MT_TMR flag needs to be enabled and schActvTmr needs to be given as
58  *     callback function
59  *
60  *  @return  short int
61  *      -# ROK
62  **/
63 short int schActvTmr(Ent ent,Inst inst)
64 {
65    Inst schInst = (inst  - SCH_INST_START);
66
67    /* Check if any timer in the scheduler instance has expired */
68    cmPrcTmr(&schCb[schInst].tmrTqCp,
69             schCb[schInst].tmrTq, (PFV) schTmrExpiry);
70
71    return ROK;
72
73 } /* end of schActvTmr */
74
75 /**********************************************************************
76
77          End of file
78 **********************************************************************/
79