From 3e47c63ff289fd04ea2df9c4791fa6d3a07ec49d Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Fri, 1 Sep 2017 20:15:27 +0530 Subject: [PATCH] qcacld-3.0: Add SAE related ini and cap exchange changes Add ini changes related to SAE and also changes related to capability exchange with supplicant. Change-Id: I8deaa124fe0c604e8777c4bffa064a2d8173661b CRs-Fixed: 2029357 --- core/hdd/inc/wlan_hdd_cfg.h | 26 ++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 23 +++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg80211.c | 25 +++++++++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index d9dd2ee5b098..47f52eb58bb9 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -12736,6 +12736,29 @@ enum hdd_external_acs_freq_band { #define CFG_PHY_REG_MIN (0x0) #define CFG_PHY_REG_MAX (0x2) +/* + * + * sae_enabled - Enable/Disable SAE support in driver + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable SAE support in driver + * Driver will update config to supplicant based on this config. + * + * Related: None + * + * Supported Feature: SAE + * Usage: External + * + * + */ + +#define CFG_IS_SAE_ENABLED_NAME "sae_enabled" +#define CFG_IS_SAE_ENABLED_DEFAULT (0) +#define CFG_IS_SAE_ENABLED_MIN (0) +#define CFG_IS_SAE_ENABLED_MAX (1) + /* * Type declarations */ @@ -14916,6 +14939,9 @@ struct hdd_config { uint8_t tx_chain_mask_5g; uint8_t rx_chain_mask_5g; uint32_t btm_offload_config; +#ifdef WLAN_FEATURE_SAE + bool is_sae_enabled; +#endif }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index d906f323e6e1..bb876bfab2e2 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -5416,6 +5416,15 @@ struct reg_table_entry g_registry_table[] = { CFG_BTM_ENABLE_DEFAULT, CFG_BTM_ENABLE_MIN, CFG_BTM_ENABLE_MAX), + +#ifdef WLAN_FEATURE_SAE + REG_VARIABLE(CFG_IS_SAE_ENABLED_NAME, WLAN_PARAM_Integer, + struct hdd_config, is_sae_enabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_IS_SAE_ENABLED_DEFAULT, + CFG_IS_SAE_ENABLED_MIN, + CFG_IS_SAE_ENABLED_MAX), +#endif }; @@ -6316,6 +6325,19 @@ static void hdd_wlm_cfg_log(struct hdd_context *hdd_ctx) hdd_ctx->config->wlm_latency_flags_ultralow); } +#ifdef WLAN_FEATURE_SAE +static void hdd_cfg_print_sae(struct hdd_context *hdd_ctx) +{ + hdd_debug("Name = [%s] value = [%u]", + CFG_IS_SAE_ENABLED_NAME, + hdd_ctx->config->is_sae_enabled); +} +#else +static void hdd_cfg_print_sae(struct hdd_context *hdd_ctx) +{ +} +#endif + /** * hdd_cfg_print() - print the hdd configuration * @iniTable: pointer to hdd context @@ -7247,6 +7269,7 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx) hdd_ctx->config->enable_phy_reg_retention); hdd_debug("Name = [btm_offload_config] value = [0x%x]", hdd_ctx->config->btm_offload_config); + hdd_cfg_print_sae(hdd_ctx); } diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 7b685ead0123..2afe061e5958 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -13753,6 +13753,29 @@ static void wlan_hdd_cfg80211_set_wiphy_fils_feature(struct wiphy *wiphy) } #endif +#ifdef WLAN_FEATURE_SAE +/** + * wlan_hdd_cfg80211_set_wiphy_sae_feature() - Indicates support of SAE feature + * @wiphy: Pointer to wiphy + * @config: pointer to config + * + * This function is used to indicate the support of SAE + * + * Return: None + */ +static void wlan_hdd_cfg80211_set_wiphy_sae_feature(struct wiphy *wiphy, + struct hdd_config *config) +{ + if (config->is_sae_enabled) + wiphy->features |= NL80211_FEATURE_SAE; +} +#else +static void wlan_hdd_cfg80211_set_wiphy_sae_feature(struct wiphy *wiphy, + struct hdd_config *config) +{ +} +#endif + /* * FUNCTION: wlan_hdd_cfg80211_init * This function is called by hdd_wlan_startup() @@ -13810,6 +13833,8 @@ int wlan_hdd_cfg80211_init(struct device *dev, if (pCfg->is_fils_enabled) wlan_hdd_cfg80211_set_wiphy_fils_feature(wiphy); + wlan_hdd_cfg80211_set_wiphy_sae_feature(wiphy, pCfg); + hdd_config_sched_scan_plans_to_wiphy(wiphy, pCfg); wlan_hdd_cfg80211_add_connected_pno_support(wiphy);