diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-11-17 11:48:30 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-18 17:09:20 -0500 |
commit | 6b21a2cd315e2e56a1748bd3ef9d910fe4f2e711 (patch) | |
tree | bf95a7ff4215c1fa9db214f28c9db284838b5580 /drivers | |
parent | 287f6f9672635f4e948c0aa96754a2ce448ebdb2 (diff) |
wl1251: Configure beacon filtering on if PSM used
Enable beacon filtering when PSM is enabled
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_acx.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_acx.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_init.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_ps.c | 10 |
5 files changed, 27 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.c b/drivers/net/wireless/wl12xx/wl1251_acx.c index 4a9c70889a45..50633e043cfd 100644 --- a/drivers/net/wireless/wl12xx/wl1251_acx.c +++ b/drivers/net/wireless/wl12xx/wl1251_acx.c | |||
@@ -494,7 +494,7 @@ out: | |||
494 | return ret; | 494 | return ret; |
495 | } | 495 | } |
496 | 496 | ||
497 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl) | 497 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter) |
498 | { | 498 | { |
499 | struct acx_beacon_filter_option *beacon_filter; | 499 | struct acx_beacon_filter_option *beacon_filter; |
500 | int ret; | 500 | int ret; |
@@ -507,7 +507,7 @@ int wl1251_acx_beacon_filter_opt(struct wl1251 *wl) | |||
507 | goto out; | 507 | goto out; |
508 | } | 508 | } |
509 | 509 | ||
510 | beacon_filter->enable = 0; | 510 | beacon_filter->enable = enable_filter; |
511 | beacon_filter->max_num_beacons = 0; | 511 | beacon_filter->max_num_beacons = 0; |
512 | 512 | ||
513 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_OPT, | 513 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_OPT, |
@@ -525,6 +525,7 @@ out: | |||
525 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl) | 525 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl) |
526 | { | 526 | { |
527 | struct acx_beacon_filter_ie_table *ie_table; | 527 | struct acx_beacon_filter_ie_table *ie_table; |
528 | int idx = 0; | ||
528 | int ret; | 529 | int ret; |
529 | 530 | ||
530 | wl1251_debug(DEBUG_ACX, "acx beacon filter table"); | 531 | wl1251_debug(DEBUG_ACX, "acx beacon filter table"); |
@@ -535,8 +536,10 @@ int wl1251_acx_beacon_filter_table(struct wl1251 *wl) | |||
535 | goto out; | 536 | goto out; |
536 | } | 537 | } |
537 | 538 | ||
538 | ie_table->num_ie = 0; | 539 | /* configure default beacon pass-through rules */ |
539 | memset(ie_table->table, 0, BEACON_FILTER_TABLE_MAX_SIZE); | 540 | ie_table->num_ie = 1; |
541 | ie_table->table[idx++] = BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN; | ||
542 | ie_table->table[idx++] = BEACON_RULE_PASS_ON_APPEARANCE; | ||
540 | 543 | ||
541 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_TABLE, | 544 | ret = wl1251_cmd_configure(wl, ACX_BEACON_FILTER_TABLE, |
542 | ie_table, sizeof(*ie_table)); | 545 | ie_table, sizeof(*ie_table)); |
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.h b/drivers/net/wireless/wl12xx/wl1251_acx.h index 926789ccc27f..ce1c995e08d8 100644 --- a/drivers/net/wireless/wl12xx/wl1251_acx.h +++ b/drivers/net/wireless/wl12xx/wl1251_acx.h | |||
@@ -450,6 +450,11 @@ struct acx_beacon_filter_option { | |||
450 | (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \ | 450 | (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \ |
451 | BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE)) | 451 | BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE)) |
452 | 452 | ||
453 | #define BEACON_RULE_PASS_ON_CHANGE BIT(0) | ||
454 | #define BEACON_RULE_PASS_ON_APPEARANCE BIT(1) | ||
455 | |||
456 | #define BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN (37) | ||
457 | |||
453 | struct acx_beacon_filter_ie_table { | 458 | struct acx_beacon_filter_ie_table { |
454 | struct acx_header header; | 459 | struct acx_header header; |
455 | 460 | ||
@@ -1283,7 +1288,7 @@ int wl1251_acx_slot(struct wl1251 *wl, enum acx_slot_type slot_time); | |||
1283 | int wl1251_acx_group_address_tbl(struct wl1251 *wl); | 1288 | int wl1251_acx_group_address_tbl(struct wl1251 *wl); |
1284 | int wl1251_acx_service_period_timeout(struct wl1251 *wl); | 1289 | int wl1251_acx_service_period_timeout(struct wl1251 *wl); |
1285 | int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold); | 1290 | int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold); |
1286 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl); | 1291 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl, bool enable_filter); |
1287 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl); | 1292 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl); |
1288 | int wl1251_acx_conn_monit_params(struct wl1251 *wl); | 1293 | int wl1251_acx_conn_monit_params(struct wl1251 *wl); |
1289 | int wl1251_acx_sg_enable(struct wl1251 *wl); | 1294 | int wl1251_acx_sg_enable(struct wl1251 *wl); |
diff --git a/drivers/net/wireless/wl12xx/wl1251_init.c b/drivers/net/wireless/wl12xx/wl1251_init.c index 035ab1140b43..5cb573383eeb 100644 --- a/drivers/net/wireless/wl12xx/wl1251_init.c +++ b/drivers/net/wireless/wl12xx/wl1251_init.c | |||
@@ -147,7 +147,8 @@ int wl1251_hw_init_beacon_filter(struct wl1251 *wl) | |||
147 | { | 147 | { |
148 | int ret; | 148 | int ret; |
149 | 149 | ||
150 | ret = wl1251_acx_beacon_filter_opt(wl); | 150 | /* disable beacon filtering at this stage */ |
151 | ret = wl1251_acx_beacon_filter_opt(wl, false); | ||
151 | if (ret < 0) | 152 | if (ret < 0) |
152 | return ret; | 153 | return ret; |
153 | 154 | ||
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c index 601c43070296..900e6e2796fc 100644 --- a/drivers/net/wireless/wl12xx/wl1251_main.c +++ b/drivers/net/wireless/wl12xx/wl1251_main.c | |||
@@ -1323,7 +1323,8 @@ int wl1251_init_ieee80211(struct wl1251 *wl) | |||
1323 | 1323 | ||
1324 | wl->hw->flags = IEEE80211_HW_SIGNAL_DBM | | 1324 | wl->hw->flags = IEEE80211_HW_SIGNAL_DBM | |
1325 | IEEE80211_HW_NOISE_DBM | | 1325 | IEEE80211_HW_NOISE_DBM | |
1326 | IEEE80211_HW_SUPPORTS_PS; | 1326 | IEEE80211_HW_SUPPORTS_PS | |
1327 | IEEE80211_HW_BEACON_FILTER; | ||
1327 | 1328 | ||
1328 | wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); | 1329 | wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); |
1329 | wl->hw->wiphy->max_scan_ssids = 1; | 1330 | wl->hw->wiphy->max_scan_ssids = 1; |
diff --git a/drivers/net/wireless/wl12xx/wl1251_ps.c b/drivers/net/wireless/wl12xx/wl1251_ps.c index c53e28727ed4..c3e348a12322 100644 --- a/drivers/net/wireless/wl12xx/wl1251_ps.c +++ b/drivers/net/wireless/wl12xx/wl1251_ps.c | |||
@@ -119,6 +119,11 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode) | |||
119 | case STATION_POWER_SAVE_MODE: | 119 | case STATION_POWER_SAVE_MODE: |
120 | wl1251_debug(DEBUG_PSM, "entering psm"); | 120 | wl1251_debug(DEBUG_PSM, "entering psm"); |
121 | 121 | ||
122 | /* enable beacon filtering */ | ||
123 | ret = wl1251_acx_beacon_filter_opt(wl, true); | ||
124 | if (ret < 0) | ||
125 | return ret; | ||
126 | |||
122 | ret = wl1251_acx_wake_up_conditions(wl, | 127 | ret = wl1251_acx_wake_up_conditions(wl, |
123 | WAKE_UP_EVENT_DTIM_BITMAP, | 128 | WAKE_UP_EVENT_DTIM_BITMAP, |
124 | wl->listen_int); | 129 | wl->listen_int); |
@@ -142,6 +147,11 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode) | |||
142 | if (ret < 0) | 147 | if (ret < 0) |
143 | return ret; | 148 | return ret; |
144 | 149 | ||
150 | /* disable beacon filtering */ | ||
151 | ret = wl1251_acx_beacon_filter_opt(wl, false); | ||
152 | if (ret < 0) | ||
153 | return ret; | ||
154 | |||
145 | ret = wl1251_acx_wake_up_conditions(wl, | 155 | ret = wl1251_acx_wake_up_conditions(wl, |
146 | WAKE_UP_EVENT_DTIM_BITMAP, | 156 | WAKE_UP_EVENT_DTIM_BITMAP, |
147 | wl->listen_int); | 157 | wl->listen_int); |