qcacmn: Add support to choose 160MHz random channel for Pine

Pine supports restricted 80+80 MHz only on cfreq=5690 and cfreq=5775. If AP
detects RADAR in this channel, it chooses new 80+80 MHz random channel
which is not supported by Pine because, notion of 80+80 is not present in
current channel in regulatory component. Hence, as a temporary fix we
change the invalid 80+80 MHz channel to 160 MHz or lower.

Change-Id: I749607236a1dd7b9c7aa93ff889b65adcbb4191c
CRs-Fixed: 2570057
This commit is contained in:
Shashikala Prabhu
2019-11-13 16:56:31 +05:30
committed by nshrivas
parent 65d547730f
commit 52ee85cf6f
2 changed files with 31 additions and 0 deletions

View File

@@ -2236,6 +2236,21 @@ uint16_t dfs_prepare_random_channel_for_freq(struct wlan_dfs *dfs,
leakage_adjusted_lst, leakage_adjusted_lst,
random_chan_cnt); random_chan_cnt);
/* Since notion of 80+80 is not present in the regulatory
* channel the function may return invalid 80+80 channels for
* some devices (e.g. Pine). Therefore, check if we need to
* correct it by checking the following condition.
*/
if ((*chan_wd == DFS_CH_WIDTH_80P80MHZ) &&
(flags & DFS_RANDOM_CH_FLAG_RESTRICTED_80P80_ENABLED) &&
!(CHAN_WITHIN_RESTRICTED_80P80(target_freq,
*dfs_cfreq_seg2))) {
*chan_wd = DFS_CH_WIDTH_160MHZ;
target_freq = dfs_find_ch_with_fallback_for_freq(
dfs, chan_wd, dfs_cfreq_seg2,
leakage_adjusted_lst, random_chan_cnt);
}
/* /*
* When flag_no_weather is set, avoid usage of Adjacent * When flag_no_weather is set, avoid usage of Adjacent
* weather radar channel in HT40 mode as extension channel * weather radar channel in HT40 mode as extension channel

View File

@@ -57,6 +57,18 @@
#define DFS_ALLOW_HW_PULSES 28 #define DFS_ALLOW_HW_PULSES 28
#define DFS_SET_PRI_MULTIPILER 29 #define DFS_SET_PRI_MULTIPILER 29
#define RESTRICTED_80P80_START_CHAN 132
#define RESTRICTED_80P80_END_CHAN 161
/* Check if the given channels are within restricted 80P80 start chan(132) and
* end chan (161).
*/
#define CHAN_WITHIN_RESTRICTED_80P80(chan, cfreq_seg2) \
((((chan) >= RESTRICTED_80P80_START_CHAN) && \
((chan) <= RESTRICTED_80P80_END_CHAN) && \
((cfreq_seg2) >= RESTRICTED_80P80_START_CHAN) && \
((cfreq_seg2) <= RESTRICTED_80P80_END_CHAN)) ? true : false)
/* /*
* Spectral IOCTLs use DFS_LAST_IOCTL as the base. * Spectral IOCTLs use DFS_LAST_IOCTL as the base.
* This must always be the last IOCTL in DFS and have * This must always be the last IOCTL in DFS and have
@@ -193,6 +205,10 @@ struct dfs_bangradar_params {
/* Flag to exclude Japan W53 channnels */ /* Flag to exclude Japan W53 channnels */
#define DFS_RANDOM_CH_FLAG_NO_JAPAN_W53_CH 0x0100 /* 0000 0001 0000 0000 */ #define DFS_RANDOM_CH_FLAG_NO_JAPAN_W53_CH 0x0100 /* 0000 0001 0000 0000 */
/* Restricted 80P80 MHz is enabled */
#define DFS_RANDOM_CH_FLAG_RESTRICTED_80P80_ENABLED 0x0200
/* 0000 0010 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?