Procházet zdrojové kódy

qcacmn: Add API to stop DBS opportunistic timer

Add API to stop DBS opportunistic timer in policy mgr.

Change-Id: I11a2b2976c59d7cd09695f90c2d2bdd7338dde54
CRs-Fixed: 2236333
Himanshu Agarwal před 7 roky
rodič
revize
3bd09d612d

+ 8 - 0
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

+ 18 - 0
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)
 {