TR181-XPON  1.4.0
TR-181 PON manager.
xpon_mngr_main.c File Reference
#include "dm_info.h"
#include "dm_xpon_mngr.h"
#include "module_mgmt.h"
#include "persistency.h"
#include "pon_ctrl.h"
#include "populate_dm_startup.h"
#include "restore_to_hal.h"
#include "upgrade_persistency.h"
#include "xpon_trace.h"

Go to the source code of this file.

Data Structures

struct  _xpon_mngr
 

Typedefs

typedef struct _xpon_mngr xpon_mngr_t
 

Functions

int _xpon_mngr_main (int reason, amxd_dm_t *dm, amxo_parser_t *parser)
 
amxd_dm_t *PRIVATE xpon_mngr_get_dm (void)
 
amxo_parser_t *PRIVATE xpon_mngr_get_parser (void)
 
static void do_cleanup (void)
 

Variables

static xpon_mngr_t s_app
 

Typedef Documentation

◆ xpon_mngr_t

typedef struct _xpon_mngr xpon_mngr_t

Function Documentation

◆ _xpon_mngr_main()

int _xpon_mngr_main ( int  reason,
amxd_dm_t *  dm,
amxo_parser_t *  parser 
)

The function mod_module_mgmt_init() should have set XPON.ModuleError to true. Keep running to show this to the user.

Definition at line 101 of file xpon_mngr_main.c.

103  {
104 
105  SAH_TRACEZ_INFO(ME, "reason=%d", reason);
106 
107  bool success = false;
108  int rc = 1; /* error */
109  bool module_error = false;
110 
111  switch(reason) {
112  case 0: // START
113  s_app.dm = dm;
114  s_app.parser = parser;
115 
116  if(!dm_info_init()) {
117  return -1;
118  }
121  rth_init();
122  if(!mod_module_mgmt_init(&module_error)) {
123  if(module_error) {
129  rc = 0;
130  }
131  break;
132  }
133  pon_ctrl_init();
134  if(!pplt_dm_init()) {
135  break;
136  }
137  success = true;
138  rc = 0;
139  break;
140  case 1: // STOP
141  do_cleanup();
142  s_app.dm = NULL;
143  s_app.parser = NULL;
144  success = true;
145  rc = 0;
146  break;
147  }
148  if(!success) {
149  do_cleanup();
150  }
151 
152  return rc;
153 }
bool dm_info_init(void)
Definition: dm_info.c:297
bool mod_module_mgmt_init(bool *module_error)
Definition: module_mgmt.c:299
void persistency_init(void)
Definition: persistency.c:161
void pon_ctrl_init(void)
Definition: pon_ctrl.c:142
bool pplt_dm_init(void)
void rth_init(void)
amxd_dm_t * dm
amxo_parser_t * parser
on event dm
void upgr_persistency_init(void)
static xpon_mngr_t s_app
static void do_cleanup(void)
#define ME
Definition: xpon_trace.h:78
Here is the call graph for this function:

◆ do_cleanup()

static void do_cleanup ( void  )
static

Definition at line 93 of file xpon_mngr_main.c.

93  {
95  rth_cleanup();
99 }
void mod_module_mgmt_cleanup(void)
Definition: module_mgmt.c:340
void persistency_cleanup(void)
Definition: persistency.c:198
void pplt_dm_cleanup(void)
void rth_cleanup(void)
void upgr_persistency_cleanup(void)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xpon_mngr_get_dm()

amxd_dm_t* PRIVATE xpon_mngr_get_dm ( void  )

Definition at line 85 of file xpon_mngr_main.c.

85  {
86  return s_app.dm;
87 }
Here is the caller graph for this function:

◆ xpon_mngr_get_parser()

amxo_parser_t* PRIVATE xpon_mngr_get_parser ( void  )

Definition at line 89 of file xpon_mngr_main.c.

89  {
90  return s_app.parser;
91 }
Here is the caller graph for this function:

Variable Documentation

◆ s_app

xpon_mngr_t s_app
static

Definition at line 79 of file xpon_mngr_main.c.