]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ath9k: fix rate control tx status handling for A-MPDU
authorFelix Fietkau <nbd@openwrt.org>
Mon, 1 Mar 2010 12:32:11 +0000 (13:32 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 10 Mar 2010 22:44:45 +0000 (17:44 -0500)
Currently the rate control tx status update gets called for every
subframe of an A-MPDU, and ath9k marks the frame with the relevant
status update with an internal flag. This not suitable for rate control
algorithms using the standard mac80211 rate control API, so fix this by
using IEEE80211_TX_STAT_AMPDU for marking the correct frames that
should be processed.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/ath/ath9k/rc.h
drivers/net/wireless/ath/ath9k/xmit.c

index 0e79e58cf4c96fb4704390645b0974516d995828..3c4b5d2d9e16dade7919821898d61372a71634c8 100644 (file)
@@ -1226,8 +1226,12 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
                long_retry = rate->count - 1;
        }
 
-       if (!priv_sta || !ieee80211_is_data(fc) ||
-           !(tx_info->pad[0] & ATH_TX_INFO_UPDATE_RC))
+       if (!priv_sta || !ieee80211_is_data(fc))
+               return;
+
+       /* This packet was aggregated but doesn't carry status info */
+       if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) &&
+           !(tx_info->flags & IEEE80211_TX_STAT_AMPDU))
                return;
 
        if (tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED)
index 4f6d6fd442f477f6d7d759539cec602459259b5d..f4818e4fa4b0f0d690fec62298d7737875ff2f8f 100644 (file)
@@ -172,7 +172,6 @@ struct ath_rate_priv {
 
 #define ATH_TX_INFO_FRAME_TYPE_INTERNAL        (1 << 0)
 #define ATH_TX_INFO_FRAME_TYPE_PAUSE   (1 << 1)
-#define ATH_TX_INFO_UPDATE_RC          (1 << 2)
 #define ATH_TX_INFO_XRETRY             (1 << 3)
 #define ATH_TX_INFO_UNDERRUN           (1 << 4)
 
index b2c8207f7bc17790b55c42e18a70e47f9a40320a..8359362fc51ceaf9b3d028c30fb63ef9b8f0ea0a 100644 (file)
@@ -1947,10 +1947,10 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds,
        tx_rateindex = ds->ds_txstat.ts_rateindex;
        WARN_ON(tx_rateindex >= hw->max_rates);
 
-       if (update_rc)
-               tx_info->pad[0] |= ATH_TX_INFO_UPDATE_RC;
        if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT)
                tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
+       if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && update_rc)
+               tx_info->flags |= IEEE80211_TX_STAT_AMPDU;
 
        if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 &&
            (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0 && update_rc) {