aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2011-04-22 02:02:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-25 14:50:18 -0400
commit515139066928da040d1482f201ef1b769bc29aa0 (patch)
treeb360ef1a4734ae2b1760b15de62ea7c288db541a /drivers/net/wireless/ath
parentd1c038d620c45fbbc65bcadf813a86bca686dd31 (diff)
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')
-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 e7d6d98ed1cc..dd2fffbbef2e 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)
2211 int timeout = 200; /* ms */ 2211 int timeout = 200; /* ms */
2212 int i, j; 2212 int i, j;
2213 2213
2214 ath9k_ps_wakeup(sc);
2215 mutex_lock(&sc->mutex); 2214 mutex_lock(&sc->mutex);
2216
2217 cancel_delayed_work_sync(&sc->tx_complete_work); 2215 cancel_delayed_work_sync(&sc->tx_complete_work);
2218 2216
2219 if (drop) 2217 if (drop)
@@ -2236,15 +2234,15 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
2236 goto out; 2234 goto out;
2237 } 2235 }
2238 2236
2237 ath9k_ps_wakeup(sc);
2239 if (!ath_drain_all_txq(sc, false)) 2238 if (!ath_drain_all_txq(sc, false))
2240 ath_reset(sc, false); 2239 ath_reset(sc, false);
2241 2240 ath9k_ps_restore(sc);
2242 ieee80211_wake_queues(hw); 2241 ieee80211_wake_queues(hw);
2243 2242
2244out: 2243out:
2245 ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0); 2244 ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0);
2246 mutex_unlock(&sc->mutex); 2245 mutex_unlock(&sc->mutex);
2247 ath9k_ps_restore(sc);
2248} 2246}
2249 2247
2250static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw) 2248static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw)