Преглед изворни кода

qcacmn: Use frequency ranges for copying NOL after mode switch

Current NOL conversion for dynamic mode switch is in such a way
that the NOL data is copied to the pdev ID entry for the targeted
mode. That is, the NOL data is split/merged before mode switch and
copied to a temporary structure before mode switch command is
sent to FW.
At this point, the target pdev's frequency range are still the old
values because of which, certain entries of the NOL data are missed.
Also in case of FW failures, the NOL entry cannot be added back
because they have been merged/split already.

To avoid the above, rearchitecture deinit and reinit NOL for
mode switch in such a way that the NOL data, as-it-is, is copied
before mode switch and is only split/merged after the frequency range
of the pdevs are properly mapped and the FW response is a success.

Change-Id: I4a073d1327ba182c40ced6089aa46d8f5f241d33
CRs-Fixed: 2632582
Vignesh Mohan пре 5 година
родитељ
комит
1d4f7736d3

+ 7 - 7
umac/dfs/core/src/dfs.h

@@ -2773,28 +2773,28 @@ void dfs_deinit_tmp_psoc_nol(struct wlan_dfs *dfs);
  * dfs_save_dfs_nol_in_psoc() - Save NOL data of given pdev.
  * @dfs: Pointer to wlan_dfs object.
  * @pdev_id: The pdev ID which will have the NOL data.
- * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id.
- * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id.
  *
  * Based on the frequency of the NOL channel, copy it to the target pdev_id
  * structure in psoc.
  *
  * Return: void.
  */
-void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs,
-			      uint8_t pdev_id,
-			      uint16_t low_5ghz_freq,
-			      uint16_t high_5ghz_freq);
+void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs, uint8_t pdev_id);
 
 /**
  * dfs_reinit_nol_from_psoc_copy() - Reinit saved NOL data to corresponding
  * DFS object.
  * @dfs: Pointer to wlan_dfs object.
  * @pdev_id: pdev_id of the given dfs object.
+ * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id.
+ * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id.
  *
  * Return: void.
  */
-void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, uint8_t pdev_id);
+void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs,
+				   uint8_t pdev_id,
+				   uint16_t low_5ghz_freq,
+				   uint16_t high_5ghz_freq);
 
 /**
  * dfs_is_hw_mode_switch_in_progress() - Check if HW mode switch in progress.

+ 36 - 33
umac/dfs/core/src/misc/dfs_nol.c

@@ -929,14 +929,11 @@ void dfs_deinit_tmp_psoc_nol(struct wlan_dfs *dfs)
 }
 
 void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs,
-			      uint8_t pdev_id,
-			      uint16_t low_5ghz_freq,
-			      uint16_t high_5ghz_freq)
+			      uint8_t pdev_id)
 {
 	struct dfs_soc_priv_obj *dfs_soc_obj = dfs->dfs_soc_obj;
 	struct dfsreq_nolinfo tmp_nolinfo, *nolinfo;
 	uint32_t i, num_chans = 0;
-	uint16_t tmp_freq;
 
 	if (!dfs->dfs_nol_count)
 		return;
@@ -951,32 +948,30 @@ void dfs_save_dfs_nol_in_psoc(struct wlan_dfs *dfs,
 	/* nolinfo might already have some data. Do not overwrite it */
 	num_chans = nolinfo->dfs_ch_nchans;
 	for (i = 0; i < tmp_nolinfo.dfs_ch_nchans; i++) {
-		tmp_freq = tmp_nolinfo.dfs_nol[i].nol_freq;
-
-		/* Add to nolinfo only if within the pdev's frequency range. */
-		if ((low_5ghz_freq < tmp_freq) && (high_5ghz_freq > tmp_freq)) {
-			/* Figure out the completed duration of each NOL. */
-			uint32_t nol_completed_ms =
-				qdf_system_ticks_to_msecs(qdf_system_ticks() -
-				tmp_nolinfo.dfs_nol[i].nol_start_ticks);
-
-			nolinfo->dfs_nol[num_chans] = tmp_nolinfo.dfs_nol[i];
-			/* Remember the remaining NOL time in the timeout
-			 * variable.
-			 */
-			nolinfo->dfs_nol[num_chans++].nol_timeout_ms -=
-				nol_completed_ms;
-		}
+		/* Figure out the completed duration of each NOL. */
+		uint32_t nol_completed_ms =
+			qdf_system_ticks_to_msecs(qdf_system_ticks() -
+					tmp_nolinfo.dfs_nol[i].nol_start_ticks);
+
+		nolinfo->dfs_nol[num_chans] = tmp_nolinfo.dfs_nol[i];
+		/* Remember the remaining NOL time in the timeout
+		 * variable.
+		 */
+		nolinfo->dfs_nol[num_chans++].nol_timeout_ms -=
+			nol_completed_ms;
 	}
 
 	nolinfo->dfs_ch_nchans = num_chans;
 }
 
