Skip to content

Commit 44f6d42

Browse files
committed
mac80211: remove 5/10 MHz rate code from station MLME
There's no need for the station MLME code to handle bitrates for 5 or 10 MHz channels when it can't ever create such a configuration. Remove the unnecessary code. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 204a7db commit 44f6d42

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

net/mac80211/mlme.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
601601
struct ieee80211_supported_band *sband;
602602
struct ieee80211_chanctx_conf *chanctx_conf;
603603
struct ieee80211_channel *chan;
604-
u32 rate_flags, rates = 0;
604+
u32 rates = 0;
605605

606606
sdata_assert_lock(sdata);
607607

@@ -612,7 +612,6 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
612612
return;
613613
}
614614
chan = chanctx_conf->def.chan;
615-
rate_flags = ieee80211_chandef_rate_flags(&chanctx_conf->def);
616615
rcu_read_unlock();
617616
sband = local->hw.wiphy->bands[chan->band];
618617
shift = ieee80211_vif_get_shift(&sdata->vif);
@@ -636,9 +635,6 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
636635
*/
637636
rates_len = 0;
638637
for (i = 0; i < sband->n_bitrates; i++) {
639-
if ((rate_flags & sband->bitrates[i].flags)
640-
!= rate_flags)
641-
continue;
642638
rates |= BIT(i);
643639
rates_len++;
644640
}
@@ -2818,7 +2814,7 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
28182814
u32 *rates, u32 *basic_rates,
28192815
bool *have_higher_than_11mbit,
28202816
int *min_rate, int *min_rate_index,
2821-
int shift, u32 rate_flags)
2817+
int shift)
28222818
{
28232819
int i, j;
28242820

@@ -2846,8 +2842,6 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
28462842
int brate;
28472843

28482844
br = &sband->bitrates[j];
2849-
if ((rate_flags & br->flags) != rate_flags)
2850-
continue;
28512845

28522846
brate = DIV_ROUND_UP(br->bitrate, (1 << shift) * 5);
28532847
if (brate == rate) {
@@ -4411,27 +4405,15 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
44114405
u32 rates = 0, basic_rates = 0;
44124406
bool have_higher_than_11mbit;
44134407
int min_rate = INT_MAX, min_rate_index = -1;
4414-
struct ieee80211_chanctx_conf *chanctx_conf;
44154408
const struct cfg80211_bss_ies *ies;
44164409
int shift = ieee80211_vif_get_shift(&sdata->vif);
4417-
u32 rate_flags;
4418-
4419-
rcu_read_lock();
4420-
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
4421-
if (WARN_ON(!chanctx_conf)) {
4422-
rcu_read_unlock();
4423-
sta_info_free(local, new_sta);
4424-
return -EINVAL;
4425-
}
4426-
rate_flags = ieee80211_chandef_rate_flags(&chanctx_conf->def);
4427-
rcu_read_unlock();
44284410

44294411
ieee80211_get_rates(sband, bss->supp_rates,
44304412
bss->supp_rates_len,
44314413
&rates, &basic_rates,
44324414
&have_higher_than_11mbit,
44334415
&min_rate, &min_rate_index,
4434-
shift, rate_flags);
4416+
shift);
44354417

44364418
/*
44374419
* This used to be a workaround for basic rates missing

0 commit comments

Comments
 (0)