X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fdu_app%2Fdu_tmr.c;h=3e24888c4092f31b0965db4dd8e025cb90962d9c;hb=49856df248fd976b4a9882ca4e650fc0bc3e4ee3;hp=838dd3586dda02bb845f91f69d427cfc634941dd;hpb=112672aee2b176d420e1474b13a5655c3d1e92b4;p=o-du%2Fl2.git diff --git a/src/du_app/du_tmr.c b/src/du_app/du_tmr.c index 838dd3586..3e24888c4 100644 --- a/src/du_app/du_tmr.c +++ b/src/du_app/du_tmr.c @@ -52,6 +52,7 @@ bool duChkTmr(PTR cb, int16_t tmrEvnt) DU_LOG("\nERROR --> DU_APP : duChkTmr: Invalid tmr Evnt [%d]", tmrEvnt); return TRUE; } + break; } case EVENT_RIC_SERVICE_UPDATE_TMR: { @@ -62,6 +63,24 @@ bool duChkTmr(PTR cb, int16_t tmrEvnt) } break; } + case EVENT_E2_NODE_CONFIG_UPDATE_TMR: + { + if(((E2NodeConfigUpdateTimer *)cb)->timer.tmrEvnt == EVENT_E2_NODE_CONFIG_UPDATE_TMR) + { + DU_LOG("\nERROR --> DU_APP : duChkTmr: Invalid tmr Evnt [%d]", tmrEvnt); + return TRUE; + } + break; + } + case EVENT_RIC_SUBSCRIPTION_REPORTING_TMR: + { + if(((RicSubscription *)cb)->ricSubsReportTimer.tmrEvnt == EVENT_RIC_SUBSCRIPTION_REPORTING_TMR) + { + DU_LOG("\nERROR --> DU_APP : duChkTmr: Timer already running for event [%d]", tmrEvnt); + return TRUE; + } + break; + } default: { DU_LOG("\nERROR --> DU_APP : duChkTmr: Invalid tmr Evnt [%d]", tmrEvnt); @@ -81,7 +100,7 @@ bool duChkTmr(PTR cb, int16_t tmrEvnt) * @return Void */ -void duStartTmr(PTR cb, int16_t tmrEvnt, uint8_t timerValue) +void duStartTmr(PTR cb, int16_t tmrEvnt, uint32_t timerValue) { CmTmrArg arg; arg.wait = 0; @@ -90,7 +109,7 @@ void duStartTmr(PTR cb, int16_t tmrEvnt, uint8_t timerValue) { case EVENT_E2_SETUP_TMR: { - CmTimer *e2SetupTimer; + CmTimer *e2SetupTimer = NULLP; e2SetupTimer = ((CmTimer *)cb); TMR_CALCUATE_WAIT(arg.wait, timerValue, duCb.duTimersInfo.tmrRes); @@ -100,7 +119,7 @@ void duStartTmr(PTR cb, int16_t tmrEvnt, uint8_t timerValue) } case EVENT_RIC_SERVICE_UPDATE_TMR: { - RicServiceUpdateTimer *ricServiceUpdateTimer; + RicServiceUpdateTimer *ricServiceUpdateTimer = NULLP; ricServiceUpdateTimer= ((RicServiceUpdateTimer*)cb); TMR_CALCUATE_WAIT(arg.wait, timerValue, duCb.duTimersInfo.tmrRes); @@ -108,9 +127,30 @@ void duStartTmr(PTR cb, int16_t tmrEvnt, uint8_t timerValue) arg.max = MAX_RIC_SERVICE_UPDATE_TMR; break; } + case EVENT_E2_NODE_CONFIG_UPDATE_TMR: + { + E2NodeConfigUpdateTimer *cfgUpdateTimer; + cfgUpdateTimer = ((E2NodeConfigUpdateTimer*)cb); + TMR_CALCUATE_WAIT(arg.wait, timerValue, duCb.duTimersInfo.tmrRes); + + arg.timers = &cfgUpdateTimer->timer; + arg.max = MAX_E2_NODE_CONFIG_UPDATE_TMR; + break; + } + case EVENT_RIC_SUBSCRIPTION_REPORTING_TMR: + { + RicSubscription *ricSubscription = NULLP; + ricSubscription = ((RicSubscription*)cb); + TMR_CALCUATE_WAIT(arg.wait, timerValue, duCb.duTimersInfo.tmrRes); + + arg.timers = &ricSubscription->ricSubsReportTimer; + arg.max = MAX_RIC_SUBSCRIPTION_REPORTING_TMR; + break; + } default: { DU_LOG("\nERROR --> DU : duStartTmr: Invalid tmr Evnt [%d]", tmrEvnt); + return; } } @@ -158,6 +198,22 @@ void duTmrExpiry(PTR cb,int16_t tmrEvnt) BuildAndSendRicServiceUpdate(ricServiceUpdateTimer->ricService); break; } + case EVENT_E2_NODE_CONFIG_UPDATE_TMR: + { + E2NodeConfigUpdateTimer *cfgUpdateTimer; + + cfgUpdateTimer = ((E2NodeConfigUpdateTimer*)cb); + BuildAndSendE2NodeConfigUpdate(&cfgUpdateTimer->configList); + break; + } + case EVENT_RIC_SUBSCRIPTION_REPORTING_TMR: + { + RicSubscription *ricSubscription = NULLP; + + ricSubscription = ((RicSubscription *)cb); + E2apHdlRicSubsReportTmrExp(ricSubscription); + break; + } default: { DU_LOG("\nERROR --> DU : duStartTmr: Invalid tmr Evnt [%d]", tmrEvnt); @@ -168,6 +224,79 @@ void duTmrExpiry(PTR cb,int16_t tmrEvnt) return; } +/** + * @brief Handler to stop timer + * + * @param[in] cb Control block depending on the type of the timer event. + * @param[in] tmrEvnt Timer event to be stopped + * + * @return Void +*/ + +void duStopTmr(PTR cb, uint8_t tmrType) +{ + CmTmrArg arg; + arg.timers = NULLP; + + switch (tmrType) + { + case EVENT_E2_SETUP_TMR: + { + CmTimer *e2SetupTimer = NULLP; + + e2SetupTimer = ((CmTimer *)cb); + arg.timers = e2SetupTimer; + arg.max = MAX_E2_SETUP_TMR; + break; + } + case EVENT_RIC_SERVICE_UPDATE_TMR: + { + RicServiceUpdateTimer *ricServiceUpdateTimer = NULLP; + + ricServiceUpdateTimer= ((RicServiceUpdateTimer*)cb); + arg.timers = &ricServiceUpdateTimer->timer; + arg.max = MAX_RIC_SERVICE_UPDATE_TMR; + break; + } + case EVENT_E2_NODE_CONFIG_UPDATE_TMR: + { + E2NodeConfigUpdateTimer *cfgUpdateTimer; + + cfgUpdateTimer = ((E2NodeConfigUpdateTimer*)cb); + arg.timers = &cfgUpdateTimer->timer; + arg.max = MAX_E2_NODE_CONFIG_UPDATE_TMR; + break; + } + case EVENT_RIC_SUBSCRIPTION_REPORTING_TMR: + { + RicSubscription *ricSubscription = NULLP; + + ricSubscription = ((RicSubscription*)cb); + arg.timers = &ricSubscription->ricSubsReportTimer; + arg.max = MAX_RIC_SUBSCRIPTION_REPORTING_TMR; + break; + } + default: + { + DU_LOG("\nERROR --> RLC : rlcStopTmr: Invalid tmr Evnt[%d]", tmrType); + break; + } + } + + if (tmrType != TMR0) + { + arg.tqCp = &(duCb.duTimersInfo.tmrTqCp); + arg.tq = duCb.duTimersInfo.tmrTq; + arg.cb = cb; + arg.evnt = tmrType; + arg.wait = 0; + arg.tNum = 0; + cmRmvCbTq(&arg); + } + + return; +} + /** * @brief DU instance timer call back function registered with system services. *