diff options
| author | Srinivas Girigowda <sgirigow@qca.qualcomm.com> | 2016-02-01 19:37:52 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-08-20 10:36:53 -0700 |
| commit | d9e6f7bb2f81f71ed8f581a08596cd6e52a54dac (patch) | |
| tree | 8c665ab112a770abbaf6ac0b438b58ac27351a2a | |
| parent | dcc4c875c4d7ee989869150e11c5e5d28effafb3 (diff) | |
qcacld-3.0: Enable packet logging during driver init/re-init
Currently packet logging can be enabled by using the pktlogconf tool.
* Customers are not happy running the user program to collect the logs.
* There are chances of running pktlogconf between traffic.
* If packet logging is enabled after the issue has happened, we will
miss the crucial debug info.
Hence introduce a mechanism to enable packet logging during driver load.
Change-Id: I3138e252e02009094d61150a55172b49f9fca4fd
CRs-Fixed: 970647
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 10 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 32 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 3 |
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; |
