Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame^] | 1 | /* |
| 2 | <:copyright-BRCM:2016:DUAL/GPL:standard |
| 3 | |
| 4 | Broadcom Proprietary and Confidential.(c) 2016 Broadcom |
| 5 | All Rights Reserved |
| 6 | |
| 7 | Unless you and Broadcom execute a separate written software license |
| 8 | agreement governing use of this software, this software is licensed |
| 9 | to you under the terms of the GNU General Public License version 2 |
| 10 | (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, |
| 11 | with 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 | |
| 22 | Not withstanding the above, under no circumstances may you combine |
| 23 | this software in any way with any other Broadcom software provided |
| 24 | under a license other than the GPL, without Broadcom's express prior |
| 25 | written 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 |
| 40 | dev_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 */ |
| 49 | uint32_t ps_get_last_switch_start_time_us(void); |
| 50 | |
| 51 | /* GPON-specific functionality */ |
| 52 | bcmos_errno ps_process_ind_gpon(const bcmolt_ps_pon *pon, const bcmolt_auto *ind); |
| 53 | bcmos_errno ps_move_to_standby_gpon(const bcmolt_ps_pon *pon); |
| 54 | bcmos_errno ps_move_to_working_gpon(const bcmolt_ps_pon *pon); |
| 55 | |
| 56 | /* EPON-specific functionality */ |
| 57 | bcmos_errno ps_process_ind_epon(const bcmolt_ps_pon *pon, const bcmolt_auto *ind); |
| 58 | bcmos_errno ps_move_to_standby_epon(const bcmolt_ps_pon *pon); |
| 59 | bcmos_errno ps_move_to_working_epon(const bcmolt_ps_pon *pon); |
| 60 | |
| 61 | /* XGPON-specific functionality */ |
| 62 | bcmos_errno ps_process_ind_xgpon(const bcmolt_ps_pon *pon, const bcmolt_auto *ind); |
| 63 | bcmos_errno ps_move_to_standby_xgpon(const bcmolt_ps_pon *pon); |
| 64 | bcmos_errno ps_move_to_working_xgpon(const bcmolt_ps_pon *pon); |
| 65 | |
| 66 | #endif |