Commit 8a7cf3fe authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wl12xx: enable/disable beacon filtering on ap suspend/resume

Beacon filtering needs to be enabled so AP won't wake up by
by every received beacon.
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent ff91afc9
...@@ -1474,13 +1474,10 @@ static struct notifier_block wl1271_dev_notifier = { ...@@ -1474,13 +1474,10 @@ static struct notifier_block wl1271_dev_notifier = {
}; };
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int wl1271_configure_suspend(struct wl1271 *wl) static int wl1271_configure_suspend_sta(struct wl1271 *wl)
{ {
int ret; int ret;
if (wl->bss_type != BSS_TYPE_STA_BSS)
return 0;
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
ret = wl1271_ps_elp_wakeup(wl); ret = wl1271_ps_elp_wakeup(wl);
...@@ -1525,11 +1522,41 @@ static int wl1271_configure_suspend(struct wl1271 *wl) ...@@ -1525,11 +1522,41 @@ 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) static void wl1271_configure_resume(struct wl1271 *wl)
{ {
int ret; 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; return;
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
...@@ -1537,10 +1564,14 @@ static void wl1271_configure_resume(struct wl1271 *wl) ...@@ -1537,10 +1564,14 @@ static void wl1271_configure_resume(struct wl1271 *wl)
if (ret < 0) if (ret < 0)
goto out; goto out;
/* exit psm if it wasn't configured */ if (is_sta) {
if (!test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) /* exit psm if it wasn't configured */
wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, if (!test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags))
wl->basic_rate, true); 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); wl1271_ps_elp_sleep(wl);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment