From 67ecb07330b79468acfd19e002f0ca4579e3d16d Mon Sep 17 00:00:00 2001 From: sheenam monga Date: Fri, 20 Sep 2019 11:25:23 +0530 Subject: [PATCH] qcacld-3.0: Add operating frequency in hdd_config Currently, operating channel is populated for hdd_config In 6G channel numbers can be same with 2G/5G which can lead to erroneous behaviour in case of 6G. Fix is to add operating frequency list in structure hdd_config as frequency will always be unique. Change-Id: I3f21b75c6763054afd42df6ea13d5ce96b0ed0a8 CRs-Fixed: 2517114 --- core/hdd/inc/hdd_config.h | 21 ++++++++++----------- core/hdd/inc/wlan_hdd_cfg.h | 2 +- core/hdd/src/wlan_hdd_main.c | 10 +++------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/core/hdd/inc/hdd_config.h b/core/hdd/inc/hdd_config.h index fa9ac326c3ac..8c9cbd483f75 100644 --- a/core/hdd/inc/hdd_config.h +++ b/core/hdd/inc/hdd_config.h @@ -554,12 +554,12 @@ enum hdd_dot11_mode { /* * - * gOperatingChannel- Default STA operating channel + * def_sta_operating_freq - Default STA operating Freq * @Min: 0 - * @Max: 14 - * @Default: 1 + * @Max: 2484 + * @Default: 2412 * - * This ini is used to specify the default operating channel of a STA during + * This ini is used to specify the default operating frequency of a STA during * initialization. * * Related: None @@ -570,14 +570,13 @@ enum hdd_dot11_mode { * * */ -#define CFG_OPERATING_CHANNEL CFG_INI_UINT( \ - "gOperatingChannel", \ +#define CFG_OPERATING_FREQUENCY CFG_INI_UINT( \ + "def_sta_operating_freq", \ 0, \ - 14, \ - 1, \ + 2484, \ + 2412, \ CFG_VALUE_OR_DEFAULT, \ - "Default Operating Channel") - + "Default STA Operating Frequency") #ifdef DHCP_SERVER_OFFLOAD #define IPADDR_NUM_ENTRIES (4) #define IPADDR_STRING_LENGTH (16) @@ -1470,7 +1469,7 @@ enum host_log_level { CFG(CFG_INFORM_BSS_RSSI_RAW) \ CFG(CFG_MULTICAST_HOST_FW_MSGS) \ CFG(CFG_NUM_VDEV_ENABLE) \ - CFG(CFG_OPERATING_CHANNEL) \ + CFG(CFG_OPERATING_FREQUENCY) \ CFG(CFG_PRIVATE_WEXT_CONTROL) \ CFG(CFG_PROVISION_INTERFACE_POOL) \ CFG(CFG_TIMER_MULTIPLIER) \ diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index e87413dc9ba1..7eff74941a17 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -207,7 +207,7 @@ struct hdd_config { #ifdef WLAN_NUD_TRACKING uint8_t enable_nud_tracking; #endif - uint8_t operating_channel; + uint32_t operating_chan_freq; uint8_t num_vdevs; uint8_t enable_concurrent_sta[CFG_CONCURRENT_IFACE_MAX_LEN]; uint8_t dbs_scan_selection[CFG_DBS_SCAN_PARAM_LENGTH]; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fe262773dfb4..aa5b414cca17 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4676,11 +4676,8 @@ QDF_STATUS hdd_init_station_mode(struct hdd_adapter *adapter) /* set fast roaming capability in sme session */ status = sme_config_fast_roaming(mac_handle, adapter->vdev_id, true); - /* Set the default operation channel */ - sta_ctx->conn_info.chan_freq = - wlan_reg_chan_to_freq( - hdd_ctx->pdev, - hdd_ctx->config->operating_channel); + /* Set the default operation channel freq*/ + sta_ctx->conn_info.chan_freq = hdd_ctx->config->operating_chan_freq; /* Make the default Auth Type as OPEN */ sta_ctx->conn_info.auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM; @@ -9972,7 +9969,6 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx) { struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; struct hdd_config *config = hdd_ctx->config; - if (!psoc) { hdd_err("Invalid psoc"); return; @@ -9999,7 +9995,7 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx) config->private_wext_control = cfg_get(psoc, CFG_PRIVATE_WEXT_CONTROL); config->enablefwprint = cfg_get(psoc, CFG_ENABLE_FW_UART_PRINT); config->enable_fw_log = cfg_get(psoc, CFG_ENABLE_FW_LOG); - config->operating_channel = cfg_get(psoc, CFG_OPERATING_CHANNEL); + config->operating_chan_freq = cfg_get(psoc, CFG_OPERATING_FREQUENCY); config->num_vdevs = cfg_get(psoc, CFG_NUM_VDEV_ENABLE); qdf_str_lcopy(config->enable_concurrent_sta, cfg_get(psoc, CFG_ENABLE_CONCURRENT_STA),