diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-11-15 12:27:56 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-12-10 16:51:50 -0500 |
commit | 8acbcddb5fb3a1dc081defe51b6ac42a7ab0b398 (patch) | |
tree | 7c7fe320b8d83a938f7cd72115946617e043b249 /net | |
parent | 8e3c1b77435d93c0207d4701ca5b3e84d40c983d (diff) |
minstrel: update stats after processing status
Instead of updating stats before sending a packet,
update them after processing the packet's status.
This makes minstrel in line with minstrel_ht.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rc80211_minstrel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 79633ae06fd..8c5acdc0622 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -154,6 +154,7 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
154 | struct ieee80211_sta *sta, void *priv_sta, | 154 | struct ieee80211_sta *sta, void *priv_sta, |
155 | struct sk_buff *skb) | 155 | struct sk_buff *skb) |
156 | { | 156 | { |
157 | struct minstrel_priv *mp = priv; | ||
157 | struct minstrel_sta_info *mi = priv_sta; | 158 | struct minstrel_sta_info *mi = priv_sta; |
158 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 159 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
159 | struct ieee80211_tx_rate *ar = info->status.rates; | 160 | struct ieee80211_tx_rate *ar = info->status.rates; |
@@ -181,6 +182,10 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband, | |||
181 | 182 | ||
182 | if (mi->sample_deferred > 0) | 183 | if (mi->sample_deferred > 0) |
183 | mi->sample_deferred--; | 184 | mi->sample_deferred--; |
185 | |||
186 | if (time_after(jiffies, mi->stats_update + | ||
187 | (mp->update_interval * HZ) / 1000)) | ||
188 | minstrel_update_stats(mp, mi); | ||
184 | } | 189 | } |
185 | 190 | ||
186 | 191 | ||
@@ -235,10 +240,6 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, | |||
235 | 240 | ||
236 | mrr = mp->has_mrr && !txrc->rts && !txrc->bss_conf->use_cts_prot; | 241 | mrr = mp->has_mrr && !txrc->rts && !txrc->bss_conf->use_cts_prot; |
237 | 242 | ||
238 | if (time_after(jiffies, mi->stats_update + (mp->update_interval * | ||
239 | HZ) / 1000)) | ||
240 | minstrel_update_stats(mp, mi); | ||
241 | |||
242 | ndx = mi->max_tp_rate; | 243 | ndx = mi->max_tp_rate; |
243 | 244 | ||
244 | if (mrr) | 245 | if (mrr) |