Skip to content

Commit

Permalink
wl12xx: configure suspend/resume only if associated/started
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Jul 5, 2011
1 parent b5d6e5f commit e85d162
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1658,10 +1661,13 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl)

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;
Expand Down

0 comments on commit e85d162

Please sign in to comment.