qcacld-3.0: Don't touch CAC timer which is not created for offloaded CAC

CAC timer is only created for non-offloaded CAC case, but in some
cleanup functions, CAC timer is stopped/destroyed without checking CAC
offload flag.

Change-Id: If8422afac2389e134769a762aa87cb7969eef9ec
CRs-Fixed: 2807650
This commit is contained in:
Will Huang 2020-10-29 11:36:28 +08:00 • committed by snandini
commit a546fb7dd2
2 changed files with 13 additions and 15 deletions

View file

@ -1039,13 +1039,14 @@ sap_find_valid_concurrent_session(mac_handle_t mac_handle)
return NULL;
}
static QDF_STATUS sap_clear_global_dfs_param(mac_handle_t mac_handle)
static QDF_STATUS sap_clear_global_dfs_param(mac_handle_t mac_handle,
struct sap_context *sap_ctx)
{
struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
struct sap_context *sap_ctx;
struct sap_context *con_sap_ctx;
sap_ctx = sap_find_valid_concurrent_session(mac_handle);
if (sap_ctx && WLAN_REG_IS_5GHZ_CH_FREQ(sap_ctx->chan_freq)) {
con_sap_ctx = sap_find_valid_concurrent_session(mac_handle);
if (con_sap_ctx && WLAN_REG_IS_5GHZ_CH_FREQ(con_sap_ctx->chan_freq)) {
sap_debug("conc session exists, no need to clear dfs struct");
return QDF_STATUS_SUCCESS;
}
@ -1055,12 +1056,7 @@ static QDF_STATUS sap_clear_global_dfs_param(mac_handle_t mac_handle)
* immediately once the radar detected or timedout. So
* as per design CAC timer should be destroyed after stop
*/
if (mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running) {
qdf_mc_timer_stop(&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
mac_ctx->sap.SapDfsInfo.is_dfs_cac_timer_running = 0;
qdf_mc_timer_destroy(
&mac_ctx->sap.SapDfsInfo.sap_dfs_cac_timer);
}
wlansap_cleanup_cac_timer(sap_ctx);
mac_ctx->sap.SapDfsInfo.cac_state = eSAP_DFS_DO_NOT_SKIP_CAC;
sap_cac_reset_notify(mac_handle);
@ -1144,7 +1140,7 @@ QDF_STATUS sap_clear_session_param(mac_handle_t mac_handle,
mac_ctx->sap.sapCtxList[sapctx->sessionId].sap_context = NULL;
mac_ctx->sap.sapCtxList[sapctx->sessionId].sapPersona =
QDF_MAX_NO_OF_MODE;
sap_clear_global_dfs_param(mac_handle);
sap_clear_global_dfs_param(mac_handle, sapctx);
sap_free_roam_profile(&sapctx->csr_roamProfile);
sap_err("Set sapCtxList null for session %d", sapctx->sessionId);
qdf_mem_zero(sapctx, sizeof(*sapctx));

View file

@ -2563,11 +2563,13 @@ void wlansap_cleanup_cac_timer(struct sap_context *sap_ctx)
}
if (mac->sap.SapDfsInfo.is_dfs_cac_timer_running) {
qdf_mc_timer_stop(&mac->sap.SapDfsInfo.
sap_dfs_cac_timer);
mac->sap.SapDfsInfo.is_dfs_cac_timer_running = 0;
qdf_mc_timer_destroy(
&mac->sap.SapDfsInfo.sap_dfs_cac_timer);
if (!sap_ctx->dfs_cac_offload) {
qdf_mc_timer_stop(
&mac->sap.SapDfsInfo.sap_dfs_cac_timer);
qdf_mc_timer_destroy(
&mac->sap.SapDfsInfo.sap_dfs_cac_timer);
}
sap_err("sapdfs, force cleanup running dfs cac timer");
}
}