aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-10-08 14:56:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:47:54 -0400
commit1922167b9de575d9d1a56be9b80f0fa3b22785f9 (patch)
treec97c48f93fd5ef307bca6f46c73ee0b289924f45
parentb771eee583343782c8b44d2b78cf53c29d0f3303 (diff)
wl1271: Configure beacon filtering on if PSM used
Enable beacon filtering when PSM is enabled Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.c11
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.h7
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_init.c3
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c3
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_ps.c11
5 files changed, 28 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index 4b5fd94921c9..b9dfa094f049 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -386,7 +386,7 @@ out:
386 return ret; 386 return ret;
387} 387}
388 388
389int wl1271_acx_beacon_filter_opt(struct wl1271 *wl) 389int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
390{ 390{
391 struct acx_beacon_filter_option *beacon_filter; 391 struct acx_beacon_filter_option *beacon_filter;
392 int ret; 392 int ret;
@@ -399,7 +399,7 @@ int wl1271_acx_beacon_filter_opt(struct wl1271 *wl)
399 goto out; 399 goto out;
400 } 400 }
401 401
402 beacon_filter->enable = 0; 402 beacon_filter->enable = enable_filter;
403 beacon_filter->max_num_beacons = 0; 403 beacon_filter->max_num_beacons = 0;
404 404
405 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_OPT, 405 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_OPT,
@@ -417,6 +417,7 @@ out:
417int wl1271_acx_beacon_filter_table(struct wl1271 *wl) 417int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
418{ 418{
419 struct acx_beacon_filter_ie_table *ie_table; 419 struct acx_beacon_filter_ie_table *ie_table;
420 int idx = 0;
420 int ret; 421 int ret;
421 422
422 wl1271_debug(DEBUG_ACX, "acx beacon filter table"); 423 wl1271_debug(DEBUG_ACX, "acx beacon filter table");
@@ -427,8 +428,10 @@ int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
427 goto out; 428 goto out;
428 } 429 }
429 430
430 ie_table->num_ie = 0; 431 /* configure default beacon pass-through rules */
431 memset(ie_table->table, 0, BEACON_FILTER_TABLE_MAX_SIZE); 432 ie_table->num_ie = 1;
433 ie_table->table[idx++] = BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN;
434 ie_table->table[idx++] = BEACON_RULE_PASS_ON_APPEARANCE;
432 435
433 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_TABLE, 436 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_TABLE,
434 ie_table, sizeof(*ie_table)); 437 ie_table, sizeof(*ie_table));
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h
index bb21bcbe1638..0c2a10734493 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.h
@@ -398,6 +398,11 @@ struct acx_beacon_filter_option {
398 (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \ 398 (BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \
399 BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE)) 399 BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE))
400 400
401#define BEACON_RULE_PASS_ON_CHANGE BIT(0)
402#define BEACON_RULE_PASS_ON_APPEARANCE BIT(1)
403
404#define BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN (37)
405
401struct acx_beacon_filter_ie_table { 406struct acx_beacon_filter_ie_table {
402 struct acx_header header; 407 struct acx_header header;
403 408
@@ -1206,7 +1211,7 @@ int wl1271_acx_group_address_tbl(struct wl1271 *wl, bool enable,
1206 void *mc_list, u32 mc_list_len); 1211 void *mc_list, u32 mc_list_len);
1207int wl1271_acx_service_period_timeout(struct wl1271 *wl); 1212int wl1271_acx_service_period_timeout(struct wl1271 *wl);
1208int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold); 1213int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold);
1209int wl1271_acx_beacon_filter_opt(struct wl1271 *wl); 1214int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter);
1210int wl1271_acx_beacon_filter_table(struct wl1271 *wl); 1215int wl1271_acx_beacon_filter_table(struct wl1271 *wl);
1211int wl1271_acx_conn_monit_params(struct wl1271 *wl); 1216int wl1271_acx_conn_monit_params(struct wl1271 *wl);
1212int wl1271_acx_sg_enable(struct wl1271 *wl); 1217int wl1271_acx_sg_enable(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c
index d3db3fba41d4..bf4d0e18fb81 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.c
+++ b/drivers/net/wireless/wl12xx/wl1271_init.c
@@ -136,7 +136,8 @@ static int wl1271_init_beacon_filter(struct wl1271 *wl)
136{ 136{
137 int ret; 137 int ret;
138 138
139 ret = wl1271_acx_beacon_filter_opt(wl); 139 /* disable beacon filtering at this stage */
140 ret = wl1271_acx_beacon_filter_opt(wl, false);
140 if (ret < 0) 141 if (ret < 0)
141 return ret; 142 return ret;
142 143
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index e6f9e9b57037..3662715c0313 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1319,7 +1319,8 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
1319 wl->hw->channel_change_time = 10000; 1319 wl->hw->channel_change_time = 10000;
1320 1320
1321 wl->hw->flags = IEEE80211_HW_SIGNAL_DBM | 1321 wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |
1322 IEEE80211_HW_NOISE_DBM; 1322 IEEE80211_HW_NOISE_DBM |
1323 IEEE80211_HW_BEACON_FILTER;
1323 1324
1324 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); 1325 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
1325 wl->hw->wiphy->max_scan_ssids = 1; 1326 wl->hw->wiphy->max_scan_ssids = 1;
diff --git a/drivers/net/wireless/wl12xx/wl1271_ps.c b/drivers/net/wireless/wl12xx/wl1271_ps.c
index 0f6ea16cae83..5580e53d103a 100644
--- a/drivers/net/wireless/wl12xx/wl1271_ps.c
+++ b/drivers/net/wireless/wl12xx/wl1271_ps.c
@@ -129,6 +129,12 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode)
129 switch (mode) { 129 switch (mode) {
130 case STATION_POWER_SAVE_MODE: 130 case STATION_POWER_SAVE_MODE:
131 wl1271_debug(DEBUG_PSM, "entering psm"); 131 wl1271_debug(DEBUG_PSM, "entering psm");
132
133 /* enable beacon filtering */
134 ret = wl1271_acx_beacon_filter_opt(wl, true);
135 if (ret < 0)
136 return ret;
137
132 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE); 138 ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE);
133 if (ret < 0) 139 if (ret < 0)
134 return ret; 140 return ret;
@@ -146,6 +152,11 @@ int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode)
146 if (ret < 0) 152 if (ret < 0)
147 return ret; 153 return ret;
148 154
155 /* disable beacon filtering */
156 ret = wl1271_acx_beacon_filter_opt(wl, false);
157 if (ret < 0)
158 return ret;
159
149 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE); 160 ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE);
150 if (ret < 0) 161 if (ret < 0)
151 return ret; 162 return ret;