Jelajahi Sumber

qcacld-3.0: Add support of setting FW debug mode

FW needs the debug mode from WLAN INI file. After parsing INI file,
WLAN driver passes the mode value to platform driver, which uses
QMI message to exchange information with FW.

Change-Id: Ifd01b18bcfafad2344196d80ab17c605cca35972
CRs-Fixed: 942237
Yuanyuan Liu 9 tahun lalu
induk
melakukan
edcbc30ce9

+ 3 - 0
core/hdd/src/wlan_hdd_main.c

@@ -104,6 +104,7 @@ extern int hdd_hostapd_stop(struct net_device *dev);
 #include "wma.h"
 #include "cds_concurrency.h"
 #include "wlan_hdd_green_ap.h"
+#include "platform_icnss.h"
 
 #ifdef MODULE
 #define WLAN_MODULE_NAME  module_name(THIS_MODULE)
@@ -4788,6 +4789,8 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
 		goto err_config;
 	}
 
+	icnss_set_fw_debug_mode(hdd_ctx->config->enablefwlog);
+
 	hdd_ctx->current_intf_count = 0;
 	hdd_ctx->max_intf_count = CSR_ROAM_SESSION_MAX;
 

+ 37 - 0
core/hif/inc/platform_icnss.h

@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+#ifndef _PLATFORM_ICNSS_H_
+#define _PLATFORM_ICNSS_H_
+
+#ifdef HIF_PCI
+#include "icnss_stub.h"
+#else
+#include <soc/qcom/icnss.h>
+#endif
+
+#endif

+ 27 - 0
core/hif/src/icnss_stub/icnss_stub.c

@@ -93,6 +93,17 @@ int icnss_wlan_disable(enum icnss_driver_mode mode)
 	return 0;
 }
 
+/**
+ * icnss_set_fw_debug_mode() - icnss_set_fw_debug_mode
+ * @mode: fw debug mode, 0 for QXDM, 1 for WMI
+ *
+ * Return: int
+ */
+int icnss_set_fw_debug_mode(bool mode)
+{
+	return 0;
+}
+
 #else
 
 /**
@@ -167,6 +178,22 @@ int icnss_wlan_disable(enum icnss_driver_mode con_mode)
 	cnss_wlan_disable(mode);
 	return 0;
 }
+
+/**
+ * icnss_set_fw_debug_mode() - call the platform driver to set fw
+ * debug mode
+ * @mode: fw debug mode, 0 for QXDM, 1 for WMI
+ *
+ * This function passes the fw debug mode to platform driver.
+ * cnss_set_fw_debug_mode has been hacked to do a qmi handshake with fw.
+ * This is not needed for rome.
+ *
+ * Return: int
+ */
+int icnss_set_fw_debug_mode(bool mode)
+{
+	return cnss_set_fw_debug_mode(mode);
+}
 #endif
 
 /**

+ 1 - 0
core/hif/src/icnss_stub/icnss_stub.h

@@ -121,6 +121,7 @@ struct icnss_soc_info {
 int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config,
 	enum icnss_driver_mode mode, const char *host_version);
 int icnss_wlan_disable(enum icnss_driver_mode mode);
+int icnss_set_fw_debug_mode(bool mode);
 int icnss_ce_request_irq(int ce_id,
 	irqreturn_t (*handler)(int ce_id, void *arg),
 	unsigned long flags, const char *name, void *context);