summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/wow.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2015-01-30 13:35:26 (GMT)
committerKalle Valo <kvalo@codeaurora.org>2015-02-03 13:31:03 (GMT)
commit661d25815ea533d06c7535ddd1c4810fa7ab9e22 (patch)
tree493762b764badb8483591008ff677367a2cb1341 /drivers/net/wireless/ath/ath9k/wow.c
parent1331f5a751eb143bc7732c880bbdde4431e90a77 (diff)
downloadlinux-661d25815ea533d06c7535ddd1c4810fa7ab9e22.tar.xz
ath9k: Fix wow init/deinit
Registering the card as a wakeup source needs to be done once, during initialization. When the WOW configuration changes, the card's status as wakeup source needs to be changed too and this is done via the set_wakeup() callback. Also, make sure the device is removed properly using ath9k_deinit_wow(). Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/wow.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/wow.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/wow.c b/drivers/net/wireless/ath/ath9k/wow.c
index 1b005c6..8bcbaa9 100644
--- a/drivers/net/wireless/ath/ath9k/wow.c
+++ b/drivers/net/wireless/ath/ath9k/wow.c
@@ -336,20 +336,34 @@ int ath9k_resume(struct ieee80211_hw *hw)
void ath9k_set_wakeup(struct ieee80211_hw *hw, bool enabled)
{
struct ath_softc *sc = hw->priv;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
mutex_lock(&sc->mutex);
- device_init_wakeup(sc->dev, 1);
device_set_wakeup_enable(sc->dev, enabled);
mutex_unlock(&sc->mutex);
+
+ ath_dbg(common, WOW, "WoW wakeup source is %s\n",
+ (enabled) ? "enabled" : "disabled");
}
void ath9k_init_wow(struct ieee80211_hw *hw)
{
struct ath_softc *sc = hw->priv;
- if ((sc->driver_data & ATH9K_PCI_WOW) && device_can_wakeup(sc->dev))
+ if (sc->driver_data & ATH9K_PCI_WOW) {
hw->wiphy->wowlan = &ath9k_wowlan_support;
- atomic_set(&sc->wow_sleep_proc_intr, -1);
- atomic_set(&sc->wow_got_bmiss_intr, -1);
+ atomic_set(&sc->wow_sleep_proc_intr, -1);
+ atomic_set(&sc->wow_got_bmiss_intr, -1);
+
+ device_init_wakeup(sc->dev, 1);
+ }
+}
+
+void ath9k_deinit_wow(struct ieee80211_hw *hw)
+{
+ struct ath_softc *sc = hw->priv;
+
+ if (sc->driver_data & ATH9K_PCI_WOW)
+ device_init_wakeup(sc->dev, 0);
}