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 Liangwei Dong
commit 5380cd5b82
4 changed files with 43 additions and 6 deletions

View file

@ -3014,6 +3014,21 @@ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config(
bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc,
uint32_t ch_freq);
/**
* policy_mgr_is_sap_freq_allowed - Check if the channel is allowed for sap
* @psoc: PSOC object information
* @sap_freq: channel frequency to be checked
*
* 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.
*
* Return: true for allowed, else false
*/
bool policy_mgr_is_sap_freq_allowed(struct wlan_objmgr_psoc *psoc,
uint32_t sap_freq);
/**
* policy_mgr_get_ch_width() - Convert hw_mode_bandwidth to phy_ch_width
* @bw: Hardware mode band width used by WMI

View file

@ -1485,6 +1485,25 @@ bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc,
return is_safe;
}
bool policy_mgr_is_sap_freq_allowed(struct wlan_objmgr_psoc *psoc,
uint32_t sap_freq)
{
if (policy_mgr_is_safe_channel(psoc, sap_freq))
return true;
/*
* Return true if it's STA+SAP SCC and
* STA+SAP SCC on LTE coex channel is allowed.
*/
if (policy_mgr_sta_sap_scc_on_lte_coex_chan(psoc) &&
policy_mgr_is_sta_sap_scc(psoc, sap_freq)) {
policy_mgr_debug("unsafe freq %d for sap is allowed", sap_freq);
return true;
}
return false;
}
bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
struct wlan_objmgr_psoc *psoc,
uint32_t sap_vdev_id, uint32_t *intf_ch_freq)

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 &&