diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-11-17 11:48:14 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-18 17:09:19 -0500 |
commit | 474c48c9f2118e637477b3b1c70003cb5cbda983 (patch) | |
tree | c334efac0bc3a46f3ab98e408bea5006e91acc8b | |
parent | 15295380f45aa0d35665f6e5596ac98c081d95b9 (diff) |
wl1251: Add connection monitoring configuration
Add configuration for connection monitor (number of allowed beacons, and
timeout after last received beacon.)
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>
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_acx.c | 29 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_acx.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_init.c | 5 |
3 files changed, 45 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.c b/drivers/net/wireless/wl12xx/wl1251_acx.c index 10b26c4532c9..4a9c70889a45 100644 --- a/drivers/net/wireless/wl12xx/wl1251_acx.c +++ b/drivers/net/wireless/wl12xx/wl1251_acx.c | |||
@@ -550,6 +550,35 @@ out: | |||
550 | return ret; | 550 | return ret; |
551 | } | 551 | } |
552 | 552 | ||
553 | int wl1251_acx_conn_monit_params(struct wl1251 *wl) | ||
554 | { | ||
555 | struct acx_conn_monit_params *acx; | ||
556 | int ret; | ||
557 | |||
558 | wl1251_debug(DEBUG_ACX, "acx connection monitor parameters"); | ||
559 | |||
560 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
561 | if (!acx) { | ||
562 | ret = -ENOMEM; | ||
563 | goto out; | ||
564 | } | ||
565 | |||
566 | acx->synch_fail_thold = SYNCH_FAIL_DEFAULT_THRESHOLD; | ||
567 | acx->bss_lose_timeout = NO_BEACON_DEFAULT_TIMEOUT; | ||
568 | |||
569 | ret = wl1251_cmd_configure(wl, ACX_CONN_MONIT_PARAMS, | ||
570 | acx, sizeof(*acx)); | ||
571 | if (ret < 0) { | ||
572 | wl1251_warning("failed to set connection monitor " | ||
573 | "parameters: %d", ret); | ||
574 | goto out; | ||
575 | } | ||
576 | |||
577 | out: | ||
578 | kfree(acx); | ||
579 | return ret; | ||
580 | } | ||
581 | |||
553 | int wl1251_acx_sg_enable(struct wl1251 *wl) | 582 | int wl1251_acx_sg_enable(struct wl1251 *wl) |
554 | { | 583 | { |
555 | struct acx_bt_wlan_coex *pta; | 584 | struct acx_bt_wlan_coex *pta; |
diff --git a/drivers/net/wireless/wl12xx/wl1251_acx.h b/drivers/net/wireless/wl12xx/wl1251_acx.h index cafb91459504..926789ccc27f 100644 --- a/drivers/net/wireless/wl12xx/wl1251_acx.h +++ b/drivers/net/wireless/wl12xx/wl1251_acx.h | |||
@@ -458,6 +458,16 @@ struct acx_beacon_filter_ie_table { | |||
458 | u8 pad[3]; | 458 | u8 pad[3]; |
459 | } __attribute__ ((packed)); | 459 | } __attribute__ ((packed)); |
460 | 460 | ||
461 | #define SYNCH_FAIL_DEFAULT_THRESHOLD 5 /* number of beacons */ | ||
462 | #define NO_BEACON_DEFAULT_TIMEOUT (100) /* TU */ | ||
463 | |||
464 | struct acx_conn_monit_params { | ||
465 | struct acx_header header; | ||
466 | |||
467 | u32 synch_fail_thold; /* number of beacons missed */ | ||
468 | u32 bss_lose_timeout; /* number of TU's from synch fail */ | ||
469 | }; | ||
470 | |||
461 | enum { | 471 | enum { |
462 | SG_ENABLE = 0, | 472 | SG_ENABLE = 0, |
463 | SG_DISABLE, | 473 | SG_DISABLE, |
@@ -1275,6 +1285,7 @@ int wl1251_acx_service_period_timeout(struct wl1251 *wl); | |||
1275 | int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold); | 1285 | int wl1251_acx_rts_threshold(struct wl1251 *wl, u16 rts_threshold); |
1276 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl); | 1286 | int wl1251_acx_beacon_filter_opt(struct wl1251 *wl); |
1277 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl); | 1287 | int wl1251_acx_beacon_filter_table(struct wl1251 *wl); |
1288 | int wl1251_acx_conn_monit_params(struct wl1251 *wl); | ||
1278 | int wl1251_acx_sg_enable(struct wl1251 *wl); | 1289 | int wl1251_acx_sg_enable(struct wl1251 *wl); |
1279 | int wl1251_acx_sg_cfg(struct wl1251 *wl); | 1290 | int wl1251_acx_sg_cfg(struct wl1251 *wl); |
1280 | int wl1251_acx_cca_threshold(struct wl1251 *wl); | 1291 | int wl1251_acx_cca_threshold(struct wl1251 *wl); |
diff --git a/drivers/net/wireless/wl12xx/wl1251_init.c b/drivers/net/wireless/wl12xx/wl1251_init.c index b2ee4f468fc4..035ab1140b43 100644 --- a/drivers/net/wireless/wl12xx/wl1251_init.c +++ b/drivers/net/wireless/wl12xx/wl1251_init.c | |||
@@ -364,6 +364,11 @@ int wl1251_hw_init(struct wl1251 *wl) | |||
364 | if (ret < 0) | 364 | if (ret < 0) |
365 | goto out_free_data_path; | 365 | goto out_free_data_path; |
366 | 366 | ||
367 | /* Initialize connection monitoring thresholds */ | ||
368 | ret = wl1251_acx_conn_monit_params(wl); | ||
369 | if (ret < 0) | ||
370 | goto out_free_data_path; | ||
371 | |||
367 | /* Beacon filtering */ | 372 | /* Beacon filtering */ |
368 | ret = wl1251_hw_init_beacon_filter(wl); | 373 | ret = wl1251_hw_init_beacon_filter(wl); |
369 | if (ret < 0) | 374 | if (ret < 0) |