blob: 8c621dabcd825090ac3bec7ef3fa8dd9d0f5db2f [file] [log] [blame]
/*
<:copyright-BRCM:2016:DUAL/GPL:standard
Broadcom Proprietary and Confidential.(c) 2016 Broadcom
All Rights Reserved
Unless you and Broadcom execute a separate written software license
agreement governing use of this software, this software is licensed
to you under the terms of the GNU General Public License version 2
(the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
with the following added to such license:
As a special exception, the copyright holders of this software give
you permission to link this software with independent modules, and
to copy and distribute the resulting executable under terms of your
choice, provided that you also meet, for each linked independent
module, the terms and conditions of the license of that module.
An independent module is a module which is not derived from this
software. The special exception does not apply to any modifications
of the software.
Not withstanding the above, under no circumstances may you combine
this software in any way with any other Broadcom software provided
under a license other than the GPL, without Broadcom's express prior
written consent.
:>
*/
#include <bcmolt_msg.h>
#include <bcmolt_api.h>
#include <bcmcli.h>
#include <bcm_api_cli.h>
#include <bcm_api_dev_log.h>
#include <bcm_dev_log.h>
#include <bcmolt_msg_pack.h>
#include "bcmolt_user_appl_cli.h"
#include "bcmolt_user_appl_gpon_utils.h"
#include "bcmolt_user_appl_ps.h"
#include "bcmolt_user_appl_ps_cli.h"
#ifndef RELEASE_BUILD
#include "bcmolt_user_appl_omci_swdl_cli.h"
#include "bcmolt_user_appl_omci_swdl.h"
#include "bcmolt_user_appl_gpon_mac_learning_cli.h"
#include "bcmolt_user_appl_gpon_mac_learning.h"
#include "bcmolt_user_appl_gpon_stress_cli.h"
#include "bcmolt_user_appl_gpon_stress.h"
#include "bcmolt_user_appl_gpon_sn_acquisition_cli.h"
#include "bcmolt_user_appl_gpon_sn_acquisition.h"
#include "bcmolt_user_appl_gpon_ds_omci_cli.h"
#include "bcmolt_user_appl_gpon_ds_omci.h"
#include "bcmolt_user_appl_gpon_statistics_cli.h"
#include "bcmolt_user_appl_gpon_statistics.h"
#include "bcmolt_user_appl_gpon_rssi_cli.h"
#include "bcmolt_user_appl_gpon_rssi.h"
#include "bcmolt_user_appl_remote_logger_cli.h"
#include "bcmolt_user_appl_remote_logger.h"
#include "bcmolt_user_appl_onu_tuning_cli.h"
#include "bcmolt_user_appl_onu_tuning.h"
#endif /* Not RELEASE_BUILD */
#include "bcmolt_eon.h"
#include "bcmolt_epon_hde.h"
#ifndef SIMULATION_BUILD
#include "omon.h"
#include <bcmolt_dev_ctrl_ioctl.h>
#include <bcmtr_pcie.h>
#endif /* #endif SIMULATION_BUILD */
#include "bcmolt_board.h"
#include "bcmolt_api_proxy.h"
#include "bcmolt_remote_cli.h"
#include "bcmolt_user_appl_epon_oam_cli.h"
#include "bcmolt_user_appl_epon_oam.h"
#include "bcmolt_image_transfer_cli.h"
#include "bcmolt_sw_upgrade_cli.h"
#include "bcmolt_user_appl_playback.h"
#include "bcmolt_user_appl_dpoe_sec.h"
#ifdef ENABLE_LOG
static uint32_t *bcmlcli_pci_dumpptr;
static dev_log_id user_appl_log_id;
static dev_log_id ind_log_id[BCMTR_MAX_INSTANCES];
static bcmcli_entry *user_dir;
static bcmos_bool sys_mode_set[BCMTR_MAX_OLTS] = {};
static void user_appl_api_msg_dump(const char *title, bcmolt_msg *msg)
{
uint8_t inst = bcmolt_msg_instance(msg);
inst = (inst > BCMTR_MAX_INSTANCES) ? 0 : inst;
bcmolt_msg_log(ind_log_id[inst], msg);
}
#ifndef RELEASE_BUILD
static bcmos_errno bcmolt_user_appl_process_exception_ind(bcmolt_devid device_id, bcmolt_auto *ind)
{
switch (ind->hdr.obj_type)
{
case BCMOLT_OBJ_ID_DEVICE:
switch (ind->hdr.subgroup)
{
case BCMOLT_DEVICE_AUTO_CFG_ID_SW_EXCEPTION:
case BCMOLT_DEVICE_AUTO_CFG_ID_SW_ERROR:
/* Stop all user application tasks. */
if (bcmolt_gpon_mac_learning_appl_is_running(device_id))
bcmolt_gpon_mac_learning_appl_stop(device_id);
if (bcmolt_gpon_stress_appl_is_running(device_id))
bcmolt_gpon_stress_appl_stop(device_id);
if (bcmolt_gpon_sn_acquisition_appl_is_running(device_id))
bcmolt_gpon_sn_acquisition_appl_stop(device_id);
if (bcmolt_user_appl_gpon_statistics_is_running(device_id))
bcmolt_user_appl_gpon_statistics_stop(device_id);
if (bcmolt_gpon_ds_omci_appl_is_running(device_id))
bcmolt_gpon_ds_omci_appl_stop(device_id);
if (bcmolt_gpon_rssi_appl_is_running(device_id))
bcmolt_gpon_rssi_appl_stop(device_id);
default:
break;
}
break;
default:
break;
}
return BCM_ERR_OK;
}
#endif
void bcmolt_user_appl_indication_cb(bcmolt_devid device_id, bcmolt_msg *msg)
{
uint8_t instance = bcmolt_msg_instance(msg);
bcmolt_auto *ind = (bcmolt_auto *)msg;
bcmolt_ps_pon ps_pon = { device_id, instance };
user_appl_api_msg_dump("Indication", msg);
bcmolt_ps_process_ind(&ps_pon, ind);
#ifndef RELEASE_BUILD
bcmolt_user_appl_process_exception_ind(device_id, ind);
/* Forward the indication to each user application. These applications will ignore indications that aren't
* relevant and errors will be printed to dedicated log IDs per application. */
bcmolt_gpon_mac_learning_process_ind(device_id, ind);
bcmolt_gpon_stress_process_ind(device_id, ind);
bcmolt_gpon_sn_acquisition_process_ind(device_id, ind);
bcmolt_user_appl_gpon_statistics_process_ind(device_id, ind);
bcmolt_gpon_ds_omci_process_ind(device_id, ind);
bcmolt_gpon_rssi_process_ind(device_id, ind);
bcmolt_onu_tuning_process_ind(device_id, ind);
#endif /* Not RELEASE_BUILD */
#ifndef SIMULATION_BUILD
bcmolt_user_appl_omon_handle_ind(device_id, instance, ind);
#endif
bcmolt_api_proxy_auto_rx_cb(device_id, msg);
bcmolt_remote_cli_auto_rx_cb(device_id, msg);
/* Free the indication since we're done processing it */
bcmolt_msg_free(msg);
}
void bcmolt_user_appl_proxy_rx_cb(bcmolt_devid device_id, bcmolt_msg *msg)
{
bcmolt_proxy_rx *proxy_rx = (bcmolt_proxy_rx *)msg;
#ifndef RELEASE_BUILD
bcmolt_omci_swdl_process_proxy_rx(device_id, proxy_rx);
/* Dump RX packet if OMCI SWDL is Not running*/
if (!bcmolt_omci_swdl_appl_is_running(device_id))
{
user_appl_api_msg_dump("Proxy Rx", msg);
}
#else
user_appl_api_msg_dump("Proxy Rx", msg);
#endif /* Not RELEASE_BUILD */
bcmolt_api_proxy_auto_rx_cb(device_id, msg);
bcmolt_remote_cli_auto_rx_cb(device_id, msg);
bcmolt_user_appl_eon_process_rx(device_id, proxy_rx);
bcmolt_epon_hde_process_rx(device_id, bcmolt_msg_instance(msg), proxy_rx);
bcmolt_user_appl_epon_oam_handle_rx(device_id, proxy_rx, NULL);
bcmolt_user_appl_dpoe_sec_process_proxy_rx(device_id, proxy_rx);
bcmolt_msg_free(msg);
}
/* example on how to read the embedded logger from the host */
static bcmos_errno _apicli_read_embedded_logger(bcmcli_session *session, const bcmcli_cmd_parm parm[], uint16_t nparms)
{
bcmolt_logger_cfg cfg;
bcmolt_logger_key key = {.file_id = parm[0].value.unumber, .reserved = 0};
int rc;
bcm_dev_log_log(
user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"%s", "--------------------------------------------------------------------------------------------------\n");
bcm_dev_log_log(
user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"| device %u logger |\n", current_device);
bcm_dev_log_log(user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"%s", "|-------------------------------------------------------------------------------------------------|\n");
while (1)
{
BCMOLT_CFG_INIT(&cfg, logger, key);
BCMOLT_CFG_PROP_GET(&cfg, logger, buffer);
rc = bcmolt_cfg_get(current_device, &cfg.hdr);
if (rc > 0)
{
bcmos_printf("get obj error %d\n", rc);
}
bcmos_printf("%s", cfg.data.buffer.buff);
if (cfg.data.buffer.msg_to_read == 0)
{
break;
}
}
return BCM_ERR_OK;
}
/* example on how to read all the embedded log entries from the host */
static bcmos_errno _apicli_get_all_log_entries(bcmcli_session *session, const bcmcli_cmd_parm parm[], uint16_t nparms)
{
bcmolt_log_entry_cfg cfg;
bcmolt_log_entry_key key = {.log_id = 0, .reserved=0};
int rc;
char *_log_level[] =
{
"NO_LOG",
"FATAL",
"ERROR",
"WARNING",
"INFO" ,
"DEBUG"
};
char *_log_type[] =
{
"NONE",
"PRINT",
"SAVE",
"BOTH"
};
char *_log_style[] =
{
"NORMAL",
"BOLD",
"UNDERLINE",
"BLIK",
"REVERSE_VIDEO"
};
bcm_dev_log_log(
user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"%s", "--------------------------------------------------------------------------------------------------\n");
bcm_dev_log_log(
user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"%s", "| LOG ID | LOG NAME | LOG level print | LOG level save | log type | log style |\n");
bcm_dev_log_log(user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"%s", "|-------------------------------------------------------------------------------------------------|\n");
while (1)
{
BCMOLT_CFG_INIT(&cfg, log_entry, key);
BCMOLT_CFG_PROP_GET(&cfg, log_entry, all_properties);
rc = bcmolt_cfg_get(current_device, &cfg.hdr);
if (rc)
{
break;
}
bcm_dev_log_log(user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER | BCM_LOG_FLAG_CALLER_FMT,
"|%-8d|%-23s|%-17s|%-17s|%-10s|%-17s|\n",
key.log_id,
cfg.data.log_name.str,
_log_level[cfg.data.log_level_print],
_log_level[cfg.data.log_level_save],
_log_type[cfg.data.log_type],
_log_style[cfg.data.log_style]);
bcm_dev_log_log(user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"%s", "|-------------------------------------------------------------------------------------------------|\n");
key.log_id++;
}
bcm_dev_log_log(user_appl_log_id, DEV_LOG_LEVEL_DEBUG, BCM_LOG_FLAG_NO_HEADER,
"%s", "|-------------------------------------------------------------------------------------------------|\n");
return BCM_ERR_OK;
}
static bcmos_errno _apicli_indication_handler(bcmcli_session *session, const bcmcli_cmd_parm parm[], uint16_t nparms)
{
struct bcmolt_rx_cfg rx_cfg =
{
.obj_type = BCMOLT_OBJECT_ANY,
.rx_cb = bcmolt_user_appl_indication_cb,
.flags = BCMOLT_AUTO_FLAGS_NONE,
.pon_ni_mask = parm[0].value.unumber
};
return bcmolt_auto_rx_cb_set(current_device, &rx_cfg);
}
static bcmos_errno _apicli_proxy_rx_handler(bcmcli_session *session, const bcmcli_cmd_parm parm[], uint16_t nparms)
{
struct bcmolt_rx_cfg rx_cfg =
{
.obj_type = BCMOLT_OBJECT_ANY,
.rx_cb = bcmolt_user_appl_proxy_rx_cb,
.flags = BCMOLT_AUTO_FLAGS_NONE,
.pon_ni_mask = parm[0].value.unumber
};
return bcmolt_proxy_rx_cb_set(current_device, &rx_cfg);
}
#endif
#ifndef SIMULATION_BUILD
static bcmos_errno _apicli_pcistat(bcmcli_session *session, const bcmcli_cmd_parm parm[], uint16_t n_parms)
{
bcmos_errno rc;
uint8_t start;
bcm_pcied_stat *stat;
start = 0;
if (n_parms > 0)
{
if (!strncmp(parm[0].value.string, "yes", strlen("yes")))
start = 1;
}
rc = bcm_board_pci_debug(0, MAPLE_DEV_CTRL_IOCTL_OP_PCI_STAT, start, 0, bcmlcli_pci_dumpptr);
stat = (bcm_pcied_stat *)bcmlcli_pci_dumpptr;
BCMOS_TRACE_CHECK_RETURN(rc, rc, "bcm_board_pci_debug() failed\n");
bcmcli_session_print(session, "Received : %d\n", stat->rx_counter);
bcmcli_session_print(session, "Send : %d\n", stat->tx_counter);
bcmcli_session_print(session, "Rx Done Isr : %d\n", stat->rx_done_isr_counter);
bcmcli_session_print(session, "Rx Err Isr : %d\n", stat->rx_err_isr_counter);
bcmcli_session_print(session, "Tx Done Isr : %d\n", stat->tx_done_isr_counter);
bcmcli_session_print(session, "Tx Err Isr : %d\n", stat->tx_err_isr_counter);
bcmcli_session_print(session, "Rx empty : %d\n", stat->rx_pcie_empty_counter);
bcmcli_session_print(session, "Tx full : %d\n\n", stat->tx_pcie_full_counter);
return BCM_ERR_OK;
}
static bcmos_errno _apicli_pcidump(bcmcli_session *session, const bcmcli_cmd_parm parm[], uint16_t n_parms)
{
bcmos_errno rc;
uint32_t command;
int32_t start, howmany;
start = -1;
howmany = 1;
if (n_parms > 1)
{
start = parm[1].value.number;
howmany = 1;
if (n_parms > 2)
howmany = parm[2].value.number;
}
if (!strncmp(parm[0].value.string, "tx", strlen("tx")))
{
command = MAPLE_DEV_CTRL_IOCTL_OP_PCI_DUMP_TX;
}
else if (!strncmp(parm[0].value.string, "rx", strlen("rx")))
{
command = MAPLE_DEV_CTRL_IOCTL_OP_PCI_DUMP_RX;
}
else
{
bcmcli_session_print(session, "Error - wrong command: %s\n", parm[0].value.string);
return BCM_ERR_PARM;
}
rc = bcm_board_pci_debug(0, command, start, howmany, bcmlcli_pci_dumpptr);
BCMOS_TRACE_CHECK_RETURN(rc, rc, "bcm_board_pci_debug() failed\n");
bcmcli_session_print(session, "%s", (char *)bcmlcli_pci_dumpptr);
return BCM_ERR_OK;
}
#endif
static void bcmolt_user_appl_cli_start_epon(void)
{
bcmolt_user_appl_epon_oam_init();
bcmolt_user_appl_epon_oam_cli_init(user_dir);
bcmolt_user_appl_eon_init();
bcmolt_user_appl_eon_cli_init(user_dir);
#ifndef SIMULATION_BUILD
bcmolt_epon_omon_appl_init();
bcmolt_user_appl_epon_omon_cli_init(user_dir);
bcmolt_epon_hde_appl_init();
bcmolt_epon_hde_appl_cli_init(user_dir);
#endif
bcmolt_user_appl_dpoe_sec_init();
bcmolt_user_appl_dpoe_sec_cli_init(user_dir);
}
static void bcmolt_user_appl_cli_start_gpon(bcmolt_devid dev)
{
bcmolt_user_appl_gpon_utils_init(user_dir);
#ifndef RELEASE_BUILD
bcmolt_gpon_mac_learning_appl_init(dev);
bcmolt_user_appl_gpon_mac_learning_cli_init(user_dir);
bcmolt_gpon_stress_appl_init(dev);
bcmolt_user_appl_gpon_stress_cli_init(user_dir);
bcmolt_gpon_sn_acquisition_appl_init(dev);
bcmolt_user_appl_gpon_sn_acquisition_cli_init(user_dir);
bcmolt_user_appl_gpon_statistics_init(dev);
bcmolt_user_appl_gpon_statistics_cli_init(user_dir);
bcmolt_gpon_ds_omci_appl_init(dev);
bcmolt_user_appl_gpon_ds_omci_cli_init(user_dir);
bcmolt_omci_swdl_appl_init(dev);
bcmolt_user_appl_omci_swdl_cli_init(user_dir);
bcmolt_gpon_rssi_appl_init(dev);
bcmolt_user_appl_gpon_rssi_cli_init(user_dir);
#endif /* Not RELEASE_BUILD */
}
static void bcmolt_user_appl_cli_start_xgpon(bcmolt_devid dev)
{
bcmolt_user_appl_gpon_utils_init(user_dir);
#ifndef RELEASE_BUILD
bcmolt_gpon_stress_appl_init(dev);
bcmolt_user_appl_gpon_stress_cli_init(user_dir);
bcmolt_gpon_sn_acquisition_appl_init(dev);
bcmolt_user_appl_gpon_sn_acquisition_cli_init(user_dir);
bcmolt_user_appl_gpon_statistics_init(dev);
bcmolt_user_appl_gpon_statistics_cli_init(user_dir);
bcmolt_gpon_ds_omci_appl_init(dev);
bcmolt_user_appl_gpon_ds_omci_cli_init(user_dir);
bcmolt_gpon_rssi_appl_init(dev);
bcmolt_user_appl_gpon_rssi_cli_init(user_dir);
bcmolt_onu_tuning_appl_init(dev);
bcmolt_user_appl_onu_tuning_cli_init(user_dir);
#endif /* Not RELEASE_BUILD */
}
void bcmolt_user_appl_cli_handle_system_mode_change(bcmolt_devid dev)
{
bcmolt_system_mode sys_mode;
if (sys_mode_set[dev] == BCMOS_TRUE)
{
return; /* only run once */
}
sys_mode_set[dev] = BCMOS_TRUE;
(void)bcmolt_system_mode_get(dev, &sys_mode);
switch (sys_mode)
{
case BCMOLT_SYSTEM_MODE_EPON__16_X:
case BCMOLT_SYSTEM_MODE_EPON__8_X:
case BCMOLT_SYSTEM_MODE_EPON__4_X:
case BCMOLT_SYSTEM_MODE_EPON__8_X_COEXISTENCE_TDMA:
case BCMOLT_SYSTEM_MODE_EPON__4_X_COEXISTENCE_TDMA:
case BCMOLT_SYSTEM_MODE_EPON__8_X_10_G:
case BCMOLT_SYSTEM_MODE_EPON__4_X_10_G:
case BCMOLT_SYSTEM_MODE_EPON__2_X_10_G:
bcmolt_user_appl_cli_start_epon();
break;
case BCMOLT_SYSTEM_MODE_GPON__16_X:
case BCMOLT_SYSTEM_MODE_GPON__8_X:
case BCMOLT_SYSTEM_MODE_GPON__4_X:
bcmolt_user_appl_cli_start_gpon(dev);
break;
case BCMOLT_SYSTEM_MODE_XGPON_1__8_X:
case BCMOLT_SYSTEM_MODE_XGPON_1__4_X:
case BCMOLT_SYSTEM_MODE_XGS__2_X_10_G:
case BCMOLT_SYSTEM_MODE_NGPON2__2_X_10_G:
bcmolt_user_appl_cli_start_xgpon(dev);
break;
case BCMOLT_SYSTEM_MODE__NUM_OF: /* unconfigured */
sys_mode_set[dev] = BCMOS_FALSE;
break;
default:
/* do nothing */
break;
}
}
bcmos_errno bcmolt_user_appl_cli_init(bcmcli_entry *top_dir)
{
bcmos_errno err;
bcmlcli_pci_dumpptr = bcmos_alloc(1024*5);
uint8_t inst;
if (!bcmlcli_pci_dumpptr)
{
BCMOS_CHECK_RETURN_ERROR(!bcmlcli_pci_dumpptr, BCM_ERR_NOMEM);
return BCM_ERR_NULL;
}
#ifdef ENABLE_LOG
static bcmcli_enum_val enum_table_file_id[] =
{
{ .name = "SRAM", .val = BCMOLT_LOG_FILE_ID_SRAM },
{ .name = "DDR", .val = BCMOLT_LOG_FILE_ID_DDR },
BCMCLI_ENUM_LAST
};
bcmolt_msg_log_init(); /* initialize API/logger integration */
user_appl_log_id = bcm_dev_log_id_register("user_appl", DEV_LOG_LEVEL_DEBUG, DEV_LOG_ID_TYPE_BOTH);
for (inst = 0; inst < BCMTR_MAX_INSTANCES; inst++)
{
char log_name[MAX_DEV_LOG_ID_NAME];
sprintf(log_name, "ind_msg%u", inst);
ind_log_id[inst] = bcm_dev_log_id_register(log_name, DEV_LOG_LEVEL_DEBUG, DEV_LOG_ID_TYPE_BOTH);
}
#endif
user_dir = bcmcli_dir_add(top_dir, "user", "User application", BCMCLI_ACCESS_ADMIN, NULL);
BCMOS_CHECK_RETURN_ERROR(!user_dir, BCM_ERR_NOMEM);
#ifdef ENABLE_LOG
BCMCLI_MAKE_CMD(user_dir, "register_indication_handler", "Register indication handler", _apicli_indication_handler,
BCMCLI_MAKE_PARM_DEFVAL("pon_ni_mask", "PON_NI interface bitmask. 0=all", BCMCLI_PARM_UNUMBER, 0, 0));
BCMCLI_MAKE_CMD(user_dir, "register_proxy_rx_handler", "Register Proxy Rx handler", _apicli_proxy_rx_handler,
BCMCLI_MAKE_PARM_DEFVAL("pon_ni_mask", "PON_NI interface bitmask. 0=all", BCMCLI_PARM_UNUMBER, 0, 0));
BCMCLI_MAKE_CMD(user_dir, "read_embedded_logger", "Read embedded logger", _apicli_read_embedded_logger,
BCMCLI_MAKE_PARM_ENUM("file_id", "file_id", enum_table_file_id, 0));
BCMCLI_MAKE_CMD_NOPARM(user_dir, "get_all_log_entries", "Get all embedded log entries", _apicli_get_all_log_entries);
#endif
#ifndef SIMULATION_BUILD
BCMCLI_MAKE_CMD(user_dir, "pcistat", "Print PCIe statistics", _apicli_pcistat,
BCMCLI_MAKE_PARM("clear", "clear", BCMCLI_PARM_STRING, BCMCLI_PARM_FLAG_OPTIONAL));
BCMCLI_MAKE_CMD(user_dir, "pcidump", "Print PCIe ring", _apicli_pcidump,
BCMCLI_MAKE_PARM("dir", "direction: tx or rx", BCMCLI_PARM_STRING, 0),
BCMCLI_MAKE_PARM("from", "start index", BCMCLI_PARM_NUMBER, BCMCLI_PARM_FLAG_OPTIONAL),
BCMCLI_MAKE_PARM("howmany", "howmany", BCMCLI_PARM_NUMBER, BCMCLI_PARM_FLAG_OPTIONAL));
#endif
#ifndef RELEASE_BUILD
bcmolt_remote_logger_appl_init();
bcmolt_remote_logger_appl_cli_init(user_dir);
#endif
err = bcmolt_user_appl_cli_image_transfer_init(user_dir);
BCMOS_CHECK_RETURN_ERROR(err != BCM_ERR_OK, err);
err = bcmolt_user_appl_cli_sw_upgrade_init(user_dir);
BCMOS_CHECK_RETURN_ERROR(err != BCM_ERR_OK, err);
bcmolt_ps_appl_init();
err = bcmolt_user_appl_ps_cli_init(user_dir);
BCMOS_CHECK_RETURN_ERROR(err != BCM_ERR_OK, err);
bcmolt_user_appl_playback_init();
bcmolt_user_appl_playback_cli_init(user_dir);
bcmolt_user_appl_cli_handle_system_mode_change(current_device);
return err;
}