X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_mgr_main.c;h=9a8c9617a1a3426de516b29c6fafec1706b18b7d;hb=5831bf6b3454aa200a92cd3e84209650734e4863;hp=ceca4ebde8b98342ec1f1b1f4f72d95fa43423d9;hpb=d349ae65e1495488772f87e5cfa1ae71d9eab075;p=o-du%2Fl2.git diff --git a/src/du_app/du_mgr_main.c b/src/du_app/du_mgr_main.c index ceca4ebde..9a8c9617a 100644 --- a/src/du_app/du_mgr_main.c +++ b/src/du_app/du_mgr_main.c @@ -17,17 +17,29 @@ *******************************************************************************/ /* This file is the entry point for DU APP */ - +#include "common_def.h" +#include "lrg.h" +#include "legtp.h" +#include "lrg.x" +#include "lkw.x" +#include "du_app_mac_inf.h" +#include "du_app_rlc_inf.h" +#include "du_cfg.h" +#include "du_mgr.h" #include "du_mgr_main.h" #include "du_sctp.h" +#include "du_egtp.h" -extern S16 kwUlActvTsk (Pst *, Buffer *); -extern S16 kwUlActvInit (Ent, Inst, Region, Reason); -extern S16 kwDlActvTsk (Pst *, Buffer *); -extern S16 kwDlActvInit (Ent, Inst, Region, Reason); +extern S16 rlcUlActvTsk (Pst *, Buffer *); +extern S16 rlcUlActvInit (Ent, Inst, Region, Reason); +extern S16 rlcDlActvTsk (Pst *, Buffer *); +extern S16 rlcDlActvInit (Ent, Inst, Region, Reason); extern S16 rgActvTsk (Pst *, Buffer *); extern S16 rgActvInit (Ent, Inst, Region, Reason); +/* Global variable */ +DuCfgParams duCfgParam; + /******************************************************************* * * @brief Initializes DU APP @@ -47,8 +59,8 @@ extern S16 rgActvInit (Ent, Inst, Region, Reason); * ****************************************************************/ S16 duAppInit(SSTskId sysTskId) { - /* Register DU APP TAPA Task for DU */ - if(SRegTTsk((Ent)ENTDUAPP, (Inst)DU_INST, (Ttype)TTNORM, (Prior)PRIOR0, + /* Register DU APP TAPA Task for DU */ + if(SRegTTsk((Ent)ENTDUAPP, (Inst)DU_INST, (Ttype)TTNORM, (Prior)PRIOR0, duActvInit, (ActvTsk)duActvTsk) != ROK) { return RFAILED; @@ -59,10 +71,48 @@ S16 duAppInit(SSTskId sysTskId) return RFAILED; } - printf("\nDU APP created and registered \ - to %d sys task\n", sysTskId); + DU_LOG("\nDU_APP : DU APP created and registered \ + to %d sys task", sysTskId); return ROK; } + +/******************************************************************* + * + * @brief Initializes EGTP + * + * @details + * + * Function : egtpInit + * + * Functionality: + * - Registers and attaches TAPA tasks belonging to + * DU_APP sys task + * + * @params[in] system task ID + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +S16 egtpInit(SSTskId sysTskId) +{ + /* Register DU APP TAPA Task for DU */ + if(SRegTTsk((Ent)ENTEGTP, (Inst)EGTP_INST, (Ttype)TTNORM, (Prior)PRIOR0, + egtpActvInit, (ActvTsk)egtpActvTsk) != ROK) + { + return RFAILED; + } + /* Attach DU APP TAPA Task for DU */ + if (SAttachTTsk((Ent)ENTEGTP, (Inst)0, sysTskId)!= ROK) + { + return RFAILED; + } + + DU_LOG("\nDU_APP : EGTP created and registered \ + to %d sys task", sysTskId); + return ROK; +} + + /******************************************************************* * * @brief Initializes SCTP task @@ -93,7 +143,7 @@ S16 sctpInit(SSTskId sysTskId) return RFAILED; } - printf("\nSCTP TAPA task created and registered to %d sys task\n", + DU_LOG("\nDU_APP : SCTP TAPA task created and registered to %d sys task", sysTskId); return ROK; } @@ -117,7 +167,7 @@ S16 rlcDlInit(SSTskId sysTskId) { /* Register RLC DL TAPA Task */ if(SRegTTsk((Ent)ENTKW, (Inst)1, (Ttype)TTNORM, (Prior)PRIOR0, - kwDlActvInit, (ActvTsk)kwDlActvTsk) != ROK) + rlcDlActvInit, (ActvTsk)rlcDlActvTsk) != ROK) { return RFAILED; } @@ -139,8 +189,8 @@ S16 rlcDlInit(SSTskId sysTskId) return RFAILED; } - printf("\nRLC DL and MAC TAPA task created and registered to \ - %d sys task\n", sysTskId); + DU_LOG("\nDU_APP : RLC DL and MAC TAPA task created and registered to \ + %d sys task", sysTskId); return ROK; } @@ -164,7 +214,7 @@ S16 rlcUlInit(SSTskId sysTskId) { /* Register RLC UL TAPA Task */ if(SRegTTsk((Ent)ENTKW, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0, - kwUlActvInit, (ActvTsk)kwUlActvTsk) != ROK) + rlcUlActvInit, (ActvTsk)rlcUlActvTsk) != ROK) { return RFAILED; } @@ -173,8 +223,8 @@ S16 rlcUlInit(SSTskId sysTskId) { return RFAILED; } - printf("\nRLC UL TAPA task created and registered to \ - %d sys task\n", sysTskId); + DU_LOG("\nDU_APP : RLC UL TAPA task created and registered to \ + %d sys task", sysTskId); return ROK; } @@ -220,25 +270,31 @@ S16 commonInit() /* Create TAPA tasks */ if(duAppInit(du_app_stsk) != ROK) { - printf("\nDU APP TAPA Task initialization failed"); + DU_LOG("\nDU_APP : DU APP TAPA Task initialization failed"); + return RFAILED; + } + + if(egtpInit(du_app_stsk) != ROK) + { + DU_LOG("\nDU_APP : EGTP TAPA Task initialization failed"); return RFAILED; } if(sctpInit(sctp_stsk) != ROK) { - printf("\nSCTP TAPA Task initialization failed"); + DU_LOG("\nDU_APP : SCTP TAPA Task initialization failed"); return RFAILED; } if(rlcDlInit(rlc_mac_cl_stsk) != ROK) { - printf("\nRLC DL Tapa Task initialization failed"); + DU_LOG("\nDU_APP : RLC DL Tapa Task initialization failed"); return RFAILED; } if(rlcUlInit(rlc_ul_stsk) != ROK) { - printf("\nRLC UL Tapa Task initialization failed"); + DU_LOG("\nDU_APP : RLC UL Tapa Task initialization failed"); return RFAILED; } return ROK; @@ -272,6 +328,10 @@ S16 duInit() return ret; } +void init_log() +{ + openlog("ODU",LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1); +} /******************************************************************* * * @brief Entry point for the DU APP @@ -291,24 +351,18 @@ S16 duInit() * ****************************************************************/ S16 tst(void) { + init_log(); - //Initialize TAPA layers - if(duInit() != ROK) - { + //Initialize TAPA layers + if(duInit() != ROK) + { return RFAILED; } + //Read all the configs from du_utils.c into duCfgParams duReadCfg(); -#if 0 - //Establish SCTP connection - while(ret == -1) - { - printf("\nEstablishing SCTP link with CU... \n"); - //ret = establishSctp(); //To be implemeted in du_sctp.c - } -#endif return ROK; }/* end of main()*/