瀏覽代碼

qca-wifi-oss: Reinit DFS after HW mode switch (phase 2)

Supported dynamic HW mode switches:
DBS (full band 5G and 2G) <-> DBS_SBS (low band 5G, high band 5G and 2G)

Description of the changes:

1. NOL conversion:
  a. Introduce a temporary NOL list copy structure in DFS psoc obj.
  b. When mode switch is triggered:
    i.   Stop the NOL timers and clear the data, to avoid processing NOL
	 expiry during mode switch.
    ii.  Allocate the psoc NOL copy for the target num_radios.
    iii. Store the NOL data of each radio to the target pdev ID
	 (pdev ID after mode switch) in the psoc NOL copy,
	 using a unified mux/demux API.
  c. After mode switch is completed:
    i.   Resume NOL by re-initializing the list from the temporary psoc
         copy.
    ii.  Free the psoc copy after mode switch is complete.
    iii. Note: changes are made to support pause and resume of NOL,
	 increasing NOL timeout by a few milliseconds.

2. PreCAC list conversion:
  a. When mode switch is triggered:
    i. Stop the existing preCAC timer and send ADFS abort command to FW.
  b. When mode switch is completed:
    i.  Unify/separate the preCAC list if the target mode is DBS/DBS_SBS
	respectively, using a single API.
    ii. Start ADFS again.

3. Radar detection lock:
  a. While detecting radar, acquire a lock to avoid handling user triggered
     mode_switch during this process. Release the lock once radar
     processing is completed and CSA start is triggered.

4. Radar detection/CAC completion defer during mode switch:
  a. While detecting radar or CAC completion, check if mode switch is
     in progress. If yes, wait for mode switch to complete before
     handling the events.
  b. Note: Precedence is Radar over CAC, i.e., if CAC processing is waiting
     and radar is received, CAC completion is no longer handled.

CRs-Fixed: 2535058
Change-Id: I55e03dae9da994c21b1aafe7b7686f5299221a40
Vignesh Mohan 5 年之前
父節點
當前提交
29948edda0
共有 1 個文件被更改,包括 54 次插入1 次删除
  1. 54 1
      umac/dfs/core/src/misc/dfs_zero_cac.c

+ 54 - 1
umac/dfs/core/src/misc/dfs_zero_cac.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
@@ -4630,3 +4630,56 @@ void dfs_set_fw_adfs_support(struct wlan_dfs *dfs,
 	dfs->dfs_fw_adfs_support_160 = fw_adfs_support_160;
 }
 #endif
+
+void dfs_reinit_precac_lists(struct wlan_dfs *src_dfs,
+			     struct wlan_dfs *dest_dfs,
+			     uint16_t low_5g_freq,
+			     uint16_t high_5g_freq)
+{
+	struct dfs_precac_entry *tmp_precac_entry, *tmp_precac_entry2;
+
+	/* If the destination DFS is not adhering ETSI (or)
+	 * if the source DFS does not have any lists, return (nothing to do).
+	 */
+	if (utils_get_dfsdomain(dest_dfs->dfs_pdev_obj) != DFS_ETSI_DOMAIN ||
+	    TAILQ_EMPTY(&src_dfs->dfs_precac_list))
+		return;
+
+	/* If dest_dfs and src_dfs are same it will cause dead_lock. */
+	if (dest_dfs == src_dfs)
+	       return;
+
+	PRECAC_LIST_LOCK(dest_dfs);
+	if (TAILQ_EMPTY(&dest_dfs->dfs_precac_list))
+		TAILQ_INIT(&dest_dfs->dfs_precac_list);
+	PRECAC_LIST_LOCK(src_dfs);
+	TAILQ_FOREACH(tmp_precac_entry,
+		      &src_dfs->dfs_precac_list,
+		      pe_list) {
+		if (low_5g_freq <= tmp_precac_entry->vht80_ch_freq &&
+		    high_5g_freq >= tmp_precac_entry->vht80_ch_freq) {
+			/* If the destination DFS already have the entries for
+			 * some reason, remove them and update with the active
+			 * entry in the source DFS list.
+			 */
+			TAILQ_FOREACH(tmp_precac_entry2,
+				      &dest_dfs->dfs_precac_list,
+				      pe_list) {
+				if (tmp_precac_entry2->vht80_ch_freq ==
+				    tmp_precac_entry->vht80_ch_freq)
+					TAILQ_REMOVE(&dest_dfs->dfs_precac_list,
+						     tmp_precac_entry2,
+						     pe_list);
+			}
+			TAILQ_REMOVE(&src_dfs->dfs_precac_list,
+				     tmp_precac_entry,
+				     pe_list);
+			tmp_precac_entry->dfs = dest_dfs;
+			TAILQ_INSERT_TAIL(&dest_dfs->dfs_precac_list,
+					  tmp_precac_entry,
+					  pe_list);
+		}
+	}
+	PRECAC_LIST_UNLOCK(src_dfs);
+	PRECAC_LIST_UNLOCK(dest_dfs);
+}