Răsfoiți Sursa

qcacld-3.0: Cleanup DFS CAC timer when SSR and reset all adapters

In SAP and SSR case, it won't cleanup DFS CAC timer until up layer
kill hostapd. It will call wlansap close when hostapd exit. If
enable sap internal restart in this case, it will double init DFS CAC
timer, which cause abnormal in kernel. Solution is cleanup DFS CAC
timer when reset all adapters.

Change-Id: I96962349af548074e226976c8c01cd5a8710ed3f
CRs-fixed: 2075904
Wu Gao 7 ani în urmă
părinte
comite
3545e64d4a
3 a modificat fișierele cu 44 adăugiri și 5 ștergeri
  1. 9 5
      core/hdd/src/wlan_hdd_main.c
  2. 12 0
      core/sap/inc/sap_api.h
  3. 23 0
      core/sap/src/sap_module.c

+ 9 - 5
core/hdd/src/wlan_hdd_main.c

@@ -4316,14 +4316,18 @@ QDF_STATUS hdd_reset_all_adapters(hdd_context_t *hdd_ctx)
 			clear_bit(WMM_INIT_DONE, &adapter->event_flags);
 		}
 
-		/*
-		 * If adapter is SAP, set session ID to invalid since SAP
-		 * session will be cleanup during SSR.
-		 */
-		if (adapter->device_mode == QDF_SAP_MODE)
+		if (adapter->device_mode == QDF_SAP_MODE) {
+			/*
+			 * If adapter is SAP, set session ID to invalid
+			 * since SAP session will be cleanup during SSR.
+			 */
 			wlansap_set_invalid_session(
 				WLAN_HDD_GET_SAP_CTX_PTR(adapter));
 
+			wlansap_cleanup_cac_timer(
+				WLAN_HDD_GET_SAP_CTX_PTR(adapter));
+		}
+
 		/* Delete peers if any for STA and P2P client modes */
 		if (adapter->device_mode == QDF_STA_MODE ||
 		    adapter->device_mode == QDF_P2P_CLIENT_MODE) {

+ 12 - 0
core/sap/inc/sap_api.h

@@ -1055,6 +1055,18 @@ QDF_STATUS wlansap_set_invalid_session(void *cds_ctx);
  * Return: None
  */
 void sap_dfs_set_current_channel(void *sap_ctx);
+
+/**
+ * wlansap_cleanup_cac_timer() - Force cleanup DFS CAC timer
+ * @sap_ctx: sap context
+ *
+ * Force cleanup DFS CAC timer when reset all adapters. It will not
+ * check concurrency SAP since just called when reset all adapters.
+ *
+ * Return: None
+ */
+void wlansap_cleanup_cac_timer(void *sap_ctx);
+
 #ifdef __cplusplus
 }
 #endif

+ 23 - 0
core/sap/src/sap_module.c

@@ -3745,3 +3745,26 @@ wlansap_set_invalid_session(void *cds_ctx)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+void wlansap_cleanup_cac_timer(void *sap_ctx)
+{
+	tHalHandle hal;
+	ptSapContext psap_ctx;
+	tpAniSirGlobal pmac;
+
+	if (!sap_ctx)
+		return;
+
+	psap_ctx = CDS_GET_SAP_CB(sap_ctx);
+	hal = CDS_GET_HAL_CB(psap_ctx->p_cds_gctx);
+	pmac = PMAC_STRUCT(hal);
+	if (pmac->sap.SapDfsInfo.is_dfs_cac_timer_running) {
+		qdf_mc_timer_stop(&pmac->sap.SapDfsInfo.
+				  sap_dfs_cac_timer);
+		pmac->sap.SapDfsInfo.is_dfs_cac_timer_running = 0;
+		qdf_mc_timer_destroy(
+			&pmac->sap.SapDfsInfo.sap_dfs_cac_timer);
+		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+			FL("sapdfs, force cleanup running dfs cac timer"));
+	}
+}