summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/inc/wlan_hdd_main.h10
-rw-r--r--core/hdd/src/wlan_hdd_main.c32
-rw-r--r--core/hdd/src/wlan_hdd_power.c3
3 files changed, 45 insertions, 0 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index b42f2fa81528..fe1170847e88 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1805,4 +1805,14 @@ static inline void hdd_enable_fastpath(struct hdd_config *hdd_cfg,
}
#endif
void hdd_wlan_update_target_info(hdd_context_t *hdd_ctx, void *context);
+
+#if !defined(REMOVE_PKT_LOG)
+int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable);
+#else
+int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable)
+{
+ return 0;
+}
+#endif /* REMOVE_PKT_LOG */
+
#endif /* end #if !defined(WLAN_HDD_MAIN_H) */
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index b2699bc28dfb..a71efbdb767e 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -6703,6 +6703,34 @@ static inline bool hdd_hold_rtnl_lock(void) { return false; }
static inline void hdd_release_rtnl_lock(void) { }
#endif
+#if !defined(REMOVE_PKT_LOG)
+/**
+ * hdd_pktlog_enable_disable() - Enable/Disable packet logging
+ * @hdd_ctx: HDD context
+ * @enable: Flag to enable/disable
+ *
+ * Return: 0 on success; error number otherwise
+ */
+int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable)
+{
+ struct sir_wifi_start_log start_log;
+ QDF_STATUS status;
+
+ start_log.ring_id = RING_ID_PER_PACKET_STATS;
+ start_log.verbose_level =
+ enable ? WLAN_LOG_LEVEL_ACTIVE : WLAN_LOG_LEVEL_OFF;
+ status = sme_wifi_start_logger(hdd_ctx->hHal, start_log);
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ hdd_err("sme_wifi_start_logger failed(err=%d)", status);
+ EXIT();
+ return -EINVAL;
+ }
+
+ return 0;
+}
+#endif /* REMOVE_PKT_LOG */
+
+
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
/**
* hdd_register_for_sap_restart_with_channel_switch() - Register for SAP channel
@@ -7507,6 +7535,10 @@ int hdd_wlan_startup(struct device *dev)
if (hdd_ctx->rps)
hdd_set_rps_cpu_mask(hdd_ctx);
+
+ if (cds_is_packet_log_enabled())
+ hdd_pktlog_enable_disable(hdd_ctx, true);
+
ret = hdd_register_notifiers(hdd_ctx);
if (ret)
goto err_debugfs_exit;
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c
index 9c50fbbf7101..02f62be9ace5 100644
--- a/core/hdd/src/wlan_hdd_power.c
+++ b/core/hdd/src/wlan_hdd_power.c
@@ -1443,6 +1443,9 @@ QDF_STATUS hdd_wlan_re_init(void)
if (QDF_IS_STATUS_ERROR(qdf_status))
goto err_cds_disable;
+ if (cds_is_packet_log_enabled())
+ hdd_pktlog_enable_disable(pHddCtx, true);
+
hdd_err("WLAN host driver reinitiation completed!");
goto success;