From 3bd09d612d1246b544f65b547faf79368487f9ce Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Fri, 4 May 2018 14:37:48 +0530 Subject: [PATCH] qcacmn: Add API to stop DBS opportunistic timer Add API to stop DBS opportunistic timer in policy mgr. Change-Id: I11a2b2976c59d7cd09695f90c2d2bdd7338dde54 CRs-Fixed: 2236333 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 8 ++++++++ .../policy_mgr/src/wlan_policy_mgr_action.c | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 3db7f62741be..9eeb9e08e845 100644 --- a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -1134,6 +1134,14 @@ QDF_STATUS policy_mgr_set_connection_update(struct wlan_objmgr_psoc *psoc); */ QDF_STATUS policy_mgr_set_opportunistic_update(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_stop_opportunistic_timer() - Stops opportunistic timer + * @psoc: PSOC object information + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_stop_opportunistic_timer(struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_restart_opportunistic_timer() - Restarts opportunistic timer * @psoc: PSOC object information diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index db6e957ad659..9cfa97d85816 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1117,6 +1117,24 @@ QDF_STATUS policy_mgr_set_opportunistic_update(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_stop_opportunistic_timer(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *policy_mgr_ctx; + + policy_mgr_ctx = policy_mgr_get_context(psoc); + if (!policy_mgr_ctx) { + policy_mgr_err("Invalid context"); + return QDF_STATUS_E_FAILURE; + } + + if (policy_mgr_ctx->dbs_opportunistic_timer.state != + QDF_TIMER_STATE_RUNNING) + return QDF_STATUS_SUCCESS; + + qdf_mc_timer_stop(&policy_mgr_ctx->dbs_opportunistic_timer); + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_restart_opportunistic_timer( struct wlan_objmgr_psoc *psoc, bool check_state) {