From 61fbc93f6ec3a47ae1ad9fac402be71ebea40eab Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Tue, 19 Dec 2017 14:27:55 +0530 Subject: [PATCH] qcacld-3.0: Enable pktlog after SSR/PDR if previously enabled Implement a flag in hdd context to track the state of pktlog events. Pktlog will be enabled/disabled after SSR/PDR, depending upon the state of Pktlog events just before SSR/PDR is triggered. Change-Id: I18999d7fcf3677a86c21559d7d443ba1cd086528 CRs-Fixed: 2151296 --- core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/src/wlan_hdd_main.c | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 7d41c3078b2c..0bc85aa2ac35 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1483,6 +1483,8 @@ struct hdd_context { bool hdd_wlan_suspended; bool suspended; + /* flag to start pktlog after SSR/PDR if previously enabled */ + bool is_pktlog_enabled; /* Lock to avoid race condition during start/stop bss */ struct mutex sap_lock; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 547ae27b9913..41d3563dc47e 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8999,6 +8999,11 @@ int hdd_pktlog_enable_disable(struct hdd_context *hdd_ctx, bool enable, return -EINVAL; } + if (enable == true) + hdd_ctx->is_pktlog_enabled = 1; + else + hdd_ctx->is_pktlog_enabled = 0; + return 0; } #endif /* REMOVE_PKT_LOG */ @@ -9582,7 +9587,15 @@ static int hdd_features_init(struct hdd_context *hdd_ctx, struct hdd_adapter *ad goto deregister_frames; } - if (cds_is_packet_log_enabled()) + /** + * In case of SSR/PDR, if pktlog was enabled manually before + * SSR/PDR, Then enabled it again automatically after Wlan + * device up. + */ + if (cds_is_driver_recovering()) { + if (hdd_ctx->is_pktlog_enabled) + hdd_pktlog_enable_disable(hdd_ctx, true, 0, 0); + } else if (cds_is_packet_log_enabled()) hdd_pktlog_enable_disable(hdd_ctx, true, 0, 0); hddtxlimit.txPower2g = hdd_ctx->config->TxPower2g;