Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2 1/3] wl12xx: configure suspend/resume only if associated/started
@ 2011-06-27 10:06 Eliad Peller
  2011-06-27 10:06 ` [PATCH v2 2/3] wl12xx: add stop_scan command Eliad Peller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eliad Peller @ 2011-06-27 10:06 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Configure the device (to wowlan) only if the sta/ap
is associated/started.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 2c2251a..7017c23 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1469,10 +1469,13 @@ static struct notifier_block wl1271_dev_notifier = {
 
 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;
@@ -1517,10 +1520,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;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-05 19:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 10:06 [PATCH v2 1/3] wl12xx: configure suspend/resume only if associated/started Eliad Peller
2011-06-27 10:06 ` [PATCH v2 2/3] wl12xx: add stop_scan command Eliad Peller
2011-06-27 10:06 ` [PATCH v2 3/3] wl12xx: implement cancel_hw_scan() callback Eliad Peller
2011-07-05 19:08 ` [PATCH v2 1/3] wl12xx: configure suspend/resume only if associated/started Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox