qcacld-3.0: Add PMO config for PCIe bus suspend in beaconing mode

By default, PCIe bus suspend is not allowed in beaconing modes
(SAP/P2PGO/NDP) with one or more clients connected. Some OEMs need
PCIe bus suspend in this mode. Hence, add a config item to serve
both types of requests.

Change-Id: Ia2d990f17f605036d43db75ecd4df57701b4ba1f
CRs-Fixed: 2860495
This commit is contained in:
Alan Chen 2021-01-21 19:04:00 -08:00 • committed by snandini
commit 5ce95ada33
6 changed files with 82 additions and 11 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@ -188,6 +188,8 @@ static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
psoc_cfg->power_save_mode = cfg_get(psoc, CFG_PMO_POWERSAVE_MODE);
psoc_cfg->is_mod_dtim_on_sys_suspend_enabled =
cfg_get(psoc, CFG_PMO_MOD_DTIM_ON_SYS_SUSPEND);
psoc_cfg->is_bus_suspend_enabled_in_beaconing_mode =
cfg_get(psoc, CFG_ENABLE_BUS_SUSPEND_IN_BEACONING_MODE);
psoc_cfg->default_power_save_mode = psoc_cfg->power_save_mode;
psoc_cfg->max_ps_poll = cfg_get(psoc, CFG_PMO_MAX_PS_POLL);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-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
@ -404,6 +404,34 @@
CFG_VALUE_OR_DEFAULT, \
"RA rate limit interval")
/*
* <ini>
* enable_bus_suspend_in_beaconing_mode - enable PCIe bus suspend as part of
* platform system suspend for SAP/P2PGO/NDP with one or more clients connected
* @Min: 0
* @Max: 1
* @Default: 0
*
* This ini is used to PCIe bus suspend as part of platform system suspend for
* SAP/P2PGO/NDP with one or more clients connected
*
* 0: PCIe Bus suspend is not supported in beaconing mode (SAP/P2PGO/NDP) with
* one or more clients connected
* 1: PCIe Bus suspend is supported in beaconing mode (SAP/P2PGO/NDP) with one
* or more clients connected
* Related: None
*
* Supported Feature: Power Save
*
* Usage: Internal
*
* </ini>
*/
#define CFG_ENABLE_BUS_SUSPEND_IN_BEACONING_MODE CFG_INI_BOOL( \
"enable_bus_suspend_in_beaconing_mode", \
0, \
"This ini is used to enable bus suspend in beaconing mode")
#define CFG_PMO_COMMON_ALL \
CFG(CFG_ENABLE_SAP_SUSPEND) \
CFG(CFG_PMO_ENABLE_HOST_ARPOFFLOAD) \
@ -420,6 +448,7 @@
CFG(CFG_PMO_PWR_FAILURE) \
CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT) \
CFG(CFG_RA_RATE_LIMIT_INTERVAL) \
CFG(CFG_PMO_MOD_DTIM_ON_SYS_SUSPEND)
CFG(CFG_PMO_MOD_DTIM_ON_SYS_SUSPEND) \
CFG(CFG_ENABLE_BUS_SUSPEND_IN_BEACONING_MODE)
#endif /* WLAN_PMO_COMMON_CFG_H__ */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@ -371,6 +371,7 @@ struct pmo_psoc_cfg {
enum active_apf_mode active_mc_bc_apf_mode;
uint8_t ito_repeat_count;
bool is_mod_dtim_on_sys_suspend_enabled;
bool is_bus_suspend_enabled_in_beaconing_mode;
};
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@ -1982,4 +1982,15 @@ ucfg_pmo_get_runtime_pm_delay(struct wlan_objmgr_psoc *psoc)
*/
bool
ucfg_pmo_get_enable_sap_suspend(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_pmo_get_beacoing_mode_bus_suspend() - get PMO config for PCIe bus
* suspend in beaconing mode (SAP/P2PGO/NDP) with one or more clients
* @psoc: pointer to psoc object
*
* Return: bool
*/
bool
ucfg_pmo_get_beaconing_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
#endif /* end of _WLAN_PMO_UCFG_API_H_ */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@ -869,3 +869,12 @@ ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
return pmo_psoc_ctx->psoc_cfg.active_mc_bc_apf_mode;
}
bool
ucfg_pmo_get_beaconing_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
{
struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_beaconing_mode;
}

View file

@ -4675,6 +4675,8 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
{
uint8_t oper_mode = BSS_OPERATIONAL_MODE_STA;
void *htc_handle;
bool is_bus_suspend_allowed_in_beaconing_mode =
ucfg_pmo_get_beaconing_mode_bus_suspend(wma->psoc);
htc_handle = lmac_get_htc_hdl(wma->psoc);
if (!htc_handle) {
@ -4703,9 +4705,17 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
break;
}
/* handle wow for sap and nan with 1 or more peer in same way */
if (BSS_OPERATIONAL_MODE_AP == oper_mode ||
BSS_OPERATIONAL_MODE_NDI == oper_mode) {
/* handle wow for sap/p2pgo with 1 or more peer in same way */
if (BSS_OPERATIONAL_MODE_AP == oper_mode) {
wma_debug("disable runtime pm and bus suspend: %d",
is_bus_suspend_allowed_in_beaconing_mode);
if (!is_bus_suspend_allowed_in_beaconing_mode)
htc_vote_link_up(htc_handle);
wma_sap_prevent_runtime_pm(wma);
}
/* handle wow for nan with 1 or more peer in same way */
if (BSS_OPERATIONAL_MODE_NDI == oper_mode) {
wma_debug("disable runtime pm and vote for link up");
htc_vote_link_up(htc_handle);
wma_sap_prevent_runtime_pm(wma);
@ -4718,6 +4728,8 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
uint8_t smesession_id = del_sta->smesessionId;
bool rsp_requested = del_sta->respReqd;
void *htc_handle;
bool is_bus_suspend_allowed_in_beaconing_mode =
ucfg_pmo_get_beaconing_mode_bus_suspend(wma->psoc);
htc_handle = lmac_get_htc_hdl(wma->psoc);
if (!htc_handle) {
@ -4765,8 +4777,15 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
qdf_mem_free(del_sta);
}
if (BSS_OPERATIONAL_MODE_AP == oper_mode ||
BSS_OPERATIONAL_MODE_NDI == oper_mode) {
if (BSS_OPERATIONAL_MODE_AP == oper_mode) {
wma_debug("allow runtime pm and bus suspend: %d",
is_bus_suspend_allowed_in_beaconing_mode);
if (!is_bus_suspend_allowed_in_beaconing_mode)
htc_vote_link_down(htc_handle);
wma_sap_allow_runtime_pm(wma);
}
if (BSS_OPERATIONAL_MODE_NDI == oper_mode) {
wma_debug("allow runtime pm and vote for link down");
htc_vote_link_down(htc_handle);
wma_sap_allow_runtime_pm(wma);