ath9k: Fix tx struck state with paprd
authorVasanthakumar Thiagarajan <vasanth@atheros.com>
Tue, 21 Sep 2010 05:54:46 +0000 (22:54 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:31:58 +0000 (13:31 -0800)
commit 9094537c3a9ef9e127e844254a74186735c9a90b upstream.

Paprd needs to be done only on active chains(not for all the chains
that hw can support). The paprd training frames which are sent
for inactive chains would be hanging on the hw queue without
getting transmitted and would make the connection so unstable.
This issue happens only with the hw which supports paprd cal(ar9003).

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath9k/main.c

index 3caa32316e7b4567c5cbb7372aef8330b8d2a747..2f3f766cc19b169cb10cba054af5d71d2a047109 100644 (file)
@@ -269,6 +269,7 @@ static void ath_paprd_activate(struct ath_softc *sc)
 {
        struct ath_hw *ah = sc->sc_ah;
        struct ath9k_hw_cal_data *caldata = ah->caldata;
+       struct ath_common *common = ath9k_hw_common(ah);
        int chain;
 
        if (!caldata || !caldata->paprd_done)
@@ -277,7 +278,7 @@ static void ath_paprd_activate(struct ath_softc *sc)
        ath9k_ps_wakeup(sc);
        ar9003_paprd_enable(ah, false);
        for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
-               if (!(ah->caps.tx_chainmask & BIT(chain)))
+               if (!(common->tx_chainmask & BIT(chain)))
                        continue;
 
                ar9003_paprd_populate_single_table(ah, caldata, chain);
@@ -299,6 +300,7 @@ void ath_paprd_calibrate(struct work_struct *work)
        struct ieee80211_supported_band *sband = &sc->sbands[band];
        struct ath_tx_control txctl;
        struct ath9k_hw_cal_data *caldata = ah->caldata;
+       struct ath_common *common = ath9k_hw_common(ah);
        int qnum, ftype;
        int chain_ok = 0;
        int chain;
@@ -332,7 +334,7 @@ void ath_paprd_calibrate(struct work_struct *work)
        ath9k_ps_wakeup(sc);
        ar9003_paprd_init_table(ah);
        for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
-               if (!(ah->caps.tx_chainmask & BIT(chain)))
+               if (!(common->tx_chainmask & BIT(chain)))
                        continue;
 
                chain_ok = 0;