Browse Source

qcacld-3.0: Add helper APIs in policy mgr

With this change add two helper APIs to check if the input
concurrency mode is SAP mode and to check if the input mode
concurrency mode represents beaconing mode.

Change-Id: Iccc82fccf20e43f600efbb4a83c00d51f1d2cd14
CRs-Fixed: 3521665
Ashish Kumar Dhanotiya 1 year ago
parent
commit
08ca873aa4

+ 17 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -5165,4 +5165,21 @@ policy_mgr_get_allowed_tdls_offchannel_freq(struct wlan_objmgr_psoc *psoc,
 					    struct wlan_objmgr_vdev *vdev,
 					    qdf_freq_t *ch_freq);
 #endif /* WLAN_FEATURE_TDLS_CONCURRENCIES */
+
+/**
+ * policy_mgr_is_sap_mode() - Check if mode is SAP mode
+ * @mode: Policy manager concurrency mode
+ *
+ * Return: true if mode is SAP mode else false
+ */
+bool policy_mgr_is_sap_mode(enum policy_mgr_con_mode mode);
+
+/**
+ * policy_mgr_is_beaconing_mode() - Check if mode represents beaconing entity
+ * @mode: Policy manager concurrency mode
+ *
+ * Return: true if mode represents beaconing entity else false
+ */
+bool policy_mgr_is_beaconing_mode(enum policy_mgr_con_mode mode);
+
 #endif /* __WLAN_POLICY_MGR_API_H */

+ 18 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -10608,3 +10608,21 @@ bool policy_mgr_is_conc_sap_present_on_sta_freq(struct wlan_objmgr_psoc *psoc,
 
 	return sap_go_exists;
 }
+
+bool policy_mgr_is_sap_mode(enum policy_mgr_con_mode mode)
+{
+	if (mode == PM_SAP_MODE || mode == PM_LL_LT_SAP_MODE)
+		return true;
+
+	return false;
+}
+
+bool policy_mgr_is_beaconing_mode(enum policy_mgr_con_mode mode)
+{
+	if (mode == PM_SAP_MODE || mode == PM_LL_LT_SAP_MODE ||
+	    mode == PM_P2P_GO_MODE)
+		return true;
+
+	return false;
+}
+