aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/410-ath9k-get-rid-of-unnecessary-setpower-calls.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-07-24 15:46:36 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-07-24 15:46:36 +0000
commit264ac83490d1c9844acc677af43b3a0de8868a30 (patch)
treef064096898d29e9ea023fc153a903c9585aedfb4 /package/mac80211/patches/410-ath9k-get-rid-of-unnecessary-setpower-calls.patch
parentffc1fefe2cc6c65407b3e23f116a960c6643abd2 (diff)
downloadupstream-264ac83490d1c9844acc677af43b3a0de8868a30.tar.gz
upstream-264ac83490d1c9844acc677af43b3a0de8868a30.tar.bz2
upstream-264ac83490d1c9844acc677af43b3a0de8868a30.zip
mac80211: add more ath9k patches
SVN-Revision: 16967
Diffstat (limited to 'package/mac80211/patches/410-ath9k-get-rid-of-unnecessary-setpower-calls.patch')
-rw-r--r--package/mac80211/patches/410-ath9k-get-rid-of-unnecessary-setpower-calls.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/package/mac80211/patches/410-ath9k-get-rid-of-unnecessary-setpower-calls.patch b/package/mac80211/patches/410-ath9k-get-rid-of-unnecessary-setpower-calls.patch
new file mode 100644
index 0000000000..4dfaeafbef
--- /dev/null
+++ b/package/mac80211/patches/410-ath9k-get-rid-of-unnecessary-setpower-calls.patch
@@ -0,0 +1,45 @@
+From 349626c9a263b41822a0c5a29061964b4a71ec3f Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <juhosg@openwrt.org>
+Date: Thu, 23 Jul 2009 09:55:52 +0200
+Subject: [PATCH 2/2] ath9k: get rid of unnecessary setpower calls
+
+We are using setpower routines regardless of the current power mode.
+Don't bother the hardware, if it is not necessary.
+
+Changes-licensed-under: ISC
+Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
+---
+ drivers/net/wireless/ath/ath9k/hw.c | 8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -475,6 +475,8 @@ static struct ath_hw *ath9k_hw_newstate(
+
+ ah->gbeacon_rate = 0;
+
++ ah->power_mode = ATH9K_PM_UNDEFINED;
++
+ return ah;
+ }
+
+@@ -2749,6 +2751,9 @@ static bool ath9k_hw_setpower_nolock(str
+ "UNDEFINED"
+ };
+
++ if (ah->power_mode == mode)
++ return status;
++
+ DPRINTF(ah->ah_sc, ATH_DBG_RESET, "%s -> %s\n",
+ modes[ah->power_mode], modes[mode]);
+
+@@ -2793,8 +2798,7 @@ void ath9k_ps_wakeup(struct ath_softc *s
+ if (++sc->ps_usecount != 1)
+ goto unlock;
+
+- if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE)
+- ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE);
++ ath9k_hw_setpower_nolock(sc->sc_ah, ATH9K_PM_AWAKE);
+
+ unlock:
+ spin_unlock_irqrestore(&sc->sc_pm_lock, flags);