|
@@ -22,6 +22,9 @@
|
|
|
#include <wlan_twt_api.h>
|
|
|
#include "twt/core/src/wlan_twt_objmgr_handler.h"
|
|
|
#include "twt/core/src/wlan_twt_common.h"
|
|
|
+#ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
|
|
|
+#include <wlan_pmo_obj_mgmt_api.h>
|
|
|
+#endif
|
|
|
|
|
|
struct wlan_lmac_if_twt_tx_ops *
|
|
|
wlan_twt_get_tx_ops(struct wlan_objmgr_psoc *psoc)
|
|
@@ -66,6 +69,52 @@ wlan_twt_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc)
|
|
|
return twt_psoc;
|
|
|
}
|
|
|
|
|
|
+#ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
|
|
|
+static QDF_STATUS
|
|
|
+wlan_twt_suspend_handler(struct wlan_objmgr_psoc *psoc, void *arg)
|
|
|
+{
|
|
|
+ wlan_twt_psoc_set_pmo_disable(psoc, REASON_PMO_SUSPEND);
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+static QDF_STATUS
|
|
|
+wlan_twt_resume_handler(struct wlan_objmgr_psoc *psoc, void *arg)
|
|
|
+{
|
|
|
+ wlan_twt_psoc_set_pmo_enable(psoc, REASON_PMO_SUSPEND);
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+static void
|
|
|
+wlan_twt_register_pmo_handler(void)
|
|
|
+{
|
|
|
+ pmo_register_suspend_handler(WLAN_UMAC_COMP_TWT,
|
|
|
+ wlan_twt_suspend_handler, NULL);
|
|
|
+ pmo_register_resume_handler(WLAN_UMAC_COMP_TWT,
|
|
|
+ wlan_twt_resume_handler, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void
|
|
|
+wlan_twt_unregister_pmo_handler(void)
|
|
|
+{
|
|
|
+ pmo_unregister_suspend_handler(WLAN_UMAC_COMP_TWT,
|
|
|
+ wlan_twt_suspend_handler);
|
|
|
+ pmo_unregister_resume_handler(WLAN_UMAC_COMP_TWT,
|
|
|
+ wlan_twt_resume_handler);
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+static void
|
|
|
+wlan_twt_register_pmo_handler(void)
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+static inline void
|
|
|
+wlan_twt_unregister_pmo_handler(void)
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+#endif
|
|
|
+
|
|
|
QDF_STATUS wlan_twt_init(void)
|
|
|
{
|
|
|
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
|
@@ -219,6 +268,8 @@ QDF_STATUS twt_psoc_enable(struct wlan_objmgr_psoc *psoc)
|
|
|
if (QDF_IS_STATUS_ERROR(status))
|
|
|
twt_err("twt_register_events failed (status=%d)", status);
|
|
|
|
|
|
+ wlan_twt_register_pmo_handler();
|
|
|
+
|
|
|
return status;
|
|
|
}
|
|
|
|
|
@@ -238,6 +289,8 @@ QDF_STATUS twt_psoc_disable(struct wlan_objmgr_psoc *psoc)
|
|
|
twt_err("twt_deregister_events failed (status=%d)",
|
|
|
status);
|
|
|
|
|
|
+ wlan_twt_unregister_pmo_handler();
|
|
|
+
|
|
|
return status;
|
|
|
}
|
|
|
|
|
@@ -248,3 +301,4 @@ wlan_set_peer_twt_capabilities(struct wlan_objmgr_psoc *psoc,
|
|
|
{
|
|
|
return wlan_twt_set_peer_capabilities(psoc, peer_mac, peer_cap);
|
|
|
}
|
|
|
+
|