qcacld-3.0: Fix SAP moved to unsafe channel

At present when user trigger SAP move to unsafe channel,
driver doesn't reject the request since "strict = false"
and unsafe checking is skipped.
Fix by check SAP channel switch target channel safe or
unsafe with API policy_mgr_is_sap_freq_allowed before
perform channel switch.

Change-Id: I2950fb31346df8705c8fc608fd79e1a44f4d4947
CRs-Fixed: 2826619
This commit is contained in:
Liangwei Dong 2020-11-30 15:31:42 +08:00
commit b83227ed06
2 changed files with 4 additions and 3 deletions

View file

@ -4323,7 +4323,9 @@ bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc,
conn_index++) {
if (pm_conc_connection_list[conn_index].in_use &&
(pm_conc_connection_list[conn_index].mode ==
PM_STA_MODE) && (sap_freq ==
PM_STA_MODE ||
pm_conc_connection_list[conn_index].mode ==
PM_P2P_CLIENT_MODE) && (sap_freq ==
pm_conc_connection_list[conn_index].freq)) {
is_scc = true;
break;

View file

@ -1378,8 +1378,7 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx,
}
mac_handle = MAC_HANDLE(mac);
if (strict && !policy_mgr_is_safe_channel(
mac->psoc, target_chan_freq)) {
if (!policy_mgr_is_sap_freq_allowed(mac->psoc, target_chan_freq)) {
sap_err("%u is unsafe channel freq", target_chan_freq);
return QDF_STATUS_E_FAULT;
}