diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9807393bc68e..157defa6d0eb 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/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) { diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index c3eb015cc873..e6cd4932b965 100644 --- a/core/sap/inc/sap_api.h +++ b/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 diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 55d2e24fd68a..2c810ea32cab 100644 --- a/core/sap/src/sap_module.c +++ b/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")); + } +}