From 4706d0fe80864362e5b0c50b309270ef06da4348 Mon Sep 17 00:00:00 2001 From: Abhishek Ambure Date: Fri, 3 Jan 2020 19:52:05 +0530 Subject: [PATCH] qcacld-3.0: Add INI to disable 6ghz support for oem 6Ghz channels information is not used by legacy OEM apps example "lowi-server" having no support for 6Ghz channels. Hence "oem_6g_support_disable" INI is added. By default INI value is 1. 6Ghz supported OEM applications sets INI value to 0 and gets 6Ghz channel information from driver. Change-Id: I2650e6ad2976b64e46ab0143b2bafc2df2343e94 CRs-Fixed: 2597651 --- components/mlme/core/src/wlan_mlme_main.c | 2 ++ .../mlme/dispatcher/inc/cfg_mlme_wifi_pos.h | 31 +++++++++++++++++-- .../dispatcher/inc/wlan_mlme_public_struct.h | 2 ++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 11 +++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 20 +++++++++++- core/hdd/src/wlan_hdd_cfg.c | 23 +++++++++++++- 6 files changed, 85 insertions(+), 4 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index dff996855ada..04387fdd9e0f 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1986,6 +1986,8 @@ static void mlme_init_wifi_pos_cfg(struct wlan_objmgr_psoc *psoc, { wifi_pos_cfg->fine_time_meas_cap = cfg_get(psoc, CFG_FINE_TIME_MEAS_CAPABILITY); + wifi_pos_cfg->oem_6g_support_disable = + cfg_get(psoc, CFG_OEM_SIXG_SUPPORT_DISABLE); } #ifdef FEATURE_WLAN_ESE diff --git a/components/mlme/dispatcher/inc/cfg_mlme_wifi_pos.h b/components/mlme/dispatcher/inc/cfg_mlme_wifi_pos.h index c93ca73c9e95..519d8e9f35f1 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_wifi_pos.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_wifi_pos.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. 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 @@ -68,7 +68,34 @@ CFG_VALUE_OR_DEFAULT, \ "fine timing measurement capability") +/* + * + * oem_6g_support_disable - oem 6g support is disabled + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to show OEM is 6Ghz disabled. For legacy OEM apps + * having no support for 6Ghz, the default value is 1 and thus driver will + * not serve 6Ghz info to legacy oem application. + * OEM apps supporting 6Ghz sets the ini value to 0 to get 6Ghz + * information from driver. + * + * Related: None + * + * Supported Feature: WIFI POS + * + * Usage: Internal/External + * + * + */ +#define CFG_OEM_SIXG_SUPPORT_DISABLE CFG_INI_BOOL( \ + "oem_6g_support_disable", \ + 1, \ + "oem 6Ghz support Enabled/disabled") + #define CFG_WIFI_POS_ALL \ - CFG(CFG_FINE_TIME_MEAS_CAPABILITY) + CFG(CFG_FINE_TIME_MEAS_CAPABILITY) \ + CFG(CFG_OEM_SIXG_SUPPORT_DISABLE) #endif /* __CFG_MLME_WIFI_POS_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 63ec3b7bb03e..700fb4c06066 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -2057,9 +2057,11 @@ struct wlan_mlme_wep_cfg { /** * struct wlan_mlme_wifi_pos_cfg - WIFI POS configs * @fine_time_meas_cap: fine timing measurement capability information + * @oem_6g_support_disable: oem is 6Ghz disabled if set */ struct wlan_mlme_wifi_pos_cfg { uint32_t fine_time_meas_cap; + bool oem_6g_support_disable; }; #define MLME_SET_BIT(value, bit_offset) ((value) |= (1 << (bit_offset))) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 0a8372228971..15f1da5c7045 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -806,6 +806,17 @@ QDF_STATUS ucfg_mlme_set_dfs_filter_offload(struct wlan_objmgr_psoc *psoc, bool dfs_filter_offload); +/** + * ucfg_mlme_get_oem_6g_supported() - Get oem 6Ghz supported + * @psoc: pointer to psoc object + * @oem_6g_supported: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_oem_6g_supported(struct wlan_objmgr_psoc *psoc, + bool *oem_6g_supported); + /** * ucfg_mlme_get_fine_time_meas_cap() - Get fine timing measurement capability * @psoc: pointer to psoc object diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 1627ece8da3b..ec8d9fedb738 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2020 The Linux Foundation. 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 @@ -254,6 +254,24 @@ ucfg_mlme_get_dfs_master_capability(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +ucfg_mlme_get_oem_6g_supported(struct wlan_objmgr_psoc *psoc, + bool *oem_6g_disable) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) { + *oem_6g_disable = + cfg_default(CFG_OEM_SIXG_SUPPORT_DISABLE); + return QDF_STATUS_E_INVAL; + } + + *oem_6g_disable = mlme_obj->cfg.wifi_pos_cfg.oem_6g_support_disable; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS ucfg_mlme_get_fine_time_meas_cap(struct wlan_objmgr_psoc *psoc, uint32_t *fine_time_meas_cap) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index e090f7f54e79..80381be75094 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. 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 @@ -480,6 +480,26 @@ static void hdd_set_fine_time_meas_cap(struct hdd_context *hdd_ctx) hdd_debug("fine time meas capability - Enabled: %04x", capability); } +/** + * hdd_set_oem_6g_supported() - set oem 6g support enabled/disable + * @hdd_ctx: HDD context + * + * This function is used to pass oem 6g support enabled/disable value + * coming from INI to SME. This function make sure that configure + * INI is supported by the device. + * + * Return: None + */ +static void hdd_set_oem_6g_supported(struct hdd_context *hdd_ctx) +{ + bool oem_6g_disable = 1; + + ucfg_mlme_get_oem_6g_supported(hdd_ctx->psoc, &oem_6g_disable); + ucfg_wifi_pos_set_oem_6g_supported(hdd_ctx->psoc, oem_6g_disable); + hdd_debug("oem 6g support is - %s", + oem_6g_disable ? "Enabled" : "Disbaled"); +} + /** * hdd_convert_string_to_u8_array() - used to convert string into u8 array * @str: String to be converted @@ -891,6 +911,7 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) sme_config->csr_config.max_intf_count = hdd_ctx->max_intf_count; hdd_set_fine_time_meas_cap(hdd_ctx); + hdd_set_oem_6g_supported(hdd_ctx); cds_set_multicast_logging(hdd_ctx->config->multicast_host_fw_msgs);