net: skbuff: ensure LSE is pullable before decrementing the MPLS ttl
[linux-2.6-microblaze.git] / net / mac80211 / rc80211_minstrel.c
index 86bc469..b13b1da 100644 (file)
@@ -274,7 +274,7 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
        success = !!(info->flags & IEEE80211_TX_STAT_ACK);
 
        for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
-               if (ar[i].idx < 0)
+               if (ar[i].idx < 0 || !ar[i].count)
                        break;
 
                ndx = rix_to_ndx(mi, ar[i].idx);
@@ -287,12 +287,6 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband,
                        mi->r[ndx].stats.success += success;
        }
 
-       if ((info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) && (i >= 0))
-               mi->sample_packets++;
-
-       if (mi->sample_deferred > 0)
-               mi->sample_deferred--;
-
        if (time_after(jiffies, mi->last_stats_update +
                                mp->update_interval / (mp->new_avg ? 2 : 1)))
                minstrel_update_stats(mp, mi);
@@ -367,7 +361,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
                return;
 
        delta = (mi->total_packets * sampling_ratio / 100) -
-                       (mi->sample_packets + mi->sample_deferred / 2);
+                       mi->sample_packets;
 
        /* delta < 0: no sampling required */
        prev_sample = mi->prev_sample;
@@ -376,7 +370,6 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
                return;
 
        if (mi->total_packets >= 10000) {
-               mi->sample_deferred = 0;
                mi->sample_packets = 0;
                mi->total_packets = 0;
        } else if (delta > mi->n_rates * 2) {
@@ -401,19 +394,8 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
         * rate sampling method should be used.
         * Respect such rates that are not sampled for 20 interations.
         */
-       if (mrr_capable &&
-           msr->perfect_tx_time > mr->perfect_tx_time &&
-           msr->stats.sample_skipped < 20) {
-               /* Only use IEEE80211_TX_CTL_RATE_CTRL_PROBE to mark
-                * packets that have the sampling rate deferred to the
-                * second MRR stage. Increase the sample counter only
-                * if the deferred sample rate was actually used.
-                * Use the sample_deferred counter to make sure that
-                * the sampling is not done in large bursts */
-               info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
-               rate++;
-               mi->sample_deferred++;
-       } else {
+       if (msr->perfect_tx_time < mr->perfect_tx_time ||
+           msr->stats.sample_skipped >= 20) {
                if (!msr->sample_limit)
                        return;
 
@@ -433,6 +415,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
 
        rate->idx = mi->r[ndx].rix;
        rate->count = minstrel_get_retry_count(&mi->r[ndx], info);
+       info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
 }