From: Eliad Peller Date: Mon, 27 Jun 2011 10:06:43 +0000 (+0300) Subject: wl12xx: configure suspend/resume only if associated/started X-Git-Tag: upstream/snapshot3+hdmi~9045^2~12^2~42^2~234^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e85d1629c69f99e91598039e5c05f1608ad19c9f;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Luciano Coelho --- diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index d7a7459..357dc9d 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;