Răsfoiți Sursa

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
gaurank kathpalia 4 ani în urmă
părinte
comite
fe1cbc425d

+ 11 - 3
umac/dfs/core/src/misc/dfs_random_chan_sel.c

@@ -1937,6 +1937,7 @@ static void dfs_apply_rules_for_freq(struct wlan_dfs *dfs,
 	bool flag_no_2g_chan  = 0;
 	bool flag_no_5g_chan  = 0;
 	bool flag_no_japan_w53 = 0;
+	bool flag_no_6g_freq;
 	int i;
 	bool found = false;
 	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_2g_chan  = flags & DFS_RANDOM_CH_FLAG_NO_2GHZ_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) {
 		num_channels =
@@ -2015,9 +2017,8 @@ static void dfs_apply_rules_for_freq(struct wlan_dfs *dfs,
 			continue;
 		}
 
-		if (flag_no_5g_chan && chan->dfs_ch_freq >
-		    DFS_MAX_24GHZ_CHANNEL_FREQ)
-		{
+		if (flag_no_5g_chan &&
+		    WLAN_REG_IS_5GHZ_CH_FREQ(chan->dfs_ch_freq)) {
 			dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,
 				  "skip 5 GHz channel=%d", chan->dfs_ch_ieee);
 			continue;
@@ -2046,6 +2047,13 @@ static void dfs_apply_rules_for_freq(struct wlan_dfs *dfs,
 			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 &&
 		    (chan->dfs_ch_flagext & WLAN_CHAN_DFS)) {
 			dfs_debug(dfs, WLAN_DEBUG_DFS_RANDOM_CHAN,

+ 3 - 0
umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h

@@ -211,6 +211,9 @@ struct dfs_bangradar_params {
 #define DFS_RANDOM_CH_FLAG_RESTRICTED_80P80_ENABLED 0x0200
 						       /* 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.
  * @wlan_dfs_ext_chan_ok:         Can radar be detected on the extension chan?