Преглед изворни кода

qcacld-3.0: Add sanity checks to prevent incorrect CSA

Prevent DFS-to-NON-DFS CSA, if the chosen candidate
frequency is passive or if the SAP is not 6 GHz capable.
Instead, select a non-dfs channel from PCL and move the
SAP. Later, the SAP will be re-oriented to SCC if there
is interference.

Change-Id: I954a5e810639fe41b9b4e16bd84a93c24a7b03e6
CRs-Fixed: 3550941
Surya Prakash Sivaraj пре 1 година
родитељ
комит
3ff6b85589

+ 3 - 1
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -4280,10 +4280,12 @@ bool policy_mgr_is_connected_sta_5g(struct wlan_objmgr_psoc *psoc,
  * 5g channel when dfs ap is present.
  *
  * @psoc: pointer to soc
+ * @freq: DFS freq of concurrent SAP/GO
  *
  * Return: true if sta scan 5g chan should be skipped
  */
-bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc);
+bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc,
+					      qdf_freq_t *freq);
 
 /**
  * policy_mgr_scan_trim_chnls_for_connected_ap() - check if sta scan

+ 4 - 1
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -9531,7 +9531,8 @@ bool policy_mgr_is_any_dfs_beaconing_session_present(
 	return status;
 }
 
-bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
+bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc,
+					      qdf_freq_t *freq)
 {
 	qdf_freq_t dfs_ch_frq = 0;
 	qdf_freq_t dfs_sta_frq = 0;
@@ -9546,6 +9547,8 @@ bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
 	if (!dfs_ch_frq)
 		return false;
 
+	*freq = dfs_ch_frq;
+
 	status = policy_mgr_get_sta_sap_scc_on_dfs_chnl(psoc,
 						&sta_sap_scc_on_dfs_chnl);
 	if (QDF_IS_STATUS_ERROR(status))

+ 10 - 1
core/hdd/src/wlan_hdd_cm_connect.c

@@ -577,6 +577,7 @@ bool wlan_hdd_cm_handle_sap_sta_dfs_conc(struct hdd_context *hdd_ctx,
 	qdf_list_t *list = NULL;
 	qdf_list_node_t *cur_lst = NULL;
 	struct scan_cache_node *cur_node = NULL;
+	bool is_6ghz_cap = false;
 
 	ap_adapter = hdd_get_sap_adapter_of_dfs(hdd_ctx);
 	/* probably no dfs sap running, no handling required */
@@ -669,11 +670,19 @@ def_chan:
 	 * for 3port MCC scenario.
 	 */
 	ch_bw = hdd_ap_ctx->sap_config.ch_width_orig;
+	if (ch_freq)
+		is_6ghz_cap = policy_mgr_get_ap_6ghz_capable(hdd_ctx->psoc,
+						ap_adapter->deflink->vdev_id,
+							     NULL);
+
 	if (!ch_freq || wlan_reg_is_dfs_for_freq(hdd_ctx->pdev, ch_freq) ||
-	    !policy_mgr_is_safe_channel(hdd_ctx->psoc, ch_freq))
+	    !policy_mgr_is_safe_channel(hdd_ctx->psoc, ch_freq) ||
+	    wlan_reg_is_passive_for_freq(hdd_ctx->pdev, ch_freq) ||
+	    (WLAN_REG_IS_6GHZ_CHAN_FREQ(ch_freq) && !is_6ghz_cap))
 		ch_freq = policy_mgr_get_nondfs_preferred_channel(
 				hdd_ctx->psoc, PM_SAP_MODE,
 				true, ap_adapter->deflink->vdev_id);
+
 	if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq) &&
 	    ch_bw > CH_WIDTH_20MHZ) {
 		struct ch_params ch_params;