qcacld-3.0: Add FW capability check for sap and go d3 wow

Add WMI service FW capability check before enabling D0 and D3
WoW for SAP and GO clients connected mode.

Change-Id: I878e4ee33807804e049bf1e8b8078d28fc1d4834
CRs-Fixed: 2869072
This commit is contained in:
Rajeev Kumar
2021-01-31 18:30:17 -08:00
committed by snandini
parent 6c5b2f62c0
commit 2906b33aa3
3 changed files with 88 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -271,6 +271,26 @@ QDF_STATUS pmo_register_is_device_in_low_pwr_mode(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
pmo_unregister_is_device_in_low_pwr_mode(struct wlan_objmgr_psoc *psoc);
/**
* wlan_pmo_get_sap_mode_bus_suspend(): API to get SAP bus suspend config
* @psoc: objmgr psoc handle
*
* Return true in case of peer connected SAP bus suspend is allowed
* else return false
*/
bool
wlan_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
/**
* wlan_pmo_get_go_mode_bus_suspend(): API to get GO bus suspend config
* @psoc: objmgr psoc handle
*
* Return true in case of peer connected GO bus suspend is allowed
* else return false
*/
bool
wlan_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
#else /* WLAN_POWER_MANAGEMENT_OFFLOAD */
static inline QDF_STATUS pmo_init(void)
@@ -422,6 +442,18 @@ pmo_unregister_get_beacon_interval_callback(struct wlan_objmgr_psoc *psoc)
return QDF_STATUS_SUCCESS;
}
static inline bool
wlan_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline bool
wlan_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
#endif /* end of _WLAN_PMO_OBJ_MGMT_API_H_ */

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -842,3 +842,25 @@ pmo_unregister_get_beacon_interval_callback(struct wlan_objmgr_psoc *psoc)
return QDF_STATUS_SUCCESS;
}
bool
wlan_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
{
struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
if (!pmo_psoc_ctx)
return false;
return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_sap_mode;
}
bool
wlan_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
{
struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
if (!pmo_psoc_ctx)
return false;
return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_go_mode;
}

View File

@@ -4812,11 +4812,15 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
/* handle wow for sap with 1 or more peer in same way */
if (wma_is_vdev_in_sap_mode(wma, add_sta->smesessionId)) {
bool is_bus_suspend_allowed_in_sap_mode =
ucfg_pmo_get_sap_mode_bus_suspend(wma->psoc);
wma_info("sap mode: disable runtime pm and bus suspend: %d",
is_bus_suspend_allowed_in_sap_mode);
if (!is_bus_suspend_allowed_in_sap_mode)
(wlan_pmo_get_sap_mode_bus_suspend(wma->psoc) &&
wmi_service_enabled(wma->wmi_handle,
wmi_service_sap_connected_d3_wow));
if (!is_bus_suspend_allowed_in_sap_mode) {
htc_vote_link_up(htc_handle);
wmi_info("sap d0 wow");
} else {
wmi_info("sap d3 wow");
}
wma_sap_prevent_runtime_pm(wma);
return;
@@ -4825,11 +4829,15 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
/* handle wow for p2pgo with 1 or more peer in same way */
if (wma_is_vdev_in_go_mode(wma, add_sta->smesessionId)) {
bool is_bus_suspend_allowed_in_go_mode =
ucfg_pmo_get_go_mode_bus_suspend(wma->psoc);
wma_info("p2pgo mode: disable runtime pm and bus suspend: %d",
is_bus_suspend_allowed_in_go_mode);
if (!is_bus_suspend_allowed_in_go_mode)
(wlan_pmo_get_go_mode_bus_suspend(wma->psoc) &&
wmi_service_enabled(wma->wmi_handle,
wmi_service_go_connected_d3_wow));
if (!is_bus_suspend_allowed_in_go_mode) {
htc_vote_link_up(htc_handle);
wmi_info("p2p go d0 wow");
} else {
wmi_info("p2p go d3 wow");
}
wma_sap_prevent_runtime_pm(wma);
return;
@@ -4901,11 +4909,15 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
if (wma_is_vdev_in_sap_mode(wma, del_sta->smesessionId)) {
bool is_bus_suspend_allowed_in_sap_mode =
ucfg_pmo_get_sap_mode_bus_suspend(wma->psoc);
wma_info("sap mode: allow runtime pm and bus suspend: %d",
is_bus_suspend_allowed_in_sap_mode);
if (!is_bus_suspend_allowed_in_sap_mode)
(wlan_pmo_get_sap_mode_bus_suspend(wma->psoc) &&
wmi_service_enabled(wma->wmi_handle,
wmi_service_sap_connected_d3_wow));
if (!is_bus_suspend_allowed_in_sap_mode) {
htc_vote_link_down(htc_handle);
wmi_info("sap d0 wow");
} else {
wmi_info("sap d3 wow");
}
wma_sap_allow_runtime_pm(wma);
return;
@@ -4913,11 +4925,15 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
if (wma_is_vdev_in_go_mode(wma, del_sta->smesessionId)) {
bool is_bus_suspend_allowed_in_go_mode =
ucfg_pmo_get_go_mode_bus_suspend(wma->psoc);
wma_info("p2pgo mode: allow runtime pm and bus suspend: %d",
is_bus_suspend_allowed_in_go_mode);
if (!is_bus_suspend_allowed_in_go_mode)
(wlan_pmo_get_go_mode_bus_suspend(wma->psoc) &&
wmi_service_enabled(wma->wmi_handle,
wmi_service_go_connected_d3_wow));
if (!is_bus_suspend_allowed_in_go_mode) {
htc_vote_link_down(htc_handle);
wmi_info("p2p go d0 wow");
} else {
wmi_info("p2p go d3 wow");
}
wma_sap_allow_runtime_pm(wma);
return;