From 643fed7c0c4ada28f6df2393c6592d7112414742 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Fri, 17 Sep 2021 16:52:19 +0800 Subject: [PATCH] qcacld-3.0: Init 5G SAP mandatory list with 2G+5G band When SAP starts on 5G, initialize SAP mandatory list with 2G and 5G mandatory list. And also select same band channel SCC channel firstly in the intersection of PCL and mandatory channel list. Change-Id: Iac86b5caf38bf72f143be81122f8378fc61b29e2 CRs-Fixed: 3039268 --- .../cmn_services/policy_mgr/src/wlan_policy_mgr_core.c | 6 +++--- .../cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 10d1fe879a1d..332732690b14 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3630,9 +3631,8 @@ void policy_mgr_init_sap_mandatory_chan(struct wlan_objmgr_psoc *psoc, if (WLAN_REG_IS_5GHZ_CH_FREQ(org_ch_freq)) { policy_mgr_debug("channel %hu, sap mandatory chan list enabled", org_ch_freq); - if (!policy_mgr_get_sap_mandatory_chan_list_len(psoc)) - policy_mgr_init_sap_mandatory_chan_by_band( - psoc, BIT(REG_BAND_2G)); + policy_mgr_init_sap_mandatory_chan_by_band( + psoc, BIT(REG_BAND_2G) | BIT(REG_BAND_5G)); policy_mgr_add_sap_mandatory_chan( psoc, org_ch_freq); } else if (WLAN_REG_IS_6GHZ_CHAN_FREQ(org_ch_freq)) { diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 1dc0810698ab..d162693fdf54 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -2506,7 +2506,9 @@ policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc, } sap_new_freq = pcl.pcl_list[0]; - if (WLAN_REG_IS_6GHZ_CHAN_FREQ(sap_ch_freq)) { + if (WLAN_REG_IS_6GHZ_CHAN_FREQ(sap_ch_freq) || + (WLAN_REG_IS_5GHZ_CH_FREQ(sap_ch_freq) && + WLAN_REG_IS_5GHZ_CH_FREQ(*intf_ch_freq))) { for (i = 0; i < pcl.pcl_len; i++) { if (pcl.pcl_list[i] == *intf_ch_freq) { sap_new_freq = pcl.pcl_list[i];