summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajeev Kumar <rajekuma@qca.qualcomm.com>2015-09-01 15:42:57 -0700
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2015-09-02 11:16:36 +0530
commitf270436d6f45bfba96a1992e48297308bd8a46f8 (patch)
tree0e17e62ce847d9a25b7c735eb7d661b6b91a2ff6
parent38ee4dd7dd95213c77a309f4bb72841d7a8cd4b4 (diff)
qcacld-2.0: Add proper wake up log for APPS triggered resume
- In system suspend mode log APPS triggered wake up as UNSPECIFIED - In runtime power manager suspend mode log APPS triggered wake up as RUNTIME PM resume - Update/display wow wake up counters only during system suspend mode - Add debug wake up counters for pno, gscan and low rssi Change-Id: Ifbe68e52c1dcbb795004f333c2d08a3144ca79d7 CRs-Fixed: 900527
-rw-r--r--CORE/SERVICES/COMMON/wmi_unified_api.h5
-rw-r--r--CORE/SERVICES/WMA/wma.c97
-rw-r--r--CORE/SERVICES/WMA/wma.h5
-rw-r--r--CORE/SERVICES/WMI/wmi_unified.c7
4 files changed, 86 insertions, 28 deletions
diff --git a/CORE/SERVICES/COMMON/wmi_unified_api.h b/CORE/SERVICES/COMMON/wmi_unified_api.h
index 01368c4189f3..efb062958ad8 100644
--- a/CORE/SERVICES/COMMON/wmi_unified_api.h
+++ b/CORE/SERVICES/COMMON/wmi_unified_api.h
@@ -142,12 +142,17 @@ wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val);
#ifdef FEATURE_RUNTIME_PM
void
wmi_set_runtime_pm_inprogress(wmi_unified_t wmi_handle, A_BOOL val);
+bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle);
#else
static inline void
wmi_set_runtime_pm_inprogress(wmi_unified_t wmi_handle, A_BOOL val)
{
return;
}
+static inline bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle)
+{
+ return false;
+}
#endif
/**
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index 66d628932f79..b8727c4b58b5 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -18257,11 +18257,14 @@ static inline void wma_free_wow_ptrn(tp_wma_handle wma, u_int8_t ptrn_id)
}
/* Converts wow wakeup reason code to text format */
-static const u8 *wma_wow_wake_reason_str(A_INT32 wake_reason)
+static const u8 *wma_wow_wake_reason_str(A_INT32 wake_reason, tp_wma_handle wma)
{
switch (wake_reason) {
case WOW_REASON_UNSPECIFIED:
- return "UNSPECIFIED";
+ if (!wmi_get_runtime_pm_inprogress(wma->wmi_handle))
+ return "UNSPECIFIED";
+ else
+ return "RUNTIME PM resume";
case WOW_REASON_NLOD:
return "NLOD";
case WOW_REASON_AP_ASSOC_LOST:
@@ -18790,14 +18793,19 @@ static void wma_extscan_wow_event_callback(void *handle, void *event,
*/
static void wma_wow_wake_up_stats_display(tp_wma_handle wma)
{
- WMA_LOGA("ucast %d bcast %d ipv4_mcast %d ipv6_mcast %d ipv6_mcast_ra %d ipv6_mcast_ns %d ipv6_mcast_na %d",
+ WMA_LOGA("uc %d bc %d v4_mc %d v6_mc %d ra %d ns %d na %d pno_match %d pno_complete %d gscan %d low_rssi %d rssi_breach %d",
wma->wow_ucast_wake_up_count,
wma->wow_bcast_wake_up_count,
wma->wow_ipv4_mcast_wake_up_count,
wma->wow_ipv6_mcast_wake_up_count,
wma->wow_ipv6_mcast_ra_stats,
wma->wow_ipv6_mcast_ns_stats,
- wma->wow_ipv6_mcast_na_stats);
+ wma->wow_ipv6_mcast_na_stats,
+ wma->wow_pno_match_wake_up_count,
+ wma->wow_pno_complete_wake_up_count,
+ wma->wow_gscan_wake_up_count,
+ wma->wow_low_rssi_wake_up_count,
+ wma->wow_rssi_breach_wake_up_count);
return;
}
@@ -18847,26 +18855,65 @@ static void wma_wow_ipv6_mcast_stats(tp_wma_handle wma, uint8_t *data)
* @wma: Pointer to wma handle
* @data: Pointer to pattern match data
* @len: Pattern match data length
+ * @event: Wake up event
*
* Return: none
*/
-static void wma_wow_wake_up_stats(tp_wma_handle wma, uint8_t *data, int32_t len)
+static void wma_wow_wake_up_stats(tp_wma_handle wma, uint8_t *data,
+ int32_t len, WOW_WAKE_REASON_TYPE event)
{
+ /* Do not increment debug stats if resume is for runtime pm */
+ if (wmi_get_runtime_pm_inprogress(wma->wmi_handle))
+ return;
- if (WMA_BCAST_MAC_ADDR == *data) {
- wma->wow_bcast_wake_up_count++;
- } else if (WMA_MCAST_IPV4_MAC_ADDR == *data) {
- wma->wow_ipv4_mcast_wake_up_count++;
- } else if (WMA_MCAST_IPV6_MAC_ADDR == *data) {
- wma->wow_ipv6_mcast_wake_up_count++;
- if (len > WMA_ICMP_V6_TYPE_OFFSET)
- wma_wow_ipv6_mcast_stats(wma, data);
- else
- WMA_LOGA("ICMP_V6 data len %d", len);
- } else {
- wma->wow_ucast_wake_up_count++;
+ switch(event) {
+
+ case WOW_REASON_PATTERN_MATCH_FOUND:
+ if (WMA_BCAST_MAC_ADDR == *data) {
+ wma->wow_bcast_wake_up_count++;
+ } else if (WMA_MCAST_IPV4_MAC_ADDR == *data) {
+ wma->wow_ipv4_mcast_wake_up_count++;
+ } else if (WMA_MCAST_IPV6_MAC_ADDR == *data) {
+ wma->wow_ipv6_mcast_wake_up_count++;
+ if (len > WMA_ICMP_V6_TYPE_OFFSET)
+ wma_wow_ipv6_mcast_stats(wma, data);
+ else
+ WMA_LOGA("ICMP_V6 data len %d", len);
+ } else {
+ wma->wow_ucast_wake_up_count++;
+ }
+ break;
+
+ case WOW_REASON_RA_MATCH:
+ wma->wow_ipv6_mcast_ra_stats++;
+ break;
+
+ case WOW_REASON_NLOD:
+ wma->wow_pno_match_wake_up_count++;
+ break;
+
+ case WOW_REASON_NLO_SCAN_COMPLETE:
+ wma->wow_pno_complete_wake_up_count++;
+ break;
+
+ case WOW_REASON_LOW_RSSI:
+ wma->wow_low_rssi_wake_up_count++;
+ break;
+
+ case WOW_REASON_EXTSCAN:
+ wma->wow_gscan_wake_up_count++;
+ break;
+
+ case WOW_REASON_RSSI_BREACH_EVENT:
+ wma->wow_rssi_breach_wake_up_count++;
+ break;
+
+ default:
+ WMA_LOGE("Unknown wake up reason");
+ break;
}
+ wma_wow_wake_up_stats_display(wma);
return;
}
@@ -18895,7 +18942,7 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
wake_info = param_buf->fixed_param;
WMA_LOGA("WOW wakeup host event received (reason: %s(%d)) for vdev %d",
- wma_wow_wake_reason_str(wake_info->wake_reason),
+ wma_wow_wake_reason_str(wake_info->wake_reason, wma),
wake_info->wake_reason,
wake_info->vdev_id);
@@ -18926,8 +18973,7 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
break;
#ifdef FEATURE_WLAN_RA_FILTERING
case WOW_REASON_RA_MATCH:
- wma->wow_ipv6_mcast_ra_stats++;
- wma_wow_wake_up_stats_display(wma);
+ wma_wow_wake_up_stats(wma, NULL, 0, WOW_REASON_RA_MATCH);
break;
#endif
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
@@ -18940,6 +18986,7 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
#endif
#ifdef FEATURE_WLAN_SCAN_PNO
case WOW_REASON_NLOD:
+ wma_wow_wake_up_stats(wma, NULL, 0, WOW_REASON_NLOD);
node = &wma->interfaces[wake_info->vdev_id];
if (node) {
WMA_LOGD("NLO match happened");
@@ -18955,6 +19002,8 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
{
WMI_NLO_SCAN_COMPLETE_EVENTID_param_tlvs param;
+ wma_wow_wake_up_stats(wma, NULL, 0,
+ WOW_REASON_NLO_SCAN_COMPLETE);
WMA_LOGD("Host woken up due to pno scan complete reason");
/* First 4-bytes of wow_packet_buffer is the length */
if (param_buf->wow_packet_buffer) {
@@ -18991,14 +19040,14 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
case WOW_REASON_HTT_EVENT:
break;
case WOW_REASON_PATTERN_MATCH_FOUND:
- wma_wow_wake_up_stats_display(wma);
WMA_LOGD("Wake up for Rx packet, dump starting from ethernet hdr");
if (param_buf->wow_packet_buffer) {
/* First 4-bytes of wow_packet_buffer is the length */
vos_mem_copy((u_int8_t *) &wow_buf_pkt_len,
param_buf->wow_packet_buffer, 4);
wma_wow_wake_up_stats(wma,
- param_buf->wow_packet_buffer + 4, wow_buf_pkt_len);
+ param_buf->wow_packet_buffer + 4, wow_buf_pkt_len,
+ WOW_REASON_PATTERN_MATCH_FOUND);
vos_trace_hex_dump(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_DEBUG,
param_buf->wow_packet_buffer + 4,
wow_buf_pkt_len);
@@ -19015,6 +19064,7 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
* wma_roam_event_callback().
*/
WMI_ROAM_EVENTID_param_tlvs param;
+ wma_wow_wake_up_stats(wma, NULL, 0, WOW_REASON_LOW_RSSI);
if (param_buf->wow_packet_buffer) {
/* Roam event is embedded in wow_packet_buffer */
WMA_LOGD("Host woken up because of roam event");
@@ -19070,6 +19120,7 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
#ifdef FEATURE_WLAN_EXTSCAN
case WOW_REASON_EXTSCAN:
WMA_LOGD("Host woken up because of extscan reason");
+ wma_wow_wake_up_stats(wma, NULL, 0, WOW_REASON_EXTSCAN);
if (param_buf->wow_packet_buffer) {
wow_buf_pkt_len =
*(uint32_t *)param_buf->wow_packet_buffer;
@@ -19089,6 +19140,8 @@ static int wma_wow_wakeup_host_event(void *handle, u_int8_t *event,
{
WMI_RSSI_BREACH_EVENTID_param_tlvs param;
+ wma_wow_wake_up_stats(wma, NULL, 0,
+ WOW_REASON_RSSI_BREACH_EVENT);
WMA_LOGD("Host woken up because of rssi breach reason");
/* rssi breach event is embedded in wow_packet_buffer */
if (param_buf->wow_packet_buffer) {
diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h
index 49aa0e592036..a743a63a98d8 100644
--- a/CORE/SERVICES/WMA/wma.h
+++ b/CORE/SERVICES/WMA/wma.h
@@ -801,6 +801,11 @@ typedef struct wma_handle {
uint32_t num_of_diag_events_logs;
uint32_t *events_logs_list;
+ uint32_t wow_pno_match_wake_up_count;
+ uint32_t wow_pno_complete_wake_up_count;
+ uint32_t wow_gscan_wake_up_count;
+ uint32_t wow_low_rssi_wake_up_count;
+ uint32_t wow_rssi_breach_wake_up_count;
uint32_t wow_ucast_wake_up_count;
uint32_t wow_bcast_wake_up_count;
uint32_t wow_ipv4_mcast_wake_up_count;
diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c
index 9f5da91cc31e..521dff3fae9a 100644
--- a/CORE/SERVICES/WMI/wmi_unified.c
+++ b/CORE/SERVICES/WMI/wmi_unified.c
@@ -647,15 +647,10 @@ static u_int8_t* get_wmi_cmd_string(WMI_CMD_ID wmi_command)
}
#ifdef FEATURE_RUNTIME_PM
-static inline int wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle)
+inline bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle)
{
return adf_os_atomic_read(&wmi_handle->runtime_pm_inprogress);
}
-#else
-static inline int wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle)
-{
- return 0;
-}
#endif
/* WMI command API */