qcacmn: Filter out the 6ghz chan freq from valid freq list

Currently the driver does not have a support to
filter out the 6ghz frequencies from the valid freq
list, and hence there is a high chance of selecting
the 6ghz freq as an operating freq for SAP, which
the legacy clients won't be able to scan.

Fix is to add a support for filtering out the 6ghz
frequencies from the valid freq list.

Change-Id: I8e3552a254e2b79cc1fc09da3e1e06ac378cbb07
CRs-Fixed: 2801414
This commit is contained in:
gaurank kathpalia
2020-10-29 19:25:52 +05:30
committed by snandini
parent f7d6997020
commit fe1cbc425d
2 changed files with 14 additions and 3 deletions

View File

@@ -1937,6 +1937,7 @@ static void dfs_apply_rules_for_freq(struct wlan_dfs *dfs,
bool flag_no_2g_chan = 0; bool flag_no_2g_chan = 0;
bool flag_no_5g_chan = 0; bool flag_no_5g_chan = 0;
bool flag_no_japan_w53 = 0; bool flag_no_japan_w53 = 0;
bool flag_no_6g_freq;
int i; int i;
bool found = false; bool found = false;
uint16_t j; uint16_t j;
@@ -1956,6 +1957,7 @@ static void dfs_apply_rules_for_freq(struct wlan_dfs *dfs,
flag_no_dfs_chan = flags & DFS_RANDOM_CH_FLAG_NO_DFS_CH; flag_no_dfs_chan = flags & DFS_RANDOM_CH_FLAG_NO_DFS_CH;
flag_no_2g_chan = flags & DFS_RANDOM_CH_FLAG_NO_2GHZ_CH; flag_no_2g_chan = flags & DFS_RANDOM_CH_FLAG_NO_2GHZ_CH;
flag_no_5g_chan = flags & DFS_RANDOM_CH_FLAG_NO_5GHZ_CH; flag_no_5g_chan = flags & DFS_RANDOM_CH_FLAG_NO_5GHZ_CH;
flag_no_6g_freq = flags & DFS_RANDOM_CH_FLAG_NO_6GHZ_CH;
if (flags & DFS_RANDOM_CH_FLAG_NO_CURR_OPE_CH) { if (flags & DFS_RANDOM_CH_FLAG_NO_CURR_OPE_CH) {
num_channels = num_channels =
@@ -2015,9 +2017,8 @@ static void dfs_apply_rules_for_freq(struct wlan_dfs *dfs,
continue; continue;
} }
if (flag_no_5g_chan && chan->dfs_ch_freq > if (flag_no_5g_chan &&
DFS_MAX_24GHZ_CHANNEL_FREQ) WLAN_REG_IS_5GHZ_CH_FREQ(chan->dfs_ch_freq)) {
{
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN, dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
"skip 5 GHz channel=%d", chan->dfs_ch_ieee); "skip 5 GHz channel=%d", chan->dfs_ch_ieee);
continue; continue;
@@ -2046,6 +2047,13 @@ static void dfs_apply_rules_for_freq(struct wlan_dfs *dfs,
continue; continue;
} }
if (flag_no_6g_freq &&
WLAN_REG_IS_6GHZ_CHAN_FREQ(chan->dfs_ch_freq)) {
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
"skip 6 GHz channel=%d", chan->dfs_ch_ieee);
continue;
}
if (flag_no_dfs_chan && if (flag_no_dfs_chan &&
(chan->dfs_ch_flagext & WLAN_CHAN_DFS)) { (chan->dfs_ch_flagext & WLAN_CHAN_DFS)) {
dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN, dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,

View File

@@ -211,6 +211,9 @@ struct dfs_bangradar_params {
#define DFS_RANDOM_CH_FLAG_RESTRICTED_80P80_ENABLED 0x0200 #define DFS_RANDOM_CH_FLAG_RESTRICTED_80P80_ENABLED 0x0200
/* 0000 0010 0000 0000 */ /* 0000 0010 0000 0000 */
/* Flag to exclude all 6GHz channels */
#define DFS_RANDOM_CH_FLAG_NO_6GHZ_CH 0x00400 /* 0000 0100 0000 0000 */
/** /**
* struct wlan_dfs_caps - DFS capability structure. * struct wlan_dfs_caps - DFS capability structure.
* @wlan_dfs_ext_chan_ok: Can radar be detected on the extension chan? * @wlan_dfs_ext_chan_ok: Can radar be detected on the extension chan?