From ba3d558cc3637be7fefddd772f2272a45c793364 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Tue, 11 Jul 2017 19:48:32 +0530 Subject: [PATCH] qcacld-3.0: Add support to load the driver in FTM mode In Emulation setup its difficult to load the driver in the mission mode and change the mode to FTM mode because of certain hardware limitations. Add support to load the driver in FTM mode. Change-Id: I7e313d1234a8a01fc601c3f7edd75ca3070302d1 CRs-Fixed: 2074551 --- core/hdd/src/wlan_hdd_main.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 740ad0c0c64d..92c45376433f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -489,6 +489,8 @@ struct notifier_block hdd_netdev_notifier = { /* variable to hold the insmod parameters */ static int con_mode; +static int con_mode_ftm; + /* Variable to hold connection mode including module parameter con_mode */ static int curr_con_mode; @@ -9553,7 +9555,8 @@ int hdd_wlan_startup(struct device *dev) sme_cli_set_command(0, (int)WMI_PDEV_PARAM_ABG_MODE_TX_CHAIN_NUM, num_abg_tx_chains, PDEV_CMD); - qdf_mc_timer_start(&hdd_ctx->iface_change_timer, + if (QDF_GLOBAL_FTM_MODE != hdd_get_conparam()) + qdf_mc_timer_start(&hdd_ctx->iface_change_timer, hdd_ctx->config->iface_change_wait_time); hdd_start_complete(0); @@ -11260,6 +11263,24 @@ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) return ret; } +static int con_mode_handler_ftm(const char *kmessage, + struct kernel_param *kp) +{ + int ret; + + ret = param_set_int(kmessage, kp); + + if (con_mode_ftm != QDF_GLOBAL_FTM_MODE) { + pr_err("Only FTM mode supported!"); + return -ENOTSUPP; + } + + hdd_set_conparam(con_mode_ftm); + con_mode = con_mode_ftm; + + return ret; +} + /** * hdd_get_conparam() - driver exit point * @@ -12102,6 +12123,9 @@ MODULE_DESCRIPTION("WLAN HOST DEVICE DRIVER"); module_param_call(con_mode, con_mode_handler, param_get_int, &con_mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +module_param_call(con_mode_ftm, con_mode_handler_ftm, param_get_int, + &con_mode_ftm, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + module_param_call(fwpath, fwpath_changed_handler, param_get_string, &fwpath, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);