Ver Fonte

qcacmn: remove inact timer multiple initialization

Inactivity timer initialization is moved from dp
attach to soc attach as the timer is being
initialized multiple times in case of multiple
radios

Change-Id: I85d1d8710ccc7531c43ec82378c3ca0b65d26cf9
Stephan Raj Ignatious Durairaj há 7 anos atrás
pai
commit
e5dd51ce96
2 ficheiros alterados com 42 adições e 5 exclusões
  1. 2 0
      dp/wifi3.0/dp_internal.h
  2. 40 5
      dp/wifi3.0/dp_main.c

+ 2 - 0
dp/wifi3.0/dp_internal.h

@@ -398,6 +398,8 @@ bool dp_set_inact_params(struct cdp_pdev *pdev_handle,
 bool dp_start_inact_timer(struct cdp_pdev *pdev_handle, bool enable);
 void dp_set_overload(struct cdp_pdev *pdev_handle, bool overload);
 bool dp_peer_is_inact(void *peer_handle);
+void dp_init_inact_timer(struct dp_soc *soc);
+void dp_free_inact_timer(struct dp_soc *soc);
 
 #ifdef WDI_EVENT_ENABLE
 QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev,

+ 40 - 5
dp/wifi3.0/dp_main.c

@@ -2252,12 +2252,29 @@ static os_timer_func(dp_txrx_peer_find_inact_timeout_handler)
 		      soc->pdev_bs_inact_interval * 1000);
 }
 
+
+/**
+ * dp_free_inact_timer(): free inact timer
+ * @timer - inact timer handle
+ *
+ * Return: bool
+ */
+void dp_free_inact_timer(struct dp_soc *soc)
+{
+	qdf_timer_free(&soc->pdev_bs_inact_timer);
+}
 #else
 
 void dp_mark_peer_inact(void *peer, bool inactive)
 {
 	return;
 }
+
+void dp_free_inact_timer(struct dp_soc *soc)
+{
+	return;
+}
+
 #endif
 
 /*
@@ -2465,11 +2482,6 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
 				"dp_wdi_evet_attach failed\n");
 		goto fail1;
 	}
-#ifdef QCA_SUPPORT_SON
-	qdf_timer_init(soc->osdev, &soc->pdev_bs_inact_timer,
-		       dp_txrx_peer_find_inact_timeout_handler,
-		       (void *)soc, QDF_TIMER_TYPE_WAKE_APPS);
-#endif
 
 	/* set the reo destination during initialization */
 	pdev->reo_dest = pdev->pdev_id + 1;
@@ -2657,6 +2669,8 @@ static void dp_soc_detach_wifi3(void *txrx_soc)
 	/* Free pending htt stats messages */
 	qdf_nbuf_queue_free(&soc->htt_stats.msg);
 
+	dp_free_inact_timer(soc);
+
 	for (i = 0; i < MAX_PDEV_CNT; i++) {
 		if (soc->pdev_list[i])
 			dp_pdev_detach_wifi3(
@@ -3622,6 +3636,19 @@ bool dp_peer_is_inact(void *peer_handle)
 	return peer->peer_bs_inact_flag == 1;
 }
 
+/**
+ * dp_init_inact_timer: initialize the inact timer
+ * @soc - SOC handle
+ *
+ * Return: void
+ */
+void dp_init_inact_timer(struct dp_soc *soc)
+{
+	qdf_timer_init(soc->osdev, &soc->pdev_bs_inact_timer,
+		dp_txrx_peer_find_inact_timeout_handler,
+		(void *)soc, QDF_TIMER_TYPE_WAKE_APPS);
+}
+
 #else
 
 bool dp_set_inact_params(struct cdp_pdev *pdev, u_int16_t inact_check_interval,
@@ -3640,6 +3667,11 @@ void dp_set_overload(struct cdp_pdev *pdev, bool overload)
 	return;
 }
 
+void dp_init_inact_timer(struct dp_soc *soc)
+{
+	return;
+}
+
 bool dp_peer_is_inact(void *peer)
 {
 	return false;
@@ -6561,6 +6593,9 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
 	/* initialize work queue for stats processing */
 	qdf_create_work(0, &soc->htt_stats.work, htt_t2h_stats_handler, soc);
 
+	/*Initialize inactivity timer for wifison */
+	dp_init_inact_timer(soc);
+
 	return (void *)soc;
 
 fail2: