aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_acx.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-10-13 05:47:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:08 -0400
commit51f2be24328957f9e2acf116b1b1d2dfd10bf41f (patch)
tree495c00ecd36cb7e84aeff4b9fd837d8e184cb8e0 /drivers/net/wireless/wl12xx/wl1271_acx.c
parent45b531a86f93c82d8e390e19a6258111b3627bb0 (diff)
wl1271: Add config structure for connection management parameters
Add a configuration structure for connection management parameters, and set default configuration values there. 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>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_acx.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.c63
1 files changed, 47 insertions, 16 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index 038203bcf447..d0036860ab60 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -34,8 +34,7 @@
34#include "wl1271_spi.h" 34#include "wl1271_spi.h"
35#include "wl1271_ps.h" 35#include "wl1271_ps.h"
36 36
37int wl1271_acx_wake_up_conditions(struct wl1271 *wl, u8 wake_up_event, 37int wl1271_acx_wake_up_conditions(struct wl1271 *wl)
38 u8 listen_interval)
39{ 38{
40 struct acx_wake_up_condition *wake_up; 39 struct acx_wake_up_condition *wake_up;
41 int ret; 40 int ret;
@@ -48,8 +47,8 @@ int wl1271_acx_wake_up_conditions(struct wl1271 *wl, u8 wake_up_event,
48 goto out; 47 goto out;
49 } 48 }
50 49
51 wake_up->wake_up_event = wake_up_event; 50 wake_up->wake_up_event = wl->conf.conn.wake_up_event;
52 wake_up->listen_interval = listen_interval; 51 wake_up->listen_interval = wl->conf.conn.listen_interval;
53 52
54 ret = wl1271_cmd_configure(wl, ACX_WAKE_UP_CONDITIONS, 53 ret = wl1271_cmd_configure(wl, ACX_WAKE_UP_CONDITIONS,
55 wake_up, sizeof(*wake_up)); 54 wake_up, sizeof(*wake_up));
@@ -393,11 +392,15 @@ out:
393 392
394int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter) 393int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
395{ 394{
396 struct acx_beacon_filter_option *beacon_filter; 395 struct acx_beacon_filter_option *beacon_filter = NULL;
397 int ret; 396 int ret = 0;
398 397
399 wl1271_debug(DEBUG_ACX, "acx beacon filter opt"); 398 wl1271_debug(DEBUG_ACX, "acx beacon filter opt");
400 399
400 if (enable_filter &&
401 wl->conf.conn.bcn_filt_mode == CONF_BCN_FILT_MODE_DISABLED)
402 goto out;
403
401 beacon_filter = kzalloc(sizeof(*beacon_filter), GFP_KERNEL); 404 beacon_filter = kzalloc(sizeof(*beacon_filter), GFP_KERNEL);
402 if (!beacon_filter) { 405 if (!beacon_filter) {
403 ret = -ENOMEM; 406 ret = -ENOMEM;
@@ -405,6 +408,11 @@ int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
405 } 408 }
406 409
407 beacon_filter->enable = enable_filter; 410 beacon_filter->enable = enable_filter;
411
412 /*
413 * When set to zero, and the filter is enabled, beacons
414 * without the unicast TIM bit set are dropped.
415 */
408 beacon_filter->max_num_beacons = 0; 416 beacon_filter->max_num_beacons = 0;
409 417
410 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_OPT, 418 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_OPT,
@@ -422,8 +430,9 @@ out:
422int wl1271_acx_beacon_filter_table(struct wl1271 *wl) 430int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
423{ 431{
424 struct acx_beacon_filter_ie_table *ie_table; 432 struct acx_beacon_filter_ie_table *ie_table;
425 int idx = 0; 433 int i, idx = 0;
426 int ret; 434 int ret;
435 bool vendor_spec = false;
427 436
428 wl1271_debug(DEBUG_ACX, "acx beacon filter table"); 437 wl1271_debug(DEBUG_ACX, "acx beacon filter table");
429 438
@@ -434,9 +443,31 @@ int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
434 } 443 }
435 444
436 /* configure default beacon pass-through rules */ 445 /* configure default beacon pass-through rules */
437 ie_table->num_ie = 1; 446 ie_table->num_ie = 0;
438 ie_table->table[idx++] = BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN; 447 for (i = 0; i < wl->conf.conn.bcn_filt_ie_count; i++) {
439 ie_table->table[idx++] = BEACON_RULE_PASS_ON_APPEARANCE; 448 struct conf_bcn_filt_rule *r = &(wl->conf.conn.bcn_filt_ie[i]);
449 ie_table->table[idx++] = r->ie;
450 ie_table->table[idx++] = r->rule;
451
452 if (r->ie == WLAN_EID_VENDOR_SPECIFIC) {
453 /* only one vendor specific ie allowed */
454 if (vendor_spec)
455 continue;
456
457 /* for vendor specific rules configure the
458 additional fields */
459 memcpy(&(ie_table->table[idx]), r->oui,
460 CONF_BCN_IE_OUI_LEN);
461 idx += CONF_BCN_IE_OUI_LEN;
462 ie_table->table[idx++] = r->type;
463 memcpy(&(ie_table->table[idx]), r->version,
464 CONF_BCN_IE_VER_LEN);
465 idx += CONF_BCN_IE_VER_LEN;
466 vendor_spec = true;
467 }
468
469 ie_table->num_ie++;
470 }
440 471
441 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_TABLE, 472 ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_TABLE,
442 ie_table, sizeof(*ie_table)); 473 ie_table, sizeof(*ie_table));
@@ -463,8 +494,8 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl)
463 goto out; 494 goto out;
464 } 495 }
465 496
466 acx->synch_fail_thold = SYNCH_FAIL_DEFAULT_THRESHOLD; 497 acx->synch_fail_thold = wl->conf.conn.synch_fail_thold;
467 acx->bss_lose_timeout = NO_BEACON_DEFAULT_TIMEOUT; 498 acx->bss_lose_timeout = wl->conf.conn.bss_lose_timeout;
468 499
469 ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS, 500 ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS,
470 acx, sizeof(*acx)); 501 acx, sizeof(*acx));
@@ -585,10 +616,10 @@ int wl1271_acx_bcn_dtim_options(struct wl1271 *wl)
585 goto out; 616 goto out;
586 } 617 }
587 618
588 bb->beacon_rx_timeout = BCN_RX_TIMEOUT_DEF_VALUE; 619 bb->beacon_rx_timeout = wl->conf.conn.beacon_rx_timeout;
589 bb->broadcast_timeout = BROADCAST_RX_TIMEOUT_DEF_VALUE; 620 bb->broadcast_timeout = wl->conf.conn.broadcast_timeout;
590 bb->rx_broadcast_in_ps = RX_BROADCAST_IN_PS_DEF_VALUE; 621 bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps;
591 bb->ps_poll_threshold = CONSECUTIVE_PS_POLL_FAILURE_DEF; 622 bb->ps_poll_threshold = wl->conf.conn.ps_poll_threshold;
592 623
593 ret = wl1271_cmd_configure(wl, ACX_BCN_DTIM_OPTIONS, bb, sizeof(*bb)); 624 ret = wl1271_cmd_configure(wl, ACX_BCN_DTIM_OPTIONS, bb, sizeof(*bb));
594 if (ret < 0) { 625 if (ret < 0) {