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;