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