]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/mac80211/rc80211_minstrel_ht.c
mac80211: minstrel_ht: reduce unnecessary rate probing attempts
[linux.git] / net / mac80211 / rc80211_minstrel_ht.c
index 5a882da82f0e47af0dc4c625a948c3b22d9dff39..ad5da9a71da0a7440c56b9200a8adf5c6942baa6 100644 (file)
@@ -575,7 +575,7 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
 
                /* (re)Initialize group rate indexes */
                for(j = 0; j < MAX_THR_RATES; j++)
-                       tmp_group_tp_rate[j] = group;
+                       tmp_group_tp_rate[j] = MCS_GROUP_RATES * group;
 
                for (i = 0; i < MCS_GROUP_RATES; i++) {
                        if (!(mi->supported[group] & BIT(i)))
@@ -1059,6 +1059,21 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
            minstrel_get_duration(mi->max_prob_rate) * 3 < sample_dur)
                return -1;
 
+
+       /*
+        * For devices with no configurable multi-rate retry, skip sampling
+        * below the per-group max throughput rate, and only use one sampling
+        * attempt per rate
+        */
+       if (mp->hw->max_rates == 1 &&
+           (minstrel_get_duration(mg->max_group_tp_rate[0]) < sample_dur ||
+            mrs->attempts))
+               return -1;
+
+       /* Skip already sampled slow rates */
+       if (sample_dur >= minstrel_get_duration(tp_rate1) && mrs->attempts)
+               return -1;
+
        /*
         * Make sure that lower rates get sampled only occasionally,
         * if the link is working perfectly.