blob: 7c3f7d19283d1cee7152b49a6e02159373e92277 [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001/*
2<:copyright-BRCM:2016:DUAL/GPL:standard
3
4 Broadcom Proprietary and Confidential.(c) 2016 Broadcom
5 All Rights Reserved
6
7Unless you and Broadcom execute a separate written software license
8agreement governing use of this software, this software is licensed
9to you under the terms of the GNU General Public License version 2
10(the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
11with the following added to such license:
12
13 As a special exception, the copyright holders of this software give
14 you permission to link this software with independent modules, and
15 to copy and distribute the resulting executable under terms of your
16 choice, provided that you also meet, for each linked independent
17 module, the terms and conditions of the license of that module.
18 An independent module is a module which is not derived from this
19 software. The special exception does not apply to any modifications
20 of the software.
21
22Not withstanding the above, under no circumstances may you combine
23this software in any way with any other Broadcom software provided
24under a license other than the GPL, without Broadcom's express prior
25written consent.
26
27:>
28*/
29
30/* This file is for internal use within the protection switching user application -
31 no functions here should be called from anywhere else! */
32
33#ifndef _BCMOLT_USER_APPL_PS_INTERNAL_H_
34#define _BCMOLT_USER_APPL_PS_INTERNAL_H_
35
36#include <bcm_dev_log.h>
37#include "bcmolt_user_appl_ps.h"
38
39#ifdef ENABLE_LOG
40dev_log_id ps_get_log_id(void);
41#define PS_ERR(...) BCM_LOG(ERROR, ps_get_log_id(), __VA_ARGS__)
42#define PS_INFO(...) BCM_LOG(INFO, ps_get_log_id(), __VA_ARGS__)
43#else
44#define PS_ERR(...) bcmos_printf("[PS ERROR] " __VA_ARGS__)
45#define PS_INFO(...) bcmos_printf("[PS INFO] " __VA_ARGS__)
46#endif
47
48/* Helper functions */
49uint32_t ps_get_last_switch_start_time_us(void);
50
51/* GPON-specific functionality */
52bcmos_errno ps_process_ind_gpon(const bcmolt_ps_pon *pon, const bcmolt_auto *ind);
53bcmos_errno ps_move_to_standby_gpon(const bcmolt_ps_pon *pon);
54bcmos_errno ps_move_to_working_gpon(const bcmolt_ps_pon *pon);
55
56/* EPON-specific functionality */
57bcmos_errno ps_process_ind_epon(const bcmolt_ps_pon *pon, const bcmolt_auto *ind);
58bcmos_errno ps_move_to_standby_epon(const bcmolt_ps_pon *pon);
59bcmos_errno ps_move_to_working_epon(const bcmolt_ps_pon *pon);
60
61/* XGPON-specific functionality */
62bcmos_errno ps_process_ind_xgpon(const bcmolt_ps_pon *pon, const bcmolt_auto *ind);
63bcmos_errno ps_move_to_standby_xgpon(const bcmolt_ps_pon *pon);
64bcmos_errno ps_move_to_working_xgpon(const bcmolt_ps_pon *pon);
65
66#endif