From ba392e15cb2469cafbbb68b9ad86ecb28c9ee5c8 Mon Sep 17 00:00:00 2001 From: Peng Xu Date: Tue, 4 Nov 2014 18:28:33 -0800 Subject: qca-cld:hdd: Set proper IE field for HT20/HT40 mode Based on hostapd.conf, INI and iwpriv setphymode settings, set proper HT Capabilities, OBSS scan parameter and HT operation IE field in beacon. Change-Id: I7ba312d0eb3bfc6cdd71408efb5df3eb28800715 CRs-fixed: 748530 --- CORE/HDD/src/wlan_hdd_cfg80211.c | 32 +++++++++++++++++++++----------- CORE/HDD/src/wlan_hdd_wext.c | 12 +++++------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 0ac8f744ddb0..ef837e9a651f 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -5520,20 +5520,30 @@ static int wlan_hdd_cfg80211_set_channel( struct wiphy *wiphy, struct net_device default: hddLog(VOS_TRACE_LEVEL_ERROR, - "%s:Error!!! Invalid HT20/40 mode !", - __func__); + "%s:Error!!! Invalid HT20/40 mode: %d !", + __func__, channel_type); return -EINVAL; } + } else { + vos_mem_zero(&smeConfig, sizeof(smeConfig)); + sme_GetConfigParam(pHddCtx->hHal, &smeConfig); + /* set cbMode for 5G */ + switch (channel_type) { + case NL80211_CHAN_HT20: + case NL80211_CHAN_NO_HT: + smeConfig.csrConfig.channelBondingMode5GHz = 0; + break; + case NL80211_CHAN_HT40MINUS: + case NL80211_CHAN_HT40PLUS: + smeConfig.csrConfig.channelBondingMode5GHz = 1; + break; + default: + hddLog(LOGE, + FL("Error!!! Invalid HT20/40 mode: %d !"), channel_type); + return -EINVAL; + } + sme_UpdateConfig(pHddCtx->hHal, &smeConfig); } - - vos_mem_zero(&smeConfig, sizeof(smeConfig)); - sme_GetConfigParam(pHddCtx->hHal, &smeConfig); - if (NL80211_CHAN_NO_HT == channel_type) - smeConfig.csrConfig.obssEnabled = VOS_FALSE; - else - smeConfig.csrConfig.obssEnabled = VOS_TRUE; - sme_UpdateConfig (pHddCtx->hHal, &smeConfig); - #endif } } diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index bc1b94ffed1e..ad49b0164912 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -4691,14 +4691,12 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, } } else if (phymode == eCSR_DOT11_MODE_11n && chwidth == WNI_CFG_CHANNEL_BONDING_MODE_ENABLE) { - if (phddctx->cfg_ini->ht2040CoexEnabled) { - smeconfig.csrConfig.obssEnabled = eANI_BOOLEAN_TRUE; - halStatus = sme_SetHT2040Mode(hal, pAdapter->sessionId, + smeconfig.csrConfig.obssEnabled = eANI_BOOLEAN_TRUE; + halStatus = sme_SetHT2040Mode(hal, pAdapter->sessionId, eHT_CHAN_HT20, eANI_BOOLEAN_TRUE); - if (halStatus == eHAL_STATUS_FAILURE) { - hddLog(LOGE, FL("Failed to enable OBSS")); - return -EIO; - } + if (halStatus == eHAL_STATUS_FAILURE) { + hddLog(LOGE, FL("Failed to enable OBSS")); + return -EIO; } } #endif -- cgit v1.2.3