X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrsch%2Fsch_msg_router.c;h=bad7ceac075b9a3e35b70ad037d8c9bc8fa4ffea;hb=6dc8a4c17da24847b3a3aee91b37151f77a8a5bc;hp=c4385ee4c82b18668886d53724b1a10ea9334f93;hpb=fa6899dae4aee415bbcfd00760b6e2b312ddceec;p=o-du%2Fl2.git diff --git a/src/5gnrsch/sch_msg_router.c b/src/5gnrsch/sch_msg_router.c index c4385ee4c..bad7ceac0 100755 --- a/src/5gnrsch/sch_msg_router.c +++ b/src/5gnrsch/sch_msg_router.c @@ -42,6 +42,74 @@ #include "rgr.x" /* layer management typedefs for MAC */ #include "rg_sch_inf.x" /* typedefs for Scheduler */ #include "sch.h" +#include "sch_tmr.h" + +/** + * @brief Task Initiation function. + * + * @details + * + * Function : schActvInit + * + * This function is supplied as one of parameters during MAC's + * task registration. MAC will invoke this function once, after + * it creates and attaches this TAPA Task to a system task. + * + * @param[in] Ent Entity, the entity ID of this task. + * @param[in] Inst Inst, the instance ID of this task. + * @param[in] Region Region, the region ID registered for memory + * usage of this task. + * @param[in] Reason Reason. + * @return int + * -# ROK + **/ +uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason) +{ + Inst inst = (instId - SCH_INST_START); + + /* Initialize the MAC TskInit structure to zero */ + memset ((uint8_t *)&schCb[inst], 0, sizeof(schCb)); + + /* Initialize the MAC TskInit with received values */ + schCb[inst].schInit.ent = entity; + schCb[inst].schInit.inst = inst; + schCb[inst].schInit.region = region; + schCb[inst].schInit.pool = 0; + schCb[inst].schInit.reason = reason; + schCb[inst].schInit.cfgDone = FALSE; + schCb[inst].schInit.acnt = FALSE; + schCb[inst].schInit.usta = FALSE; + schCb[inst].schInit.trc = FALSE; + schCb[inst].schInit.procId = ODU_GET_PROCID(); + + return ROK; +} /* schActvInit */ + +/** + * @brief Task Activation callback function. + * + * @details + * + * Function : schActvTsk + * + * Primitives invoked by SCH's users/providers through + * a loosely coupled interface arrive here by means of + * SSI's message handling. This API is registered with + * SSI during the Task Registration of SCH. + * + * @param[in] Pst *pst, Post structure of the primitive. + * @param[in] Buffer *mBuf, Packed primitive parameters in the buffer. + * @param[in] Reason reason. + * @return uint8_t + * -# ROK + **/ +uint8_t schActvTsk(Pst *pst, Buffer *mBuf) +{ + SchMessageRouter(pst, (void *)mBuf); + + ODU_EXIT_TASK(); + return ROK; +} #ifdef CALL_FLOW_DEBUG_LOG /** @@ -102,6 +170,20 @@ void callFlowSchMsgRouter(Pst *pst) strcpy(message,"EVENT_MODIFY_UE_CONFIG_REQ_TO_SCH"); break; } + case EVENT_UL_CQI_TO_SCH: + { + strcpy(message,"EVENT_UL_CQI_TO_SCH"); + break; + } + case EVENT_DL_CQI_TO_SCH: + { + strcpy(message,"EVENT_DL_CQI_TO_SCH"); + break; + } + case EVENT_PHR_IND_TO_SCH + { + strcpy(message,"EVENT_PHR_IND_TO_SCH"); + } case EVENT_RACH_IND_TO_SCH: { strcpy(message,"EVENT_RACH_IND_TO_SCH"); @@ -162,6 +244,16 @@ void callFlowSchMsgRouter(Pst *pst) strcpy(message,"EVENT_DL_HARQ_IND_TO_SCH"); break; } + case EVENT_STATISTICS_REQ_TO_SCH: + { + strcpy(message,"EVENT_STATISTICS_REQ_TO_SCH"); + break; + } + case EVENT_STATISTICS_DELETE_REQ_TO_SCH: + { + strcpy(message,"EVENT_STATISTICS_DELETE_REQ_TO_SCH"); + break; + } default: strcpy(message,"Invalid Event"); break; @@ -179,7 +271,7 @@ uint8_t SchMessageRouter(Pst *pst, void *msg) switch(pst->event) { case EVENT_SCH_GEN_CFG: - { + { SchProcGenCfgReq(pst, (RgMngmt *)msg); break; } @@ -213,6 +305,21 @@ uint8_t SchMessageRouter(Pst *pst, void *msg) SchModUeConfigReq(pst, (SchUeRecfgReq *)msg); break; } + case EVENT_UL_CQI_TO_SCH: + { + SchProcUlCqiInd(pst, (SchUlCqiInd *)msg); + break; + } + case EVENT_DL_CQI_TO_SCH: + { + SchProcDlCqiInd(pst, (SchDlCqiInd *)msg); + break; + } + case EVENT_PHR_IND_TO_SCH: + { + SchProcPhrInd(pst, (SchPwrHeadroomInd *)msg); + break; + } case EVENT_RACH_IND_TO_SCH: { SchProcRachInd(pst, (RachIndInfo *)msg); @@ -269,6 +376,16 @@ uint8_t SchMessageRouter(Pst *pst, void *msg) SchProcDlHarqInd(pst, (DlHarqInd *)msg); break; } + case EVENT_STATISTICS_REQ_TO_SCH: + { + SchProcStatsReq(pst, (SchStatsReq *)msg); + break; + } + case EVENT_STATISTICS_DELETE_REQ_TO_SCH: + { + SchProcStatsDeleteReq(pst, (SchStatsDeleteReq *)msg); + break; + } default: { DU_LOG("\nERROR --> SCH : SchMessageRouter(): Invalid event [%d] received", pst->event);