-void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, uint8_t pdev_id)
+void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs,
+				   uint8_t pdev_id,
+				   uint16_t low_5ghz_freq,
+				   uint16_t high_5ghz_freq)
 {
 	struct dfs_soc_priv_obj *dfs_soc_obj = dfs->dfs_soc_obj;
-	struct dfsreq_nolinfo *nol;
-	uint8_t i;
+	struct dfsreq_nolinfo *nol, req_nol;
+	uint8_t i, j = 0;
 
 	if (!dfs_soc_obj->dfs_psoc_nolinfo)
 		return;
@@ -986,14 +981,22 @@ void dfs_reinit_nol_from_psoc_copy(struct wlan_dfs *dfs, uint8_t pdev_id)
 
 	nol = &dfs_soc_obj->dfs_psoc_nolinfo[pdev_id];
 
-	/* The NOL timeout value in each entry points to the remaining time
-	 * of the NOL. This is to indicate that the NOL entries are paused
-	 * and are not left to continue.
-	 * While adding these NOL, update the start ticks to current time
-	 * to avoid losing entries which might have timed out during
-	 * the pause and resume mechanism.
-	 */
-	for (i = 0; i < nol->dfs_ch_nchans; i++)
-		nol->dfs_nol[i].nol_start_ticks = qdf_system_ticks();
-	dfs_set_nol(dfs, nol->dfs_nol, nol->dfs_ch_nchans);
+	for (i = 0; i < nol->dfs_ch_nchans; i++) {
+		uint16_t tmp_freq = nol->dfs_nol[i].nol_freq;
+
+		/* Add to nol only if within the tgt pdev's frequency range. */
+		if ((low_5ghz_freq < tmp_freq) && (high_5ghz_freq > tmp_freq)) {
+			/* The NOL timeout value in each entry points to the
+			 * remaining time of the NOL. This is to indicate that
+			 * the NOL entries are paused and are not left to
+			 * continue.
+			 * While adding these NOL, update the start ticks to
+			 * current time to avoid losing entries which might
+			 * have timed out during the pause and resume mechanism.
+			 */
+			nol->dfs_nol[i].nol_start_ticks = qdf_system_ticks();
+			req_nol.dfs_nol[j++] = nol->dfs_nol[i];
+		}
+	}
+	dfs_set_nol(dfs, req_nol.dfs_nol, j);
 }

+ 6 - 6
umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h

@@ -627,8 +627,6 @@ void tgt_dfs_deinit_tmp_psoc_nol(struct wlan_objmgr_pdev *pdev);
  * tgt_dfs_save_dfs_nol_in_psoc() - Save NOL data of given pdev.
  * @pdev: Pointer to pdev object.
  * @pdev_id: The pdev ID which will have the NOL data.
- * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id.
- * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id.
  *
  * Based on the frequency of the NOL channel, copy it to the target pdev_id
  * structure in psoc.
