qcacld-3.0: Split SAP and GO modes ini

Rename existing INI to enable_bus_suspend_in_sap_mode and define a
new enable_bus_suspend_in_go_mode. Also define new APIs
wma_is_vdev_in_sap_mode and wma_is_vdev_in_go_mode.

Change-Id: If38c4db7b3d1f7323df45d9a7d80a02a44e7ca41
CRs-Fixed: 2864596
This commit is contained in:
Alan Chen
2021-01-27 13:56:52 -08:00
committed by snandini
parent de3787f386
commit b52dadc0b5
6 changed files with 144 additions and 32 deletions

View File

@@ -206,8 +206,10 @@ 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->is_bus_suspend_enabled_in_sap_mode =
cfg_get(psoc, CFG_ENABLE_BUS_SUSPEND_IN_SAP_MODE);
psoc_cfg->is_bus_suspend_enabled_in_go_mode =
cfg_get(psoc, CFG_ENABLE_BUS_SUSPEND_IN_GO_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

@@ -406,19 +406,19 @@
/*
* <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
* enable_bus_suspend_in_sap_mode - enable PCIe bus suspend as part of
* platform system suspend for SAP 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
* SAP 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
* 0: PCIe Bus suspend is not supported in SAP mode with one or more clients
* connected
* 1: PCIe Bus suspend is supported in SAP mode with one or more clients
* connected
* Related: None
*
* Supported Feature: Power Save
@@ -427,10 +427,38 @@
*
* </ini>
*/
#define CFG_ENABLE_BUS_SUSPEND_IN_BEACONING_MODE CFG_INI_BOOL( \
"enable_bus_suspend_in_beaconing_mode", \
#define CFG_ENABLE_BUS_SUSPEND_IN_SAP_MODE CFG_INI_BOOL( \
"enable_bus_suspend_in_sap_mode", \
0, \
"This ini is used to enable bus suspend in beaconing mode")
"This ini is used to enable bus suspend in SAP mode")
/*
* <ini>
* enable_bus_suspend_in_go_mode - enable PCIe bus suspend as part of
* platform system suspend for P2PGO 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
* P2PGO with one or more clients connected
*
* 0: PCIe Bus suspend is not supported in P2PGO mode with one or more clients
* connected
* 1: PCIe Bus suspend is supported in P2PGO mode with one or more clients
* connected
* Related: None
*
* Supported Feature: Power Save
*
* Usage: Internal
*
* </ini>
*/
#define CFG_ENABLE_BUS_SUSPEND_IN_GO_MODE CFG_INI_BOOL( \
"enable_bus_suspend_in_go_mode", \
0, \
"This ini is used to enable bus suspend in P2PGO mode")
#define CFG_PMO_COMMON_ALL \
CFG(CFG_ENABLE_SAP_SUSPEND) \
@@ -449,6 +477,7 @@
CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT) \
CFG(CFG_RA_RATE_LIMIT_INTERVAL) \
CFG(CFG_PMO_MOD_DTIM_ON_SYS_SUSPEND) \
CFG(CFG_ENABLE_BUS_SUSPEND_IN_BEACONING_MODE)
CFG(CFG_ENABLE_BUS_SUSPEND_IN_SAP_MODE) \
CFG(CFG_ENABLE_BUS_SUSPEND_IN_GO_MODE)
#endif /* WLAN_PMO_COMMON_CFG_H__ */

View File

@@ -390,7 +390,8 @@ 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;
bool is_bus_suspend_enabled_in_sap_mode;
bool is_bus_suspend_enabled_in_go_mode;
#ifdef WLAN_ENABLE_GPIO_WAKEUP
bool enable_gpio_wakeup;
uint32_t gpio_wakeup_pin;

View File

@@ -2029,13 +2029,23 @@ 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
* ucfg_pmo_get_sap_mode_bus_suspend() - get PMO config for PCIe bus
* suspend in SAP mode 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);
ucfg_pmo_get_sap_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_pmo_get_go_mode_bus_suspend() - get PMO config for PCIe bus
* suspend in P2PGO mode with one or more clients
* @psoc: pointer to psoc object
*
* Return: bool
*/
bool
ucfg_pmo_get_go_mode_bus_suspend(struct wlan_objmgr_psoc *psoc);
#endif /* end of _WLAN_PMO_UCFG_API_H_ */

View File

@@ -895,10 +895,17 @@ ucfg_pmo_get_gpio_wakeup_mode(struct wlan_objmgr_psoc *psoc)
#endif
bool
ucfg_pmo_get_beaconing_mode_bus_suspend(struct wlan_objmgr_psoc *psoc)
ucfg_pmo_get_sap_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;
return pmo_psoc_ctx->psoc_cfg.is_bus_suspend_enabled_in_sap_mode;
}
bool
ucfg_pmo_get_go_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_go_mode;
}

View File

@@ -4731,12 +4731,44 @@ static bool wma_add_sta_allow_sta_mode_vote_link(uint8_t oper_mode)
}
#endif /* FEATURE_STA_MODE_VOTE_LINK */
static bool wma_is_vdev_in_sap_mode(tp_wma_handle wma, uint8_t vdev_id)
{
struct wma_txrx_node *intf = wma->interfaces;
if (vdev_id >= wma->max_bssid) {
wma_err("Invalid vdev_id %hu", vdev_id);
QDF_ASSERT(0);
return false;
}
if ((intf[vdev_id].type == WMI_VDEV_TYPE_AP) &&
(intf[vdev_id].sub_type == 0))
return true;
return false;
}
static bool wma_is_vdev_in_go_mode(tp_wma_handle wma, uint8_t vdev_id)
{
struct wma_txrx_node *intf = wma->interfaces;
if (vdev_id >= wma->max_bssid) {
wma_err("Invalid vdev_id %hu", vdev_id);
QDF_ASSERT(0);
return false;
}
if ((intf[vdev_id].type == WMI_VDEV_TYPE_AP) &&
(intf[vdev_id].sub_type == WMI_UNIFIED_VDEV_SUBTYPE_P2P_GO))
return true;
return false;
}
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) {
@@ -4765,13 +4797,30 @@ void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta)
break;
}
/* 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)
/* 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)
htc_vote_link_up(htc_handle);
wma_sap_prevent_runtime_pm(wma);
return;
}
/* 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)
htc_vote_link_up(htc_handle);
wma_sap_prevent_runtime_pm(wma);
return;
}
/* handle wow for nan with 1 or more peer in same way */
@@ -4791,8 +4840,6 @@ 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) {
@@ -4840,12 +4887,28 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
qdf_mem_free(del_sta);
}
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)
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)
htc_vote_link_down(htc_handle);
wma_sap_allow_runtime_pm(wma);
return;
}
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)
htc_vote_link_down(htc_handle);
wma_sap_allow_runtime_pm(wma);
return;
}
if (BSS_OPERATIONAL_MODE_NDI == oper_mode) {