d4c04c4d8bfd079b010bfa458791423f0617efdf
[openwrt/staging/mkresin.git] / package / mac80211 / patches / 300-minstrel_no_mrr.patch
1 This fixes tx status processing for drivers that do not support mrr.
2 If the retry count is bigger than the maximum retry count configured in
3 the hardware, do not count the rate attempt as successful, the hardware
4 has probably switched to a lower rate.
5
6 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
7
8 --- a/net/mac80211/rc80211_minstrel.c
9 +++ b/net/mac80211/rc80211_minstrel.c
10 @@ -171,6 +171,7 @@ minstrel_tx_status(void *priv, struct ie
11 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
12 struct ieee80211_tx_altrate *ar = info->status.retries;
13 struct minstrel_priv *mp = priv;
14 + struct ieee80211_local *local = hw_to_local(mp->hw);
15 int i, ndx, tries;
16 int success = 0;
17
18 @@ -180,6 +181,13 @@ minstrel_tx_status(void *priv, struct ie
19 if (!mp->has_mrr || (ar[0].rate_idx < 0)) {
20 ndx = rix_to_ndx(mi, info->tx_rate_idx);
21 tries = info->status.retry_count + 1;
22 +
23 + /* If the driver does not support the MRR API, but uses
24 + * a fallback rate, use the long retry limit as indication
25 + * that a rate switch has happened */
26 + if (!mp->has_mrr && (tries >= local->long_retry_limit))
27 + success = 0;
28 +
29 mi->r[ndx].success += success;
30 mi->r[ndx].attempts += tries;
31 return;