Skip to content

Commit

Permalink
mac80211: Fix BW upgrade for TDLS peers
Browse files Browse the repository at this point in the history
It is possible that the station is connected to an AP
with bandwidth of 80+80MHz or 160MHz. In such cases
there is no need to perform an upgrade as the maximal
supported bandwidth is 80MHz.

In addition, when upgrading and setting center_freq1
and bandwidth to 80MHz also set center_freq2 to 0.

Fixes: 0fabfaa ("mac80211: upgrade BW of TDLS peers when possible"
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Ilan Peer authored and Johannes Berg committed Apr 5, 2016
1 parent facde7f commit 4b559ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/mac80211/tdls.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ ieee80211_tdls_chandef_vht_upgrade(struct ieee80211_sub_if_data *sdata,
if (max_width > NL80211_CHAN_WIDTH_80)
max_width = NL80211_CHAN_WIDTH_80;

if (uc.width == max_width)
if (uc.width >= max_width)
return;
/*
* Channel usage constrains in the IEEE802.11ac-2013 specification only
Expand All @@ -325,6 +325,7 @@ ieee80211_tdls_chandef_vht_upgrade(struct ieee80211_sub_if_data *sdata,
for (i = 0; i < ARRAY_SIZE(centers_80mhz); i++)
if (abs(uc.chan->center_freq - centers_80mhz[i]) <= 30) {
uc.center_freq1 = centers_80mhz[i];
uc.center_freq2 = 0;
uc.width = NL80211_CHAN_WIDTH_80;
break;
}
Expand Down

0 comments on commit 4b559ec

Please sign in to comment.