diff options
| author | Kiran Kumar Lokere <klokere@codeaurora.org> | 2017-02-07 00:06:43 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-02-10 02:28:21 -0800 |
| commit | ff29955158ee2a78b71c6aaab554a5fa39fc4d00 (patch) | |
| tree | 350f52891a0ecb0e71d528c76900c2c96468cb03 | |
| parent | e520bcf9dd8d5a9e6ba5426ff77fe07d17f0debd (diff) | |
qcacld-3.0: Check FW capabilities for VHT160 support
Check the FW capabilities to enable VHT160MHz support.
Disable 160MHz by default in the configuration.
Change-Id: Ia6985d9f7c55a070dbb47faf95cd409201037e0c
CRs-Fixed: 2004245
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 75 | ||||
| -rw-r--r-- | core/mac/inc/sir_mac_prot_def.h | 4 |
2 files changed, 63 insertions, 16 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2bb8bec63378..120733650dae 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -477,6 +477,8 @@ static int curr_con_mode; */ enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width) { + uint8_t fw_ch_bw; + fw_ch_bw = wma_get_vht_ch_width(); switch (ch_width) { case NL80211_CHAN_WIDTH_20_NOHT: case NL80211_CHAN_WIDTH_20: @@ -487,9 +489,17 @@ enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width) case NL80211_CHAN_WIDTH_80: return CH_WIDTH_80MHZ; case NL80211_CHAN_WIDTH_80P80: - return CH_WIDTH_80P80MHZ; + if (fw_ch_bw == WNI_CFG_VHT_CHANNEL_WIDTH_80_PLUS_80MHZ) + return CH_WIDTH_80P80MHZ; + else if (fw_ch_bw == WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ) + return CH_WIDTH_160MHZ; + else + return CH_WIDTH_80MHZ; case NL80211_CHAN_WIDTH_160: - return CH_WIDTH_160MHZ; + if (fw_ch_bw >= WNI_CFG_VHT_CHANNEL_WIDTH_160MHZ) + return CH_WIDTH_160MHZ; + else + return CH_WIDTH_80MHZ; case NL80211_CHAN_WIDTH_5: return CH_WIDTH_5MHZ; case NL80211_CHAN_WIDTH_10: @@ -929,6 +939,7 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, struct ieee80211_supported_band *band_5g = wiphy->bands[NL80211_BAND_5GHZ]; uint32_t temp = 0; + uint32_t ch_width = eHT_CHANNEL_WIDTH_80MHZ; if (!band_5g) { hdd_info("5GHz band disabled, skipping capability population"); @@ -960,16 +971,6 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, } } - /* Get the current supported chan width */ - status = sme_cfg_get_int(hdd_ctx->hHal, - WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, - &value); - - if (status != QDF_STATUS_SUCCESS) { - hdd_err("could not get MPDU LENGTH"); - value = 0; - } - sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_BASIC_MCS_SET, &temp); temp = (temp & VHT_MCS_1x1) | pconfig->vhtRxMCS; @@ -1214,20 +1215,62 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895; - if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_80P80MHZ)) + if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_80P80MHZ)) { + status = sme_cfg_set_int(hdd_ctx->hHal, + WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, + VHT_CAP_160_AND_80P80_SUPP); + if (status == QDF_STATUS_E_FAILURE) + hdd_alert("could not set the VHT CAP 160"); band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ; - else if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_160MHZ)) + ch_width = eHT_CHANNEL_WIDTH_80P80MHZ; + } else if (cfg->supp_chan_width & (1 << eHT_CHANNEL_WIDTH_160MHZ)) { + status = sme_cfg_set_int(hdd_ctx->hHal, + WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, + VHT_CAP_160_SUPP); + if (status == QDF_STATUS_E_FAILURE) + hdd_alert("could not set the VHT CAP 160"); band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; + ch_width = eHT_CHANNEL_WIDTH_160MHZ; + } else { + status = sme_cfg_set_int(hdd_ctx->hHal, + WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, + VHT_CAP_80_SUPP); + if (status == QDF_STATUS_E_FAILURE) + hdd_alert("could not set the VHT CH BW"); + } + pconfig->vhtChannelWidth = QDF_MIN(pconfig->vhtChannelWidth, + ch_width); + /* Get the current supported chan width */ + status = sme_cfg_get_int(hdd_ctx->hHal, + WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, + &value); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("could not get CH BW"); + value = 0; + } + /* set the Guard interval 160MHz */ + if (value) { + if (cfg->vht_short_gi_160 & WMI_VHT_CAP_SGI_160MHZ) + band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_160; + value = cfg->vht_short_gi_160; + } else { + value = 0; + } + + status = sme_cfg_set_int(hdd_ctx->hHal, + WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ, + value); + + if (status == QDF_STATUS_E_FAILURE) + hdd_alert("failed to set SHORT GI 160MHZ"); if (cfg->vht_rx_ldpc & WMI_VHT_CAP_RX_LDPC) band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_RXLDPC; if (cfg->vht_short_gi_80 & WMI_VHT_CAP_SGI_80MHZ) band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_80; - if (cfg->vht_short_gi_160 & WMI_VHT_CAP_SGI_160MHZ) - band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_160; if (cfg->vht_tx_stbc & WMI_VHT_CAP_TX_STBC) band_5g->vht_cap.cap |= IEEE80211_VHT_CAP_TXSTBC; diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 238b433bca8c..84a2328cca3c 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -402,6 +402,10 @@ #define VHT_RX_HIGHEST_SUPPORTED_DATA_RATE_2_2 780 #define VHT_TX_HIGHEST_SUPPORTED_DATA_RATE_2_2 780 +#define VHT_CAP_80_SUPP 0 +#define VHT_CAP_160_SUPP 1 +#define VHT_CAP_160_AND_80P80_SUPP 2 + #define VHT_MCS_1x1 0xFFFC #define VHT_MCS_2x2 0xFFF3 |
