diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-10-08 14:56:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:47:53 -0400 |
commit | 344152361e6d14ade61d7f43678db7418cb445db (patch) | |
tree | bd887b29b38639cf390ee8b011f0d2a8b346c30b | |
parent | 1fba49741dc50d13d2fe6cf04f5a547e6c5c81f6 (diff) |
wl1271: 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>
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.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.c | 6 |
3 files changed, 47 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c index a457123442a7..4b5fd94921c9 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c | |||
@@ -442,6 +442,36 @@ out: | |||
442 | return ret; | 442 | return ret; |
443 | } | 443 | } |
444 | 444 | ||
445 | int wl1271_acx_conn_monit_params(struct wl1271 *wl) | ||
446 | { | ||
447 | struct acx_conn_monit_params *acx; | ||
448 | int ret; | ||
449 | |||
450 | wl1271_debug(DEBUG_ACX, "acx connection monitor parameters"); | ||
451 | |||
452 | acx = kzalloc(sizeof(*acx), GFP_KERNEL); | ||
453 | if (!acx) { | ||
454 | ret = -ENOMEM; | ||
455 | goto out; | ||
456 | } | ||
457 | |||
458 | acx->synch_fail_thold = SYNCH_FAIL_DEFAULT_THRESHOLD; | ||
459 | acx->bss_lose_timeout = NO_BEACON_DEFAULT_TIMEOUT; | ||
460 | |||
461 | ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS, | ||
462 | acx, sizeof(*acx)); | ||
463 | if (ret < 0) { | ||
464 | wl1271_warning("failed to set connection monitor " | ||
465 | "parameters: %d", ret); | ||
466 | goto out; | ||
467 | } | ||
468 | |||
469 | out: | ||
470 | kfree(acx); | ||
471 | return ret; | ||
472 | } | ||
473 | |||
474 | |||
445 | int wl1271_acx_sg_enable(struct wl1271 *wl) | 475 | int wl1271_acx_sg_enable(struct wl1271 *wl) |
446 | { | 476 | { |
447 | struct acx_bt_wlan_coex *pta; | 477 | struct acx_bt_wlan_coex *pta; |
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h index dae1fed66b30..bb21bcbe1638 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.h +++ b/drivers/net/wireless/wl12xx/wl1271_acx.h | |||
@@ -406,6 +406,16 @@ struct acx_beacon_filter_ie_table { | |||
406 | u8 pad[3]; | 406 | u8 pad[3]; |
407 | } __attribute__ ((packed)); | 407 | } __attribute__ ((packed)); |
408 | 408 | ||
409 | #define SYNCH_FAIL_DEFAULT_THRESHOLD 5 /* number of beacons */ | ||
410 | #define NO_BEACON_DEFAULT_TIMEOUT (100) /* TU */ | ||
411 | |||
412 | struct acx_conn_monit_params { | ||
413 | struct acx_header header; | ||
414 | |||
415 | u32 synch_fail_thold; /* number of beacons missed */ | ||
416 | u32 bss_lose_timeout; /* number of TU's from synch fail */ | ||
417 | }; | ||
418 | |||
409 | enum { | 419 | enum { |
410 | SG_ENABLE = 0, | 420 | SG_ENABLE = 0, |
411 | SG_DISABLE, | 421 | SG_DISABLE, |
@@ -1198,6 +1208,7 @@ int wl1271_acx_service_period_timeout(struct wl1271 *wl); | |||
1198 | int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold); | 1208 | int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold); |
1199 | int wl1271_acx_beacon_filter_opt(struct wl1271 *wl); | 1209 | int wl1271_acx_beacon_filter_opt(struct wl1271 *wl); |
1200 | int wl1271_acx_beacon_filter_table(struct wl1271 *wl); | 1210 | int wl1271_acx_beacon_filter_table(struct wl1271 *wl); |
1211 | int wl1271_acx_conn_monit_params(struct wl1271 *wl); | ||
1201 | int wl1271_acx_sg_enable(struct wl1271 *wl); | 1212 | int wl1271_acx_sg_enable(struct wl1271 *wl); |
1202 | int wl1271_acx_sg_cfg(struct wl1271 *wl); | 1213 | int wl1271_acx_sg_cfg(struct wl1271 *wl); |
1203 | int wl1271_acx_cca_threshold(struct wl1271 *wl); | 1214 | int wl1271_acx_cca_threshold(struct wl1271 *wl); |
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c index 49ff4071c0bc..d3db3fba41d4 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.c +++ b/drivers/net/wireless/wl12xx/wl1271_init.c | |||
@@ -323,6 +323,11 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
323 | if (ret < 0) | 323 | if (ret < 0) |
324 | goto out_free_memmap; | 324 | goto out_free_memmap; |
325 | 325 | ||
326 | /* Initialize connection monitoring thresholds */ | ||
327 | ret = wl1271_acx_conn_monit_params(wl); | ||
328 | if (ret < 0) | ||
329 | goto out_free_memmap; | ||
330 | |||
326 | /* Beacon filtering */ | 331 | /* Beacon filtering */ |
327 | ret = wl1271_init_beacon_filter(wl); | 332 | ret = wl1271_init_beacon_filter(wl); |
328 | if (ret < 0) | 333 | if (ret < 0) |
@@ -392,6 +397,7 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
392 | 397 | ||
393 | out_free_memmap: | 398 | out_free_memmap: |
394 | kfree(wl->target_mem_map); | 399 | kfree(wl->target_mem_map); |
400 | wl->target_mem_map = NULL; | ||
395 | 401 | ||
396 | return ret; | 402 | return ret; |
397 | } | 403 | } |