qcacld-3.0: Enable the FTM mode to retrieve the radio index

qcacld-2.0 to qcacld-3.0 propagation

The wlan_hdd_nl_init() is escaped for FTM case due to the multicast
logging feature is not required for FTM mode.

But with recent logging feature change, when CNSS_LOGGER enabled,
the wlan_hdd_nl_init() is used to register to cnss_logger module
and retrieves the radio index. So allow the wlan_hdd_nl_init() be called
in both FTM and normal mode, then the radio index can be correctly assigned.

This change doesn't impact to the non CNSS_LOGGER case as it does still
initialized, but never been used.

Change-Id: Ic78982baef8770494c4319df8b1bde45f4d2bd02
CRs-fixed: 1007357
This commit is contained in:
Ryan Hsu 2016-04-28 10:20:46 -07:00 • committed by Gerrit - the friendly Code Review server
commit cfef0aee5b
2 changed files with 23 additions and 24 deletions

View file

@ -11694,16 +11694,14 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy,
void *buf;
QDF_STATUS status;
if (!tb[WLAN_HDD_TM_ATTR_DATA]) {
hddLog(LOGE,
FL
("WLAN_HDD_TM_ATTR_DATA attribute is invalid"));
hdd_err("WLAN_HDD_TM_ATTR_DATA attribute is invalid");
return -EINVAL;
}
buf = nla_data(tb[WLAN_HDD_TM_ATTR_DATA]);
buf_len = nla_len(tb[WLAN_HDD_TM_ATTR_DATA]);
pr_info("****FTM Tx cmd len = %d*****\n", buf_len);
hdd_info("****FTM Tx cmd len = %d*****", buf_len);
status = wlan_hdd_ftm_testmode_cmd(buf, buf_len);
@ -11785,7 +11783,7 @@ void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len)
nla_put(skb, WLAN_HDD_TM_ATTR_DATA, buf_len, buf))
goto nla_put_failure;
pr_info("****FTM Rx cmd len = %zu*****\n", buf_len);
hdd_info("****FTM Rx cmd len = %zu*****", buf_len);
cfg80211_testmode_event(skb, GFP_KERNEL);
return;

View file

@ -4068,6 +4068,8 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx)
hdd_unregister_wext_all_adapters(hdd_ctx);
hdd_exit_netlink_services(hdd_ctx);
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
hdd_disable_ftm(hdd_ctx);
@ -4169,8 +4171,6 @@ void hdd_wlan_exit(hdd_context_t *hdd_ctx)
hdd_wlan_green_ap_deinit(hdd_ctx);
hdd_exit_netlink_services(hdd_ctx);
hdd_close_all_adapters(hdd_ctx, false);
hdd_ipa_cleanup(hdd_ctx);
@ -6117,11 +6117,14 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
if (IS_ERR(hdd_ctx))
return PTR_ERR(hdd_ctx);
ret = hdd_init_netlink_services(hdd_ctx);
if (ret)
goto err_hdd_free_context;
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
ret = hdd_enable_ftm(hdd_ctx);
if (ret)
goto err_hdd_free_context;
goto err_exit_nl_srv;
goto success;
}
@ -6131,7 +6134,7 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
status = cds_open();
if (!QDF_IS_STATUS_SUCCESS(status)) {
hddLog(QDF_TRACE_LEVEL_FATAL, FL("cds_open failed"));
goto err_hdd_free_context;
goto err_exit_nl_srv;
}
wlan_hdd_update_wiphy(hdd_ctx->wiphy, hdd_ctx->config);
@ -6215,11 +6218,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
/* FW capabilities received, Set the Dot11 mode */
sme_setdef_dot11mode(hdd_ctx->hHal);
ret = hdd_init_netlink_services(hdd_ctx);
if (ret)
goto err_close_adapter;
/*
* Action frame registered in one adapter which will
* applicable to all interfaces
@ -6257,14 +6255,14 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
status = cds_init_policy_mgr();
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("Policy manager initialization failed");
goto err_exit_nl_srv;
goto err_debugfs_exit;
}
ret = hdd_init_thermal_info(hdd_ctx);
if (ret) {
hdd_err("Error while initializing thermal information");
goto err_exit_nl_srv;
goto err_debugfs_exit;
}
if (0 != hdd_lro_init(hdd_ctx))
@ -6326,13 +6324,8 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc)
goto success;
err_exit_nl_srv:
hdd_exit_netlink_services(hdd_ctx);
if (!QDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) {
hdd_err("Failed to deinit policy manager");
/* Proceed and complete the clean up */
}
err_debugfs_exit:
hdd_debugfs_exit(adapter);
err_close_adapter:
hdd_release_rtnl_lock();
@ -6358,6 +6351,14 @@ err_cds_close:
}
cds_close(hdd_ctx->pcds_context);
err_exit_nl_srv:
hdd_exit_netlink_services(hdd_ctx);
if (!QDF_IS_STATUS_SUCCESS(cds_deinit_policy_mgr())) {
hdd_err("Failed to deinit policy manager");
/* Proceed and complete the clean up */
}
err_hdd_free_context:
hdd_context_destroy(hdd_ctx);
QDF_BUG(1);