* [PATCH] mac80211: fix rx-rate report when rate is invalid.
@ 2016-12-05 22:12 greearb
2016-12-07 9:07 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: greearb @ 2016-12-05 22:12 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Ben Greear
From: Ben Greear <greearb@candelatech.com>
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).
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
net/mac80211/sta_info.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 01868f9..868dc88 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2076,10 +2076,12 @@ static void 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
+ if (rate == STA_STATS_RATE_INVALID) {
+ rinfo->flags = 0; /* means use legacy rates */
+ rinfo->legacy = 0; /* Initialize legacy rates to known value */
+ } else {
sta_stats_decode_rate(sta->local, rate, rinfo);
+ }
}
static void sta_set_tidstats(struct sta_info *sta,
--
2.4.11
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mac80211: fix rx-rate report when rate is invalid.
2016-12-05 22:12 [PATCH] mac80211: fix rx-rate report when rate is invalid greearb
@ 2016-12-07 9:07 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2016-12-07 9:07 UTC (permalink / raw)
To: greearb, linux-wireless
On Mon, 2016-12-05 at 14:12 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> 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).
Please fix this completely while at it, i.e.
make sta_set_rate_info_rx() have a return value and don't set
the BIT(NL80211_STA_INFO_RX_BITRATE) when there's no known rate.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-07 9:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 22:12 [PATCH] mac80211: fix rx-rate report when rate is invalid greearb
2016-12-07 9:07 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).