diff --git a/components/pmo/core/src/wlan_pmo_main.c b/components/pmo/core/src/wlan_pmo_main.c
index 4285ffb7f027..57ac20c1a25e 100644
--- a/components/pmo/core/src/wlan_pmo_main.c
+++ b/components/pmo/core/src/wlan_pmo_main.c
@@ -188,8 +188,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);
diff --git a/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h b/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h
index 9bbccba3d62a..d9d6c6fb8ea5 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h
+++ b/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h
@@ -406,19 +406,19 @@
/*
*
- * 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 @@
*
*
*/
-#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")
+
+/*
+ *
+ * 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
+ *
+ *
+ */
+#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__ */
diff --git a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
index 1058e5696946..b142081cca45 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
+++ b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
@@ -371,7 +371,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;
};
/**
diff --git a/components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h b/components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h
index fea8a85c46b4..3f0f6d6588df 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h
+++ b/components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h
@@ -1984,13 +1984,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_ */
diff --git a/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c b/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c
index 6be3236f259d..cdb09f657778 100644
--- a/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c
+++ b/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c
@@ -871,10 +871,17 @@ ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
}
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;
+}
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index a6097d74e61e..46ffeb1e0a20 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -4671,12 +4671,44 @@ static void wma_sap_allow_runtime_pm(tp_wma_handle wma)
qdf_runtime_pm_allow_suspend(&wma->sap_prevent_runtime_pm_lock);
}
+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) {
@@ -4705,13 +4737,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 */
@@ -4728,8 +4777,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) {
@@ -4777,12 +4824,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) {