summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-06-27 13:06:43 +0300
committerLuciano Coelho <coelho@ti.com>2011-07-05 21:50:39 +0300
commite85d1629c69f99e91598039e5c05f1608ad19c9f (patch)
tree7a18160cec70ac0a83e0d0d0c84f9544cb703cc0 /drivers/net/wireless/wl12xx
parentb5d6e5f66304bddc2b5bc7222e993dfeb629ef0c (diff)
downloadblackbird-op-linux-e85d1629c69f99e91598039e5c05f1608ad19c9f.tar.gz
blackbird-op-linux-e85d1629c69f99e91598039e5c05f1608ad19c9f.zip
wl12xx: configure suspend/resume only if associated/started
Configure the device (to wowlan) only if the sta/ap is associated/started. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index d7a74597fd59..357dc9d99945 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1610,10 +1610,13 @@ static struct notifier_block wl1271_dev_notifier = {
#ifdef CONFIG_PM
static int wl1271_configure_suspend_sta(struct wl1271 *wl)
{
- int ret;
+ int ret = 0;
mutex_lock(&wl->mutex);
+ if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
+ goto out_unlock;
+
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out_unlock;
@@ -1658,10 +1661,13 @@ out:
static int wl1271_configure_suspend_ap(struct wl1271 *wl)
{
- int ret;
+ int ret = 0;
mutex_lock(&wl->mutex);
+ if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags))
+ goto out_unlock;
+
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out_unlock;
OpenPOWER on IntegriCloud