Merge "[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-472] Handling of drx timer in SCH...
[o-du/l2.git] / src / du_app / du_mgr_main.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /* This file is the entry point for DU APP */
20 #include "common_def.h"
21 #include "lrg.h"
22 #include "legtp.h"
23 #include "lrg.x"
24 #include "lkw.x"
25 #include "du_app_mac_inf.h"
26 #include "du_app_rlc_inf.h"
27 #include "du_cfg.h"
28 #include "du_mgr.h"
29 #include "du_mgr_main.h"
30 #include "du_sctp.h"
31 #include "du_egtp.h"
32
33 #ifdef O1_ENABLE
34
35 #include "O1Interface.h"
36 #include "CmInterface.h"
37 #endif
38
39 uint8_t rlcUlActvTsk (Pst *, Buffer *);
40 uint8_t rlcUlActvInit (Ent, Inst, Region, Reason);
41 uint8_t rlcDlActvTsk (Pst *, Buffer *);
42 uint8_t rlcDlActvInit (Ent, Inst, Region, Reason);
43 uint8_t rgActvTsk (Pst *, Buffer *);
44 uint8_t rgActvInit (Ent, Inst, Region, Reason);
45 uint8_t lwrMacActvTsk(Pst *, Buffer *);
46 uint8_t lwrMacActvInit(Ent, Inst, Region, Reason);
47 #ifndef INTEL_WLS_MEM
48 uint8_t phyStubActvTsk(Pst *, Buffer *);
49 uint8_t phyStubActvInit(Ent, Inst, Region, Reason);
50 #endif
51
52 /* Global variable */
53 DuCfgParams duCfgParam;
54
55 #ifdef O1_ENABLE
56 extern NRCellDU cellParams;
57 #endif
58
59 /*******************************************************************
60  *
61  * @brief Initializes DU APP
62  *
63  * @details
64  *
65  *    Function : duAppInit
66  *
67  *    Functionality:
68  *       - Registers and attaches TAPA tasks belonging to 
69  *         DU_APP sys task
70  *
71  * @params[in] system task ID
72  * @return ROK     - success
73  *         RFAILED - failure
74  *
75  * ****************************************************************/
76 uint8_t duAppInit(SSTskId sysTskId)
77 {
78    /* Register DU APP TAPA Task for DU */
79    if(ODU_REG_TTSK((Ent)ENTDUAPP, (Inst)DU_INST, (Ttype)TTNORM, (Prior)PRIOR0,
80       duActvInit, (ActvTsk)duActvTsk) != ROK)
81    {
82       return RFAILED;
83    }
84    /* Attach DU APP TAPA Task for DU */
85    if (ODU_ATTACH_TTSK((Ent)ENTDUAPP, (Inst)0, sysTskId)!= ROK)
86    {
87       return RFAILED;
88    }
89
90    DU_LOG("\nINFO   -->  DU_APP : DU APP created and registered \
91    to %d sys task", sysTskId);
92    return ROK;
93 }
94
95 #ifdef O1_ENABLE
96
97 /*******************************************************************
98  *
99  * @brief update Rrm Policy at DU and process the slice cfg request
100  *
101  * @details
102  *
103  *    Function : setRrmPolicy 
104  *
105  *    Functionality:
106  *       - update Rrm Policy at DU and process the slice cfg request
107  *
108  * @params[in] RrmPolicy rrmPolicy[], uint8_t policyNum, uint8_t memberList
109  * @return true     - success
110  *         false    - failure
111  *
112  * ****************************************************************/
113
114 uint8_t setRrmPolicy(RrmPolicyList rrmPolicy[], uint8_t policyNum)
115 {
116    DU_LOG("\nINFO   -->  DU_APP : DU APP RRM number of policy %d,", \
117           policyNum);
118    for(uint8_t i=0; i<policyNum ; i++)
119    {
120       DU_LOG("\nINFO   -->  DU_APP : DU APP  id = %s",rrmPolicy[i].id);
121       DU_LOG("\nINFO   -->  DU_APP : DU APP  resourceType = %d", \
122                 rrmPolicy[i].resourceType);
123       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMPolicyMaxRatio = %d", \
124                 rrmPolicy[i].rRMPolicyMaxRatio);
125       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMPolicyMinRatio = %d", \
126                 rrmPolicy[i].rRMPolicyMinRatio);
127       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMPolicyDedicatedRatio = %d", \
128                 rrmPolicy[i].rRMPolicyDedicatedRatio);
129       DU_LOG("\nINFO   -->  DU_APP : DU APP  rRMMemberNum = %d", \
130                 rrmPolicy[i].rRMMemberNum);
131       for(uint8_t j=0; j<rrmPolicy[i].rRMMemberNum ; j++)
132       {
133          DU_LOG("\nINFO   -->  DU_APP : DU APP  mcc = %d%d%d", \
134                  rrmPolicy[i].rRMPolicyMemberList[j].mcc[0], \
135                  rrmPolicy[i].rRMPolicyMemberList[j].mcc[1], \
136                  rrmPolicy[i].rRMPolicyMemberList[j].mcc[2]);
137          DU_LOG("\nINFO   -->  DU_APP : DU APP  mnc = %d%d%d", \
138                    rrmPolicy[i].rRMPolicyMemberList[j].mnc[0], \
139                    rrmPolicy[i].rRMPolicyMemberList[j].mnc[1], \
140                    rrmPolicy[i].rRMPolicyMemberList[j].mnc[2]);
141
142          DU_LOG("\nINFO   -->  DU_APP : DU APP  sd = %d%d%d", \
143                    rrmPolicy[i].rRMPolicyMemberList[j].sd[0], \
144                    rrmPolicy[i].rRMPolicyMemberList[j].sd[1], \
145                    rrmPolicy[i].rRMPolicyMemberList[j].sd[2]);
146
147          DU_LOG("\nINFO   -->  DU_APP : DU APP  sst = %d\n", \
148                    rrmPolicy[i].rRMPolicyMemberList[j].sst);
149       }
150
151    }
152    DuCellCb *cellCb = NULLP;
153
154     cpyRrmPolicyInDuCfgParams(rrmPolicy, policyNum, &duCfgParam.tempSliceCfg);
155     cellCb = duCb.actvCellLst[0];
156
157     if(cellCb)
158     {
159        if(cellCb->cellStatus == ACTIVATED)
160        {
161            if(duCb.sliceState == SLICE_INFO_NOT_AVAILABLE)
162            {
163               BuildAndSendSliceConfigReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy,\
164               duCfgParam.tempSliceCfg.totalSliceCount);
165            }
166            else 
167            {
168               BuildAndSendSliceRecfgReq(duCfgParam.tempSliceCfg.rrmPolicy, duCfgParam.tempSliceCfg.totalRrmPolicy,\
169               duCfgParam.tempSliceCfg.totalSliceCount);
170            }
171        }
172     }
173    return ROK;
174 }
175
176 /*******************************************************************
177  *
178  * @brief Bring the cell Up
179  *
180  * @details
181  *
182  *    Function : bringCellUp
183  *
184  *    Functionality:
185  *       - Bring the cell Up when requested from OAM
186  *
187  * @params[in] Cell Id
188  * @return true     - success
189  *         false    - failure
190  *
191  * ****************************************************************/
192
193 bool bringCellUp(uint16_t cellId)
194 {
195    duProcCfgComplete();
196    BuildAndSendF1SetupReq();
197    return true;
198 }
199
200 /*******************************************************************
201  *
202  * @brief configure cell parameters
203  *
204  * @details
205  *
206  *    Function : configurecell
207  *
208  *    Functionality:
209  *       - configure cell parameters
210  *
211  * @params[in] Cell Id
212  * @return true     - success
213  *         false    - failure
214  *
215  * ****************************************************************/
216
217 uint8_t setCellParam()
218 {
219    //Read all the configs from smo edit-config into cellParams
220    DU_LOG("\nO1 configurecell du_app enterd");
221    DU_LOG("\nDU_APP configurecell cellLocalId value:%d",cellParams.cellLocalId);
222    DU_LOG("\nDU_APP configurecell operationalState value:%d", \
223              cellParams.operationalState);
224    DU_LOG("\nDU_APP configurecell administrativeState value:%d", \
225              cellParams.administrativeState);
226    DU_LOG("\nDU_APP configurecell cellState value:%d",cellParams.cellState);
227    DU_LOG("\nDU_APP configurecell nRPCI value:%d",cellParams.nRPCI);
228    DU_LOG("\nDU_APP configurecell nRTAC value:%d",cellParams.nRTAC);
229    DU_LOG("\nDU_APP configurecell arfcnDL value:%d",cellParams.arfcnDL);
230    DU_LOG("\nDU_APP configurecell arfcnUL value:%d",cellParams.arfcnUL);
231    DU_LOG("\nDU_APP configurecell arfcnSUL value:%d",cellParams.arfcnSUL);
232    DU_LOG("\nDU_APP configurecell ssbFrequency value:%d",cellParams.ssbFrequency);
233    DU_LOG("\nDU_APP configurecell ssbPeriodicity value:%d", \
234              cellParams.ssbPeriodicity);
235    DU_LOG("\nDU_APP configurecell ssbSubCarrierSpacing value:%d", \
236              cellParams.ssbSubCarrierSpacing);
237    DU_LOG("\nDU_APP configurecell ssbOffset value:%d",cellParams.ssbOffset);
238    DU_LOG("\nDU_APP configurecell ssbDuration value:%d",cellParams.ssbDuration);
239    DU_LOG("\nDU_APP configurecell bSChannelBwUL value:%d", \
240              cellParams.bSChannelBwUL);
241    DU_LOG("\nDU_APP configurecell bSChannelBwDL value:%d", \
242              cellParams.bSChannelBwDL);
243    DU_LOG("\nDU_APP configurecell bSChannelBwSUL value:%d", \
244              cellParams.bSChannelBwSUL);
245    for (int i=0 ; i<MAX_SUPPORTED_PLMN; i++)
246    {
247
248        DU_LOG("\nINFO   -->  DU_APP : DU APP  mcellParams.plmnList[%d].mcc = %d%d%d", i,\
249                  cellParams.plmnList[i].mcc[0], \
250                  cellParams.plmnList[i].mcc[1], \
251                  cellParams.plmnList[i].mcc[2]);
252          DU_LOG("\nINFO   -->  DU_APP : DU APP  cellParams.plmnList[%d].mnc = %d%d%d", i,\
253                    cellParams.plmnList[i].mnc[0], \
254                    cellParams.plmnList[i].mnc[1], \
255                    cellParams.plmnList[i].mnc[2]);
256
257          DU_LOG("\nINFO   -->  DU_APP : DU APP  cellParams.plmnList[%d].sd = %d%d%d", i,\
258                    cellParams.plmnList[i].sd[0], \
259                    cellParams.plmnList[i].sd[1], \
260                    cellParams.plmnList[i].sd[2]);
261
262          DU_LOG("\nINFO   -->  DU_APP : DU APP  cellParams.plmnList[%d].sst = %d\n", i,\
263                    cellParams.plmnList[i].sst);
264
265    }
266
267    duReadCfg();
268    return ROK;
269 }
270 /*******************************************************************
271  *
272  * @brief Bring the cell Down
273  *
274  * @details
275  *
276  *    Function : bringCellDown
277  *
278  *    Functionality:
279  *       - Bring the cell Down when requested from OAM
280  *
281  * @params[in] Cell Id
282  * @return true     - success
283  *         false    - failure
284  *
285  * ****************************************************************/
286
287 bool bringCellDown(uint16_t cellId)
288 {
289    BuildAndSendDUConfigUpdate(SERV_CELL_TO_DELETE);
290    return true;
291 }
292 #endif
293
294 /*******************************************************************
295  *
296  * @brief Initializes EGTP
297  *
298  * @details
299  *
300  *    Function : egtpInit
301  *
302  *    Functionality:
303  *       - Registers and attaches TAPA tasks belonging to 
304  *         DU_APP sys task
305  *
306  * @params[in] system task ID
307  * @return ROK     - success
308  *         RFAILED - failure
309  *
310  * ****************************************************************/
311 uint8_t egtpInit(SSTskId sysTskId)
312 {
313    /* Register DU APP TAPA Task for DU */
314    if(ODU_REG_TTSK((Ent)ENTEGTP, (Inst)EGTP_INST, (Ttype)TTNORM, (Prior)PRIOR0,
315              egtpActvInit, (ActvTsk)egtpActvTsk) != ROK)
316    {
317       return RFAILED;
318    }
319    /* Attach DU APP TAPA Task for DU */
320    if (ODU_ATTACH_TTSK((Ent)ENTEGTP, (Inst)0, sysTskId)!= ROK)
321    {
322       return RFAILED;
323    }
324  
325     DU_LOG("\nINFO   -->  DU_APP : EGTP created and registered \
326     to %d sys task", sysTskId);
327     return ROK;
328 }
329  
330
331 /*******************************************************************
332  *
333  * @brief Initializes SCTP task
334  *
335  * @details
336  *
337  *    Function : sctpInit
338  *
339  *    Functionality:
340  *       - Registers and attaches TAPA tasks for SCTP receiver 
341  *
342  * @params[in] system task ID
343  * @return ROK     - success
344  *         RFAILED - failure
345  *
346  * ****************************************************************/
347 uint8_t sctpInit(SSTskId sysTskId)
348 {
349    /* Register SCTP TAPA Task */
350    if(ODU_REG_TTSK((Ent)ENTSCTP, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0,
351             sctpActvInit, (ActvTsk)sctpActvTsk) != ROK)
352    {
353       return RFAILED;
354    }
355    /* Attach SCTP TAPA Task */
356    if (ODU_ATTACH_TTSK((Ent)ENTSCTP, (Inst)SCTP_INST, sysTskId)!= ROK)
357    {
358       return RFAILED;
359    }
360
361    DU_LOG("\nINFO   -->  DU_APP : SCTP TAPA task created and registered to %d sys task", 
362          sysTskId);
363    return ROK;
364 }
365 /*******************************************************************
366  *
367  * @brief Initializes RLC DL, MAC TAPA task
368  *
369  * @details
370  *
371  *    Function : rlcDlInit
372  *
373  *    Functionality:
374  *       - Registers and attaches TAPA tasks for MAC and RLC DL
375  *
376  * @params[in] system task ID
377  * @return ROK     - success
378  *         RFAILED - failure
379  *
380  * ****************************************************************/
381 uint8_t rlcDlInit(SSTskId sysTskId)
382 {
383    /* Register RLC DL TAPA Task */
384    if(ODU_REG_TTSK((Ent)ENTRLC, (Inst)1, (Ttype)TTNORM, (Prior)PRIOR0,
385             rlcDlActvInit, (ActvTsk)rlcDlActvTsk) != ROK)
386    {
387       return RFAILED;
388    }
389    /* Attach RLC DL Task */
390    if (ODU_ATTACH_TTSK((Ent)ENTRLC, (Inst)1, sysTskId)!= ROK)
391    {
392       return RFAILED;
393    }
394
395    /* Register MAC TAPA Task */
396    if(ODU_REG_TTSK((Ent)ENTMAC, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0,
397             rgActvInit, (ActvTsk)rgActvTsk) != ROK)
398    {
399       return RFAILED;
400    }
401    /* Attach MAC Task */
402    if (ODU_ATTACH_TTSK((Ent)ENTMAC, (Inst)0, sysTskId)!= ROK)
403    {
404       return RFAILED;
405    }
406
407    DU_LOG("\nINFO   -->  DU_APP : RLC DL and MAC TAPA task created and registered to \
408    %d sys task", sysTskId);
409    return ROK;
410 }
411
412 /*******************************************************************
413  *
414  * @brief Initializes RLC UL TAPA task
415  *
416  * @details
417  *
418  *    Function : rlcUlInit
419  *
420  *    Functionality:
421  *       - Registers and attaches TAPA task for RLC UL
422  *
423  * @params[in] system task ID
424  * @return ROK     - success
425  *         RFAILED - failure
426  *
427  * ****************************************************************/
428 uint8_t rlcUlInit(SSTskId sysTskId)
429 {
430    /* Register RLC UL TAPA Task */
431    if(ODU_REG_TTSK((Ent)ENTRLC, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0,
432             rlcUlActvInit, (ActvTsk)rlcUlActvTsk) != ROK)
433    {
434       return RFAILED;
435    }
436    /* Attach RLC DL Task */
437    if (ODU_ATTACH_TTSK((Ent)ENTRLC, (Inst)0, sysTskId)!= ROK)
438    {
439       return RFAILED;
440    }
441    DU_LOG("\nINFO   -->  DU_APP : RLC UL TAPA task created and registered to \
442    %d sys task", sysTskId);
443    return ROK;
444 }
445
446 /*******************************************************************
447  *
448  * @brief Initializes Lower MAC receiver task
449  *
450  * @details
451  *
452  *    Function : lwrMacInit
453  *
454  *    Functionality:
455  *       - Registers and attaches TAPA tasks for Lower MAC receiver
456  *
457  * @params[in] system task ID
458  * @return ROK     - success
459  *         RFAILED - failure
460  *
461  * ****************************************************************/
462 uint8_t lwrMacInit(SSTskId sysTskId)
463 {
464    /* Register SCTP TAPA Task */
465    if(ODU_REG_TTSK((Ent)ENTLWRMAC, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0,
466             lwrMacActvInit, (ActvTsk)lwrMacActvTsk) != ROK)
467    {
468       return RFAILED;
469    }
470    /* Attach SCTP TAPA Task */
471    if (ODU_ATTACH_TTSK((Ent)ENTLWRMAC, (Inst)0, sysTskId)!= ROK)
472    {
473       return RFAILED;
474    }
475
476    DU_LOG("\nINFO   -->  DU_APP : LWR MAC TAPA task created and registered to %d sys task",
477          sysTskId);
478    return ROK;
479 }
480
481 #ifndef INTEL_WLS_MEM
482 /*******************************************************************
483  *
484  * @brief Initializes Phy stub slot indication generator task
485  *
486  * @details
487  *
488  *    Function : phyStubInit
489  *
490  *    Functionality:
491  *       - Registers and attaches TAPA tasks for Phy stub's slot
492  *       indication generator
493  *
494  * @params[in] system task ID
495  * @return ROK     - success
496  *         RFAILED - failure
497  *
498  * ****************************************************************/
499 uint8_t phyStubInit(SSTskId sysTskId)
500 {
501    /* Register PHY stub slot indication TAPA Task */
502    if(ODU_REG_TTSK((Ent)ENTPHYSTUB, (Inst)0, (Ttype)TTNORM, (Prior)PRIOR0,
503             phyStubActvInit, (ActvTsk)phyStubActvTsk) != ROK)
504    {
505       return RFAILED;
506    }
507    /* Attach Phy stub slot indication TAPA Task */
508    if (ODU_ATTACH_TTSK((Ent)ENTPHYSTUB, (Inst)0, sysTskId)!= ROK)
509    {
510       return RFAILED;
511    }
512
513    DU_LOG("\nINFO   -->  DU_APP : PHY stub slot indication TAPA task created and registered to %d sys task",
514          sysTskId);
515    return ROK;
516 }
517 #endif
518
519 /*******************************************************************
520  *
521  * @brief Initializes system and TAPA tasks
522  *
523  * @details
524  *
525  *    Function : commonInit
526  *
527  *    Functionality:
528  *       - Registers and attaches system and TAPA tasks
529  *
530  * @params[in] void
531  * @return ROK     - success
532  *         RFAILED - failure
533  *
534  * ****************************************************************/
535 uint8_t commonInit()
536 {
537    /* Declare system task Ids */
538    SSTskId du_app_stsk, egtp_stsk, sctp_stsk, rlc_ul_stsk, rlc_mac_cl_stsk, lwr_mac_stsk, phy_stub_slot_ind_stsk;
539
540    pthread_attr_t attr;
541
542    ODU_SET_PROC_ID(DU_PROC);
543
544    /* Intel L1 using core 0-15. ODU-High using 16-21 */
545    /* system task for DU APP */
546    if(ODU_CREATE_TASK(PRIOR0, &du_app_stsk) != ROK)
547    {
548       DU_LOG("\nERROR  -->  DU_APP : System Task creation for DU APP failed");
549       return RFAILED;
550    }
551    //ODU_SET_THREAD_AFFINITY(&du_app_stsk, SS_AFFINITY_MODE_EXCL, 16, 0);
552
553    /* system task for EGTP */
554    if(ODU_CREATE_TASK(PRIOR0, &egtp_stsk) != ROK)
555    {
556       DU_LOG("\nERROR  -->  DU_APP : System Task creation for EGTP failed");
557       return RFAILED;
558    }
559    //ODU_SET_THREAD_AFFINITY(&egtp_stsk, SS_AFFINITY_MODE_EXCL, 27, 0);
560
561    /* system task for RLC_DL and MAC */
562    if(ODU_CREATE_TASK(PRIOR0, &rlc_mac_cl_stsk) != ROK)
563    {
564       DU_LOG("\nERROR  -->  DU_APP : System Task creation for RLC DL/MAC failed");
565       return RFAILED;
566    }
567    pthread_attr_init(&attr);
568    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
569    //ODU_SET_THREAD_AFFINITY(&rlc_mac_cl_stsk, SS_AFFINITY_MODE_EXCL, 18, 0);
570
571    /* system task for RLC UL */
572    if(ODU_CREATE_TASK(PRIOR1, &rlc_ul_stsk) != ROK)
573    {
574       DU_LOG("\nERROR  -->  DU_APP : System Task creation for RLC UL failed");
575       return RFAILED;
576    }
577    //ODU_SET_THREAD_AFFINITY(&rlc_ul_stsk, SS_AFFINITY_MODE_EXCL, 22, 0);
578
579    /* system task for SCTP receiver thread */
580    if(ODU_CREATE_TASK(PRIOR0, &sctp_stsk) != ROK)
581    {
582       DU_LOG("\nERROR  -->  DU_APP : System Task creation for SCTP failed");
583       return RFAILED;
584    }
585    //ODU_SET_THREAD_AFFINITY(&sctp_stsk, SS_AFFINITY_MODE_EXCL, 25, 0);
586
587    /* system task for lower-mac receiver thread */
588    if(ODU_CREATE_TASK(PRIOR0, &lwr_mac_stsk) != ROK)
589    {
590       DU_LOG("\nERROR  -->  DU_APP : System Task creation for Lower MAC failed");
591       return RFAILED;
592    }
593    //ODU_SET_THREAD_AFFINITY(&lwr_mac_stsk, SS_AFFINITY_MODE_EXCL, 21, 0);
594
595 #ifndef INTEL_WLS_MEM
596    /* system task for phy stub's slot indication generator thread */
597    if(ODU_CREATE_TASK(PRIOR0, &phy_stub_slot_ind_stsk) != ROK)
598    {
599       DU_LOG("\nERROR  -->  DU_APP : System Task creation for Phy stub slot indication generator failed. MAX STSK [%d]", SS_MAX_STSKS);
600       return RFAILED;
601    }
602
603 #endif
604
605    /* Create TAPA tasks */
606    if(duAppInit(du_app_stsk) != ROK)
607    {
608       DU_LOG("\nERROR  -->  DU_APP : DU APP TAPA Task initialization failed");
609       return RFAILED;
610    }
611
612    if(egtpInit(egtp_stsk) != ROK)
613    {
614       DU_LOG("\nERROR  -->  DU_APP : EGTP TAPA Task initialization failed");
615       return RFAILED;
616    }
617
618    if(sctpInit(sctp_stsk) != ROK)
619    {
620       DU_LOG("\nERROR  -->  DU_APP : SCTP TAPA Task initialization failed");
621       return RFAILED;
622    }
623
624    if(rlcDlInit(rlc_mac_cl_stsk) != ROK)
625    {
626       DU_LOG("\nERROR  -->  DU_APP : RLC DL Tapa Task initialization failed");
627       return RFAILED;
628    } 
629
630    if(rlcUlInit(rlc_ul_stsk) != ROK)
631    {
632      DU_LOG("\nERROR  -->  DU_APP : RLC UL Tapa Task initialization failed");
633      return RFAILED;
634    } 
635
636    if(lwrMacInit(lwr_mac_stsk) != ROK)
637    {
638       DU_LOG("\nERROR  -->  DU_APP : Lower MAC Tapa Task initialization failed");
639       return RFAILED;
640    }
641
642 #ifndef INTEL_WLS_MEM
643    if(phyStubInit(phy_stub_slot_ind_stsk) != ROK)
644    {
645       DU_LOG("\nERROR  -->  DU_APP : PHY stub slot indication Tapa Task initialization failed");
646       return RFAILED;
647    }
648 #endif
649
650
651    return ROK;
652 }
653
654 /*******************************************************************
655  *
656  * @brief Initializes the DU
657  *
658  * @details
659  *
660  *    Function : duInit
661  *
662  *    Functionality:
663  *       - Calls commonInit
664  *       - Registers DU Layers
665  *
666  * @params[in] void
667  * @return ROK     - success
668  *         RFAILED - failure
669  *
670  * ****************************************************************/
671 uint8_t duInit()
672 {
673    int ret = ROK;
674    if(commonInit() != ROK)
675    {
676       ret = RFAILED;
677    } 
678    return ret;
679 }
680
681 void init_log()
682 {
683         openlog("ODU",LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
684 }
685
686 /*******************************************************************
687  *
688  * @brief Entry point for the DU APP 
689  *
690  * @details
691  *
692  *    Function : main
693  *
694  *    Functionality:
695  *      - Read config params into duCfgParams
696  *      - Initiate the init functions
697  *
698  * @params[in] void
699  * @return ROK     - success
700  *         RFAILED - failure
701  *
702  * ****************************************************************/
703 uint8_t tst(void)
704 {
705    init_log();
706 #ifdef O1_ENABLE
707    if(start_O1_module() != ROK)
708       return RFAILED;
709 #endif
710    //Initialize TAPA layers
711    if(duInit() != ROK)
712    {
713       return RFAILED;
714    } 
715
716    //Read all the configs from du_utils.c into duCfgParams
717 #ifndef O1_ENABLE
718    duReadCfg();
719 #endif
720
721 #ifdef O1_ENABLE
722    //Send VES PNF registration message to SMO
723    sendPnfRegistration();
724 #endif
725
726    return ROK;
727
728 }/* end of main()*/
729
730 /**********************************************************************
731          End of file
732 **********************************************************************/