blob: 681fcc2b7fb876198fe23aee8055605b61fc1204 [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#ifndef _BCMOLT_USER_APPL_ONU_TUNING_H_
31#define _BCMOLT_USER_APPL_ONU_TUNING_H_
32
33#include <bcmolt_host_api.h>
34
35typedef struct
36{
37 bcmolt_pon_ni target_pon_ni;
38 bcmolt_pon_ni source_pon_ni;
39 bcmolt_pon_id target_pon_id;
40 uint32_t time_to_switch;
41 bcmos_bool rollback;
42}bcmolt_onu_tuning_onu_db;
43
44typedef struct
45{
46 bcmos_task task;
47 bcmos_msg_pool msg_pool;
48 bcmos_mutex mutex;
49 bcmos_timer timer;
50 dev_log_id log_id;
51 bcmos_bool is_running;
52 bcmolt_devid device;
53 uint32_t *timeouts;
54 bcmolt_onu_tuning_onu_db onu_db[XGPON_MAX_NUM_OF_ONUS];
55} bcmolt_onu_tuning_context;
56
57typedef enum
58{
59
60 ONU_TUNING_MODE,
61} bcmolt_onu_tuning_mode;
62
63/** Initialize the ONU Tuning application (this should be called as part of application startup). */
64void bcmolt_onu_tuning_appl_init(bcmolt_devid device_id);
65
66/** Start the ONU Tuning application.
67 *
68 * \param[in] device The device ID on which the application will be started.
69 * \return BCM_ERR_OK if the application was started successfully, <0 otherwise.
70 */
71bcmos_errno bcmolt_onu_tuning_appl_start(bcmolt_devid device_id);
72
73/** Stop the ONU Tuning application.
74 *
75 * \return BCM_ERR_OK if the application was stopped successfully, <0 otherwise.
76 */
77bcmos_errno bcmolt_onu_tuning_appl_stop(bcmolt_devid device_id);
78
79/** Query whether the ONU Tuning application is currently running.
80 *
81 * \return BCMOS_TRUE if the application is running, BCMOS_FALSE otherwise.
82 */
83bcmos_bool bcmolt_onu_tuning_appl_is_running(bcmolt_devid device_id);
84
85/** Process an indication received. If the ONU Tuning application is interested in the indication, the
86 * appropriate action will be taken. If the application is not interested, the indication will be ignored.
87 *
88 *
89 * Note: this function does not free the indication.
90 * The caller must free it using bcmos_msg_free() after calling this function.
91 *
92 * \param[in] ind The indication that was received.
93 * \return BCM_ERR_OK if the indication was processed successfully or ignored, <0 otherwise.
94 */
95bcmos_errno bcmolt_onu_tuning_process_ind(bcmolt_devid device_id, bcmolt_auto *ind);
96bcmos_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);
97
98#endif