diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 040f930ef5fd..4dd3629ad843 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -2129,6 +2129,19 @@ void policy_mgr_set_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc, * Return: conc_system_pref */ uint8_t policy_mgr_get_cur_conc_system_pref(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_check_and_stop_opportunistic_timer - Get current + * state of opportunistic timer, if running, stop it and take + * action + * @psoc: soc pointer + * + * Get the current state of opportunistic timer, if it is + * running, stop it and take action. + * + * Return: None + */ +void policy_mgr_check_and_stop_opportunistic_timer( + struct wlan_objmgr_psoc *psoc); /** * policy_mgr_set_weight_of_dfs_passive_channels_to_zero() - set weight of dfs diff --git a/inc/wlan_policy_mgr_public_struct.h b/inc/wlan_policy_mgr_public_struct.h index b10adbaff31a..4d4f9ad53f86 100644 --- a/inc/wlan_policy_mgr_public_struct.h +++ b/inc/wlan_policy_mgr_public_struct.h @@ -896,6 +896,7 @@ struct policy_mgr_hw_mode { void *set_hw_mode_cb; enum policy_mgr_conn_update_reason reason; uint32_t session_id; + struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_psoc *context; }; diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 2b53cc4697a2..48ab89322b0f 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1092,6 +1092,23 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( pm_dbs_opportunistic_timer_handler((void *)psoc); } +void policy_mgr_check_and_stop_opportunistic_timer( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return; + } + if (QDF_TIMER_STATE_RUNNING == + pm_ctx->dbs_opportunistic_timer.state) { + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + pm_dbs_opportunistic_timer_handler((void *)psoc); + } +} + void policy_mgr_set_hw_mode_change_in_progress( struct wlan_objmgr_psoc *psoc, enum policy_mgr_hw_mode_change value) {