]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ath9k_hw: increase ACK timeout for half/quarter channels
authorFelix Fietkau <nbd@openwrt.org>
Thu, 19 Apr 2012 19:18:23 +0000 (21:18 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 23 Apr 2012 19:35:30 +0000 (15:35 -0400)
For some reason the MAC timing is a bit off when waiting for ACKs, so add
some extra delay to the ACK timeout values. Significantly reduces the
number of retransmissions in my tests.
Also disable the 2.4 GHz ACK timeout workaround in half/quarter mode, it
is not required there.

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

index a43934fb81388b85fa966e738f39bf61a110e57d..4dddffd7c4038ebd87617ede8c68277bd44ef4eb 100644 (file)
@@ -1020,7 +1020,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
        struct ath_common *common = ath9k_hw_common(ah);
        struct ieee80211_conf *conf = &common->hw->conf;
        const struct ath9k_channel *chan = ah->curchan;
-       int acktimeout, ctstimeout;
+       int acktimeout, ctstimeout, ack_offset = 0;
        int slottime;
        int sifstime;
        int rx_lat = 0, tx_lat = 0, eifs = 0;
@@ -1054,6 +1054,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
                    tx_lat += 11;
 
                sifstime *= 2;
+               ack_offset = 16;
                slottime = 13;
        } else if (IS_CHAN_QUARTER_RATE(chan)) {
                eifs = 340;
@@ -1063,6 +1064,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
                    tx_lat += 22;
 
                sifstime *= 4;
+               ack_offset = 32;
                slottime = 21;
        } else {
                if (AR_SREV_9287(ah) && AR_SREV_9287_13_OR_LATER(ah)) {
@@ -1080,7 +1082,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
        }
 
        /* As defined by IEEE 802.11-2007 17.3.8.6 */
-       acktimeout = slottime + sifstime + 3 * ah->coverage_class;
+       acktimeout = slottime + sifstime + 3 * ah->coverage_class + ack_offset;
        ctstimeout = acktimeout;
 
        /*
@@ -1090,7 +1092,8 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
         * BA frames in some implementations, but it has been found to fix ACK
         * timeout issues in other cases as well.
         */
-       if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) {
+       if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ &&
+           !IS_CHAN_HALF_RATE(chan) && !IS_CHAN_QUARTER_RATE(chan)) {
                acktimeout += 64 - sifstime - ah->slottime;
                ctstimeout += 48 - sifstime - ah->slottime;
        }