diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 72bc8e6dd4..2a45634ac8 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -9901,6 +9901,11 @@ enum dot11p_mode { #define CFG_SAP_FORCE_11N_FOR_11AC_MAX (1) #define CFG_SAP_FORCE_11N_FOR_11AC_DEFAULT (0) +#define CFG_GO_FORCE_11N_FOR_11AC_NAME "gGoForce11NFor11AC" +#define CFG_GO_FORCE_11N_FOR_11AC_MIN (0) +#define CFG_GO_FORCE_11N_FOR_11AC_MAX (1) +#define CFG_GO_FORCE_11N_FOR_11AC_DEFAULT (0) + /* * sap tx leakage threshold * customer can set this value from 100 to 1000 which means @@ -14257,6 +14262,7 @@ struct hdd_config { bool indoor_channel_support; /* parameter to force sap into 11n */ bool sap_force_11n_for_11ac; + bool go_force_11n_for_11ac; uint16_t sap_tx_leakage_threshold; bool multicast_replay_filter; /* parameter for indicating sifs burst duration to fw */ diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index b9ed97cd27..c79da6d2e0 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -4366,6 +4366,13 @@ struct reg_table_entry g_registry_table[] = { CFG_SAP_FORCE_11N_FOR_11AC_MIN, CFG_SAP_FORCE_11N_FOR_11AC_MAX), + REG_VARIABLE(CFG_GO_FORCE_11N_FOR_11AC_NAME, WLAN_PARAM_Integer, + struct hdd_config, go_force_11n_for_11ac, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_GO_FORCE_11N_FOR_11AC_DEFAULT, + CFG_GO_FORCE_11N_FOR_11AC_MIN, + CFG_GO_FORCE_11N_FOR_11AC_MAX), + REG_VARIABLE(CFG_INTERFACE_CHANGE_WAIT_NAME, WLAN_PARAM_Integer, struct hdd_config, iface_change_wait_time, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -6880,6 +6887,9 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx) hdd_debug("Name = [%s] Value = [%d]", CFG_SAP_FORCE_11N_FOR_11AC_NAME, hdd_ctx->config->sap_force_11n_for_11ac); + hdd_debug("Name = [%s] Value = [%d]", + CFG_GO_FORCE_11N_FOR_11AC_NAME, + hdd_ctx->config->go_force_11n_for_11ac); hdd_debug("Name = [%s] Value = [%d]", CFG_BPF_PACKET_FILTER_OFFLOAD, hdd_ctx->config->bpf_packet_filter_enable); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e41e1895d5..bb18d1f6e1 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2563,7 +2563,10 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, else vht_enabled = 0; - if (hdd_ctx->config->sap_force_11n_for_11ac) { + if (((adapter->device_mode == QDF_SAP_MODE) && + (hdd_ctx->config->sap_force_11n_for_11ac)) || + ((adapter->device_mode == QDF_P2P_GO_MODE) && + (hdd_ctx->config->go_force_11n_for_11ac))) { vht_enabled = 0; hdd_log(LOG1, FL("VHT is Disabled in ACS")); } @@ -2577,7 +2580,9 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, ch_width = 20; } - /* this may be possible, when sap_force_11n_for_11ac is set */ + /* this may be possible, when sap_force_11n_for_11ac or + * go_force_11n_for_11ac is set + */ if ((ch_width == 80 || ch_width == 160) && !vht_enabled) { if (ht_enabled && ht40_enabled) ch_width = 40; @@ -2683,7 +2688,10 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, sap_config->acs_cfg.band = hw_mode; /* ACS override for android */ if (hdd_ctx->config->sap_p2p_11ac_override && ht_enabled && - !hdd_ctx->config->sap_force_11n_for_11ac) { + !(((adapter->device_mode == QDF_SAP_MODE) && + (hdd_ctx->config->sap_force_11n_for_11ac)) || + ((adapter->device_mode == QDF_P2P_GO_MODE) && + (hdd_ctx->config->go_force_11n_for_11ac)))) { hdd_debug("ACS Config override for 11AC vhtChannelWidth %d", hdd_ctx->config->vhtChannelWidth); vht_enabled = 1; diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index b9395810e0..a77aa1189b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7322,8 +7322,11 @@ static int wlan_hdd_sap_p2p_11ac_overrides(struct hdd_adapter *ap_adapter) sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ax || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ax_ONLY) && - !hdd_ctx->config->sap_force_11n_for_11ac) { - hdd_debug("** Driver force override for SAP/Go **"); + !(((ap_adapter->device_mode == QDF_SAP_MODE) && + (hdd_ctx->config->sap_force_11n_for_11ac)) || + ((ap_adapter->device_mode == QDF_P2P_GO_MODE) && + (hdd_ctx->config->go_force_11n_for_11ac)))) { + hdd_debug("** Driver force 11AC override for SAP/Go **"); /* 11n only shall not be overridden since it may be on purpose*/ if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n) @@ -7396,7 +7399,10 @@ static int wlan_hdd_setup_acs_overrides(struct hdd_adapter *ap_adapter) sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11ac; } - if (hdd_ctx->config->sap_force_11n_for_11ac) { + if (((ap_adapter->device_mode == QDF_SAP_MODE) && + (hdd_ctx->config->sap_force_11n_for_11ac)) || + ((ap_adapter->device_mode == QDF_P2P_GO_MODE) && + (hdd_ctx->config->go_force_11n_for_11ac))) { if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac || sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11n; @@ -7944,7 +7950,10 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, if (!cds_is_sub_20_mhz_enabled()) wlan_hdd_set_sap_hwmode(adapter); - if (hdd_ctx->config->sap_force_11n_for_11ac) { + if (((adapter->device_mode == QDF_SAP_MODE) && + (hdd_ctx->config->sap_force_11n_for_11ac)) || + ((adapter->device_mode == QDF_P2P_GO_MODE) && + (hdd_ctx->config->go_force_11n_for_11ac))) { if (pConfig->SapHw_mode == eCSR_DOT11_MODE_11ac || pConfig->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) pConfig->SapHw_mode = eCSR_DOT11_MODE_11n; @@ -7966,7 +7975,10 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, sme_config->csrConfig.WMMSupportMode = eCsrRoamWmmNoQos; sme_update_config(hdd_ctx->hHal, sme_config); - if (!hdd_ctx->config->sap_force_11n_for_11ac) { + if (!((adapter->device_mode == QDF_SAP_MODE) && + (hdd_ctx->config->sap_force_11n_for_11ac)) || + ((adapter->device_mode == QDF_P2P_GO_MODE) && + (hdd_ctx->config->go_force_11n_for_11ac))) { pConfig->ch_width_orig = hdd_map_nl_chan_width(pConfig->ch_width_orig); } else {