diff options
-rw-r--r-- | net/mac80211/sta_info.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 1711bae4abf2..b6cfcf038c11 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -1972,6 +1972,7 @@ static void sta_stats_decode_rate(struct ieee80211_local *local, u16 rate, | |||
1972 | u16 brate; | 1972 | u16 brate; |
1973 | unsigned int shift; | 1973 | unsigned int shift; |
1974 | 1974 | ||
1975 | rinfo->flags = 0; | ||
1975 | sband = local->hw.wiphy->bands[(rate >> 4) & 0xf]; | 1976 | sband = local->hw.wiphy->bands[(rate >> 4) & 0xf]; |
1976 | brate = sband->bitrates[rate & 0xf].bitrate; | 1977 | brate = sband->bitrates[rate & 0xf].bitrate; |
1977 | if (rinfo->bw == RATE_INFO_BW_5) | 1978 | if (rinfo->bw == RATE_INFO_BW_5) |
@@ -1987,14 +1988,15 @@ static void sta_stats_decode_rate(struct ieee80211_local *local, u16 rate, | |||
1987 | rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; | 1988 | rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI; |
1988 | } | 1989 | } |
1989 | 1990 | ||
1990 | static void sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo) | 1991 | static int sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo) |
1991 | { | 1992 | { |
1992 | u16 rate = ACCESS_ONCE(sta_get_last_rx_stats(sta)->last_rate); | 1993 | u16 rate = ACCESS_ONCE(sta_get_last_rx_stats(sta)->last_rate); |
1993 | 1994 | ||
1994 | if (rate == STA_STATS_RATE_INVALID) | 1995 | if (rate == STA_STATS_RATE_INVALID) |
1995 | rinfo->flags = 0; | 1996 | return -EINVAL; |
1996 | else | 1997 | |
1997 | sta_stats_decode_rate(sta->local, rate, rinfo); | 1998 | sta_stats_decode_rate(sta->local, rate, rinfo); |
1999 | return 0; | ||
1998 | } | 2000 | } |
1999 | 2001 | ||
2000 | static void sta_set_tidstats(struct sta_info *sta, | 2002 | static void sta_set_tidstats(struct sta_info *sta, |
@@ -2199,8 +2201,8 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
2199 | } | 2201 | } |
2200 | 2202 | ||
2201 | if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) { | 2203 | if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) { |
2202 | sta_set_rate_info_rx(sta, &sinfo->rxrate); | 2204 | if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0) |
2203 | sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE); | 2205 | sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE); |
2204 | } | 2206 | } |
2205 | 2207 | ||
2206 | sinfo->filled |= BIT(NL80211_STA_INFO_TID_STATS); | 2208 | sinfo->filled |= BIT(NL80211_STA_INFO_TID_STATS); |