浏览代码

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
Shashikala Prabhu 5 年之前
父节点
当前提交
52ee85cf6f
共有 2 个文件被更改,包括 31 次插入0 次删除
  1. 15 0
      umac/dfs/core/src/misc/dfs_random_chan_sel.c
  2. 16 0
      umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h

+ 15 - 0
umac/dfs/core/src/misc/dfs_random_chan_sel.c

@@ -2236,6 +2236,21 @@ uint16_t dfs_prepare_random_channel_for_freq(struct wlan_dfs *dfs,
 							   leakage_adjusted_lst,
 							   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
 		 * weather radar channel in HT40 mode as extension channel

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

@@ -57,6 +57,18 @@
 #define DFS_ALLOW_HW_PULSES 28
 #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.
  * 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 */
 #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.
  * @wlan_dfs_ext_chan_ok:         Can radar be detected on the extension chan?