diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-02-01 09:59:49 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-02-01 10:00:23 +0100 |
commit | 84fa59b5a80f8522239755d75d7ae51855c47fd2 (patch) | |
tree | f6aeafba9cda91ab2180f415dc09c2d02143dfdc /package/kernel/mac80211/patches/subsys | |
parent | 8019c54d8a191cfb90c3bf06ff367f601f872fd1 (diff) | |
download | upstream-84fa59b5a80f8522239755d75d7ae51855c47fd2.tar.gz upstream-84fa59b5a80f8522239755d75d7ae51855c47fd2.tar.bz2 upstream-84fa59b5a80f8522239755d75d7ae51855c47fd2.zip |
mac80211: fix station rate table updates on assoc
If the driver uses .sta_add, station entries are only uploaded after the sta
is in assoc state. Fix early station rate table updates by deferring them
until the sta has been uploaded
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys')
-rw-r--r-- | package/kernel/mac80211/patches/subsys/353-mac80211-fix-station-rate-table-updates-on-assoc.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/353-mac80211-fix-station-rate-table-updates-on-assoc.patch b/package/kernel/mac80211/patches/subsys/353-mac80211-fix-station-rate-table-updates-on-assoc.patch new file mode 100644 index 0000000000..c96fc56921 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/353-mac80211-fix-station-rate-table-updates-on-assoc.patch @@ -0,0 +1,38 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Mon, 1 Feb 2021 00:59:14 +0100 +Subject: [PATCH] mac80211: fix station rate table updates on assoc + +If the driver uses .sta_add, station entries are only uploaded after the sta +is in assoc state. Fix early station rate table updates by deferring them +until the sta has been uploaded + +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/net/mac80211/driver-ops.c ++++ b/net/mac80211/driver-ops.c +@@ -125,8 +125,11 @@ int drv_sta_state(struct ieee80211_local + } else if (old_state == IEEE80211_STA_AUTH && + new_state == IEEE80211_STA_ASSOC) { + ret = drv_sta_add(local, sdata, &sta->sta); +- if (ret == 0) ++ if (ret == 0) { + sta->uploaded = true; ++ if (rcu_dereference(sta->sta.rates)) ++ drv_sta_rate_tbl_update(local, sdata, &sta->sta); ++ } + } else if (old_state == IEEE80211_STA_ASSOC && + new_state == IEEE80211_STA_AUTH) { + drv_sta_remove(local, sdata, &sta->sta); +--- a/net/mac80211/rate.c ++++ b/net/mac80211/rate.c +@@ -934,7 +934,8 @@ int rate_control_set_rates(struct ieee80 + if (old) + kfree_rcu(old, rcu_head); + +- drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); ++ if (sta->uploaded) ++ drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta); + + ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta)); + |