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
This commit is contained in:
Liangwei Dong
2020-01-13 17:12:48 +08:00
committed by nshrivas
parent ffc0b8ea67
commit f9a0512cae

View File

@@ -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)) {