Skip to content

Commit 77423fa

Browse files
gbhat-marvellKalle Valo
authored andcommitted
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 <[email protected]> Signed-off-by: Ganapathi Bhat <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent 53a7094 commit 77423fa

File tree

1 file changed

+30
-0
lines changed
  • drivers/net/wireless/marvell/mwifiex

1 file changed

+30
-0
lines changed

drivers/net/wireless/marvell/mwifiex/11n.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,36 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
341341
le16_to_cpu(ht_cap->header.len));
342342

343343
mwifiex_fill_cap_info(priv, radio_type, &ht_cap->ht_cap);
344+
/* Update HT40 capability from current channel information */
345+
if (bss_desc->bcn_ht_oper) {
346+
u8 ht_param = bss_desc->bcn_ht_oper->ht_param;
347+
u8 radio =
348+
mwifiex_band_to_radio_type(bss_desc->bss_band);
349+
int freq =
350+
ieee80211_channel_to_frequency(bss_desc->channel,
351+
radio);
352+
struct ieee80211_channel *chan =
353+
ieee80211_get_channel(priv->adapter->wiphy, freq);
354+
355+
switch (ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
356+
case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
357+
if (chan->flags & IEEE80211_CHAN_NO_HT40PLUS) {
358+
ht_cap->ht_cap.cap_info &=
359+
~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
360+
ht_cap->ht_cap.cap_info &=
361+
~IEEE80211_HT_CAP_SGI_40;
362+
}
363+
break;
364+
case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
365+
if (chan->flags & IEEE80211_CHAN_NO_HT40MINUS) {
366+
ht_cap->ht_cap.cap_info &=
367+
~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
368+
ht_cap->ht_cap.cap_info &=
369+
~IEEE80211_HT_CAP_SGI_40;
370+
}
371+
break;
372+
}
373+
}
344374

345375
*buffer += sizeof(struct mwifiex_ie_types_htcap);
346376
ret_len += sizeof(struct mwifiex_ie_types_htcap);

0 commit comments

Comments
 (0)