|
@@ -1972,6 +1972,7 @@ static void sta_stats_decode_rate(struct ieee80211_local *local, u16 rate,
|
|
u16 brate;
|
|
u16 brate;
|
|
unsigned int shift;
|
|
unsigned int shift;
|
|
|
|
|
|
|
|
+ rinfo->flags = 0;
|
|
sband = local->hw.wiphy->bands[(rate >> 4) & 0xf];
|
|
sband = local->hw.wiphy->bands[(rate >> 4) & 0xf];
|
|
brate = sband->bitrates[rate & 0xf].bitrate;
|
|
brate = sband->bitrates[rate & 0xf].bitrate;
|
|
if (rinfo->bw == RATE_INFO_BW_5)
|
|
if (rinfo->bw == RATE_INFO_BW_5)
|
|
@@ -1987,14 +1988,15 @@ static void sta_stats_decode_rate(struct ieee80211_local *local, u16 rate,
|
|
rinfo->flags |= RATE_INFO_FLAGS_SHORT_GI;
|
|
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);
|
|
u16 rate = ACCESS_ONCE(sta_get_last_rx_stats(sta)->last_rate);
|
|
|
|
|
|
if (rate == STA_STATS_RATE_INVALID)
|
|
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,
|
|
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)
|
|
}
|
|
}
|
|
|
|
|
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) {
|
|
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);
|
|
sinfo->filled |= BIT(NL80211_STA_INFO_TID_STATS);
|