Skip to content

Commit 96aa2e7

Browse files
committed
mac80211: calculate min channel width correctly
In the current minimum chandef code there's an issue in that the recalculation can happen after rate control is initialized for a station that has a wider bandwidth than the current chanctx, and then rate control can immediately start using those higher rates which could cause problems. Observe that first of all that this problem is because we don't take non-associated and non-uploaded stations into account. The restriction to non-associated is quite pointless and is one of the causes for the problem described above, since the rate init will happen before the station is set to associated; no frames could actually be sent until associated, but the rate table can already contain higher rates and that might cause problems. Also, rejecting non-uploaded stations is wrong, since the rate control can select higher rates for those as well. Secondly, it's then necessary to recalculate the minimal config before initializing rate control, so that when rate control is initialized, the higher rates are already available. This can be done easily by adding the necessary function call in rate init. Change-Id: Ib9bc02d34797078db55459d196993f39dcd43070 Signed-off-by: Johannes Berg <[email protected]>
1 parent 06f7c88 commit 96aa2e7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

net/mac80211/chan.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,6 @@ ieee80211_get_max_required_bw(struct ieee80211_sub_if_data *sdata)
231231
!(sta->sdata->bss && sta->sdata->bss == sdata->bss))
232232
continue;
233233

234-
if (!sta->uploaded || !test_sta_flag(sta, WLAN_STA_ASSOC))
235-
continue;
236-
237234
max_bw = max(max_bw, ieee80211_get_sta_bw(&sta->sta));
238235
}
239236
rcu_read_unlock();

net/mac80211/rate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ void rate_control_rate_init(struct sta_info *sta)
4040

4141
ieee80211_sta_set_rx_nss(sta);
4242

43+
ieee80211_recalc_min_chandef(sta->sdata);
44+
4345
if (!ref)
4446
return;
4547

0 commit comments

Comments
 (0)