diff options
author | Ganapathi Bhat <gbhat@marvell.com> | 2018-03-09 19:15:25 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-03-13 17:53:46 +0100 |
commit | 77423fa739274a4c7b0e7ad90ca52ef22bdbe84e (patch) | |
tree | 0a3a1fbcd6d4325a8bddfaa88cf35f0bbb2ce816 | |
parent | Revert "mwifiex: fix incorrect ht capability problem" (diff) | |
download | linux-77423fa739274a4c7b0e7ad90ca52ef22bdbe84e.tar.xz linux-77423fa739274a4c7b0e7ad90ca52ef22bdbe84e.zip |
mwifiex: fix incorrect ht capability problem
IEEE80211_CHAN_NO_HT40PLUS and IEEE80211_CHAN_NO_HT40PLUS channel
flags tell if HT40 operation is allowed on a channel or not.
This patch ensures ht_capability information is modified
accordingly so that we don't end up creating a HT40 connection
when it's not allowed for current regulatory domain.
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/11n.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/11n.c b/drivers/net/wireless/marvell/mwifiex/11n.c index 8772e3949327..feebfdcf025a 100644 --- a/drivers/net/wireless/marvell/mwifiex/11n.c +++ b/drivers/net/wireless/marvell/mwifiex/11n.c @@ -341,6 +341,36 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv, le16_to_cpu(ht_cap->header.len)); mwifiex_fill_cap_info(priv, radio_type, &ht_cap->ht_cap); + /* Update HT40 capability from current channel information */ + if (bss_desc->bcn_ht_oper) { + u8 ht_param = bss_desc->bcn_ht_oper->ht_param; + u8 radio = + mwifiex_band_to_radio_type(bss_desc->bss_band); + int freq = + ieee80211_channel_to_frequency(bss_desc->channel, + radio); + struct ieee80211_channel *chan = + ieee80211_get_channel(priv->adapter->wiphy, freq); + + switch (ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { + case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: + if (chan->flags & IEEE80211_CHAN_NO_HT40PLUS) { + ht_cap->ht_cap.cap_info &= + ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; + ht_cap->ht_cap.cap_info &= + ~IEEE80211_HT_CAP_SGI_40; + } + break; + case IEEE80211_HT_PARAM_CHA_SEC_BELOW: + if (chan->flags & IEEE80211_CHAN_NO_HT40MINUS) { + ht_cap->ht_cap.cap_info &= + ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; + ht_cap->ht_cap.cap_info &= + ~IEEE80211_HT_CAP_SGI_40; + } + break; + } + } *buffer += sizeof(struct mwifiex_ie_types_htcap); ret_len += sizeof(struct mwifiex_ie_types_htcap); |