| /* |
| <: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. |
| |
| :> |
| */ |
| |
| #ifndef _BCMOLT_USER_APPL_ONU_TUNING_H_ |
| #define _BCMOLT_USER_APPL_ONU_TUNING_H_ |
| |
| #include <bcmolt_host_api.h> |
| |
| typedef struct |
| { |
| bcmolt_pon_ni target_pon_ni; |
| bcmolt_pon_ni source_pon_ni; |
| bcmolt_pon_id target_pon_id; |
| uint32_t time_to_switch; |
| bcmos_bool rollback; |
| }bcmolt_onu_tuning_onu_db; |
| |
| typedef struct |
| { |
| bcmos_task task; |
| bcmos_msg_pool msg_pool; |
| bcmos_mutex mutex; |
| bcmos_timer timer; |
| dev_log_id log_id; |
| bcmos_bool is_running; |
| bcmolt_devid device; |
| uint32_t *timeouts; |
| bcmolt_onu_tuning_onu_db onu_db[XGPON_MAX_NUM_OF_ONUS]; |
| } bcmolt_onu_tuning_context; |
| |
| typedef enum |
| { |
| |
| ONU_TUNING_MODE, |
| } bcmolt_onu_tuning_mode; |
| |
| /** Initialize the ONU Tuning application (this should be called as part of application startup). */ |
| void bcmolt_onu_tuning_appl_init(bcmolt_devid device_id); |
| |
| /** Start the ONU Tuning application. |
| * |
| * \param[in] device The device ID on which the application will be started. |
| * \return BCM_ERR_OK if the application was started successfully, <0 otherwise. |
| */ |
| bcmos_errno bcmolt_onu_tuning_appl_start(bcmolt_devid device_id); |
| |
| /** Stop the ONU Tuning application. |
| * |
| * \return BCM_ERR_OK if the application was stopped successfully, <0 otherwise. |
| */ |
| bcmos_errno bcmolt_onu_tuning_appl_stop(bcmolt_devid device_id); |
| |
| /** Query whether the ONU Tuning application is currently running. |
| * |
| * \return BCMOS_TRUE if the application is running, BCMOS_FALSE otherwise. |
| */ |
| bcmos_bool bcmolt_onu_tuning_appl_is_running(bcmolt_devid device_id); |
| |
| /** Process an indication received. If the ONU Tuning application is interested in the indication, the |
| * appropriate action will be taken. If the application is not interested, the indication will be ignored. |
| * |
| * |
| * Note: this function does not free the indication. |
| * The caller must free it using bcmos_msg_free() after calling this function. |
| * |
| * \param[in] ind The indication that was received. |
| * \return BCM_ERR_OK if the indication was processed successfully or ignored, <0 otherwise. |
| */ |
| bcmos_errno bcmolt_onu_tuning_process_ind(bcmolt_devid device_id, bcmolt_auto *ind); |
| bcmos_errno onu_tuning_update_onu_db (bcmolt_devid device_id, bcmolt_xgpon_onu_id onu_id, bcmolt_pon_ni source_pon_ni, bcmolt_pon_ni target_pon_ni, bcmolt_pon_id target_pon_id, bcmos_bool rollback); |
| |
| #endif |