1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 #include "common_def.h"
25 #include "du_app_rlc_inf.h"
26 #include "du_app_mac_inf.h"
28 #include "du_e2ap_mgr.h"
30 #include "du_e2ap_msg_hdl.h"
33 * @brief Handler to check if the timer is running
35 * @param[in] cb Control block depending on the type of the timer event.
36 * It can be uplink/downlink rbCb or rgu sap control block
37 * @param[in] tmrEvnt Timer event to be started
39 * @return Bool indicating whether the timer is running or not
44 bool duChkTmr(PTR cb, int16_t tmrEvnt)
48 case EVENT_E2_SETUP_TMR:
50 if(((E2apDb *)cb)->e2Timers.e2SetupTimer.tmrEvnt == EVENT_E2_SETUP_TMR)
52 DU_LOG("\nERROR --> DU_APP : duChkTmr: Invalid tmr Evnt [%d]", tmrEvnt);
59 DU_LOG("\nERROR --> DU_APP : duChkTmr: Invalid tmr Evnt [%d]", tmrEvnt);
67 * @brief Handler to start timer
69 * @param[in] cb Control block depending on the type of the timer event.
70 * It can be uplink/downlink rbCb or rgu sap control block
71 * @param[in] tmrEvnt Timer event to be started
76 void duStartTmr(PTR cb, int16_t tmrEvnt, uint8_t timerValue)
84 case EVENT_E2_SETUP_TMR:
86 e2apDb = ((E2apDb *)cb);
87 DU_TMR_CALCUATE_WAIT(arg.wait, timerValue, duCb.duTimersInfo.tmrRes);
89 arg.timers = &e2apDb->e2Timers.e2SetupTimer;
90 arg.max = MAX_E2_SETUP_TMR;
95 DU_LOG("\nERROR --> DU : duStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);
101 arg.tqCp = &(duCb.duTimersInfo.tmrTqCp);
102 arg.tq = duCb.duTimersInfo.tmrTq;
113 * @brief Handler to invoke events on expiry of timer.
116 * This function is used to handle expiry of timer,it invokes relevant
119 * @param[in] cb Control block depending on the type of the timer event.
120 * It can be uplink/downlink rbCb or rgu sap control block
121 * @param[in] tmrEvnt Timer event to be started
126 void duTmrExpiry(PTR cb,int16_t tmrEvnt)
130 case EVENT_E2_SETUP_TMR:
132 BuildAndSendE2SetupReq();
137 DU_LOG("\nERROR --> DU : duStartTmr: Invalid tmr Evnt [%d]", tmrEvnt);
146 * @brief DU instance timer call back function registered with system services.
150 * Function : duActvTmr
152 * This function is invoked for every timer activation
153 * period expiry. Note that SS_MT_TMR flag needs to be enabled for this
154 * as isntId is needed.As part of SRegTmr call for du instance
155 * SS_MT_TMR flag needs to be enabled and duActvTmr needs to be given as
162 short int duActvTmr(Ent ent,Inst inst)
164 /* Check if any timer in the du instance has expired */
165 cmPrcTmr(&(duCb.duTimersInfo.tmrTqCp), duCb.duTimersInfo.tmrTq, (PFV) duTmrExpiry);
169 } /* end of duActvTmr */
171 /**********************************************************************
174 **********************************************************************/