Jelajahi Sumber

qcacmn: Allow SAP to come up on DFS channel in SCC mode

Allow SAP to come up on DFS channel in STA+SAP concurrency mode
only when g_sta_sap_scc_on_dfs_chan enabled in ini file and also
disable chan_switch_hostapd_rate_enabled when force SCC is enabled.

CRs-Fixed: 2147032
Change-Id: Id1333a49d0538eb4ccfaf3c8498e9ca06671de02
Ganesh Kondabattini 7 tahun lalu
induk
melakukan
2f8cae3455

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

@@ -2187,4 +2187,15 @@ void policy_mgr_check_and_stop_opportunistic_timer(
 void policy_mgr_set_weight_of_dfs_passive_channels_to_zero(
 		struct wlan_objmgr_psoc *psoc, uint8_t *pcl_channels,
 		uint32_t *len, uint8_t *weight_list, uint32_t weight_len);
+
+/**
+ * policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan() - check if sta+sap scc
+ * allowed on dfs chan
+ * @psoc: pointer to soc
+ * This function is used to check if sta+sap scc allowed on dfs channel
+ *
+ * Return: true if sta+sap scc is allowed on dfs channel, otherwise false
+ */
+bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(
+		struct wlan_objmgr_psoc *psoc);
 #endif /* __WLAN_POLICY_MGR_API_H */

+ 1 - 0
umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h

@@ -1017,6 +1017,7 @@ struct policy_mgr_user_cfg {
 	bool enable2x2;
 	uint32_t mcc_to_scc_switch_mode;
 	bool sub_20_mhz_enabled;
+	bool is_sta_sap_scc_allowed_on_dfs_chan;
 };
 
 /**

+ 4 - 2
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -747,13 +747,15 @@ static bool policy_mgr_valid_sta_channel_check(struct wlan_objmgr_psoc *psoc,
 		return false;
 	}
 
-	if (wlan_reg_is_dfs_ch(pm_ctx->pdev, sta_channel) ||
+	if ((wlan_reg_is_dfs_ch(pm_ctx->pdev, sta_channel) &&
+		(!policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(psoc))) ||
 		wlan_reg_is_passive_or_disable_ch(pm_ctx->pdev, sta_channel) ||
-		!policy_mgr_is_safe_channel(psoc, sta_channel))
+		!policy_mgr_is_safe_channel(psoc, sta_channel)) {
 		if (policy_mgr_is_hw_dbs_capable(psoc))
 			return true;
 		else
 			return false;
+	}
 	else
 		return true;
 }

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

@@ -2721,3 +2721,22 @@ bool policy_mgr_is_force_scc(struct wlan_objmgr_psoc *psoc)
 		(pm_ctx->user_cfg.mcc_to_scc_switch_mode ==
 		QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION));
 }
+
+bool policy_mgr_is_sta_sap_scc_allowed_on_dfs_chan(
+		struct wlan_objmgr_psoc *psoc)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	bool status = false;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return status;
+	}
+
+	if (policy_mgr_is_force_scc(psoc) &&
+		pm_ctx->user_cfg.is_sta_sap_scc_allowed_on_dfs_chan)
+		status = true;
+
+	return status;
+}

+ 1 - 0
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -271,6 +271,7 @@ struct policy_mgr_psoc_priv_obj {
 	uint16_t unsafe_channel_count;
 	struct sta_ap_intf_check_work_ctx *sta_ap_intf_check_work_info;
 	uint8_t cur_conc_system_pref;
+	uint8_t sta_sap_scc_on_dfs_chan_allowed;
 };
 
 /**