From bf6e36876e7d6c3bb9c85d9b02f37c12b2ce6189 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Tue, 2 Apr 2019 06:44:54 -0400 Subject: [PATCH] qcacld-3.0: Move second DFS AP to CAC wait If the first DFS AP is in CAC progress and second AP starts on DFS chan, move the second AP to CAC wait state as well. Otherwise, when CAC end, the second AP will always stay in "WLAN_VDEV_S_START" state and can not handle CAC end event. Change-Id: I440ce3339dd2afb62bdb574f2f785d733a980933 CRs-Fixed: 2426714 --- core/sap/src/sap_fsm.c | 50 ++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index a6798c5d55..6ea16fe7eb 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2270,6 +2270,30 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx, return qdf_status; } +#ifdef CONFIG_VDEV_SM +/** + * sap_move_to_cac_wait_state() - move to cac wait state + * @sap_ctx: SAP context + * + * Return: QDF_STATUS + */ +static QDF_STATUS sap_move_to_cac_wait_state(struct sap_context *sap_ctx) +{ + QDF_STATUS status; + + status = + wlan_vdev_mlme_sm_deliver_evt(sap_ctx->vdev, + WLAN_VDEV_SM_EV_DFS_CAC_WAIT, + 0, NULL); + return status; +} +#else +static inline QDF_STATUS sap_move_to_cac_wait_state(struct sap_context *sap_ctx) +{ + return QDF_STATUS_SUCCESS; +} +#endif + /** * sap_fsm_cac_start() - start cac wait timer * @sap_ctx: SAP context @@ -2292,6 +2316,8 @@ static QDF_STATUS sap_fsm_cac_start(struct sap_context *sap_ctx, FL("sapdfs: starting dfs cac timer on sapctx[%pK]"), sap_ctx); sap_start_dfs_cac_timer(sap_ctx); + } else { + sap_move_to_cac_wait_state(sap_ctx); } return sap_cac_start_notify(mac_handle); @@ -3752,30 +3778,6 @@ static int sap_stop_dfs_cac_timer(struct sap_context *sap_ctx) return 0; } -#ifdef CONFIG_VDEV_SM -/** - * sap_move_to_cac_wait_state() - move to cac wait state - * @sap_ctx: SAP context - * - * Return: QDF_STATUS - */ -static QDF_STATUS sap_move_to_cac_wait_state(struct sap_context *sap_ctx) -{ - QDF_STATUS status; - - status = - wlan_vdev_mlme_sm_deliver_evt(sap_ctx->vdev, - WLAN_VDEV_SM_EV_DFS_CAC_WAIT, - 0, NULL); - return status; -} -#else -static inline QDF_STATUS sap_move_to_cac_wait_state(struct sap_context *sap_ctx) -{ - return QDF_STATUS_SUCCESS; -} -#endif - /* * Function to start the DFS CAC Timer * when SAP is started on a DFS channel