diff options
author | Eliad Peller <eliad@wizery.com> | 2011-06-06 05:21:54 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-06-27 06:35:40 -0400 |
commit | 8a7cf3febbb2b7c1ade717ddb3065de67c5983c5 (patch) | |
tree | af69234bc920ebb6c5e5fcebdf29252162255b5d /drivers | |
parent | ff91afc90a736c97f24dec31e642411563906cfb (diff) |
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: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 6a21c13761ba..00ee01e7d4a4 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1474,13 +1474,10 @@ static struct notifier_block wl1271_dev_notifier = { | |||
1474 | }; | 1474 | }; |
1475 | 1475 | ||
1476 | #ifdef CONFIG_PM | 1476 | #ifdef CONFIG_PM |
1477 | static int wl1271_configure_suspend(struct wl1271 *wl) | 1477 | static int wl1271_configure_suspend_sta(struct wl1271 *wl) |
1478 | { | 1478 | { |
1479 | int ret; | 1479 | int ret; |
1480 | 1480 | ||
1481 | if (wl->bss_type != BSS_TYPE_STA_BSS) | ||
1482 | return 0; | ||
1483 | |||
1484 | mutex_lock(&wl->mutex); | 1481 | mutex_lock(&wl->mutex); |
1485 | 1482 | ||
1486 | ret = wl1271_ps_elp_wakeup(wl); | 1483 | ret = wl1271_ps_elp_wakeup(wl); |
@@ -1525,11 +1522,41 @@ out: | |||
1525 | 1522 | ||
1526 | } | 1523 | } |
1527 | 1524 | ||
1525 | static int wl1271_configure_suspend_ap(struct wl1271 *wl) | ||
1526 | { | ||
1527 | int ret; | ||
1528 | |||
1529 | mutex_lock(&wl->mutex); | ||
1530 | |||
1531 | ret = wl1271_ps_elp_wakeup(wl); | ||
1532 | if (ret < 0) | ||
1533 | goto out_unlock; | ||
1534 | |||
1535 | ret = wl1271_acx_set_ap_beacon_filter(wl, true); | ||
1536 | |||
1537 | wl1271_ps_elp_sleep(wl); | ||
1538 | out_unlock: | ||
1539 | mutex_unlock(&wl->mutex); | ||
1540 | return ret; | ||
1541 | |||
1542 | } | ||
1543 | |||
1544 | static int wl1271_configure_suspend(struct wl1271 *wl) | ||
1545 | { | ||
1546 | if (wl->bss_type == BSS_TYPE_STA_BSS) | ||
1547 | return wl1271_configure_suspend_sta(wl); | ||
1548 | if (wl->bss_type == BSS_TYPE_AP_BSS) | ||
1549 | return wl1271_configure_suspend_ap(wl); | ||
1550 | return 0; | ||
1551 | } | ||
1552 | |||
1528 | static void wl1271_configure_resume(struct wl1271 *wl) | 1553 | static void wl1271_configure_resume(struct wl1271 *wl) |
1529 | { | 1554 | { |
1530 | int ret; | 1555 | int ret; |
1556 | bool is_sta = wl->bss_type == BSS_TYPE_STA_BSS; | ||
1557 | bool is_ap = wl->bss_type == BSS_TYPE_AP_BSS; | ||
1531 | 1558 | ||
1532 | if (wl->bss_type != BSS_TYPE_STA_BSS) | 1559 | if (!is_sta && !is_ap) |
1533 | return; | 1560 | return; |
1534 | 1561 | ||
1535 | mutex_lock(&wl->mutex); | 1562 | mutex_lock(&wl->mutex); |
@@ -1537,10 +1564,14 @@ static void wl1271_configure_resume(struct wl1271 *wl) | |||
1537 | if (ret < 0) | 1564 | if (ret < 0) |
1538 | goto out; | 1565 | goto out; |
1539 | 1566 | ||
1540 | /* exit psm if it wasn't configured */ | 1567 | if (is_sta) { |
1541 | if (!test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) | 1568 | /* exit psm if it wasn't configured */ |
1542 | wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, | 1569 | if (!test_bit(WL1271_FLAG_PSM_REQUESTED, &wl->flags)) |
1543 | wl->basic_rate, true); | 1570 | wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE, |
1571 | wl->basic_rate, true); | ||
1572 | } else if (is_ap) { | ||
1573 | wl1271_acx_set_ap_beacon_filter(wl, false); | ||
1574 | } | ||
1544 | 1575 | ||
1545 | wl1271_ps_elp_sleep(wl); | 1576 | wl1271_ps_elp_sleep(wl); |
1546 | out: | 1577 | out: |