From fe10dd1441e8bdf7358e506ff2babb29c6cdfa1d Mon Sep 17 00:00:00 2001 From: bings Date: Wed, 21 Mar 2018 17:21:40 +0800 Subject: [PATCH] qcacld-3.0: Do not switch channel when target channel is 0 When all the configured channel are in NOL list, the target channel will be set as 0 and sap will be stopped. Currently a workqueue is created to stop sap, so channel switch may still happens if it is called before this workqueue is executed. Switch channel should be not happened when target channel is 0. Change-Id: I368830bddcd9363826f6f2c8898b86ece8dd7d89 CRs-Fixed: 2203899 --- core/sap/src/sap_fsm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index c45511d4e00e..5ba1584ba2bf 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2365,6 +2365,11 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx, wlan_reg_set_channel_params(mac_ctx->pdev, mac_ctx->sap.SapDfsInfo.target_channel, 0, &sap_ctx->ch_params); + } else { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, + FL("Invalid target channel %d"), + mac_ctx->sap.SapDfsInfo.target_channel); + return qdf_status; } for (intf = 0; intf < SAP_MAX_NUM_SESSION; intf++) { @@ -2584,6 +2589,13 @@ static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx, qdf_status = sap_goto_disconnecting(sap_ctx); } else if (eSAP_DFS_CHNL_SWITCH_ANNOUNCEMENT_START == msg) { uint8_t intf; + if (!mac_ctx->sap.SapDfsInfo.target_channel) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, + FL("Invalid target channel %d"), + mac_ctx->sap.SapDfsInfo.target_channel); + return qdf_status; + } + /* * Radar is seen on the current operating channel * send CSA IE for all associated stations