From e4219805a99d672d31523e49e5817f14ca467bcc Mon Sep 17 00:00:00 2001 From: Abdul Muqtadeer Ahmed Date: Tue, 2 Feb 2021 12:04:51 +0530 Subject: [PATCH] qcacld-3.0: Add new WMI wakeup reason MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the new WMI wakeup reason “WOW_REASON_FATAL_EVENT_WAKE". Change-Id: I93b530f78f568fa88cb310c5d78cd950451fc441 CRs-Fixed: 2868523 --- .../cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h | 2 ++ .../cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c | 4 ++++ .../target_if/cp_stats/src/target_if_mc_cp_stats.c | 4 ++++ core/wma/inc/wma_types.h | 4 ++-- core/wma/src/wma_features.c | 9 +++++++-- core/wma/src/wma_main.c | 2 ++ 6 files changed, 21 insertions(+), 4 deletions(-) diff --git a/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h b/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h index 622026352f51..510ca3bda98e 100644 --- a/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h +++ b/components/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h @@ -134,6 +134,7 @@ enum txrate_gi { * @pno_match_wake_up_count: pno match wakeup count * @oem_response_wake_up_count: oem response wakeup count * @uc_drop_wake_up_count: local data uc drop wakeup count + * @fatal_event_wake_up_count: fatal event wakeup count * @pwr_save_fail_detected: pwr save fail detected wakeup count * @scan_11d 11d scan wakeup count * @mgmt_assoc: association request management frame @@ -162,6 +163,7 @@ struct wake_lock_stats { uint32_t pno_match_wake_up_count; uint32_t oem_response_wake_up_count; uint32_t uc_drop_wake_up_count; + uint32_t fatal_event_wake_up_count; uint32_t pwr_save_fail_detected; uint32_t scan_11d; uint32_t mgmt_assoc; diff --git a/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c b/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c index 6f01a6e6f628..0579ef5c246c 100644 --- a/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c +++ b/components/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c @@ -552,6 +552,8 @@ static void vdev_iterator(struct wlan_objmgr_psoc *psoc, void *vdev, void *arg) stats->oem_response_wake_up_count += vdev_stats->oem_response_wake_up_count; stats->uc_drop_wake_up_count += vdev_stats->uc_drop_wake_up_count; + stats->fatal_event_wake_up_count += + vdev_stats->fatal_event_wake_up_count; stats->pwr_save_fail_detected += vdev_stats->pwr_save_fail_detected; stats->scan_11d += vdev_stats->scan_11d; } @@ -663,6 +665,7 @@ QDF_STATUS ucfg_mc_cp_stats_write_wow_stats( "\tPNO Complete: %u\n" "\tPNO Match: %u\n" "\tUC Drop wake_count: %u\n" + "\twake count due to fatal event: %u\n" "\tOEM rsp wake_count: %u\n" "\twake count due to pwr_save_fail_detected: %u\n" "\twake count due to 11d scan: %u\n", @@ -682,6 +685,7 @@ QDF_STATUS ucfg_mc_cp_stats_write_wow_stats( wow_stats.pno_complete_wake_up_count, wow_stats.pno_match_wake_up_count, wow_stats.uc_drop_wake_up_count, + wow_stats.fatal_event_wake_up_count, wow_stats.oem_response_wake_up_count, wow_stats.pwr_save_fail_detected, wow_stats.scan_11d); diff --git a/components/target_if/cp_stats/src/target_if_mc_cp_stats.c b/components/target_if/cp_stats/src/target_if_mc_cp_stats.c index 6a8d45006b06..5cf11c77c933 100644 --- a/components/target_if/cp_stats/src/target_if_mc_cp_stats.c +++ b/components/target_if/cp_stats/src/target_if_mc_cp_stats.c @@ -1073,6 +1073,10 @@ static void target_if_cp_stats_inc_wake_lock_stats(uint32_t reason, stats->uc_drop_wake_up_count++; break; + case WOW_REASON_FATAL_EVENT_WAKE: + stats->fatal_event_wake_up_count++; + break; + default: break; } diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index c91e8fa14274..c50a0a0bf0d5 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -442,7 +442,7 @@ enum wmamsgtype { WMA_TWT_NUDGE_DIALOG_REQUEST = SIR_HAL_TWT_NUDGE_DIALOG_REQUEST, }; -#define WMA_DATA_STALL_TRIGGER 6 +#define WMA_DATA_STALL_TRIGGER 0x1006 /* Bit 6 will be used to control BD rate for Management frames */ #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 3d7996f53171..6ae64f14d243 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -1486,6 +1486,8 @@ static const uint8_t *wma_wow_wake_reason_str(A_INT32 wake_reason) return "VDEV_DISCONNECT"; case WOW_REASON_LOCAL_DATA_UC_DROP: return "LOCAL_DATA_UC_DROP"; + case WOW_REASON_FATAL_EVENT_WAKE: + return "FATAL_EVENT_WAKE"; case WOW_REASON_GENERIC_WAKE: return "GENERIC_WAKE"; case WOW_REASON_TWT: @@ -1519,6 +1521,7 @@ static bool wma_wow_reason_has_stats(enum wake_reason_e reason) case WOW_REASON_CHIP_POWER_FAILURE_DETECT: case WOW_REASON_11D_SCAN: case WOW_REASON_LOCAL_DATA_UC_DROP: + case WOW_REASON_FATAL_EVENT_WAKE: return true; #ifdef WLAN_FEATURE_MOTION_DETECTION case WOW_REASON_WLAN_MD: @@ -1569,7 +1572,8 @@ static void wma_wow_stats_display(struct wake_lock_stats *stats) wma_conditional_log(is_wakeup_event_console_logs_enabled, "pno_match:%d pno_complete:%d gscan:%d low_rssi:%d" - " rssi_breach:%d oem:%d ucdrop:%d scan_11d:%d", + " rssi_breach:%d oem:%d ucdrop:%d scan_11d:%d" + " fatal_event:%d", stats->pno_match_wake_up_count, stats->pno_complete_wake_up_count, stats->gscan_wake_up_count, @@ -1577,7 +1581,8 @@ static void wma_wow_stats_display(struct wake_lock_stats *stats) stats->rssi_breach_wake_up_count, stats->oem_response_wake_up_count, stats->uc_drop_wake_up_count, - stats->scan_11d); + stats->scan_11d, + stats->fatal_event_wake_up_count); } static void wma_print_wow_stats(t_wma_handle *wma, diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 74fd75e8d6b6..cbd1c3f381be 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1829,6 +1829,7 @@ static void wma_state_info_dump(char **buf_ptr, uint16_t *size) "\tipv6_mcast_na %u\n" "\toem_response %u\n" "\tuc_drop %u\n" + "\tfatal_event %u\n" "dtimPeriod %d\n" "chan_width %d\n" "vdev_active %d\n" @@ -1855,6 +1856,7 @@ static void wma_state_info_dump(char **buf_ptr, uint16_t *size) stats.ipv6_mcast_na_stats, stats.oem_response_wake_up_count, stats.uc_drop_wake_up_count, + stats.fatal_event_wake_up_count, iface->dtimPeriod, iface->chan_width, iface->vdev_active,