Explorar el Código

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
Srinivas Girigowda hace 9 años
padre
commit
d9e6f7bb2f
Se han modificado 3 ficheros con 45 adiciones y 0 borrados
  1. 10 0
      core/hdd/inc/wlan_hdd_main.h
  2. 32 0
      core/hdd/src/wlan_hdd_main.c
  3. 3 0
      core/hdd/src/wlan_hdd_power.c

+ 10 - 0
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) */

+ 32 - 0
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;

+ 3 - 0
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;