mac80211: don't set mesh peer ht caps if ht disabled
PATCH 1/2 mac80211: don't set mesh peer ht caps if ht disabled
Blindly setting ht caps on a mesh peer's station entry would result in MCS rates being used by the rate control algorithm even if no ht had been configured. Fix this by checking the channel type before assigning ht capabilites.
--- net/mac80211/mesh_plink.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/mesh_plink.c +2 -1
@@ -295,7 +295,8 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,spin_lock_bh (&sta->lock); sta->last_rx = jiffies; sta->sta.supp_rates[band] = rates; -if (elems->ht_cap_elem) +if (elems->ht_cap_elem && + sdata->local->_oper_channel_type !=NL80211_CHAN_NO_HT )ieee80211_ht_cap_ie_to_sta_ht_cap (sdata, sband, elems->ht_cap_elem, &sta->sta.ht_cap);
Signature · 1 line
1.7.5.4
PATCH 2/2 mac80211: fix STA channel width field
According to IEEE 802.11 8.4.2.59, set the "STA channel width" bit to 0 if transmitting STA is using a 20mhz channel.
--- net/mac80211/util.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
net/mac80211/util.c +3 -1
@@ -1684,7 +1684,9 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap, ht_oper->ht_param =IEEE80211_HT_PARAM_CHA_SEC_NONE ;break ; } -if (ht_cap->cap &IEEE80211_HT_CAP_SUP_WIDTH_20_40 ) +if (ht_cap->cap &IEEE80211_HT_CAP_SUP_WIDTH_20_40 && + channel_type !=NL80211_CHAN_NO_HT && + channel_type !=NL80211_CHAN_HT20 ) ht_oper->ht_param |=IEEE80211_HT_PARAM_CHAN_WIDTH_ANY ;/*
Signature · 1 line
1.7.5.4
Quoted 25 lines · Thomas Pedersen
Blindly setting ht caps on a mesh peer's station entry would result in MCS rates being used by the rate control algorithm even if no ht had been configured. Fix this by checking the channel type before assigning ht capabilites.
Signed-off-by Thomas Pedersen <[email protected]>---
net/mac80211/mesh_plink.c | 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)net/mac80211/mesh_plink.c +2
-2@@ -295,7 +295,8 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, spin_lock_bh(&sta->lock); sta->last_rx = jiffies; sta->sta.supp_rates[band] = rates; - if (elems->ht_cap_elem) + if (elems->ht_cap_elem && + sdata->local->_oper_channel_type != NL80211_CHAN_NO_HT) ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, elems->ht_cap_elem, &sta->sta.ht_cap); --
Quoted 2 lines
1.7.5.4
Yikes, this obviously needs the mesh refactor series to apply.