mac80211: minstrel_ht A-MPDU fix
[pandora-kernel.git] / net / mac80211 / rc80211_minstrel_ht.c
index b5ace24..2a18d66 100644 (file)
@@ -397,8 +397,9 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
            !(info->flags & IEEE80211_TX_STAT_AMPDU))
                return;
 
-       if (!info->status.ampdu_len) {
-               info->status.ampdu_ack_len = 1;
+       if (!(info->flags & IEEE80211_TX_STAT_AMPDU)) {
+               info->status.ampdu_ack_len =
+                       (info->flags & IEEE80211_TX_STAT_ACK ? 1 : 0);
                info->status.ampdu_len = 1;
        }
 
@@ -426,7 +427,7 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
                group = minstrel_ht_get_group_idx(&ar[i]);
                rate = &mi->groups[group].rates[ar[i].idx % 8];
 
-               if (last && (info->flags & IEEE80211_TX_STAT_ACK))
+               if (last)
                        rate->success += info->status.ampdu_ack_len;
 
                rate->attempts += ar[i].count * info->status.ampdu_len;
@@ -636,7 +637,7 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
        int i;
 
        /* fall back to the old minstrel for legacy stations */
-       if (sta && !sta->ht_cap.ht_supported) {
+       if (!sta->ht_cap.ht_supported) {
                msp->is_ht = false;
                memset(&msp->legacy, 0, sizeof(msp->legacy));
                msp->legacy.r = msp->ratelist;
@@ -748,7 +749,7 @@ minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
        return msp;
 
 error1:
-       kfree(msp->sample_table);
+       kfree(msp->ratelist);
 error:
        kfree(msp);
        return NULL;