From f9a0512cae4cdb9a3644ac4a38d1d53ca23cff9a Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 13 Jan 2020 17:12:48 +0800 Subject: [PATCH] qcacld-3.0: Check SBS supported or not before set hw mode If the request is SBS action and the HW doesn't support SBS, return QDF_STATUS_E_NOSUPPORT. The caller will continue to connect/start_ap instead of failure when policy_mgr_current_connections_update return QDF_STATUS_E_NOSUPPORT. Change-Id: I158f90c13e2685697b82c874a247883f21f013cb CRs-Fixed: 2602194 --- .../policy_mgr/src/wlan_policy_mgr_action.c | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index 3afcd60dcf42..8f892fe7edac 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1004,6 +1004,31 @@ policy_mgr_validate_dbs_switch(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +/** + * policy_mgr_validate_unsupported_action() - unsupported action validation + * @psoc: psoc object + * @action: action type + * + * The help function checks the Action supported by HW or not. + * + * Return: QDF_STATUS_SUCCESS if supported by HW, otherwise + * return QDF_STATUS_E_NOSUPPORT + */ +static QDF_STATUS policy_mgr_validate_unsupported_action + (struct wlan_objmgr_psoc *psoc, + enum policy_mgr_conc_next_action action) +{ + if (action == PM_SBS || action == PM_SBS_DOWNGRADE) { + if (!policy_mgr_is_hw_sbs_capable(psoc)) { + /* No action */ + policy_mgr_notice("firmware is not sbs capable"); + return QDF_STATUS_E_NOSUPPORT; + } + } + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_next_actions( struct wlan_objmgr_psoc *psoc, uint32_t session_id, @@ -1019,7 +1044,9 @@ QDF_STATUS policy_mgr_next_actions( policy_mgr_err("driver isn't dbs capable, no further action needed"); return QDF_STATUS_E_NOSUPPORT; } - + status = policy_mgr_validate_unsupported_action(psoc, action); + if (!QDF_IS_STATUS_SUCCESS(status)) + return status; /* check for the current HW index to see if really need any action */ status = policy_mgr_get_current_hw_mode(psoc, &hw_mode); if (!QDF_IS_STATUS_SUCCESS(status)) {