diff options
| author | Ashish Kumar Dhanotiya <adhanoti@codeaurora.org> | 2018-01-19 19:26:44 +0530 |
|---|---|---|
| committer | Ashish Kumar Dhanotiya <adhanoti@codeaurora.org> | 2018-01-22 23:53:13 +0530 |
| commit | 29c9e10ef61a3b1d8979ee76f800bbca351ff734 (patch) | |
| tree | b4bf1d374274689ae00b2bc7d27862a11c232853 | |
| parent | 7ca219de0710a1772a5e07491f27f628e24e2864 (diff) | |
qcacld-3.0: Add host support to configure GCMP
Add an ini parameter for GCMP support. Send an indication
to FW with the ini value.
Change-Id: Ib24747ddb35593373ecc83d6c7f89866571c2421
CRs-Fixed: 2175104
| -rw-r--r-- | core/hdd/inc/wlan_hdd_cfg.h | 25 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg.c | 13 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 43 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 2 |
4 files changed, 77 insertions, 6 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index aa895ae6506a..09e96d1915da 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -13959,6 +13959,30 @@ enum hw_filter_mode { #define CFG_DERIVED_INTERFACE_POOL_MAX (0xffffffff) #define CFG_DERIVED_INTERFACE_POOL_DEFAULT (0xffffffff) +/* + * <ini> + * gcmp_enabled - ini to enable/disable GCMP + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * Currently Firmware update the sequence number for each TID with 2^3 + * because of security issues. But with this PN mechanism, throughput drop + * is observed. With this ini FW takes the decision to trade off between + * security and throughput + * + * Supported Feature: STA/SAP/P2P + * + * Usage: External + * + * </ini> + */ + +#define CFG_ENABLE_GCMP_NAME "gcmp_enabled" +#define CFG_ENABLE_GCMP_MIN (0) +#define CFG_ENABLE_GCMP_MAX (1) +#define CFG_ENABLE_GCMP_DEFAULT (0) + /*--------------------------------------------------------------------------- Type declarations -------------------------------------------------------------------------*/ @@ -14849,6 +14873,7 @@ struct hdd_config { bool mac_provision; uint32_t provisioned_intf_pool; uint32_t derived_intf_pool; + bool gcmp_enabled; }; #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 a69ec0b0120b..f3a3c855a004 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -5428,6 +5428,14 @@ struct reg_table_entry g_registry_table[] = { CFG_DERIVED_INTERFACE_POOL_DEFAULT, CFG_DERIVED_INTERFACE_POOL_MIN, CFG_DERIVED_INTERFACE_POOL_MAX), + + REG_VARIABLE(CFG_ENABLE_GCMP_NAME, WLAN_PARAM_Integer, + struct hdd_config, gcmp_enabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_GCMP_DEFAULT, + CFG_ENABLE_GCMP_MIN, + CFG_ENABLE_GCMP_MAX), + }; /** @@ -7250,6 +7258,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_debug("Name = [%s] value = [0x%x]", CFG_DERIVED_INTERFACE_POOL_NAME, pHddCtx->config->derived_intf_pool); + hdd_debug("Name = [%s] value = [%d]", + CFG_ENABLE_GCMP_NAME, + pHddCtx->config->gcmp_enabled); } /** diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 02495279f517..5ecd3a2639fd 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -175,6 +175,11 @@ */ #define WLAN_DEAUTH_DPTRACE_DUMP_COUNT 100 +static const u32 hdd_gcmp_cipher_suits[] = { + WLAN_CIPHER_SUITE_GCMP, + WLAN_CIPHER_SUITE_GCMP_256, +}; + static const u32 hdd_cipher_suites[] = { WLAN_CIPHER_SUITE_WEP40, WLAN_CIPHER_SUITE_WEP104, @@ -194,8 +199,6 @@ static const u32 hdd_cipher_suites[] = { #ifdef WLAN_FEATURE_11W WLAN_CIPHER_SUITE_AES_CMAC, #endif - WLAN_CIPHER_SUITE_GCMP, - WLAN_CIPHER_SUITE_GCMP_256, }; static const struct ieee80211_channel hdd_channels_2_4_ghz[] = { @@ -13415,6 +13418,7 @@ int wlan_hdd_cfg80211_init(struct device *dev, int i, j; hdd_context_t *pHddCtx = wiphy_priv(wiphy); int len = 0; + uint32_t *cipher_suites; ENTER(); @@ -13636,9 +13640,32 @@ int wlan_hdd_cfg80211_init(struct device *dev, } } /*Initialise the supported cipher suite details */ - wiphy->cipher_suites = hdd_cipher_suites; - wiphy->n_cipher_suites = ARRAY_SIZE(hdd_cipher_suites); - + if (pCfg->gcmp_enabled) { + cipher_suites = qdf_mem_malloc(sizeof(hdd_cipher_suites) + + sizeof(hdd_gcmp_cipher_suits)); + if (cipher_suites == NULL) { + hdd_err("Not enough memory for cipher suites"); + return -ENOMEM; + } + wiphy->n_cipher_suites = QDF_ARRAY_SIZE(hdd_cipher_suites) + + QDF_ARRAY_SIZE(hdd_gcmp_cipher_suits); + qdf_mem_copy(cipher_suites, &hdd_cipher_suites, + sizeof(hdd_cipher_suites)); + qdf_mem_copy(cipher_suites + QDF_ARRAY_SIZE(hdd_cipher_suites), + &hdd_gcmp_cipher_suits, + sizeof(hdd_gcmp_cipher_suits)); + } else { + cipher_suites = qdf_mem_malloc(sizeof(hdd_cipher_suites)); + if (cipher_suites == NULL) { + hdd_err("Not enough memory for cipher suites"); + return -ENOMEM; + } + wiphy->n_cipher_suites = QDF_ARRAY_SIZE(hdd_cipher_suites); + qdf_mem_copy(cipher_suites, &hdd_cipher_suites, + sizeof(hdd_cipher_suites)); + } + wiphy->cipher_suites = cipher_suites; + cipher_suites = NULL; /*signal strength in mBm (100*dBm) */ wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wiphy->max_remain_on_channel_duration = MAX_REMAIN_ON_CHANNEL_DURATION; @@ -13700,6 +13727,7 @@ mem_fail: void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy) { int i; + const uint32_t *cipher_suites; for (i = 0; i < HDD_NUM_NL80211_BANDS; i++) { if (NULL != wiphy->bands[i] && @@ -13708,6 +13736,11 @@ void wlan_hdd_cfg80211_deinit(struct wiphy *wiphy) wiphy->bands[i]->channels = NULL; } } + cipher_suites = wiphy->cipher_suites; + wiphy->cipher_suites = NULL; + wiphy->n_cipher_suites = 0; + qdf_mem_free((uint32_t *)cipher_suites); + cipher_suites = NULL; hdd_reset_global_reg_params(); } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index e6c27a8f58bd..907d2ed3e583 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10130,6 +10130,8 @@ int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) if (hdd_ctx->config->enable_phy_reg_retention) sme_cli_set_command(0, WMI_PDEV_PARAM_FAST_PWR_TRANSITION, hdd_ctx->config->enable_phy_reg_retention, PDEV_CMD); + sme_cli_set_command(0, WMI_PDEV_PARAM_GCMP_SUPPORT_ENABLE, + hdd_ctx->config->gcmp_enabled, PDEV_CMD); sme_cli_set_command(0, (int)WMI_PDEV_AUTO_DETECT_POWER_FAILURE, hdd_ctx->config->auto_pwr_save_fail_mode, PDEV_CMD); |
