mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
qcacld-3.0: Acquire a wakelock whenever packet capture mode is enabled
Whenever packet capture mode is enabled, all packets are forwarded
to host from firmware which causes frequent wakeups if WOW suspend is
allowed. This leads to flooding of WMI transactions due to WOW
suspend/wakeup and other WMI events due to packet capture mode over CE.
So, to reduce number of WMI transactions due to frequent suspend and
then wakeup due to enablement of packet capture mode, acquire a
wakelock and prevent runtime suspend whenever packet capture mode is
enabled.
Change-Id: I71b73e7327e14890dc8509b81b22e8b5611cbac6
CRs-Fixed: 3603566
(cherry picked from commit d1fe6088f3)
This commit is contained in:
parent
4142ad0b53
commit
968d9fad59
2 changed files with 18 additions and 0 deletions
|
|
@ -65,6 +65,8 @@ struct pkt_capture_cb_context {
|
|||
* @last_freq: Last connected freq
|
||||
* @curr_freq: current connected freq
|
||||
* @rx_vht_sgi: guard interval of vht rx packet
|
||||
* @wake_lock: wake lock for packet capture
|
||||
* @runtime_lock: runtime lock for packet capture
|
||||
*/
|
||||
struct pkt_capture_vdev_priv {
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
|
|
@ -78,6 +80,8 @@ struct pkt_capture_vdev_priv {
|
|||
qdf_freq_t last_freq;
|
||||
qdf_freq_t curr_freq;
|
||||
uint8_t rx_vht_sgi;
|
||||
qdf_wake_lock_t wake_lock;
|
||||
qdf_runtime_lock_t runtime_lock;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "wlan_pkt_capture_tgt_api.h"
|
||||
#include <cds_ieee80211_common.h>
|
||||
#include "wlan_vdev_mgr_utils_api.h"
|
||||
#include "host_diag_core_event.h"
|
||||
|
||||
static struct wlan_objmgr_vdev *gp_pkt_capture_vdev;
|
||||
|
||||
|
|
@ -775,6 +776,10 @@ pkt_capture_register_callbacks(struct wlan_objmgr_vdev *vdev,
|
|||
goto send_mode_fail;
|
||||
}
|
||||
|
||||
qdf_wake_lock_acquire(&vdev_priv->wake_lock,
|
||||
WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE);
|
||||
qdf_runtime_pm_prevent_suspend(&vdev_priv->runtime_lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
send_mode_fail:
|
||||
|
|
@ -845,6 +850,10 @@ QDF_STATUS pkt_capture_deregister_callbacks(struct wlan_objmgr_vdev *vdev)
|
|||
vdev_priv->cb_ctx->mon_cb = NULL;
|
||||
vdev_priv->cb_ctx->mon_ctx = NULL;
|
||||
|
||||
qdf_wake_lock_release(&vdev_priv->wake_lock,
|
||||
WIFI_POWER_EVENT_WAKELOCK_MONITOR_MODE);
|
||||
qdf_runtime_pm_allow_suspend(&vdev_priv->runtime_lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -1097,6 +1106,8 @@ pkt_capture_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg)
|
|||
}
|
||||
qdf_spinlock_create(&vdev_priv->lock_q);
|
||||
qdf_list_create(&vdev_priv->ppdu_stats_q, PPDU_STATS_Q_MAX_SIZE);
|
||||
qdf_wake_lock_create(&vdev_priv->wake_lock, "pkt_capture_mode");
|
||||
qdf_runtime_lock_init(&vdev_priv->runtime_lock);
|
||||
|
||||
return status;
|
||||
|
||||
|
|
@ -1133,6 +1144,9 @@ pkt_capture_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg)
|
|||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_runtime_lock_deinit(&vdev_priv->runtime_lock);
|
||||
qdf_wake_lock_destroy(&vdev_priv->wake_lock);
|
||||
|
||||
while (qdf_list_remove_front(&vdev_priv->ppdu_stats_q, &node)
|
||||
== QDF_STATUS_SUCCESS) {
|
||||
stats_node = qdf_container_of(
|
||||
|
|
|
|||
Loading…
Reference in a new issue