Jelajahi Sumber

qcacld-3.0: Stop TDLS timer when PDR triggered

Host is not stopping the TDLS timers when PDR is triggered.
These timers are expiring during wlan shut down and leading to
crash.

Fix is to stop TDLS timers while resetting adapters.

CRs-Fixed: 2050795
Change-Id: I944081342ff2de2548ff839a7b852d64282c0323
Ganesh Kondabattini 8 tahun lalu
induk
melakukan
9e4fbbbe57

+ 1 - 0
core/hdd/inc/wlan_hdd_tdls.h

@@ -890,4 +890,5 @@ static inline void hdd_wlan_block_scan_by_tdls_event(void) {}
 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
 bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode);
 void cds_set_tdls_ct_mode(hdd_context_t *hdd_ctx);
+void wlan_hdd_tdls_timers_stop(tdlsCtx_t *hdd_tdls_ctx);
 #endif /* __HDD_TDLS_H */

+ 10 - 0
core/hdd/src/wlan_hdd_main.c

@@ -4155,6 +4155,7 @@ QDF_STATUS hdd_reset_all_adapters(hdd_context_t *hdd_ctx)
 	hdd_adapter_t *adapter;
 	hdd_station_ctx_t *pHddStaCtx;
 	struct qdf_mac_addr peerMacAddr;
+	tdlsCtx_t *tdls_ctx;
 
 	ENTER();
 
@@ -4166,6 +4167,15 @@ QDF_STATUS hdd_reset_all_adapters(hdd_context_t *hdd_ctx)
 		adapter = adapterNode->pAdapter;
 		hdd_notice("Disabling queues for adapter type: %d",
 			   adapter->device_mode);
+
+		if ((adapter->device_mode == QDF_STA_MODE) ||
+			(adapter->device_mode == QDF_P2P_CLIENT_MODE)) {
+			/* Stop tdls timers */
+			tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(adapter);
+			if (tdls_ctx)
+				wlan_hdd_tdls_timers_stop(tdls_ctx);
+		}
+
 		if (hdd_ctx->config->sap_internal_restart &&
 		    adapter->device_mode == QDF_SAP_MODE) {
 			wlan_hdd_netif_queue_control(adapter,

+ 1 - 1
core/hdd/src/wlan_hdd_tdls.c

@@ -611,7 +611,7 @@ static void wlan_hdd_tdls_ct_timers_stop(tdlsCtx_t *hdd_tdls_ctx)
  *
  * Return: none
  */
-static void wlan_hdd_tdls_timers_stop(tdlsCtx_t *hdd_tdls_ctx)
+void wlan_hdd_tdls_timers_stop(tdlsCtx_t *hdd_tdls_ctx)
 {
 	wlan_hdd_tdls_monitor_timers_stop(hdd_tdls_ctx);
 	wlan_hdd_tdls_ct_timers_stop(hdd_tdls_ctx);