aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/349-mac80211-fix-legacy-invalid-rxrate.patch
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2017-01-13 10:34:52 +0100
committerFelix Fietkau <nbd@nbd.name>2017-01-14 18:28:21 +0100
commitadf2fef5e8665e534d4895308d9e3325df7716ba (patch)
tree27ea4f52e79589ba6fe75ed3c81745fb5839ecf2 /package/kernel/mac80211/patches/349-mac80211-fix-legacy-invalid-rxrate.patch
parent5b089e45a649b936d5ce71930adef4fdea8a7875 (diff)
downloadupstream-adf2fef5e8665e534d4895308d9e3325df7716ba.tar.gz
upstream-adf2fef5e8665e534d4895308d9e3325df7716ba.tar.bz2
upstream-adf2fef5e8665e534d4895308d9e3325df7716ba.zip
mac80211: backport some upstream fixes
Backports the following upstream fixes: mac80211: initialize fast-xmit 'info' later mac80211: fix legacy and invalid rx-rate report mac80211: fix tid_agg_rx NULL dereference Compiled and tested on: cns3xxx Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'package/kernel/mac80211/patches/349-mac80211-fix-legacy-invalid-rxrate.patch')
-rw-r--r--package/kernel/mac80211/patches/349-mac80211-fix-legacy-invalid-rxrate.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/349-mac80211-fix-legacy-invalid-rxrate.patch b/package/kernel/mac80211/patches/349-mac80211-fix-legacy-invalid-rxrate.patch
new file mode 100644
index 0000000000..c160515892
--- /dev/null
+++ b/package/kernel/mac80211/patches/349-mac80211-fix-legacy-invalid-rxrate.patch
@@ -0,0 +1,60 @@
+From a17d93ff3a950fefaea40e4a4bf3669b9137c533 Mon Sep 17 00:00:00 2001
+From: Ben Greear <greearb@candelatech.com>
+Date: Wed, 14 Dec 2016 11:30:38 -0800
+Subject: [PATCH] mac80211: fix legacy and invalid rx-rate report
+
+This fixes obtaining the rate info via sta_set_sinfo
+when the rx rate is invalid (for instance, on IBSS
+interface that has received no frames from one of its
+peers).
+
+Also initialize rinfo->flags for legacy rates, to not
+rely on the whole sinfo being initialized to zero.
+
+Signed-off-by: Ben Greear <greearb@candelatech.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+---
+ net/mac80211/sta_info.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -1975,6 +1975,7 @@ static void sta_stats_decode_rate(struct
+ u16 brate;
+ unsigned int shift;
+
++ rinfo->flags = 0;
+ sband = local->hw.wiphy->bands[(rate >> 4) & 0xf];
+ brate = sband->bitrates[rate & 0xf].bitrate;
+ if (rinfo->bw == RATE_INFO_BW_5)
+@@ -1990,14 +1991,15 @@ static void sta_stats_decode_rate(struct
+ rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
+ }
+
+-static void sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo)
++static int sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo)
+ {
+ u16 rate = ACCESS_ONCE(sta_get_last_rx_stats(sta)->last_rate);
+
+ if (rate == STA_STATS_RATE_INVALID)
+- rinfo->flags = 0;
+- else
+- sta_stats_decode_rate(sta->local, rate, rinfo);
++ return -EINVAL;
++
++ sta_stats_decode_rate(sta->local, rate, rinfo);
++ return 0;
+ }
+
+ static void sta_set_tidstats(struct sta_info *sta,
+@@ -2202,8 +2204,8 @@ void sta_set_sinfo(struct sta_info *sta,
+ }
+
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) {
+- sta_set_rate_info_rx(sta, &sinfo->rxrate);
+- sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
++ if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0)
++ sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
+ }
+
+ sinfo->filled |= BIT(NL80211_STA_INFO_TID_STATS);