From fc81ecf9149550d4477a3a10b0e900666c84cad8 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Thu, 22 Nov 2018 11:38:41 +0800 Subject: [PATCH] qcacld-3.0: Refactor one INI about obss ht40 Based on new cfg component, refactor INI CFG_OVERRIDE_HT40_20_24GHZ_NAME and remove legacy codes. Change-Id: I5b4ed96a4930a9358bd93ee809bf5cddb2787fb4 CRs-Fixed: 2354476 --- components/mlme/core/src/wlan_mlme_main.c | 3 +++ .../mlme/dispatcher/inc/cfg_mlme_obss_ht40.h | 26 ++++++++++++++++++- .../dispatcher/inc/wlan_mlme_public_struct.h | 2 ++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 10 +++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 16 ++++++++++++ core/hdd/inc/wlan_hdd_cfg.h | 25 ------------------ core/hdd/src/wlan_hdd_cfg.c | 7 ----- core/hdd/src/wlan_hdd_cfg80211.c | 7 +++-- 8 files changed, 61 insertions(+), 35 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 7740c9ce53..204497d995 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1127,7 +1127,10 @@ static void mlme_init_obss_ht40_cfg(struct wlan_objmgr_psoc *psoc, cfg_default(CFG_OBSS_HT40_WIDTH_CH_TRANSITION_DELAY); obss_ht40->scan_activity_threshold = (uint32_t) cfg_default(CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD); + obss_ht40->is_override_ht20_40_24g = + cfg_get(psoc, CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ); } + static void mlme_init_threshold_cfg(struct wlan_objmgr_psoc *psoc, struct wlan_mlme_threshold *threshold) { diff --git a/components/mlme/dispatcher/inc/cfg_mlme_obss_ht40.h b/components/mlme/dispatcher/inc/cfg_mlme_obss_ht40.h index 866746d761..561a1385bd 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_obss_ht40.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_obss_ht40.h @@ -196,6 +196,29 @@ CFG_VALUE_OR_DEFAULT, \ "obss ht40 width transition delay") +/* + * + * override_ht20_40_24g - Use channel bonding in 2.4GHz from supplicant + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini used to set whether use channel Bonding in 2.4GHz from supplicant + * if gChannelBondingMode24GHz is set + * + * Related: gChannelBondingMode24GHz + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ CFG_INI_BOOL( \ + "override_ht20_40_24g", \ + 0, \ + "Use channel bonding in 24 GHz") + #define CFG_OBSS_HT40_ALL \ CFG(CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME) \ CFG(CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME) \ @@ -203,6 +226,7 @@ CFG(CFG_OBSS_HT40_SCAN_PASSIVE_TOTAL_PER_CHANNEL) \ CFG(CFG_OBSS_HT40_SCAN_ACTIVE_TOTAL_PER_CHANNEL) \ CFG(CFG_OBSS_HT40_SCAN_ACTIVITY_THRESHOLD) \ - CFG(CFG_OBSS_HT40_WIDTH_CH_TRANSITION_DELAY) + CFG(CFG_OBSS_HT40_WIDTH_CH_TRANSITION_DELAY) \ + CFG(CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ) #endif /* CFG_MLME_OBSS_HT40_H__ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 280eb61189..bdfe8e6f1e 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -946,6 +946,7 @@ struct wlan_mlme_acs { * @active_per_channel: obss scan active total duration per channel * @width_trans_delay: obss width transition delay * @scan_activity_threshold: obss scan activity threshold + * @is_override_ht20_40_24g: use channel bonding in 2.4 GHz */ struct wlan_mlme_obss_ht40 { uint32_t active_dwelltime; @@ -955,6 +956,7 @@ struct wlan_mlme_obss_ht40 { uint32_t active_per_channel; uint32_t width_trans_delay; uint32_t scan_activity_threshold; + bool is_override_ht20_40_24g; }; /** diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 595d1b4fdc..bc73a35fd4 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -740,6 +740,16 @@ QDF_STATUS ucfg_mlme_get_tgt_gtx_usr_cfg(struct wlan_objmgr_psoc *psoc, uint32_t *val); +/** + * ucfg_mlme_is_override_ht20_40_24g() - use channel bonding in 2.4 GHz or not + * @psoc: pointer to psoc object + * @val: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_is_override_ht20_40_24g(struct wlan_objmgr_psoc *psoc, bool *val); + /** * ucfg_mlme_get_roaming_offload() - Get roaming offload setting * @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 0be1135988..8545152d99 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -331,6 +331,22 @@ ucfg_mlme_get_tgt_gtx_usr_cfg(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +ucfg_mlme_is_override_ht20_40_24g(struct wlan_objmgr_psoc *psoc, bool *val) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *val = cfg_default(CFG_OBSS_HT40_OVERRIDE_HT40_20_24GHZ); + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + *val = mlme_obj->cfg.obss_ht40.is_override_ht20_40_24g; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS ucfg_mlme_get_roaming_offload(struct wlan_objmgr_psoc *psoc, bool *val) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 824b446437..4a6a0c6f4c 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -218,30 +218,6 @@ enum hdd_dot11_mode { #define CFG_CHANNEL_BONDING_MODE_MAX WNI_CFG_CHANNEL_BONDING_MODE_STAMAX #define CFG_CHANNEL_BONDING_MODE_DEFAULT WNI_CFG_CHANNEL_BONDING_MODE_STADEF -/* - * - * override_ht20_40_24g - use channel Bonding in 24 GHz from supplicant - * @Min: 0 - * @Max: 1 - * @Default: 0 - * - * This ini is used to use channel Bonding in 24 GHz from supplicant if - * gChannelBondingMode24GHz is set - * - * Related: gChannelBondingMode24GHz - * - * Supported Feature: STA - * - * Usage: Internal/External - * - * - */ - -#define CFG_OVERRIDE_HT40_20_24GHZ_NAME "override_ht20_40_24g" -#define CFG_OVERRIDE_HT40_20_24GHZ_MIN 0 -#define CFG_OVERRIDE_HT40_20_24GHZ_MAX 1 -#define CFG_OVERRIDE_HT40_20_24GHZ_DEFAULT 0 - /* * * gChannelBondingMode5GHz - Configures Channel Bonding in 5 GHz @@ -6041,7 +6017,6 @@ struct hdd_config { uint32_t nBmpsMinListenInterval; enum hdd_dot11_mode dot11Mode; uint32_t nChannelBondingMode24GHz; - bool override_ht20_40_24g; uint32_t nChannelBondingMode5GHz; uint32_t ScanResultAgeCount; uint8_t nRssiCatGap; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index b4ff6a1192..3da51a11a0 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -430,13 +430,6 @@ struct reg_table_entry g_registry_table[] = { CFG_CHANNEL_BONDING_MODE_MIN, CFG_CHANNEL_BONDING_MODE_MAX), - REG_VARIABLE(CFG_OVERRIDE_HT40_20_24GHZ_NAME, WLAN_PARAM_Integer, - struct hdd_config, override_ht20_40_24g, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_OVERRIDE_HT40_20_24GHZ_DEFAULT, - CFG_OVERRIDE_HT40_20_24GHZ_MIN, - CFG_OVERRIDE_HT40_20_24GHZ_MAX), - REG_VARIABLE(CFG_CHANNEL_BONDING_MODE_5GHZ_NAME, WLAN_PARAM_Integer, struct hdd_config, nChannelBondingMode5GHz, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e78f8b0f3f..0eb8baf5c8 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -16765,18 +16765,21 @@ wlan_hdd_check_ht20_ht40_ind(struct hdd_context *hdd_ctx, struct cfg80211_connect_params *req) { struct csr_roam_profile *roam_profile; + bool is_override_ht20_40_24g; roam_profile = hdd_roam_profile(adapter); roam_profile->force_24ghz_in_ht20 = false; - if (hdd_ctx->config->override_ht20_40_24g && + ucfg_mlme_is_override_ht20_40_24g(hdd_ctx->psoc, + &is_override_ht20_40_24g); + if (is_override_ht20_40_24g && !(req->ht_capa.cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40)) roam_profile->force_24ghz_in_ht20 = true; hdd_debug("req->ht_capa.cap_info %x override_ht20_40_24g %d", req->ht_capa.cap_info, - hdd_ctx->config->override_ht20_40_24g); + is_override_ht20_40_24g); } #else static inline void