5dbad9494e42afdc826b01f0faab2fe4d4fe8010
[openwrt/staging/xback.git] /
1 Enabling beacon filtering before receving a beacon
2 might result in not having a beacon at all for the
3 current connected AP, which prevents the station
4 from entering power-save.
5
6 Replace the current approach (of starting beacon
7 filtering on init) and configure beacon filering
8 only after bss_conf->dtimper is set (which means
9 mac80211 already parsed a beacon).
10
11 Signed-off-by: Eliad Peller <eliad@wizery.com>
12
13 ---
14 drivers/net/wireless/ti/wlcore/acx.c | 3 ++-
15 drivers/net/wireless/ti/wlcore/init.c | 4 ++--
16 drivers/net/wireless/ti/wlcore/main.c | 12 ++++++++++++
17 3 files changed, 16 insertions(+), 3 deletions(-)
18
19 --- a/drivers/net/wireless/ti/wlcore/acx.c
20 +++ b/drivers/net/wireless/ti/wlcore/acx.c
21 @@ -358,7 +358,8 @@ int wl1271_acx_beacon_filter_opt(struct
22 struct acx_beacon_filter_option *beacon_filter = NULL;
23 int ret = 0;
24
25 - wl1271_debug(DEBUG_ACX, "acx beacon filter opt");
26 + wl1271_debug(DEBUG_ACX, "acx beacon filter opt enable=%d",
27 + enable_filter);
28
29 if (enable_filter &&
30 wl->conf.conn.bcn_filt_mode == CONF_BCN_FILT_MODE_DISABLED)
31 --- a/drivers/net/wireless/ti/wlcore/init.c
32 +++ b/drivers/net/wireless/ti/wlcore/init.c
33 @@ -287,8 +287,8 @@ static int wl1271_init_sta_beacon_filter
34 if (ret < 0)
35 return ret;
36
37 - /* enable beacon filtering */
38 - ret = wl1271_acx_beacon_filter_opt(wl, wlvif, true);
39 + /* disable beacon filtering until we get the first beacon */
40 + ret = wl1271_acx_beacon_filter_opt(wl, wlvif, false);
41 if (ret < 0)
42 return ret;
43
44 --- a/drivers/net/wireless/ti/wlcore/main.c
45 +++ b/drivers/net/wireless/ti/wlcore/main.c
46 @@ -2941,6 +2941,11 @@ static int wlcore_unset_assoc(struct wl1
47 ret = wl1271_acx_keep_alive_mode(wl, wlvif, false);
48 if (ret < 0)
49 return ret;
50 +
51 + /* disable beacon filtering */
52 + ret = wl1271_acx_beacon_filter_opt(wl, wlvif, false);
53 + if (ret < 0)
54 + return ret;
55 }
56
57 if (test_and_clear_bit(WLVIF_FLAG_CS_PROGRESS, &wlvif->flags)) {
58 @@ -4345,6 +4350,13 @@ static void wl1271_bss_info_changed_sta(
59 }
60 }
61
62 + if ((changed & BSS_CHANGED_BEACON_INFO) && bss_conf->dtim_period) {
63 + /* enable beacon filtering */
64 + ret = wl1271_acx_beacon_filter_opt(wl, wlvif, true);
65 + if (ret < 0)
66 + goto out;
67 + }
68 +
69 ret = wl1271_bss_erp_info_changed(wl, vif, bss_conf, changed);
70 if (ret < 0)
71 goto out;