Răsfoiți Sursa

qcacmn: Add ucfg API to reset im stats and freq ctrl params

When dcs happened for three times in five minutes, then do
restart(start/stop) SAP operation, when SAP is started again,
dcs may happen again quickly, if total four times dcs happened
in five minutes, dcs_disable_timer will be started due to dcs
happened frequency control policy, it will disable wlan
interference detection for 30 minutes and dcs interference
detection won't work for 30 minutes, it's unreasonable. After
SAP restart, dcs happened times should be calculated from zero.

Add ucfg API to reset im stats and freq ctrl params.

Change-Id: I4ad8234349d24f044dff700d90e1bec859eaa397
CRs-Fixed: 2739299
hqu 5 ani în urmă
părinte
comite
f2067eb53f

+ 24 - 7
umac/dcs/core/src/wlan_dcs.c

@@ -126,13 +126,6 @@ QDF_STATUS wlan_dcs_cmd_send(struct wlan_objmgr_psoc *psoc,
 	dcs_tx_ops = target_if_dcs_get_tx_ops(psoc);
 
 	if (dcs_tx_ops->dcs_cmd_send) {
-		if (dcs_enable & CAP_DCS_WLANIM) {
-			qdf_timer_stop(&dcs_pdev_priv->dcs_disable_timer);
-			qdf_mem_set(&dcs_pdev_priv->dcs_im_stats,
-				    sizeof(dcs_pdev_priv->dcs_im_stats), 0);
-			dcs_pdev_priv->dcs_freq_ctrl_params.
-						disable_delay_process = false;
-		}
 		dcs_info("dcs_enable: %u, pdev_id: %u", dcs_enable, pdev_id);
 		return dcs_tx_ops->dcs_cmd_send(psoc,
 						pdev_id,
@@ -733,3 +726,27 @@ wlan_dcs_process(struct wlan_objmgr_psoc *psoc, struct dcs_stats_event *event)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+void wlan_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id)
+{
+	struct dcs_pdev_priv_obj *dcs_pdev_priv;
+
+	if (!psoc) {
+		dcs_err("psoc is null");
+		return;
+	}
+
+	dcs_pdev_priv = wlan_dcs_get_pdev_private_obj(psoc, pdev_id);
+	if (!dcs_pdev_priv) {
+		dcs_err("dcs pdev private object is null");
+		return;
+	}
+
+	qdf_timer_stop(&dcs_pdev_priv->dcs_disable_timer);
+	qdf_mem_set(&dcs_pdev_priv->dcs_im_stats,
+		    sizeof(dcs_pdev_priv->dcs_im_stats), 0);
+	qdf_mem_set(dcs_pdev_priv->dcs_freq_ctrl_params.timestamp,
+		    MAX_DCS_TIME_RECORD * sizeof(unsigned long), 0);
+	dcs_pdev_priv->dcs_freq_ctrl_params.dcs_happened_count = 0;
+	dcs_pdev_priv->dcs_freq_ctrl_params.disable_delay_process = false;
+}

+ 11 - 0
umac/dcs/core/src/wlan_dcs.h

@@ -226,4 +226,15 @@ QDF_STATUS wlan_dcs_process(struct wlan_objmgr_psoc *psoc,
  */
 void wlan_dcs_disable_timer_fn(void *dcs_timer_args);
 
+/**
+ * wlan_dcs_clear() - clear dcs information
+ * @psoc: psoc pointer
+ * @pdev_id: pdev_id
+ *
+ * The function gets called to clear dcs information such as dcs
+ * frequency control parameters and stop dcs disable timer
+ *
+ * Return: None
+ */
+void wlan_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id);
 #endif  /* _WLAN_DCS_H_ */

+ 10 - 0
umac/dcs/dispatcher/inc/wlan_dcs_ucfg_api.h

@@ -117,4 +117,14 @@ void ucfg_config_dcs_disable(struct wlan_objmgr_psoc *psoc,
  */
 uint8_t ucfg_get_dcs_enable(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id);
 
+/**
+ * ucfg_dcs_clear() - API to clear dcs related information
+ * @psoc: pointer to psoc object
+ * @pdev_id: pdev id
+ *
+ * This function gets called to clear dcs related information
+ *
+ * Return: None
+ */
+void ucfg_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id);
 #endif /* _WLAN_DCS_UCFG_API_H_ */

+ 5 - 0
umac/dcs/dispatcher/src/wlan_dcs_ucfg_api.c

@@ -91,3 +91,8 @@ uint8_t ucfg_get_dcs_enable(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id)
 
 	return dcs_pdev_priv->dcs_host_params.dcs_enable;
 }
+
+void ucfg_dcs_clear(struct wlan_objmgr_psoc *psoc, uint32_t pdev_id)
+{
+	wlan_dcs_clear(psoc, pdev_id);
+}