From 43c526270014444d0cee8680005678ecf30e1e0a Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Mon, 11 Feb 2019 12:30:05 +0530 Subject: [PATCH] qcacld-3.0: Refactor cfg item dot11mode ini to hdd cfg Refactor cfg item dot11mode ini to hdd cfg Change-Id: I212ea8040f958de5834aefc70b1e39102aa635ab CRs-Fixed: 2393501 --- core/hdd/inc/hdd_config.h | 45 +++++++++++++++++++++++++++++++++++- core/hdd/inc/wlan_hdd_cfg.h | 39 ------------------------------- core/hdd/src/wlan_hdd_cfg.c | 7 ------ core/hdd/src/wlan_hdd_main.c | 1 + 4 files changed, 45 insertions(+), 47 deletions(-) diff --git a/core/hdd/inc/hdd_config.h b/core/hdd/inc/hdd_config.h index bbf3822938e5..3d928ec412a0 100644 --- a/core/hdd/inc/hdd_config.h +++ b/core/hdd/inc/hdd_config.h @@ -84,6 +84,48 @@ enum hdd_wext_control { CFG_VALUE_OR_DEFAULT, \ "Private WEXT Control") +enum hdd_dot11_mode { + eHDD_DOT11_MODE_AUTO = 0, /* covers all things we support */ + eHDD_DOT11_MODE_abg, /* 11a/b/g only, no HT, no proprietary */ + eHDD_DOT11_MODE_11b, + eHDD_DOT11_MODE_11g, + eHDD_DOT11_MODE_11n, + eHDD_DOT11_MODE_11g_ONLY, + eHDD_DOT11_MODE_11n_ONLY, + eHDD_DOT11_MODE_11b_ONLY, + eHDD_DOT11_MODE_11ac_ONLY, + eHDD_DOT11_MODE_11ac, + eHDD_DOT11_MODE_11a, + eHDD_DOT11_MODE_11ax_ONLY, + eHDD_DOT11_MODE_11ax, +}; + +/* + * + * gDot11Mode - Phymode of vdev + * @Min: 0 (auto) + * @Max: 12 (11ax) + * @Default: 12 (11ax) + * + * This ini is used to set Phy Mode (auto, b, g, n, etc/) Valid values are + * 0-12, with 0 = Auto, 12 = 11ax. + * + * Related: None. + * + * Supported Feature: SAP + * + * Usage: Internal/External + * + * + */ + #define CFG_HDD_DOT11_MODE CFG_INI_UINT( \ + "gDot11Mode", \ + eHDD_DOT11_MODE_AUTO, \ + eHDD_DOT11_MODE_11ax, \ + eHDD_DOT11_MODE_11ax, \ + CFG_VALUE_OR_DEFAULT, \ + "dot11 mode") + /* * * gInterfaceChangeWait - Interface change wait @@ -1159,5 +1201,6 @@ enum hdd_wext_control { CFG(CFG_OPERATING_CHANNEL) \ CFG(CFG_PRIVATE_WEXT_CONTROL) \ CFG(CFG_PROVISION_INTERFACE_POOL) \ - CFG(CFG_TIMER_MULTIPLIER) + CFG(CFG_TIMER_MULTIPLIER) \ + CFG(CFG_HDD_DOT11_MODE) #endif diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 7ffb1c137e15..1bf0c0a43a5a 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -80,45 +80,6 @@ struct hdd_context; #define CFG_ENABLE_CONNECTED_SCAN_MAX (1) #define CFG_ENABLE_CONNECTED_SCAN_DEFAULT (1) -enum hdd_dot11_mode { - eHDD_DOT11_MODE_AUTO = 0, /* covers all things we support */ - eHDD_DOT11_MODE_abg, /* 11a/b/g only, no HT, no proprietary */ - eHDD_DOT11_MODE_11b, - eHDD_DOT11_MODE_11g, - eHDD_DOT11_MODE_11n, - eHDD_DOT11_MODE_11g_ONLY, - eHDD_DOT11_MODE_11n_ONLY, - eHDD_DOT11_MODE_11b_ONLY, - eHDD_DOT11_MODE_11ac_ONLY, - eHDD_DOT11_MODE_11ac, - eHDD_DOT11_MODE_11a, - eHDD_DOT11_MODE_11ax_ONLY, - eHDD_DOT11_MODE_11ax, -}; - -/* - * - * gDot11Mode - SAP phy mode - * @Min: 0 - * @Max: 12 (11ax) - * @Default: 12 (11ax) - * - * This ini is used to set Phy Mode (auto, b, g, n, etc/) Valid values are - * 0-12, with 0 = Auto, 12 = 11ax. - * - * Related: None. - * - * Supported Feature: SAP - * - * Usage: Internal/External - * - * - */ -#define CFG_DOT11_MODE_NAME "gDot11Mode" -#define CFG_DOT11_MODE_MIN eHDD_DOT11_MODE_AUTO -#define CFG_DOT11_MODE_DEFAULT eHDD_DOT11_MODE_11ax -#define CFG_DOT11_MODE_MAX eHDD_DOT11_MODE_11ax - /* * * gEnableSNRMonitoring - Enables SNR Monitoring diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 02d27e9513bb..1b574720e5d6 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -56,13 +56,6 @@ struct reg_table_entry g_registry_table[] = { CFG_ENABLE_CONNECTED_SCAN_MIN, CFG_ENABLE_CONNECTED_SCAN_MAX), - REG_VARIABLE(CFG_DOT11_MODE_NAME, WLAN_PARAM_Integer, - struct hdd_config, dot11Mode, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, - CFG_DOT11_MODE_DEFAULT, - CFG_DOT11_MODE_MIN, - CFG_DOT11_MODE_MAX), - REG_VARIABLE(CFG_ENABLE_SNR_MONITORING_NAME, WLAN_PARAM_Integer, struct hdd_config, fEnableSNRMonitoring, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ddd2ef693e76..2244e3a79e46 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9426,6 +9426,7 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx) return; } + config->dot11Mode = cfg_get(psoc, CFG_HDD_DOT11_MODE); config->bug_on_reinit_failure = cfg_get(psoc, CFG_BUG_ON_REINIT_FAILURE);