Browse Source

qcacmn: Add policy mgr API to get no. of active sessions

Add policy mgr API to get no. of active sessions for a specific
mode.

Change-Id: If91685ae7b72c6be52426648e9d01cba92eee85e
CRs-Fixed: 2178921
Himanshu Agarwal 7 years ago
parent
commit
0261f94dd5

+ 13 - 0
umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -984,6 +984,19 @@ QDF_STATUS policy_mgr_mode_specific_num_open_sessions(
 		struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode,
 		uint8_t *num_sessions);
 
+/**
+ * policy_mgr_mode_specific_num_active_sessions() - to get number of active
+ *               sessions for a specific mode
+ * @psoc: PSOC object information
+ * @mode: device mode
+ * @num_sessions: to store num active sessions
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS policy_mgr_mode_specific_num_active_sessions(
+		struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode,
+		uint8_t *num_sessions);
+
 /**
  * policy_mgr_concurrent_open_sessions_running() - Checks for
  * concurrent open session

+ 16 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -2076,6 +2076,22 @@ QDF_STATUS policy_mgr_mode_specific_num_open_sessions(
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS policy_mgr_mode_specific_num_active_sessions(
+		struct wlan_objmgr_psoc *psoc, enum QDF_OPMODE mode,
+		uint8_t *num_sessions)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid context");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*num_sessions = pm_ctx->no_of_active_sessions[mode];
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * policy_mgr_concurrent_open_sessions_running() - Checks for
  * concurrent open session