1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 22 Jan 2021 18:21:13 +0100
3 Subject: [PATCH] mac80211: minstrel_ht: update total packets counter in tx
6 Keep the update in one place and prepare for further rework
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/net/mac80211/rc80211_minstrel_ht.c
12 +++ b/net/mac80211/rc80211_minstrel_ht.c
13 @@ -1093,6 +1093,16 @@ minstrel_ht_tx_status(void *priv, struct
14 info->status.ampdu_len = 1;
18 + if (mi->total_packets >= ~0 - info->status.ampdu_len) {
19 + mi->total_packets = 0;
20 + mi->sample_packets = 0;
23 + mi->total_packets += info->status.ampdu_len;
24 + if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
25 + mi->sample_packets += info->status.ampdu_len;
28 mi->ampdu_len += info->status.ampdu_len;
30 @@ -1104,9 +1114,6 @@ minstrel_ht_tx_status(void *priv, struct
34 - if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
35 - mi->sample_packets += info->status.ampdu_len;
37 if (mi->sample_mode != MINSTREL_SAMPLE_IDLE)
38 rate_sample = minstrel_get_ratestats(mi, mi->sample_rate);
40 @@ -1504,14 +1511,6 @@ minstrel_ht_get_rate(void *priv, struct
42 sample_idx = minstrel_get_sample_rate(mp, mi);
44 - mi->total_packets++;
47 - if (mi->total_packets == ~0) {
48 - mi->total_packets = 0;
49 - mi->sample_packets = 0;