@@ -636,20 +634,22 @@ void tgt_dfs_deinit_tmp_psoc_nol(struct wlan_objmgr_pdev *pdev);
  * Return: void.
  */
 void tgt_dfs_save_dfs_nol_in_psoc(struct wlan_objmgr_pdev *pdev,
-				  uint8_t pdev_id,
-				  uint16_t low_5ghz_freq,
-				  uint16_t high_5ghz_freq);
+				  uint8_t pdev_id);
 
 /**
  * tgt_dfs_reinit_nol_from_psoc_copy() - Reinit saved NOL data to corresponding
  * pdevs.
  * @pdev: Pointer to pdev object.
  * @pdev_id: pdev_id of the given pdev.
+ * @low_5ghz_freq: The low 5GHz frequency value of the target pdev id.
+ * @high_5ghz_freq: The high 5GHz frequency value of the target pdev id.
  *
  * Return: void.
  */
 void tgt_dfs_reinit_nol_from_psoc_copy(struct wlan_objmgr_pdev *pdev,
-				       uint8_t pdev_id);
+				       uint8_t pdev_id,
+				       uint16_t low_5ghz_freq,
+				       uint16_t high_5ghz_freq);
 
 /**
  * tgt_dfs_reinit_precac_lists() - Reinit preCAC lists.

+ 9 - 6
umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c

@@ -977,9 +977,7 @@ void tgt_dfs_deinit_tmp_psoc_nol(struct wlan_objmgr_pdev *pdev)
 qdf_export_symbol(tgt_dfs_deinit_tmp_psoc_nol);
 
 void tgt_dfs_save_dfs_nol_in_psoc(struct wlan_objmgr_pdev *pdev,
-				  uint8_t pdev_id,
-				  uint16_t low_5ghz_freq,
-				  uint16_t high_5ghz_freq)
+				  uint8_t pdev_id)
 {
 	struct wlan_dfs *dfs;
 
@@ -989,13 +987,15 @@ void tgt_dfs_save_dfs_nol_in_psoc(struct wlan_objmgr_pdev *pdev,
 		return;
 	}
 
-	dfs_save_dfs_nol_in_psoc(dfs, pdev_id, low_5ghz_freq, high_5ghz_freq);
+	dfs_save_dfs_nol_in_psoc(dfs, pdev_id);
 }
 
 qdf_export_symbol(tgt_dfs_save_dfs_nol_in_psoc);
 
 void tgt_dfs_reinit_nol_from_psoc_copy(struct wlan_objmgr_pdev *pdev,
-				       uint8_t pdev_id)
+				       uint8_t pdev_id,
+				       uint16_t low_5ghz_freq,
+				       uint16_t high_5ghz_freq)
 {
 	struct wlan_dfs *dfs;
 
@@ -1005,7 +1005,10 @@ void tgt_dfs_reinit_nol_from_psoc_copy(struct wlan_objmgr_pdev *pdev,
 		return;
 	}
 
-	dfs_reinit_nol_from_psoc_copy(dfs, pdev_id);
+	dfs_reinit_nol_from_psoc_copy(dfs,
+				      pdev_id,
+				      low_5ghz_freq,
+				      high_5ghz_freq);
 }
 
 qdf_export_symbol(tgt_dfs_reinit_nol_from_psoc_copy);

+ 4 - 4
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -1592,11 +1592,11 @@ struct wlan_lmac_if_dfs_rx_ops {
 				      uint8_t num_radios);
 	void (*dfs_deinit_tmp_psoc_nol)(struct wlan_objmgr_pdev *pdev);
 	void (*dfs_save_dfs_nol_in_psoc)(struct wlan_objmgr_pdev *pdev,
-					 uint8_t pdev_id,
-					 uint16_t low_5ghz_freq,
-					 uint16_t high_5ghz_freq);
+					 uint8_t pdev_id);
 	void (*dfs_reinit_nol_from_psoc_copy)(struct wlan_objmgr_pdev *pdev,
-					      uint8_t pdev_id);
+					      uint8_t pdev_id,
+					      uint16_t low_5ghz_freq,
+					      uint16_t high_5ghz_freq);
 	void (*dfs_reinit_precac_lists)(struct wlan_objmgr_pdev *src_pdev,
 					struct wlan_objmgr_pdev *dest_pdev,
 					uint16_t low_5g_freq,