mac80211: fix a few more minstrel_ht bugs (thx to Christian Lamparter)
authorFelix Fietkau <nbd@openwrt.org>
Sun, 7 Mar 2010 18:35:39 +0000 (18:35 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 7 Mar 2010 18:35:39 +0000 (18:35 +0000)
SVN-Revision: 20040

package/mac80211/patches/560-minstrel_ht.patch

index 9fa9e05c526fcb70fa886e6f7ba41baf3d97b115..1cb433db12949ebbb2416b09228cbc6ab6cd1df9 100644 (file)
@@ -68,7 +68,7 @@
  
 --- /dev/null
 +++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -0,0 +1,807 @@
+@@ -0,0 +1,809 @@
 +/*
 + * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org>
 + *
 +       * downgrade to a lower number of streams if necessary.
 +       */
 +      rate = minstrel_get_ratestats(mi, mi->max_tp_rate);
-+      if (MINSTREL_FRAC(rate->success, rate->attempts) <
-+          MINSTREL_FRAC(20, 100) && rate->attempts > 30)
++      if (rate->attempts > 30 &&
++          MINSTREL_FRAC(rate->success, rate->attempts) <
++          MINSTREL_FRAC(20, 100))
 +              minstrel_downgrade_rate(mi, &mi->max_tp_rate, true);
 +
 +      rate2 = minstrel_get_ratestats(mi, mi->max_tp_rate2);
-+      if (MINSTREL_FRAC(rate->success, rate->attempts) <
-+          MINSTREL_FRAC(20, 100) && rate->attempts > 30)
++      if (rate->attempts > 30 &&
++          MINSTREL_FRAC(rate->success, rate->attempts) <
++          MINSTREL_FRAC(20, 100))
 +              minstrel_downgrade_rate(mi, &mi->max_tp_rate2, false);
 +
 +      if (time_after(jiffies, mi->stats_update + (mp->update_interval / 2 * HZ) / 1000))
 +                      struct minstrel_rate_stats *mr = &mi->groups[i].rates[j];
 +                      int idx = i * MCS_GROUP_RATES + j;
 +
-+                      if (!mi->groups[i].supported & BIT(j))
++                      if (!(mi->groups[i].supported & BIT(j)))
 +                              continue;
 +
 +                      p += sprintf(p, "HT%c0/%cGI ", htmode, gimode);