mac80211: fix an issue in ieee80211_tx_info count field management
authorLorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Fri, 6 Apr 2012 18:48:15 +0000 (20:48 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Apr 2012 18:32:49 +0000 (14:32 -0400)
I noticed a possible issue in the status count field management of the
ieee80211_tx_info data structure. In particular, when the AGGR
processing is employed,
status.rates[].count is set just for the first frame and not for
others belonging to the same burst, leading to wrong statistic data in
the mac80211 debug file system.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/status.c

index 5f8f89e89d6b446e989d9d3ae546174a711e016f..05f257aa2e08551f0991d4964d9acd97f4dcdf88 100644 (file)
@@ -355,7 +355,13 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
        int rtap_len;
 
        for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
-               if (info->status.rates[i].idx < 0) {
+               if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
+                   !(info->flags & IEEE80211_TX_STAT_AMPDU)) {
+                       /* just the first aggr frame carry status info */
+                       info->status.rates[i].idx = -1;
+                       info->status.rates[i].count = 0;
+                       break;
+               } else if (info->status.rates[i].idx < 0) {
                        break;
                } else if (i >= hw->max_report_rates) {
                        /* the HW cannot have attempted that rate */