diff --git a/core/hdd/src/wlan_hdd_active_tos.c b/core/hdd/src/wlan_hdd_active_tos.c index 3f9d59cded9b..789accc97748 100644 --- a/core/hdd/src/wlan_hdd_active_tos.c +++ b/core/hdd/src/wlan_hdd_active_tos.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -166,6 +167,11 @@ __wlan_hdd_cfg80211_set_limit_offchan_param(struct wiphy *wiphy, hdd_enter(); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret < 0) return ret; diff --git a/core/hdd/src/wlan_hdd_bcn_recv.c b/core/hdd/src/wlan_hdd_bcn_recv.c index 63db8edfda36..00194a1fb63a 100644 --- a/core/hdd/src/wlan_hdd_bcn_recv.c +++ b/core/hdd/src/wlan_hdd_bcn_recv.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -321,6 +322,11 @@ static int __wlan_hdd_cfg80211_bcn_rcv_op(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + errno = hdd_validate_adapter(adapter); if (errno) return errno; diff --git a/core/hdd/src/wlan_hdd_btc_chain_mode.c b/core/hdd/src/wlan_hdd_btc_chain_mode.c index 4bc14b249d10..99c4ff9fa8ea 100644 --- a/core/hdd/src/wlan_hdd_btc_chain_mode.c +++ b/core/hdd/src/wlan_hdd_btc_chain_mode.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -141,6 +142,11 @@ static int __wlan_hdd_cfg80211_set_btc_chain_mode(struct wiphy *wiphy, hdd_enter_dev(wdev->netdev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + errno = wlan_hdd_validate_context(hdd_ctx); if (errno != 0) return errno; diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e0d28e54f34f..454a4b716103 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -6011,6 +6011,11 @@ static int __wlan_hdd_cfg80211_disable_dfs_chan_scan(struct wiphy *wiphy, bool enable_dfs_scan = true; hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret_val = wlan_hdd_validate_context(hdd_ctx); if (ret_val) return ret_val; @@ -11390,6 +11395,11 @@ __wlan_hdd_cfg80211_set_ns_offload(struct wiphy *wiphy, hdd_enter_dev(wdev->netdev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + status = wlan_hdd_validate_context(hdd_ctx); if (0 != status) return status; @@ -11574,6 +11584,11 @@ static int __wlan_hdd_cfg80211_get_preferred_freq_list(struct wiphy *wiphy, hdd_enter_dev(wdev->netdev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return -EINVAL; @@ -11769,6 +11784,11 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy, hdd_enter_dev(ndev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; @@ -12854,6 +12874,11 @@ static int __wlan_hdd_cfg80211_setband(struct wiphy *wiphy, hdd_enter(); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; @@ -13548,6 +13573,11 @@ static int __wlan_hdd_cfg80211_getband(struct wiphy *wiphy, hdd_enter(); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; @@ -15289,6 +15319,11 @@ static int __wlan_hdd_cfg80211_get_usable_channel(struct wiphy *wiphy, uint32_t count = 0; QDF_STATUS status; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (0 != ret) return ret; @@ -15411,6 +15446,11 @@ static int __wlan_hdd_cfg80211_set_roam_events(struct wiphy *wiphy, int ret; uint8_t config, state, param = 0; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret != 0) { hdd_err("Invalid hdd_ctx"); @@ -15542,6 +15582,11 @@ static int __wlan_hdd_cfg80211_get_chain_rssi(struct wiphy *wiphy, hdd_enter(); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + retval = wlan_hdd_validate_context(hdd_ctx); if (0 != retval) return retval; @@ -17165,15 +17210,11 @@ int wlan_hdd_cfg80211_init(struct device *dev, wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wiphy->max_remain_on_channel_duration = MAX_REMAIN_ON_CHANNEL_DURATION; - if (cds_get_conparam() != QDF_GLOBAL_FTM_MODE) { - wiphy->n_vendor_commands = - ARRAY_SIZE(hdd_wiphy_vendor_commands); - wiphy->vendor_commands = hdd_wiphy_vendor_commands; + wiphy->n_vendor_commands = ARRAY_SIZE(hdd_wiphy_vendor_commands); + wiphy->vendor_commands = hdd_wiphy_vendor_commands; - wiphy->vendor_events = wlan_hdd_cfg80211_vendor_events; - wiphy->n_vendor_events = - ARRAY_SIZE(wlan_hdd_cfg80211_vendor_events); - } + wiphy->vendor_events = wlan_hdd_cfg80211_vendor_events; + wiphy->n_vendor_events = ARRAY_SIZE(wlan_hdd_cfg80211_vendor_events); #ifdef QCA_HT_2040_COEX wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE; diff --git a/core/hdd/src/wlan_hdd_coex_config.c b/core/hdd/src/wlan_hdd_coex_config.c index befc34d7d26b..93bf49fee345 100644 --- a/core/hdd/src/wlan_hdd_coex_config.c +++ b/core/hdd/src/wlan_hdd_coex_config.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -74,6 +75,11 @@ static int __wlan_hdd_cfg80211_set_coex_config(struct wiphy *wiphy, hdd_enter(); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + errno = wlan_hdd_validate_context(hdd_ctx); if (errno != 0) return errno; diff --git a/core/hdd/src/wlan_hdd_disa.c b/core/hdd/src/wlan_hdd_disa.c index f7a4ee12d7c0..1484e81e44b5 100644 --- a/core/hdd/src/wlan_hdd_disa.c +++ b/core/hdd/src/wlan_hdd_disa.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -437,6 +438,11 @@ static int __wlan_hdd_cfg80211_encrypt_decrypt_msg(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; diff --git a/core/hdd/src/wlan_hdd_ocb.c b/core/hdd/src/wlan_hdd_ocb.c index 6c02d3554ad2..fe8eb4fe7455 100644 --- a/core/hdd/src/wlan_hdd_ocb.c +++ b/core/hdd/src/wlan_hdd_ocb.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -780,6 +781,11 @@ static int __wlan_hdd_cfg80211_ocb_set_config(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; @@ -980,6 +986,11 @@ static int __wlan_hdd_cfg80211_ocb_set_utc_time(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; @@ -1106,6 +1117,11 @@ __wlan_hdd_cfg80211_ocb_start_timing_advert(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; @@ -1235,6 +1251,11 @@ __wlan_hdd_cfg80211_ocb_stop_timing_advert(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; @@ -1428,6 +1449,11 @@ __wlan_hdd_cfg80211_ocb_get_tsf_timer(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + rc = wlan_hdd_validate_context(hdd_ctx); if (rc) return rc; @@ -1664,6 +1690,11 @@ static int __wlan_hdd_cfg80211_dcc_get_stats(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + rc = wlan_hdd_validate_context(hdd_ctx); if (rc) return rc; @@ -1812,6 +1843,11 @@ static int __wlan_hdd_cfg80211_dcc_clear_stats(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; @@ -1955,6 +1991,11 @@ static int __wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + rc = wlan_hdd_validate_context(hdd_ctx); if (rc) return rc; diff --git a/core/hdd/src/wlan_hdd_oemdata.c b/core/hdd/src/wlan_hdd_oemdata.c index 0194b48f9911..e12c93422a4e 100644 --- a/core/hdd/src/wlan_hdd_oemdata.c +++ b/core/hdd/src/wlan_hdd_oemdata.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1253,6 +1254,11 @@ __wlan_hdd_cfg80211_oem_data_handler(struct wiphy *wiphy, .dealloc = wlan_hdd_free_oem_data, }; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; diff --git a/core/hdd/src/wlan_hdd_rssi_monitor.c b/core/hdd/src/wlan_hdd_rssi_monitor.c index 5fbc39745466..92e226dfd7be 100644 --- a/core/hdd/src/wlan_hdd_rssi_monitor.c +++ b/core/hdd/src/wlan_hdd_rssi_monitor.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -77,6 +78,11 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + if (wlan_hdd_validate_vdev_id(adapter->vdev_id)) return -EINVAL; diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 8319dc4186a2..7c69a2412d04 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -970,6 +971,11 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, hdd_enter_dev(wdev->netdev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) { /* diff --git a/core/hdd/src/wlan_hdd_subnet_detect.c b/core/hdd/src/wlan_hdd_subnet_detect.c index d4b0e4a9c2f4..48cecae81bcd 100644 --- a/core/hdd/src/wlan_hdd_subnet_detect.c +++ b/core/hdd/src/wlan_hdd_subnet_detect.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2015-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -80,6 +81,11 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (0 != ret) return ret; diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index 90fd4f3d187b..0eb7671f196c 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -2455,6 +2455,11 @@ static int __wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, hdd_enter_dev(wdev->netdev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + status = wlan_hdd_validate_context(hdd_ctx); if (0 != status) return -EINVAL; diff --git a/core/hdd/src/wlan_hdd_tx_power.c b/core/hdd/src/wlan_hdd_tx_power.c index 68edcb5e44ac..a6a8201f4086 100644 --- a/core/hdd/src/wlan_hdd_tx_power.c +++ b/core/hdd/src/wlan_hdd_tx_power.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -63,6 +64,11 @@ static int __wlan_hdd_cfg80211_txpower_scale(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; @@ -147,6 +153,11 @@ __wlan_hdd_cfg80211_txpower_scale_decr_db(struct wiphy *wiphy, hdd_enter_dev(dev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c index 6b0eee8e75e0..8789d36c74aa 100644 --- a/core/hdd/src/wlan_hdd_wmm.c +++ b/core/hdd/src/wlan_hdd_wmm.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2835,6 +2836,11 @@ static int __wlan_hdd_cfg80211_config_tspec(struct wiphy *wiphy, hdd_enter_dev(wdev->netdev); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + ret = wlan_hdd_validate_context(hdd_ctx); if (ret != 0) return ret; diff --git a/os_if/interop_issues_ap/src/wlan_cfg80211_interop_issues_ap.c b/os_if/interop_issues_ap/src/wlan_cfg80211_interop_issues_ap.c index 077045a270a0..81a010a54b38 100644 --- a/os_if/interop_issues_ap/src/wlan_cfg80211_interop_issues_ap.c +++ b/os_if/interop_issues_ap/src/wlan_cfg80211_interop_issues_ap.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -182,6 +183,11 @@ __wlan_cfg80211_set_interop_issues_ap_config(struct wiphy *wiphy, struct wlan_objmgr_vdev *vdev; vdev = hdd_objmgr_get_vdev(adapter); + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("Command not allowed in FTM mode"); + return -EPERM; + } + if (!vdev) { osif_err("Invalid vdev"); return -EINVAL;