Browse Source

qcacld-3.0: Add API to check Agile DFS scan supportability

The old change I7e5a21601642e0d6afef73beeecf80a3e0475909
is missing when new scan mgr introduced, re-design the
change.
If DFS AP present, station scan 5g chanlist should be
avoided if target doesn't support Agile DFS Scan in Single
MAC mode. And also if current hw mode is DBS, the 5g chan
scan is not allowed as well.
1) if agile & DFS scans are supported
2) if hardware is DBS capable
3) if current hw mode is non-dbs
If all above 3 conditions are true then don't skip any
channel from scan list.

Change-Id: I3773c1c63ea3f33db6f6ee2c31cb5d09d3c2ae71
CRs-Fixed: 2471542
Liangwei Dong 6 years ago
parent
commit
bb0b7f5f47

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

@@ -2746,6 +2746,16 @@ void policy_mgr_trim_acs_channel_list(uint8_t *pcl, uint8_t pcl_count,
 				      uint8_t *org_ch_list,
 				      uint8_t *org_ch_list_count);
 
+/**
+ * policy_mgr_scan_trim_5g_chnls_for_dfs_ap() - check if sta scan should skip
+ * 5g channel when dfs ap is present.
+ *
+ * @psoc: pointer to soc
+ *
+ * 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);
+
 /**
  * policy_mgr_is_hwmode_set_for_given_chnl() - to check for given channel
  * if the hw mode is properly set.

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

@@ -2764,6 +2764,40 @@ 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)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	uint8_t ap_dfs_channel = 0;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid Context");
+		return false;
+	}
+
+	policy_mgr_is_any_dfs_beaconing_session_present(
+		psoc, &ap_dfs_channel);
+	if (!ap_dfs_channel)
+		return false;
+	/*
+	 * 1) if agile & DFS scans are supportet
+	 * 2) if hardware is DBS capable
+	 * 3) if current hw mode is non-dbs
+	 * if all above 3 conditions are true then don't skip any
+	 * channel from scan list
+	 */
+	if (policy_mgr_is_hw_dbs_capable(psoc) &&
+	    !policy_mgr_is_current_hwmode_dbs(psoc) &&
+	    policy_mgr_get_dbs_plus_agile_scan_config(psoc) &&
+	    policy_mgr_get_single_mac_scan_with_dfs_config(psoc))
+		return false;
+
+	policy_mgr_err("scan skip 5g chan due to dfs ap(ch %d) present",
+		       ap_dfs_channel);
+
+	return true;
+}
+
 QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc,
 				enum policy_mgr_con_mode mode,
 				uint8_t *nss_2g, uint8_t *nss_5g)