aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2011-04-22 11:32:10 +0530
committerJohn W. Linville <linville@tuxdriver.com>2011-04-25 14:50:18 -0400
commit515139066928da040d1482f201ef1b769bc29aa0 (patch)
treeb360ef1a4734ae2b1760b15de62ea7c288db541a /drivers/net/wireless/ath/ath9k/main.c
parentd1c038d620c45fbbc65bcadf813a86bca686dd31 (diff)
downloadkernel_samsung_smdk4412-515139066928da040d1482f201ef1b769bc29aa0.zip
kernel_samsung_smdk4412-515139066928da040d1482f201ef1b769bc29aa0.tar.gz
kernel_samsung_smdk4412-515139066928da040d1482f201ef1b769bc29aa0.tar.bz2
ath9k: optimize the usage of power save wrappers.
We need not wake up the chip even before mutex lock is acquired and also that it is required only if we are going to drain the txq. So place the wrappers accordingly and this change is also useful when there are no pending frames in the txq as we do not wake up the chip unnecessarily. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index e7d6d98..dd2fffb 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2211,9 +2211,7 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
int timeout = 200; /* ms */
int i, j;
- ath9k_ps_wakeup(sc);
mutex_lock(&sc->mutex);
-
cancel_delayed_work_sync(&sc->tx_complete_work);
if (drop)
@@ -2236,15 +2234,15 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
goto out;
}
+ ath9k_ps_wakeup(sc);
if (!ath_drain_all_txq(sc, false))
ath_reset(sc, false);
-
+ ath9k_ps_restore(sc);
ieee80211_wake_queues(hw);
out:
ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0);
mutex_unlock(&sc->mutex);
- ath9k_ps_restore(sc);
}
static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw)