Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256221
b: refs/heads/master
c: 8a7cf3f
h: refs/heads/master
i:
  256219: 435e37c
v: v3
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Jun 27, 2011
1 parent a5f3173 commit bc1e721
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff91afc90a736c97f24dec31e642411563906cfb
refs/heads/master: 8a7cf3febbb2b7c1ade717ddb3065de67c5983c5
49 changes: 40 additions & 9 deletions trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,13 +1474,10 @@ static struct notifier_block wl1271_dev_notifier = {
};

#ifdef CONFIG_PM
static int wl1271_configure_suspend(struct wl1271 *wl)
static int wl1271_configure_suspend_sta(struct wl1271 *wl)
{
int ret;

if (wl->bss_type != BSS_TYPE_STA_BSS)
return 0;

mutex_lock(&wl->mutex);

ret = wl1271_ps_elp_wakeup(wl);
Expand Down Expand Up @@ -1525,22 +1522,56 @@ static int wl1271_configure_suspend(struct wl1271 *wl)

}

static int wl1271_configure_suspend_ap(struct wl1271 *wl)
{
int ret;

mutex_lock(&wl->mutex);

ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out_unlock;

ret = wl1271_acx_set_ap_beacon_filter(wl, true);

wl1271_ps_elp_sleep(wl);
out_unlock:
mutex_unlock(&wl->mutex);
return ret;

}

static int wl1271_configure_suspend(struct wl1271 *wl)
{
if (wl->bss_type == BSS_TYPE_STA_BSS)
return wl1271_configure_suspend_sta(wl);
if (wl->bss_type == BSS_TYPE_AP_BSS)
return wl1271_configure_suspend_ap(wl);
return 0;
}

static void wl1271_configure_resume(struct wl1271 *wl)
{
int ret;
bool is_sta = wl->bss_type == BSS_TYPE_STA_BSS;
bool is_ap = wl->bss_type == BSS_TYPE_AP_BSS;

if (wl->bss_type != BSS_TYPE_STA_BSS)
if (!is_sta && !is_ap)
return;

mutex_lock(&wl->mutex);
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
goto out;

/* exit psm if it wasn't configured */
if (!test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags))
wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
wl->basic_rate, true);
if (is_sta) {
/* exit psm if it wasn't configured */
if (!test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags))
wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
wl->basic_rate, true);
} else if (is_ap) {
wl1271_acx_set_ap_beacon_filter(wl, false);
}

wl1271_ps_elp_sleep(wl);
out:
Expand Down

0 comments on commit bc1e721

Please sign in to comment.