qcacld-3.0: add api to check if the channel is allowed for sap

Check the factors as below to decide whether the channel is
allowed or not:
 * If the channel is in LTE coex channel avoidance list;
 * If it's STA+SAP SCC;
 * If STA+SAP SCC on LTE coex channel is allowed.

Replace policy_mgr_is_safe_channel() with this new function
for sap channel selection and acs channel filtering, to allow
unsafe channels when it's STA+SAP SCC and STA+SAP SCC on LTE
coex channel is allowed.

CRs-Fixed: 2743042
Change-Id: Ic5a84b2628200fe9decf6972f00706f190f04722
This commit is contained in:
Yu Wang
2020-07-29 15:01:53 +08:00
committed by snandini
parent db21759630
commit c37adc1bf1
4 changed files with 43 additions and 6 deletions

View File

@@ -237,6 +237,7 @@ wlansap_filter_unsafe_ch(struct wlan_objmgr_psoc *psoc,
{
uint16_t i;
uint16_t num_safe_ch = 0;
uint32_t freq;
/*
* There are two channel list, one acs cfg channel list, and one
@@ -252,13 +253,12 @@ wlansap_filter_unsafe_ch(struct wlan_objmgr_psoc *psoc,
* the acs channel list before chosing one of them as a default channel
*/
for (i = 0; i < sap_ctx->acs_cfg->ch_list_count; i++) {
if (!policy_mgr_is_safe_channel(
psoc, sap_ctx->acs_cfg->freq_list[i])) {
sap_debug("unsafe freq %d removed from acs list",
sap_ctx->acs_cfg->freq_list[i]);
freq = sap_ctx->acs_cfg->freq_list[i];
if (!policy_mgr_is_sap_freq_allowed(psoc, freq)) {
sap_debug("remove freq %d from acs list", freq);
continue;
}
/* Add only safe channels to the acs cfg ch list */
/* Add only allowed channels to the acs cfg ch list */
sap_ctx->acs_cfg->freq_list[num_safe_ch++] =
sap_ctx->acs_cfg->freq_list[i];
}

View File

@@ -472,8 +472,11 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle,
}
}
if (!policy_mgr_is_safe_channel(mac->psoc, *pChans))
if (!policy_mgr_is_sap_freq_allowed(mac->psoc, *pChans)) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: Skip freq %d", __func__, *pChans);
continue;
}
/* OFDM rates are not supported on channel 14 */
if (channel == 14 &&