diff --git a/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 7539c0f0dc..281bfe44c0 100644 --- a/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -1309,6 +1309,7 @@ struct policy_mgr_hdd_cbacks { enum QDF_OPMODE (*hdd_get_device_mode)(uint32_t session_id); bool (*hdd_wapi_security_sta_exist)(void); bool (*hdd_is_chan_switch_in_progress)(void); + bool (*hdd_is_cac_in_progress)(void); void (*wlan_hdd_set_sap_csa_reason)(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, uint8_t reason); }; diff --git a/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index e565fde9a7..8ac96d092f 100644 --- a/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -165,6 +165,17 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_E_FAILURE; } + /* Don't send WMI_PDEV_SET_HW_MODE_CMDID to FW if existing SAP / GO is + * in CAC-in-progress state. Host is blocking this command as FW is + * having design limitation and FW don't expect this command when CAC + * is in progress state. + */ + if (pm_ctx->hdd_cbacks.hdd_is_cac_in_progress && + pm_ctx->hdd_cbacks.hdd_is_cac_in_progress()) { + policy_mgr_err("SAP CAC_IN_PROGRESS state, drop WMI_PDEV_SET_HW_MODE_CMDID"); + return QDF_STATUS_E_FAILURE; + } + msg.hw_mode_index = hw_mode_index; msg.set_hw_mode_cb = (void *)policy_mgr_pdev_set_hw_mode_cb; msg.reason = reason; diff --git a/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 01381216e5..29cfeaa8b8 100644 --- a/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -1464,6 +1464,7 @@ void pm_dbs_opportunistic_timer_handler(void *data) uint32_t session_id; struct wlan_objmgr_psoc *psoc = (struct wlan_objmgr_psoc *)data; enum policy_mgr_conn_update_reason reason; + struct policy_mgr_psoc_priv_obj *pm_ctx = policy_mgr_get_context(psoc); if (!psoc) { policy_mgr_err("Invalid Context"); @@ -1473,8 +1474,14 @@ void pm_dbs_opportunistic_timer_handler(void *data) /* if we still need it */ action = policy_mgr_need_opportunistic_upgrade(psoc, &reason); policy_mgr_debug("action:%d", action); - if (!action) + if (!action) { return; + } else if (pm_ctx->hdd_cbacks.hdd_is_cac_in_progress && + pm_ctx->hdd_cbacks.hdd_is_cac_in_progress()) { + policy_mgr_debug("SAP is in CAC_IN_PROGRESS state, restarting"); + policy_mgr_restart_opportunistic_timer(psoc, false); + return; + } session_id = pm_get_vdev_id_of_first_conn_idx(psoc); policy_mgr_next_actions(psoc, session_id, action, reason); diff --git a/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c b/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c index 3ae16a9f40..6dbb5b37e2 100644 --- a/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c +++ b/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c @@ -610,6 +610,8 @@ QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc, hdd_cbacks->hdd_wapi_security_sta_exist; pm_ctx->hdd_cbacks.hdd_is_chan_switch_in_progress = hdd_cbacks->hdd_is_chan_switch_in_progress; + pm_ctx->hdd_cbacks.hdd_is_cac_in_progress = + hdd_cbacks->hdd_is_cac_in_progress; return QDF_STATUS_SUCCESS; } @@ -628,6 +630,8 @@ QDF_STATUS policy_mgr_deregister_hdd_cb(struct wlan_objmgr_psoc *psoc) pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart = NULL; pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev = NULL; pm_ctx->hdd_cbacks.hdd_get_device_mode = NULL; + pm_ctx->hdd_cbacks.hdd_is_chan_switch_in_progress = NULL; + pm_ctx->hdd_cbacks.hdd_is_cac_in_progress = NULL; return QDF_STATUS_SUCCESS; }