|
@@ -30,6 +30,9 @@
|
|
|
#include "../../core/src/wlan_cp_stats_defs.h"
|
|
|
#include "../../core/src/wlan_cp_stats_defs.h"
|
|
|
#include "../../core/src/wlan_cp_stats_cmn_api_i.h"
|
|
|
+#ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
|
|
|
+#include <wlan_pmo_obj_mgmt_api.h>
|
|
|
+#endif
|
|
|
|
|
|
QDF_STATUS wlan_cp_stats_psoc_cs_init(struct psoc_cp_stats *psoc_cs)
|
|
|
{
|
|
@@ -510,6 +513,11 @@ QDF_STATUS ucfg_mc_cp_stats_set_pending_req(struct wlan_objmgr_psoc *psoc,
|
|
|
|
|
|
wlan_cp_stats_psoc_obj_lock(psoc_cp_stats_priv);
|
|
|
psoc_mc_stats = psoc_cp_stats_priv->obj_stats;
|
|
|
+ if (psoc_mc_stats->is_cp_stats_suspended) {
|
|
|
+ cp_stats_debug("cp stats is suspended try again after resume");
|
|
|
+ wlan_cp_stats_psoc_obj_unlock(psoc_cp_stats_priv);
|
|
|
+ return QDF_STATUS_E_AGAIN;
|
|
|
+ }
|
|
|
psoc_mc_stats->pending.type_map |= (1 << type);
|
|
|
psoc_mc_stats->pending.req[type] = *req;
|
|
|
wlan_cp_stats_psoc_obj_unlock(psoc_cp_stats_priv);
|
|
@@ -622,3 +630,67 @@ QDF_STATUS ucfg_mc_cp_stats_set_rate_flags(struct wlan_objmgr_vdev *vdev,
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
+
|
|
|
+#ifdef WLAN_POWER_MANAGEMENT_OFFLOAD
|
|
|
+static QDF_STATUS
|
|
|
+ucfg_mc_cp_stats_suspend_req_handler(struct wlan_objmgr_psoc *psoc)
|
|
|
+{
|
|
|
+ struct psoc_mc_cp_stats *psoc_mc_stats;
|
|
|
+ struct psoc_cp_stats *psoc_cp_stats_priv;
|
|
|
+
|
|
|
+ psoc_cp_stats_priv = wlan_cp_stats_get_psoc_stats_obj(psoc);
|
|
|
+ if (!psoc_cp_stats_priv) {
|
|
|
+ cp_stats_err("psoc cp stats object is null");
|
|
|
+ return QDF_STATUS_E_NULL_VALUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ wlan_cp_stats_psoc_obj_lock(psoc_cp_stats_priv);
|
|
|
+ psoc_mc_stats = psoc_cp_stats_priv->obj_stats;
|
|
|
+ psoc_mc_stats->is_cp_stats_suspended = true;
|
|
|
+ wlan_cp_stats_psoc_obj_unlock(psoc_cp_stats_priv);
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+static QDF_STATUS
|
|
|
+ucfg_mc_cp_stats_resume_req_handler(struct wlan_objmgr_psoc *psoc)
|
|
|
+{
|
|
|
+ struct psoc_mc_cp_stats *psoc_mc_stats;
|
|
|
+ struct psoc_cp_stats *psoc_cp_stats_priv;
|
|
|
+
|
|
|
+ psoc_cp_stats_priv = wlan_cp_stats_get_psoc_stats_obj(psoc);
|
|
|
+ if (!psoc_cp_stats_priv) {
|
|
|
+ cp_stats_err("psoc cp stats object is null");
|
|
|
+ return QDF_STATUS_E_NULL_VALUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ wlan_cp_stats_psoc_obj_lock(psoc_cp_stats_priv);
|
|
|
+ psoc_mc_stats = psoc_cp_stats_priv->obj_stats;
|
|
|
+ psoc_mc_stats->is_cp_stats_suspended = false;
|
|
|
+ wlan_cp_stats_psoc_obj_unlock(psoc_cp_stats_priv);
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+static QDF_STATUS
|
|
|
+ucfg_mc_cp_stats_resume_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
+ void *arg)
|
|
|
+{
|
|
|
+ return ucfg_mc_cp_stats_resume_req_handler(psoc);
|
|
|
+}
|
|
|
+
|
|
|
+static QDF_STATUS
|
|
|
+ucfg_mc_cp_stats_suspend_handler(struct wlan_objmgr_psoc *psoc,
|
|
|
+ void *arg)
|
|
|
+{
|
|
|
+ return ucfg_mc_cp_stats_suspend_req_handler(psoc);
|
|
|
+}
|
|
|
+
|
|
|
+void ucfg_mc_cp_stats_register_pmo_handler(void)
|
|
|
+{
|
|
|
+ pmo_register_suspend_handler(WLAN_UMAC_COMP_CP_STATS,
|
|
|
+ ucfg_mc_cp_stats_suspend_handler, NULL);
|
|
|
+ pmo_register_resume_handler(WLAN_UMAC_COMP_CP_STATS,
|
|
|
+ ucfg_mc_cp_stats_resume_handler, NULL);
|
|
|
+}
|
|
|
+#endif
|