summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajeev Kumar Sirasanagandla <rsirasan@qti.qualcomm.com>2016-05-30 20:46:57 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-06-01 17:36:08 +0530
commitfd6fee3ecb79247548ed20c4755bdfbea1c5f193 (patch)
treeb4286e7adb8aa2a33e75e35605ed119edf49862b
parentd448630c25fa85705c1c338e0f9f8a47d737ba9b (diff)
qcacld-2.0: Add ini to force sap into 11n for 11ac
In the current implementation, there is no way to force softap to configure in 11n, when request from hostapd is for 11ac. This change adds the ini parameter gSapForce11NFor11AC, when enabled, configures softap in 11n mode if hostapd request is for 11ac. Change-Id: I22da3971c90726a13a4b7d9c2c9b9b535d0d6809 CRs-Fixed: 1019018
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg.h11
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg.c12
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c36
3 files changed, 56 insertions, 3 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index 80ad64d82339..1ae35c8abba3 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -251,6 +251,15 @@
#define CFG_ADVERTISE_CONCURRENT_OPERATION_MIN ( 0 )
#define CFG_ADVERTISE_CONCURRENT_OPERATION_MAX ( 1 )
+/*
+ * Force softap to 11n, when gSapForce11NFor11AC is set to 1 from ini
+ * despite of hostapd.conf request for 11ac
+ */
+#define CFG_SAP_FORCE_11N_FOR_11AC_NAME "gSapForce11NFor11AC"
+#define CFG_SAP_FORCE_11N_FOR_11AC_MIN (0)
+#define CFG_SAP_FORCE_11N_FOR_11AC_MAX (1)
+#define CFG_SAP_FORCE_11N_FOR_11AC_DEFAULT (0)
+
typedef enum
{
eHDD_DOT11_MODE_AUTO = 0, //covers all things we support
@@ -4602,6 +4611,8 @@ struct hdd_config {
uint32_t tgt_gtx_usr_cfg;
bool sap_restrt_ch_avoid;
bool bug_on_reinit_failure;
+ /* parameter to force sap into 11n */
+ bool sap_force_11n_for_11ac;
};
typedef struct hdd_config hdd_config_t;
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index 911a01d3781e..984d187a0bf6 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -4590,6 +4590,13 @@ REG_TABLE_ENTRY g_registry_table[] =
CFG_BUG_ON_REINIT_FAILURE_DEFAULT,
CFG_BUG_ON_REINIT_FAILURE_MIN,
CFG_BUG_ON_REINIT_FAILURE_MAX),
+
+ REG_VARIABLE(CFG_SAP_FORCE_11N_FOR_11AC_NAME, WLAN_PARAM_Integer,
+ hdd_config_t, sap_force_11n_for_11ac,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_SAP_FORCE_11N_FOR_11AC_DEFAULT,
+ CFG_SAP_FORCE_11N_FOR_11AC_MIN,
+ CFG_SAP_FORCE_11N_FOR_11AC_MAX)
};
@@ -5410,6 +5417,11 @@ void print_hdd_cfg(hdd_context_t *pHddCtx)
hddLog(LOG2, "Name = [%s] Value = [%u]",
CFG_CH_AVOID_SAP_RESTART_NAME,
pHddCtx->cfg_ini->sap_restrt_ch_avoid);
+
+ hddLog(LOG2, "Name = [%s] Value = [%u]",
+ CFG_SAP_FORCE_11N_FOR_11AC_NAME,
+ pHddCtx->cfg_ini->sap_force_11n_for_11ac);
+
hdd_ndp_print_ini_config(pHddCtx);
}
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 77c82bad9d99..e6c47345251b 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -8047,6 +8047,11 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
else
vht_enabled = 0;
+ if (hdd_ctx->cfg_ini->sap_force_11n_for_11ac) {
+ vht_enabled = 0;
+ hddLog(LOG1, FL("VHT is Disabled in ACS"));
+ }
+
if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]) {
ch_width = nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]);
} else {
@@ -8055,6 +8060,15 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
else
ch_width = 20;
}
+
+ /* this may be possible, when sap_force_11n_for_11ac is set */
+ if ((ch_width == 80 || ch_width == 160) && !vht_enabled) {
+ if (ht_enabled && ht40_enabled)
+ ch_width = 40;
+ else
+ ch_width = 20;
+ }
+
if (ch_width == 80)
sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_80MHZ;
else if (ch_width == 40)
@@ -8082,7 +8096,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled);
/* ACS override for android */
- if (hdd_ctx->cfg_ini->sap_p2p_11ac_override && ht_enabled) {
+ if (hdd_ctx->cfg_ini->sap_p2p_11ac_override && ht_enabled &&
+ !hdd_ctx->cfg_ini->sap_force_11n_for_11ac) {
hddLog(LOG1, FL("ACS Config override for 11AC"));
vht_enabled = 1;
sap_config->acs_cfg.hw_mode = eCSR_DOT11_MODE_11ac;
@@ -13272,7 +13287,8 @@ int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter)
if (hdd_ctx->cfg_ini->sap_p2p_11ac_override &&
(sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11n ||
sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac ||
- sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY)) {
+ sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11ac_ONLY) &&
+ !hdd_ctx->cfg_ini->sap_force_11n_for_11ac) {
hddLog(LOG1, FL("** Driver force 11AC override for SAP/Go **"));
/* 11n only shall not be overridden since it may be on purpose*/
@@ -13317,6 +13333,12 @@ setup_acs_overrides:
if (sap_cfg->SapHw_mode == eCSR_DOT11_MODE_AUTO)
sap_cfg->SapHw_mode = eCSR_DOT11_MODE_11ac;
+ if (hdd_ctx->cfg_ini->sap_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;
+ }
+
if ((sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11b ||
sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11g ||
sap_cfg->SapHw_mode == eCSR_DOT11_MODE_11g_ONLY) &&
@@ -13909,6 +13931,13 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
}
wlan_hdd_set_sapHwmode(pHostapdAdapter);
+
+ if (pHddCtx->cfg_ini->sap_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;
+ }
+
/* Override hostapd.conf wmm_enabled only for 11n and 11AC configs (IOT)
* As per spec 11n/11AC STA are QOS STA and may not connect to nonQOS 11n AP
* Default enable QOS for SAP
@@ -13934,7 +13963,8 @@ static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
pConfig->ch_width_orig = iniConfig->vhtChannelWidth;
#endif
- if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80) {
+ if (pConfig->ch_width_orig == NL80211_CHAN_WIDTH_80 &&
+ !pHddCtx->cfg_ini->sap_force_11n_for_11ac) {
if (pHddCtx->isVHT80Allowed == false)
pConfig->ch_width_orig = eHT_CHANNEL_WIDTH_40MHZ;
else