diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 086844e24a86..cd88a6cbc978 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/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. diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index a2e32ef41519..9961a4596378 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/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)