X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fdu_app%2Fdu_mgr_main.c;h=d4988301c0d2c3a4fb3f47254ae05200706b1dcc;hb=cbb5d8d83a41cbf191347d447a66c9cd062d4d81;hp=4feb2c66171336e1040ffadacec28ed85ad8d4fd;hpb=79b8d410dc34e5624583b9ad935e65350dd3f62a;p=o-du%2Fl2.git diff --git a/src/du_app/du_mgr_main.c b/src/du_app/du_mgr_main.c index 4feb2c661..d4988301c 100644 --- a/src/du_app/du_mgr_main.c +++ b/src/du_app/du_mgr_main.c @@ -30,6 +30,13 @@ #include "du_sctp.h" #include "du_egtp.h" +#ifdef O1_ENABLE + +#include "O1Interface.h" +#include "ConfigInterface.h" + +#endif + uint8_t rlcUlActvTsk (Pst *, Buffer *); uint8_t rlcUlActvInit (Ent, Inst, Region, Reason); uint8_t rlcDlActvTsk (Pst *, Buffer *); @@ -38,6 +45,10 @@ uint8_t rgActvTsk (Pst *, Buffer *); uint8_t rgActvInit (Ent, Inst, Region, Reason); uint8_t lwrMacActvTsk(Pst *, Buffer *); uint8_t lwrMacActvInit(Ent, Inst, Region, Reason); +#ifndef INTEL_WLS_MEM +uint8_t phyStubActvTsk(Pst *, Buffer *); +uint8_t phyStubActvInit(Ent, Inst, Region, Reason); +#endif /* Global variable */ DuCfgParams duCfgParam; @@ -73,11 +84,60 @@ uint8_t duAppInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : DU APP created and registered \ + DU_LOG("\nINFO --> DU_APP : DU APP created and registered \ to %d sys task", sysTskId); return ROK; } +#ifdef O1_ENABLE +/******************************************************************* + * + * @brief Bring the cell Up + * + * @details + * + * Function : bringCellUp + * + * Functionality: + * - Bring the cell Up when requested from OAM + * + * @params[in] Cell Id + * @return true - success + * false - failure + * + * ****************************************************************/ + +bool bringCellUp(uint16_t cellId) +{ + duProcCfgComplete(); + BuildAndSendF1SetupReq(); + return true; +} + +/******************************************************************* + * + * @brief Bring the cell Down + * + * @details + * + * Function : bringCellDown + * + * Functionality: + * - Bring the cell Down when requested from OAM + * + * @params[in] Cell Id + * @return true - success + * false - failure + * + * ****************************************************************/ + +bool bringCellDown(uint16_t cellId) +{ + BuildAndSendDUConfigUpdate(SERV_CELL_TO_DELETE); + return true; +} +#endif + /******************************************************************* * * @brief Initializes EGTP @@ -109,7 +169,7 @@ uint8_t egtpInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : EGTP created and registered \ + DU_LOG("\nINFO --> DU_APP : EGTP created and registered \ to %d sys task", sysTskId); return ROK; } @@ -145,7 +205,7 @@ uint8_t sctpInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : SCTP TAPA task created and registered to %d sys task", + DU_LOG("\nINFO --> DU_APP : SCTP TAPA task created and registered to %d sys task", sysTskId); return ROK; } @@ -191,7 +251,7 @@ uint8_t rlcDlInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : RLC DL and MAC TAPA task created and registered to \ + DU_LOG("\nINFO --> DU_APP : RLC DL and MAC TAPA task created and registered to \ %d sys task", sysTskId); return ROK; } @@ -225,7 +285,7 @@ uint8_t rlcUlInit(SSTskId sysTskId) { return RFAILED; } - DU_LOG("\nDU_APP : RLC UL TAPA task created and registered to \ + DU_LOG("\nINFO --> DU_APP : RLC UL TAPA task created and registered to \ %d sys task", sysTskId); return ROK; } @@ -260,10 +320,48 @@ uint8_t lwrMacInit(SSTskId sysTskId) return RFAILED; } - DU_LOG("\nDU_APP : LWR MAC TAPA task created and registered to %d sys task", + DU_LOG("\nINFO --> DU_APP : LWR MAC TAPA task created and registered to %d sys task", + sysTskId); + return ROK; +} + +#ifndef INTEL_WLS_MEM +/******************************************************************* + * + * @brief Initializes Phy stub slot indication generator task + * + * @details + * + * Function : phyStubInit + * + * Functionality: + * - Registers and attaches TAPA tasks for Phy stub's slot + * indication generator + * + * @params[in] system task ID + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t phyStubInit(SSTskId sysTskId) +{ + /* Register PHY stub slot indication TAPA Task */ + if(ODU_REG_TTSK((Ent)ENTPHYSTUB, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0, + phyStubActvInit, (ActvTsk)phyStubActvTsk) != ROK) + { + return RFAILED; + } + /* Attach Phy stub slot indication TAPA Task */ + if (ODU_ATTACH_TTSK((Ent)ENTPHYSTUB, (Inst)0, sysTskId)!= ROK) + { + return RFAILED; + } + + DU_LOG("\nINFO --> DU_APP : PHY stub slot indication TAPA task created and registered to %d sys task", sysTskId); return ROK; } +#endif /******************************************************************* * @@ -284,98 +382,117 @@ uint8_t lwrMacInit(SSTskId sysTskId) uint8_t commonInit() { /* Declare system task Ids */ - SSTskId du_app_stsk, egtp_stsk, sctp_stsk, rlc_ul_stsk, rlc_mac_cl_stsk, lwr_mac_stsk; + SSTskId du_app_stsk, egtp_stsk, sctp_stsk, rlc_ul_stsk, rlc_mac_cl_stsk, lwr_mac_stsk, phy_stub_slot_ind_stsk; pthread_attr_t attr; ODU_SET_PROC_ID(DU_PROC); + /* Intel L1 using core 0-15. ODU-High using 16-21 */ /* system task for DU APP */ if(ODU_CREATE_TASK(PRIOR0, &du_app_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for DU APP failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for DU APP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 15, 0); + ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0); /* system task for EGTP */ if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for EGTP failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for EGTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 16, 0); + ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 17, 0); /* system task for RLC_DL and MAC */ if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for RLC DL/MAC failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for RLC DL/MAC failed"); return RFAILED; } pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 17, 0); + ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0); /* system task for RLC UL */ if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for RLC UL failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for RLC UL failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 18, 0); + ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 19, 0); /* system task for SCTP receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for SCTP failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for SCTP failed"); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 19, 0); + ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 20, 0); /* system task for lower-mac receiver thread */ if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK) { - DU_LOG("\nDU_APP : System Task creation for Lower MAC failed"); + DU_LOG("\nERROR --> DU_APP : System Task creation for Lower MAC failed"); + return RFAILED; + } + ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0); + +#ifndef INTEL_WLS_MEM + /* system task for phy stub's slot indication generator thread */ + if(ODU_CREATE_TASK(PRIOR0, &phy_stub_slot_ind_stsk) != ROK) + { + DU_LOG("\nERROR --> DU_APP : System Task creation for Phy stub slot indication generator failed. MAX STSK [%d]", SS_MAX_STSKS); return RFAILED; } - ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 20, 0); + +#endif /* Create TAPA tasks */ if(duAppInit(du_app_stsk) != ROK) { - DU_LOG("\nDU_APP : DU APP TAPA Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : DU APP TAPA Task initialization failed"); return RFAILED; } if(egtpInit(egtp_stsk) != ROK) { - DU_LOG("\nDU_APP : EGTP TAPA Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : EGTP TAPA Task initialization failed"); return RFAILED; } if(sctpInit(sctp_stsk) != ROK) { - DU_LOG("\nDU_APP : SCTP TAPA Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : SCTP TAPA Task initialization failed"); return RFAILED; } if(rlcDlInit(rlc_mac_cl_stsk) != ROK) { - DU_LOG("\nDU_APP : RLC DL Tapa Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : RLC DL Tapa Task initialization failed"); return RFAILED; } if(rlcUlInit(rlc_ul_stsk) != ROK) { - DU_LOG("\nDU_APP : RLC UL Tapa Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : RLC UL Tapa Task initialization failed"); return RFAILED; } if(lwrMacInit(lwr_mac_stsk) != ROK) { - DU_LOG("\nDU_APP : Lower MAC Tapa Task initialization failed"); + DU_LOG("\nERROR --> DU_APP : Lower MAC Tapa Task initialization failed"); + return RFAILED; + } + +#ifndef INTEL_WLS_MEM + if(phyStubInit(phy_stub_slot_ind_stsk) != ROK) + { + DU_LOG("\nERROR --> DU_APP : PHY stub slot indication Tapa Task initialization failed"); return RFAILED; } +#endif return ROK; } @@ -433,6 +550,10 @@ uint8_t tst(void) { init_log(); +#ifdef O1_ENABLE + if(start_O1_module() != ROK) + return RFAILED; +#endif //Initialize TAPA layers if(duInit() != ROK) {